diff --git a/dist/mermaid.full.js b/dist/mermaid.full.js index 0fa7f888c..f3442707a 100644 --- a/dist/mermaid.full.js +++ b/dist/mermaid.full.js @@ -25,12 +25,9228 @@ var t=x.length;if(t){x.sort(c);for(var e,r=1,u=x[0],i=[u];t>r;++r)e=x[r],l(e[0], * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -module.exports={graphlib:require("./lib/graphlib"),dagre:require("./lib/dagre"),intersect:require("./lib/intersect"),render:require("./lib/render"),util:require("./lib/util"),version:require("./lib/version")}},{"./lib/dagre":8,"./lib/graphlib":9,"./lib/intersect":10,"./lib/render":23,"./lib/util":25,"./lib/version":26}],2:[function(require,module,exports){var util=require("./util");module.exports={"default":normal,normal:normal,vee:vee};function normal(parent,id,edge,type){var marker=parent.append("marker").attr("id",id).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto");var path=marker.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");util.applyStyle(path,edge[type+"Style"])}function vee(parent,id,edge,type){var marker=parent.append("marker").attr("id",id).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto");var path=marker.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");util.applyStyle(path,edge[type+"Style"])}},{"./util":25}],3:[function(require,module,exports){var util=require("./util");module.exports=createClusters;function createClusters(selection,g){var clusters=g.nodes().filter(function(v){return util.isSubgraph(g,v)}),svgClusters=selection.selectAll("g.cluster").data(clusters,function(v){return v});svgClusters.enter().append("g").attr("class","cluster").style("opacity",0).append("rect");util.applyTransition(svgClusters.exit(),g).style("opacity",0).remove();util.applyTransition(svgClusters,g).style("opacity",1);util.applyTransition(svgClusters.selectAll("rect"),g).attr("width",function(v){return g.node(v).width}).attr("height",function(v){return g.node(v).height}).attr("x",function(v){var node=g.node(v);return node.x-node.width/2}).attr("y",function(v){var node=g.node(v);return node.y-node.height/2})}},{"./util":25}],4:[function(require,module,exports){"use strict";var _=require("./lodash"),addLabel=require("./label/add-label"),util=require("./util"),d3=require("./d3");module.exports=createEdgeLabels;function createEdgeLabels(selection,g){var svgEdgeLabels=selection.selectAll("g.edgeLabel").data(g.edges(),function(e){return util.edgeToId(e)}).classed("update",true);svgEdgeLabels.selectAll("*").remove();svgEdgeLabels.enter().append("g").classed("edgeLabel",true).style("opacity",0);svgEdgeLabels.each(function(e){var edge=g.edge(e),label=addLabel(d3.select(this),g.edge(e),0,0).classed("label",true),bbox=label.node().getBBox();if(edge.labelId){label.attr("id",edge.labelId)}if(!_.has(edge,"width")){edge.width=bbox.width}if(!_.has(edge,"height")){edge.height=bbox.height}});util.applyTransition(svgEdgeLabels.exit(),g).style("opacity",0).remove();return svgEdgeLabels}},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],5:[function(require,module,exports){"use strict";var _=require("./lodash"),intersectNode=require("./intersect/intersect-node"),util=require("./util"),d3=require("./d3");module.exports=createEdgePaths;function createEdgePaths(selection,g,arrows){var svgPaths=selection.selectAll("g.edgePath").data(g.edges(),function(e){return util.edgeToId(e)}).classed("update",true);enter(svgPaths,g);exit(svgPaths,g);util.applyTransition(svgPaths,g).style("opacity",1);svgPaths.selectAll("path.path").each(function(e){var edge=g.edge(e);edge.arrowheadId=_.uniqueId("arrowhead");var domEdge=d3.select(this).attr("marker-end",function(){return"url(#"+edge.arrowheadId+")"}).style("fill","none");util.applyTransition(domEdge,g).attr("d",function(e){return calcPoints(g,e)});if(edge.id){domEdge.attr("id",edge.id)}util.applyStyle(domEdge,edge.style)});svgPaths.selectAll("defs *").remove();svgPaths.selectAll("defs").each(function(e){var edge=g.edge(e),arrowhead=arrows[edge.arrowhead];arrowhead(d3.select(this),edge.arrowheadId,edge,"arrowhead")});return svgPaths}function calcPoints(g,e){var edge=g.edge(e),tail=g.node(e.v),head=g.node(e.w),points=edge.points.slice(1,edge.points.length-1);points.unshift(intersectNode(tail,points[0]));points.push(intersectNode(head,points[points.length-1]));return createLine(edge,points)}function createLine(edge,points){var line=d3.svg.line().x(function(d){return d.x}).y(function(d){return d.y});if(_.has(edge,"lineInterpolate")){line.interpolate(edge.lineInterpolate)}if(_.has(edge,"lineTension")){line.tension(Number(edge.lineTension))}return line(points)}function getCoords(elem){var bbox=elem.getBBox(),matrix=elem.getTransformToElement(elem.ownerSVGElement).translate(bbox.width/2,bbox.height/2);return{x:matrix.e,y:matrix.f}}function enter(svgPaths,g){var svgPathsEnter=svgPaths.enter().append("g").attr("class","edgePath").style("opacity",0);svgPathsEnter.append("path").attr("class","path").attr("d",function(e){var edge=g.edge(e),sourceElem=g.node(e.v).elem,points=_.range(edge.points.length).map(function(){return getCoords(sourceElem)});return createLine(edge,points)});svgPathsEnter.append("defs")}function exit(svgPaths,g){var svgPathExit=svgPaths.exit();util.applyTransition(svgPathExit,g).style("opacity",0).remove();util.applyTransition(svgPathExit.select("path.path"),g).attr("d",function(e){var source=g.node(e.v);if(source){var points=_.range(this.pathSegList.length).map(function(){return source});return createLine({},points)}else{return d3.select(this).attr("d")}})}},{"./d3":7,"./intersect/intersect-node":14,"./lodash":20,"./util":25}],6:[function(require,module,exports){"use strict";var _=require("./lodash"),addLabel=require("./label/add-label"),util=require("./util"),d3=require("./d3");module.exports=createNodes;function createNodes(selection,g,shapes){var simpleNodes=g.nodes().filter(function(v){return!util.isSubgraph(g,v)});var svgNodes=selection.selectAll("g.node").data(simpleNodes,function(v){return v}).classed("update",true);svgNodes.selectAll("*").remove();svgNodes.enter().append("g").attr("class","node").style("opacity",0);svgNodes.each(function(v){var node=g.node(v),thisGroup=d3.select(this),labelGroup=thisGroup.append("g").attr("class","label"),labelDom=addLabel(labelGroup,node),shape=shapes[node.shape],bbox=labelDom.node().getBBox();node.elem=this;if(node.id){thisGroup.attr("id",node.id)}if(node.labelId){labelGroup.attr("id",node.labelId)}util.applyClass(thisGroup,node.class,(thisGroup.classed("update")?"update ":"")+"node");if(_.has(node,"width")){bbox.width=node.width}if(_.has(node,"height")){bbox.height=node.height}bbox.width+=node.paddingLeft+node.paddingRight;bbox.height+=node.paddingTop+node.paddingBottom;labelGroup.attr("transform","translate("+(node.paddingLeft-node.paddingRight)/2+","+(node.paddingTop-node.paddingBottom)/2+")");var shapeSvg=shape(d3.select(this),bbox,node);util.applyStyle(shapeSvg,node.style);var shapeBBox=shapeSvg.node().getBBox();node.width=shapeBBox.width;node.height=shapeBBox.height});util.applyTransition(svgNodes.exit(),g).style("opacity",0).remove();return svgNodes}},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],7:[function(require,module,exports){module.exports=window.d3},{}],8:[function(require,module,exports){var dagre;if(require){try{dagre=require("dagre")}catch(e){}}if(!dagre){dagre=window.dagre}module.exports=dagre},{dagre:27}],9:[function(require,module,exports){var graphlib;if(require){try{graphlib=require("graphlib")}catch(e){}}if(!graphlib){graphlib=window.graphlib}module.exports=graphlib},{graphlib:57}],10:[function(require,module,exports){module.exports={node:require("./intersect-node"),circle:require("./intersect-circle"),ellipse:require("./intersect-ellipse"),polygon:require("./intersect-polygon"),rect:require("./intersect-rect")}},{"./intersect-circle":11,"./intersect-ellipse":12,"./intersect-node":14,"./intersect-polygon":15,"./intersect-rect":16}],11:[function(require,module,exports){var intersectEllipse=require("./intersect-ellipse");module.exports=intersectCircle;function intersectCircle(node,rx,point){return intersectEllipse(node,rx,rx,point)}},{"./intersect-ellipse":12}],12:[function(require,module,exports){module.exports=intersectEllipse;function intersectEllipse(node,rx,ry,point){var cx=node.x;var cy=node.y;var px=cx-point.x;var py=cy-point.y;var det=Math.sqrt(rx*rx*py*py+ry*ry*px*px);var dx=Math.abs(rx*ry*px/det);if(point.x0}},{}],14:[function(require,module,exports){module.exports=intersectNode;function intersectNode(node,point){return node.intersect(point)}},{}],15:[function(require,module,exports){var intersectLine=require("./intersect-line");module.exports=intersectPolygon;function intersectPolygon(node,polyPoints,point){var x1=node.x;var y1=node.y;var intersections=[];var minX=Number.POSITIVE_INFINITY,minY=Number.POSITIVE_INFINITY;polyPoints.forEach(function(entry){minX=Math.min(minX,entry.x);minY=Math.min(minY,entry.y)});var left=x1-node.width/2-minX;var top=y1-node.height/2-minY;for(var i=0;i1){intersections.sort(function(p,q){var pdx=p.x-point.x,pdy=p.y-point.y,distp=Math.sqrt(pdx*pdx+pdy*pdy),qdx=q.x-point.x,qdy=q.y-point.y,distq=Math.sqrt(qdx*qdx+qdy*qdy);return distpMath.abs(dx)*h){if(dy<0){h=-h}sx=dy===0?0:h*dx/dy;sy=h}else{if(dx<0){w=-w}sx=w;sy=dx===0?0:w*dy/dx}return{x:x+sx,y:y+sy}}},{}],17:[function(require,module,exports){var util=require("../util");module.exports=addHtmlLabel;function addHtmlLabel(root,node){var fo=root.append("foreignObject").attr("width","100000");var div=fo.append("xhtml:div");var label=node.label;switch(typeof label){case"function":div.insert(label);break;case"object":div.insert(function(){return label});break;default:div.html(label)}util.applyStyle(div,node.labelStyle);div.style("display","inline-block");div.style("white-space","nowrap");var w,h;div.each(function(){w=this.clientWidth;h=this.clientHeight});fo.attr("width",w).attr("height",h);return fo}},{"../util":25}],18:[function(require,module,exports){var addTextLabel=require("./add-text-label"),addHtmlLabel=require("./add-html-label");module.exports=addLabel;function addLabel(root,node){var label=node.label;var labelSvg=root.append("g");if(typeof label!=="string"||node.labelType==="html"){addHtmlLabel(labelSvg,node)}else{addTextLabel(labelSvg,node)}var labelBBox=labelSvg.node().getBBox();labelSvg.attr("transform","translate("+-labelBBox.width/2+","+-labelBBox.height/2+")");return labelSvg}},{"./add-html-label":17,"./add-text-label":19}],19:[function(require,module,exports){var util=require("../util");module.exports=addTextLabel;function addTextLabel(root,node){var domNode=root.append("text");var lines=processEscapeSequences(node.label).split("\n");for(var i=0;i0;--i){entry=buckets[i].dequeue();if(entry){results=results.concat(removeNode(g,buckets,zeroIdx,entry,true));break}}}}return results}function removeNode(g,buckets,zeroIdx,entry,collectPredecessors){var results=collectPredecessors?[]:undefined;_.each(g.inEdges(entry.v),function(edge){var weight=g.edge(edge),uEntry=g.node(edge.v);if(collectPredecessors){results.push({v:edge.v,w:edge.w})}uEntry.out-=weight;assignBucket(buckets,zeroIdx,uEntry)});_.each(g.outEdges(entry.v),function(edge){var weight=g.edge(edge),w=edge.w,wEntry=g.node(w);wEntry.in-=weight;assignBucket(buckets,zeroIdx,wEntry)});g.removeNode(entry.v);return results}function buildState(g,weightFn){var fasGraph=new Graph,maxIn=0,maxOut=0;_.each(g.nodes(),function(v){fasGraph.setNode(v,{v:v,"in":0,out:0})});_.each(g.edges(),function(e){var prevWeight=fasGraph.edge(e.v,e.w)||0,weight=weightFn(e),edgeWeight=prevWeight+weight;fasGraph.setEdge(e.v,e.w,edgeWeight);maxOut=Math.max(maxOut,fasGraph.node(e.v).out+=weight);maxIn=Math.max(maxIn,fasGraph.node(e.w).in+=weight)});var buckets=_.range(maxOut+maxIn+3).map(function(){return new List});var zeroIdx=maxIn+1;_.each(fasGraph.nodes(),function(v){assignBucket(buckets,zeroIdx,fasGraph.node(v))});return{graph:fasGraph,buckets:buckets,zeroIdx:zeroIdx}}function assignBucket(buckets,zeroIdx,entry){if(!entry.out){buckets[0].enqueue(entry)}else if(!entry.in){buckets[buckets.length-1].enqueue(entry)}else{buckets[entry.out-entry.in+zeroIdx].enqueue(entry)}}},{"./data/list":31,"./graphlib":33,"./lodash":36}],35:[function(require,module,exports){"use strict";var _=require("./lodash"),acyclic=require("./acyclic"),normalize=require("./normalize"),rank=require("./rank"),normalizeRanks=require("./util").normalizeRanks,parentDummyChains=require("./parent-dummy-chains"),removeEmptyRanks=require("./util").removeEmptyRanks,nestingGraph=require("./nesting-graph"),addBorderSegments=require("./add-border-segments"),coordinateSystem=require("./coordinate-system"),order=require("./order"),position=require("./position"),util=require("./util"),Graph=require("./graphlib").Graph;module.exports=layout;function layout(g,opts){var time=opts&&opts.debugTiming?util.time:util.notime;time("layout",function(){var layoutGraph=time(" buildLayoutGraph",function(){return buildLayoutGraph(g)});time(" runLayout",function(){runLayout(layoutGraph,time)});time(" updateInputGraph",function(){updateInputGraph(g,layoutGraph)})})}function runLayout(g,time){time(" makeSpaceForEdgeLabels",function(){makeSpaceForEdgeLabels(g)});time(" removeSelfEdges",function(){removeSelfEdges(g)});time(" acyclic",function(){acyclic.run(g)});time(" nestingGraph.run",function(){nestingGraph.run(g)});time(" rank",function(){rank(util.asNonCompoundGraph(g))});time(" injectEdgeLabelProxies",function(){injectEdgeLabelProxies(g)});time(" removeEmptyRanks",function(){removeEmptyRanks(g)});time(" nestingGraph.cleanup",function(){nestingGraph.cleanup(g)});time(" normalizeRanks",function(){normalizeRanks(g)});time(" assignRankMinMax",function(){assignRankMinMax(g)});time(" removeEdgeLabelProxies",function(){removeEdgeLabelProxies(g)});time(" normalize.run",function(){normalize.run(g)});time(" parentDummyChains",function(){parentDummyChains(g)});time(" addBorderSegments",function(){addBorderSegments(g)});time(" order",function(){order(g)});time(" insertSelfEdges",function(){insertSelfEdges(g)});time(" adjustCoordinateSystem",function(){coordinateSystem.adjust(g)});time(" position",function(){position(g)});time(" positionSelfEdges",function(){positionSelfEdges(g)});time(" removeBorderNodes",function(){removeBorderNodes(g)});time(" normalize.undo",function(){normalize.undo(g)});time(" fixupEdgeLabelCoords",function(){fixupEdgeLabelCoords(g)});time(" undoCoordinateSystem",function(){coordinateSystem.undo(g)});time(" translateGraph",function(){translateGraph(g)});time(" assignNodeIntersects",function(){assignNodeIntersects(g)});time(" reversePoints",function(){reversePointsForReversedEdges(g)});time(" acyclic.undo",function(){acyclic.undo(g)})}function updateInputGraph(inputGraph,layoutGraph){_.each(inputGraph.nodes(),function(v){var inputLabel=inputGraph.node(v),layoutLabel=layoutGraph.node(v);if(inputLabel){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y;if(layoutGraph.children(v).length){inputLabel.width=layoutLabel.width;inputLabel.height=layoutLabel.height}}});_.each(inputGraph.edges(),function(e){var inputLabel=inputGraph.edge(e),layoutLabel=layoutGraph.edge(e);inputLabel.points=layoutLabel.points;if(_.has(layoutLabel,"x")){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y}});inputGraph.graph().width=layoutGraph.graph().width;inputGraph.graph().height=layoutGraph.graph().height}var graphNumAttrs=["nodesep","edgesep","ranksep","marginx","marginy"],graphDefaults={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},graphAttrs=["acyclicer","ranker","rankdir","align"],nodeNumAttrs=["width","height"],nodeDefaults={width:0,height:0},edgeNumAttrs=["minlen","weight","width","height","labeloffset"],edgeDefaults={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},edgeAttrs=["labelpos"];function buildLayoutGraph(inputGraph){var g=new Graph({multigraph:true,compound:true}),graph=canonicalize(inputGraph.graph());g.setGraph(_.merge({},graphDefaults,selectNumberAttrs(graph,graphNumAttrs),_.pick(graph,graphAttrs)));_.each(inputGraph.nodes(),function(v){var node=canonicalize(inputGraph.node(v));g.setNode(v,_.defaults(selectNumberAttrs(node,nodeNumAttrs),nodeDefaults));g.setParent(v,inputGraph.parent(v))});_.each(inputGraph.edges(),function(e){var edge=canonicalize(inputGraph.edge(e));g.setEdge(e,_.merge({},edgeDefaults,selectNumberAttrs(edge,edgeNumAttrs),_.pick(edge,edgeAttrs)))});return g}function makeSpaceForEdgeLabels(g){var graph=g.graph();graph.ranksep/=2;_.each(g.edges(),function(e){var edge=g.edge(e);edge.minlen*=2;if(edge.labelpos.toLowerCase()!=="c"){if(graph.rankdir==="TB"||graph.rankdir==="BT"){edge.width+=edge.labeloffset}else{edge.height+=edge.labeloffset}}})}function injectEdgeLabelProxies(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.width&&edge.height){var v=g.node(e.v),w=g.node(e.w),label={rank:(w.rank-v.rank)/2+v.rank,e:e};util.addDummyNode(g,"edge-proxy",label,"_ep")}})}function assignRankMinMax(g){var maxRank=0;_.each(g.nodes(),function(v){var node=g.node(v);if(node.borderTop){node.minRank=g.node(node.borderTop).rank;node.maxRank=g.node(node.borderBottom).rank;maxRank=_.max(maxRank,node.maxRank)}});g.graph().maxRank=maxRank}function removeEdgeLabelProxies(g){_.each(g.nodes(),function(v){var node=g.node(v);if(node.dummy==="edge-proxy"){g.edge(node.e).labelRank=node.rank;g.removeNode(v)}})}function translateGraph(g){var minX=Number.POSITIVE_INFINITY,maxX=0,minY=Number.POSITIVE_INFINITY,maxY=0,graphLabel=g.graph(),marginX=graphLabel.marginx||0,marginY=graphLabel.marginy||0;function getExtremes(attrs){var x=attrs.x,y=attrs.y,w=attrs.width,h=attrs.height;minX=Math.min(minX,x-w/2);maxX=Math.max(maxX,x+w/2);minY=Math.min(minY,y-h/2);maxY=Math.max(maxY,y+h/2) -}_.each(g.nodes(),function(v){getExtremes(g.node(v))});_.each(g.edges(),function(e){var edge=g.edge(e);if(_.has(edge,"x")){getExtremes(edge)}});minX-=marginX;minY-=marginY;_.each(g.nodes(),function(v){var node=g.node(v);node.x-=minX;node.y-=minY});_.each(g.edges(),function(e){var edge=g.edge(e);_.each(edge.points,function(p){p.x-=minX;p.y-=minY});if(_.has(edge,"x")){edge.x-=minX}if(_.has(edge,"y")){edge.y-=minY}});graphLabel.width=maxX-minX+marginX;graphLabel.height=maxY-minY+marginY}function assignNodeIntersects(g){_.each(g.edges(),function(e){var edge=g.edge(e),nodeV=g.node(e.v),nodeW=g.node(e.w),p1,p2;if(!edge.points){edge.points=[];p1=nodeW;p2=nodeV}else{p1=edge.points[0];p2=edge.points[edge.points.length-1]}edge.points.unshift(util.intersectRect(nodeV,p1));edge.points.push(util.intersectRect(nodeW,p2))})}function fixupEdgeLabelCoords(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(_.has(edge,"x")){if(edge.labelpos==="l"||edge.labelpos==="r"){edge.width-=edge.labeloffset}switch(edge.labelpos){case"l":edge.x-=edge.width/2+edge.labeloffset;break;case"r":edge.x+=edge.width/2+edge.labeloffset;break}}})}function reversePointsForReversedEdges(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.reversed){edge.points.reverse()}})}function removeBorderNodes(g){_.each(g.nodes(),function(v){if(g.children(v).length){var node=g.node(v),t=g.node(node.borderTop),b=g.node(node.borderBottom),l=g.node(_.last(node.borderLeft)),r=g.node(_.last(node.borderRight));node.width=Math.abs(r.x-l.x);node.height=Math.abs(b.y-t.y);node.x=l.x+node.width/2;node.y=t.y+node.height/2}});_.each(g.nodes(),function(v){if(g.node(v).dummy==="border"){g.removeNode(v)}})}function removeSelfEdges(g){_.each(g.edges(),function(e){if(e.v===e.w){var node=g.node(e.v);if(!node.selfEdges){node.selfEdges=[]}node.selfEdges.push({e:e,label:g.edge(e)});g.removeEdge(e)}})}function insertSelfEdges(g){var layers=util.buildLayerMatrix(g);_.each(layers,function(layer){var orderShift=0;_.each(layer,function(v,i){var node=g.node(v);node.order=i+orderShift;_.each(node.selfEdges,function(selfEdge){util.addDummyNode(g,"selfedge",{width:selfEdge.label.width,height:selfEdge.label.height,rank:node.rank,order:i+ ++orderShift,e:selfEdge.e,label:selfEdge.label},"_se")});delete node.selfEdges})})}function positionSelfEdges(g){_.each(g.nodes(),function(v){var node=g.node(v);if(node.dummy==="selfedge"){var selfNode=g.node(node.e.v),x=selfNode.x+selfNode.width/2,y=selfNode.y,dx=node.x-x,dy=selfNode.height/2;g.setEdge(node.e,node.label);g.removeNode(v);node.label.points=[{x:x+2*dx/3,y:y-dy},{x:x+5*dx/6,y:y-dy},{x:x+dx,y:y},{x:x+5*dx/6,y:y+dy},{x:x+2*dx/3,y:y+dy}];node.label.x=node.x;node.label.y=node.y}})}function selectNumberAttrs(obj,attrs){return _.mapValues(_.pick(obj,attrs),Number)}function canonicalize(attrs){var newAttrs={};_.each(attrs,function(v,k){newAttrs[k.toLowerCase()]=v});return newAttrs}},{"./acyclic":28,"./add-border-segments":29,"./coordinate-system":30,"./graphlib":33,"./lodash":36,"./nesting-graph":37,"./normalize":38,"./order":43,"./parent-dummy-chains":48,"./position":50,"./rank":52,"./util":55}],36:[function(require,module,exports){module.exports=require(20)},{"/Users/cpettitt/projects/dagre-d3/lib/lodash.js":20,lodash:77}],37:[function(require,module,exports){var _=require("./lodash"),util=require("./util");module.exports={run:run,cleanup:cleanup};function run(g){var root=util.addDummyNode(g,"root",{},"_root"),depths=treeDepths(g),height=_.max(depths)-1,nodeSep=2*height+1;g.graph().nestingRoot=root;_.each(g.edges(),function(e){g.edge(e).minlen*=nodeSep});var weight=sumWeights(g)+1;_.each(g.children(),function(child){dfs(g,root,nodeSep,weight,height,depths,child)});g.graph().nodeRankFactor=nodeSep}function dfs(g,root,nodeSep,weight,height,depths,v){var children=g.children(v);if(!children.length){if(v!==root){g.setEdge(root,v,{weight:0,minlen:nodeSep})}return}var top=util.addBorderNode(g,"_bt"),bottom=util.addBorderNode(g,"_bb"),label=g.node(v);g.setParent(top,v);label.borderTop=top;g.setParent(bottom,v);label.borderBottom=bottom;_.each(children,function(child){dfs(g,root,nodeSep,weight,height,depths,child);var childNode=g.node(child),childTop=childNode.borderTop?childNode.borderTop:child,childBottom=childNode.borderBottom?childNode.borderBottom:child,thisWeight=childNode.borderTop?weight:2*weight,minlen=childTop!==childBottom?1:height-depths[v]+1;g.setEdge(top,childTop,{weight:thisWeight,minlen:minlen,nestingEdge:true});g.setEdge(childBottom,bottom,{weight:thisWeight,minlen:minlen,nestingEdge:true})});if(!g.parent(v)){g.setEdge(root,top,{weight:0,minlen:height+depths[v]})}}function treeDepths(g){var depths={};function dfs(v,depth){var children=g.children(v);if(children&&children.length){_.each(children,function(child){dfs(child,depth+1)})}depths[v]=depth}_.each(g.children(),function(v){dfs(v,1)});return depths}function sumWeights(g){return _.reduce(g.edges(),function(acc,e){return acc+g.edge(e).weight},0)}function cleanup(g){var graphLabel=g.graph();g.removeNode(graphLabel.nestingRoot);delete graphLabel.nestingRoot;_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.nestingEdge){g.removeEdge(e)}})}},{"./lodash":36,"./util":55}],38:[function(require,module,exports){"use strict";var _=require("./lodash"),util=require("./util");module.exports={run:run,undo:undo};function run(g){g.graph().dummyChains=[];_.each(g.edges(),function(edge){normalizeEdge(g,edge)})}function normalizeEdge(g,e){var v=e.v,vRank=g.node(v).rank,w=e.w,wRank=g.node(w).rank,name=e.name,edgeLabel=g.edge(e),labelRank=edgeLabel.labelRank;if(wRank===vRank+1)return;g.removeEdge(e);var dummy,attrs,i;for(i=0,++vRank;vRank0){if(index%2){weightSum+=tree[index+1]}index=index-1>>1;tree[index]+=entry.weight}cc+=entry.weight*weightSum}));return cc}},{"../lodash":36}],43:[function(require,module,exports){"use strict";var _=require("../lodash"),initOrder=require("./init-order"),crossCount=require("./cross-count"),sortSubgraph=require("./sort-subgraph"),buildLayerGraph=require("./build-layer-graph"),addSubgraphConstraints=require("./add-subgraph-constraints"),Graph=require("../graphlib").Graph,util=require("../util");module.exports=order;function order(g){var maxRank=util.maxRank(g),downLayerGraphs=buildLayerGraphs(g,_.range(1,maxRank+1),"inEdges"),upLayerGraphs=buildLayerGraphs(g,_.range(maxRank-1,-1,-1),"outEdges");var layering=initOrder(g);assignOrder(g,layering);var bestCC=Number.POSITIVE_INFINITY,best;for(var i=0,lastBest=0;lastBest<4;++i,++lastBest){sweepLayerGraphs(i%2?downLayerGraphs:upLayerGraphs,i%4>=2);layering=util.buildLayerMatrix(g);var cc=crossCount(g,layering);if(cc=vEntry.barycenter){mergeEntries(vEntry,uEntry)}}}function handleOut(vEntry){return function(wEntry){wEntry.in.push(vEntry);if(--wEntry.indegree===0){sourceSet.push(wEntry)}}}while(sourceSet.length){var entry=sourceSet.pop();entries.push(entry);_.each(entry.in.reverse(),handleIn(entry));_.each(entry.out,handleOut(entry))}return _.chain(entries).filter(function(entry){return!entry.merged}).map(function(entry){return _.pick(entry,["vs","i","barycenter","weight"])}).value()}function mergeEntries(target,source){var sum=0,weight=0;if(target.weight){sum+=target.barycenter*target.weight;weight+=target.weight}if(source.weight){sum+=source.barycenter*source.weight;weight+=source.weight}target.vs=source.vs.concat(target.vs);target.barycenter=sum/weight;target.weight=weight;target.i=Math.min(source.i,target.i);source.merged=true}},{"../lodash":36}],46:[function(require,module,exports){var _=require("../lodash"),barycenter=require("./barycenter"),resolveConflicts=require("./resolve-conflicts"),sort=require("./sort");module.exports=sortSubgraph;function sortSubgraph(g,v,cg,biasRight){var movable=g.children(v),node=g.node(v),bl=node?node.borderLeft:undefined,br=node?node.borderRight:undefined,subgraphs={};if(bl){movable=_.filter(movable,function(w){return w!==bl&&w!==br})}var barycenters=barycenter(g,movable);_.each(barycenters,function(entry){if(g.children(entry.v).length){var subgraphResult=sortSubgraph(g,entry.v,cg,biasRight);subgraphs[entry.v]=subgraphResult;if(_.has(subgraphResult,"barycenter")){mergeBarycenters(entry,subgraphResult)}}});var entries=resolveConflicts(barycenters,cg);expandSubgraphs(entries,subgraphs);var result=sort(entries,biasRight);if(bl){result.vs=_.flatten([bl,result.vs,br],true);if(g.predecessors(bl).length){var blPred=g.node(g.predecessors(bl)[0]),brPred=g.node(g.predecessors(br)[0]);if(!_.has(result,"barycenter")){result.barycenter=0;result.weight=0}result.barycenter=(result.barycenter*result.weight+blPred.order+brPred.order)/(result.weight+2);result.weight+=2}}return result}function expandSubgraphs(entries,subgraphs){_.each(entries,function(entry){entry.vs=_.flatten(entry.vs.map(function(v){if(subgraphs[v]){return subgraphs[v].vs}return v}),true)})}function mergeBarycenters(target,other){if(!_.isUndefined(target.barycenter)){target.barycenter=(target.barycenter*target.weight+other.barycenter*other.weight)/(target.weight+other.weight);target.weight+=other.weight}else{target.barycenter=other.barycenter;target.weight=other.weight}}},{"../lodash":36,"./barycenter":40,"./resolve-conflicts":45,"./sort":47}],47:[function(require,module,exports){var _=require("../lodash"),util=require("../util");module.exports=sort;function sort(entries,biasRight){var parts=util.partition(entries,function(entry){return _.has(entry,"barycenter")});var sortable=parts.lhs,unsortable=_.sortBy(parts.rhs,function(entry){return-entry.i}),vs=[],sum=0,weight=0,vsIndex=0;sortable.sort(compareWithBias(!!biasRight));vsIndex=consumeUnsortable(vs,unsortable,vsIndex);_.each(sortable,function(entry){vsIndex+=entry.vs.length;vs.push(entry.vs);sum+=entry.barycenter*entry.weight;weight+=entry.weight;vsIndex=consumeUnsortable(vs,unsortable,vsIndex)});var result={vs:_.flatten(vs,true)};if(weight){result.barycenter=sum/weight;result.weight=weight}return result}function consumeUnsortable(vs,unsortable,index){var last;while(unsortable.length&&(last=_.last(unsortable)).i<=index){unsortable.pop();vs.push(last.vs);index++}return index}function compareWithBias(bias){return function(entryV,entryW){if(entryV.barycenterentryW.barycenter){return 1}return!bias?entryV.i-entryW.i:entryW.i-entryV.i}}},{"../lodash":36,"../util":55}],48:[function(require,module,exports){var _=require("./lodash");module.exports=parentDummyChains;function parentDummyChains(g){var postorderNums=postorder(g);_.each(g.graph().dummyChains,function(v){var node=g.node(v),edgeObj=node.edgeObj,pathData=findPath(g,postorderNums,edgeObj.v,edgeObj.w),path=pathData.path,lca=pathData.lca,pathIdx=0,pathV=path[pathIdx],ascending=true;while(v!==edgeObj.w){node=g.node(v);if(ascending){while((pathV=path[pathIdx])!==lca&&g.node(pathV).maxRanklow||lim>postorderNums[parent].lim));lca=parent;parent=w;while((parent=g.parent(parent))!==lca){wPath.push(parent)}return{path:vPath.concat(wPath.reverse()),lca:lca}}function postorder(g){var result={},lim=0;function dfs(v){var low=lim;_.each(g.children(v),dfs);result[v]={low:low,lim:lim++}}_.each(g.children(),dfs);return result}},{"./lodash":36}],49:[function(require,module,exports){"use strict";var _=require("../lodash"),util=require("../util");module.exports={positionX:positionX,findType1Conflicts:findType1Conflicts,findType2Conflicts:findType2Conflicts,addConflict:addConflict,hasConflict:hasConflict,verticalAlignment:verticalAlignment,horizontalCompaction:horizontalCompaction,alignCoordinates:alignCoordinates,findSmallestWidthAlignment:findSmallestWidthAlignment,balance:balance};function findType1Conflicts(g,layering){var conflicts={};function visitLayer(prevLayer,layer){var k0=0,scanPos=0,prevLayerLength=prevLayer.length,lastNode=_.last(layer);_.each(layer,function(v,i){var w=findOtherInnerSegmentNode(g,v),k1=w?g.node(w).order:prevLayerLength;if(w||v===lastNode){_.each(layer.slice(scanPos,i+1),function(scanNode){_.each(g.predecessors(scanNode),function(u){var uLabel=g.node(u),uPos=uLabel.order;if((uPosnextNorthBorder)){addConflict(conflicts,u,v)}})}})}function visitLayer(north,south){var prevNorthPos=-1,nextNorthPos,southPos=0;_.each(south,function(v,southLookahead){if(g.node(v).dummy==="border"){var predecessors=g.predecessors(v);if(predecessors.length){nextNorthPos=g.node(predecessors[0]).order;scan(south,southPos,southLookahead,prevNorthPos,nextNorthPos);southPos=southLookahead;prevNorthPos=nextNorthPos}}scan(south,southPos,south.length,nextNorthPos,north.length)});return south}_.reduce(layering,visitLayer);return conflicts}function findOtherInnerSegmentNode(g,v){if(g.node(v).dummy){return _.find(g.predecessors(v),function(u){return g.node(u).dummy})}}function addConflict(conflicts,v,w){if(v>w){var tmp=v;v=w;w=tmp}var conflictsV=conflicts[v];if(!conflictsV){conflicts[v]=conflictsV={}}conflictsV[w]=true}function hasConflict(conflicts,v,w){if(v>w){var tmp=v;v=w;w=tmp}return _.has(conflicts[v],w)}function verticalAlignment(g,layering,conflicts,neighborFn){var root={},align={},pos={};_.each(layering,function(layer){_.each(layer,function(v,order){root[v]=v;align[v]=v;pos[v]=order})});_.each(layering,function(layer){var prevIdx=-1;_.each(layer,function(v){var ws=neighborFn(v);if(ws.length){ws=_.sortBy(ws,function(w){return pos[w]});var mp=(ws.length-1)/2;for(var i=Math.floor(mp),il=Math.ceil(mp);i<=il;++i){var w=ws[i];if(align[v]===v&&prevIdxwLabel.lim){tailLabel=wLabel;flip=true}var candidates=_.filter(g.edges(),function(edge){return flip===isDescendant(t,t.node(edge.v),tailLabel)&&flip!==isDescendant(t,t.node(edge.w),tailLabel)});return _.min(candidates,function(edge){return slack(g,edge)})}function exchangeEdges(t,g,e,f){var v=e.v,w=e.w;t.removeEdge(v,w);t.setEdge(f.v,f.w,{});initLowLimValues(t);initCutValues(t,g);updateRanks(t,g)}function updateRanks(t,g){var root=_.find(t.nodes(),function(v){return!g.node(v).parent}),vs=preorder(t,root);vs=vs.slice(1);_.each(vs,function(v){var parent=t.node(v).parent,edge=g.edge(v,parent),flipped=false;if(!edge){edge=g.edge(parent,v);flipped=true}g.node(v).rank=g.node(parent).rank+(flipped?edge.minlen:-edge.minlen)})}function isTreeEdge(tree,u,v){return tree.hasEdge(u,v)}function isDescendant(tree,vLabel,rootLabel){return rootLabel.low<=vLabel.lim&&vLabel.lim<=rootLabel.lim}},{"../graphlib":33,"../lodash":36,"../util":55,"./feasible-tree":51,"./util":54}],54:[function(require,module,exports){"use strict";var _=require("../lodash");module.exports={longestPath:longestPath,slack:slack};function longestPath(g){var visited={};function dfs(v){var label=g.node(v);if(_.has(visited,v)){return label.rank}visited[v]=true;var rank=_.min(_.map(g.outEdges(v),function(e){return dfs(e.w)-g.edge(e).minlen}));if(rank===Number.POSITIVE_INFINITY){rank=0}return label.rank=rank}_.each(g.sources(),dfs)}function slack(g,e){return g.node(e.w).rank-g.node(e.v).rank-g.edge(e).minlen}},{"../lodash":36}],55:[function(require,module,exports){"use strict";var _=require("./lodash"),Graph=require("./graphlib").Graph;module.exports={addDummyNode:addDummyNode,simplify:simplify,asNonCompoundGraph:asNonCompoundGraph,successorWeights:successorWeights,predecessorWeights:predecessorWeights,intersectRect:intersectRect,buildLayerMatrix:buildLayerMatrix,normalizeRanks:normalizeRanks,removeEmptyRanks:removeEmptyRanks,addBorderNode:addBorderNode,maxRank:maxRank,partition:partition,time:time,notime:notime};function addDummyNode(g,type,attrs,name){var v;do{v=_.uniqueId(name)}while(g.hasNode(v));attrs.dummy=type;g.setNode(v,attrs);return v}function simplify(g){var simplified=(new Graph).setGraph(g.graph());_.each(g.nodes(),function(v){simplified.setNode(v,g.node(v))});_.each(g.edges(),function(e){var simpleLabel=simplified.edge(e.v,e.w)||{weight:0,minlen:1},label=g.edge(e);simplified.setEdge(e.v,e.w,{weight:simpleLabel.weight+label.weight,minlen:Math.max(simpleLabel.minlen,label.minlen)})});return simplified}function asNonCompoundGraph(g){var simplified=new Graph({multigraph:g.isMultigraph()}).setGraph(g.graph());_.each(g.nodes(),function(v){if(!g.children(v).length){simplified.setNode(v,g.node(v))}});_.each(g.edges(),function(e){simplified.setEdge(e,g.edge(e))});return simplified}function successorWeights(g){var weightMap=_.map(g.nodes(),function(v){var sucs={};_.each(g.outEdges(v),function(e){sucs[e.w]=(sucs[e.w]||0)+g.edge(e).weight});return sucs});return _.zipObject(g.nodes(),weightMap)}function predecessorWeights(g){var weightMap=_.map(g.nodes(),function(v){var preds={};_.each(g.inEdges(v),function(e){preds[e.v]=(preds[e.v]||0)+g.edge(e).weight});return preds});return _.zipObject(g.nodes(),weightMap)}function intersectRect(rect,point){var x=rect.x;var y=rect.y;var dx=point.x-x;var dy=point.y-y;var w=rect.width/2;var h=rect.height/2;if(!dx&&!dy){throw new Error("Not possible to find intersection inside of the rectangle")}var sx,sy;if(Math.abs(dy)*w>Math.abs(dx)*h){if(dy<0){h=-h}sx=h*dx/dy;sy=h}else{if(dx<0){w=-w}sx=w;sy=w*dy/dx}return{x:x+sx,y:y+sy}}function buildLayerMatrix(g){var layering=_.map(_.range(maxRank(g)+1),function(){return[]});_.each(g.nodes(),function(v){var node=g.node(v),rank=node.rank;if(!_.isUndefined(rank)){layering[rank][node.order]=v}});return layering}function normalizeRanks(g){var min=_.min(_.map(g.nodes(),function(v){return g.node(v).rank -}));_.each(g.nodes(),function(v){var node=g.node(v);if(_.has(node,"rank")){node.rank-=min}})}function removeEmptyRanks(g){var offset=_.min(_.map(g.nodes(),function(v){return g.node(v).rank}));var layers=[];_.each(g.nodes(),function(v){var rank=g.node(v).rank-offset;if(!_.has(layers,rank)){layers[rank]=[]}layers[rank].push(v)});var delta=0,nodeRankFactor=g.graph().nodeRankFactor;_.each(layers,function(vs,i){if(_.isUndefined(vs)&&i%nodeRankFactor!==0){--delta}else if(delta){_.each(vs,function(v){g.node(v).rank+=delta})}})}function addBorderNode(g,prefix,rank,order){var node={width:0,height:0};if(arguments.length>=4){node.rank=rank;node.order=order}return addDummyNode(g,"border",node,prefix)}function maxRank(g){return _.max(_.map(g.nodes(),function(v){var rank=g.node(v).rank;if(!_.isUndefined(rank)){return rank}}))}function partition(collection,fn){var result={lhs:[],rhs:[]};_.each(collection,function(value){if(fn(value)){result.lhs.push(value)}else{result.rhs.push(value)}});return result}function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+" time: "+(_.now()-start)+"ms")}}function notime(name,fn){return fn()}},{"./graphlib":33,"./lodash":36}],56:[function(require,module,exports){module.exports="0.6.1"},{}],57:[function(require,module,exports){var lib=require("./lib");module.exports={Graph:lib.Graph,json:require("./lib/json"),alg:require("./lib/alg"),version:lib.version}},{"./lib":73,"./lib/alg":64,"./lib/json":74}],58:[function(require,module,exports){var _=require("../lodash");module.exports=components;function components(g){var visited={},cmpts=[],cmpt;function dfs(v){if(_.has(visited,v))return;visited[v]=true;cmpt.push(v);_.each(g.successors(v),dfs);_.each(g.predecessors(v),dfs)}_.each(g.nodes(),function(v){cmpt=[];dfs(v);if(cmpt.length){cmpts.push(cmpt)}});return cmpts}},{"../lodash":75}],59:[function(require,module,exports){var _=require("../lodash");module.exports=dfs;function dfs(g,vs,order){if(!_.isArray(vs)){vs=[vs]}var acc=[],visited={};_.each(vs,function(v){if(!g.hasNode(v)){throw new Error("Graph does not have node: "+v)}doDfs(g,v,order==="post",visited,acc)});return acc}function doDfs(g,v,postorder,visited,acc){if(!_.has(visited,v)){visited[v]=true;if(!postorder){acc.push(v)}_.each(g.neighbors(v),function(w){doDfs(g,w,postorder,visited,acc)});if(postorder){acc.push(v)}}}},{"../lodash":75}],60:[function(require,module,exports){var dijkstra=require("./dijkstra"),_=require("../lodash");module.exports=dijkstraAll;function dijkstraAll(g,weightFunc,edgeFunc){return _.transform(g.nodes(),function(acc,v){acc[v]=dijkstra(g,v,weightFunc,edgeFunc)},{})}},{"../lodash":75,"./dijkstra":61}],61:[function(require,module,exports){var _=require("../lodash"),PriorityQueue=require("../data/priority-queue");module.exports=dijkstra;var DEFAULT_WEIGHT_FUNC=_.constant(1);function dijkstra(g,source,weightFn,edgeFn){return runDijkstra(g,String(source),weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runDijkstra(g,source,weightFn,edgeFn){var results={},pq=new PriorityQueue,v,vEntry;var updateNeighbors=function(edge){var w=edge.v!==v?edge.v:edge.w,wEntry=results[w],weight=weightFn(edge),distance=vEntry.distance+weight;if(weight<0){throw new Error("dijkstra does not allow negative edge weights. "+"Bad edge: "+edge+" Weight: "+weight)}if(distance0){v=pq.removeMin();vEntry=results[v];if(vEntry.distance===Number.POSITIVE_INFINITY){break}edgeFn(v).forEach(updateNeighbors)}return results}},{"../data/priority-queue":71,"../lodash":75}],62:[function(require,module,exports){var _=require("../lodash"),tarjan=require("./tarjan");module.exports=findCycles;function findCycles(g){return _.filter(tarjan(g),function(cmpt){return cmpt.length>1})}},{"../lodash":75,"./tarjan":69}],63:[function(require,module,exports){var _=require("../lodash");module.exports=floydWarshall;var DEFAULT_WEIGHT_FUNC=_.constant(1);function floydWarshall(g,weightFn,edgeFn){return runFloydWarshall(g,weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runFloydWarshall(g,weightFn,edgeFn){var results={},nodes=g.nodes();nodes.forEach(function(v){results[v]={};results[v][v]={distance:0};nodes.forEach(function(w){if(v!==w){results[v][w]={distance:Number.POSITIVE_INFINITY}}});edgeFn(v).forEach(function(edge){var w=edge.v===v?edge.w:edge.v,d=weightFn(edge);results[v][w]={distance:d,predecessor:v}})});nodes.forEach(function(k){var rowK=results[k];nodes.forEach(function(i){var rowI=results[i];nodes.forEach(function(j){var ik=rowI[k];var kj=rowK[j];var ij=rowI[j];var altDistance=ik.distance+kj.distance;if(altDistance0){v=pq.removeMin();if(_.has(parents,v)){result.setEdge(v,parents[v])}else if(init){throw new Error("Input graph is not connected: "+g)}else{init=true}g.nodeEdges(v).forEach(updateNeighbors)}return result}},{"../data/priority-queue":71,"../graph":72,"../lodash":75}],69:[function(require,module,exports){var _=require("../lodash");module.exports=tarjan;function tarjan(g){var index=0,stack=[],visited={},results=[];function dfs(v){var entry=visited[v]={onStack:true,lowlink:index,index:index++};stack.push(v);g.successors(v).forEach(function(w){if(!_.has(visited,w)){dfs(w);entry.lowlink=Math.min(entry.lowlink,visited[w].lowlink)}else if(visited[w].onStack){entry.lowlink=Math.min(entry.lowlink,visited[w].index)}});if(entry.lowlink===entry.index){var cmpt=[],w;do{w=stack.pop();visited[w].onStack=false;cmpt.push(w)}while(v!==w);results.push(cmpt)}}g.nodes().forEach(function(v){if(!_.has(visited,v)){dfs(v)}});return results}},{"../lodash":75}],70:[function(require,module,exports){var _=require("../lodash");module.exports=topsort;topsort.CycleException=CycleException;function topsort(g){var visited={},stack={},results=[];function visit(node){if(_.has(stack,node)){throw new CycleException}if(!_.has(visited,node)){stack[node]=true;visited[node]=true;_.each(g.predecessors(node),visit);delete stack[node];results.push(node)}}_.each(g.sinks(),visit);if(_.size(visited)!==g.nodeCount()){throw new CycleException}return results}function CycleException(){}},{"../lodash":75}],71:[function(require,module,exports){var _=require("../lodash");module.exports=PriorityQueue;function PriorityQueue(){this._arr=[];this._keyIndices={}}PriorityQueue.prototype.size=function(){return this._arr.length};PriorityQueue.prototype.keys=function(){return this._arr.map(function(x){return x.key})};PriorityQueue.prototype.has=function(key){return _.has(this._keyIndices,key)};PriorityQueue.prototype.priority=function(key){var index=this._keyIndices[key];if(index!==undefined){return this._arr[index].priority}};PriorityQueue.prototype.min=function(){if(this.size()===0){throw new Error("Queue underflow")}return this._arr[0].key};PriorityQueue.prototype.add=function(key,priority){var keyIndices=this._keyIndices;key=String(key);if(!_.has(keyIndices,key)){var arr=this._arr;var index=arr.length;keyIndices[key]=index;arr.push({key:key,priority:priority});this._decrease(index);return true}return false};PriorityQueue.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var min=this._arr.pop();delete this._keyIndices[min.key];this._heapify(0);return min.key};PriorityQueue.prototype.decrease=function(key,priority){var index=this._keyIndices[key];if(priority>this._arr[index].priority){throw new Error("New priority is greater than current priority. "+"Key: "+key+" Old: "+this._arr[index].priority+" New: "+priority)}this._arr[index].priority=priority;this._decrease(index)};PriorityQueue.prototype._heapify=function(i){var arr=this._arr;var l=2*i,r=l+1,largest=i;if(l>1;if(arr[parent].priority1){this.setNode(v,value)}else{this.setNode(v)}},this);return this};Graph.prototype.setNode=function(v,value){if(_.has(this._nodes,v)){if(arguments.length>1){this._nodes[v]=value}return this}this._nodes[v]=arguments.length>1?value:this._defaultNodeLabelFn(v);if(this._isCompound){this._parent[v]=GRAPH_NODE;this._children[v]={};this._children[GRAPH_NODE][v]=true}this._in[v]={};this._preds[v]={};this._out[v]={};this._sucs[v]={};++this._nodeCount;return this};Graph.prototype.node=function(v){return this._nodes[v]};Graph.prototype.hasNode=function(v){return _.has(this._nodes,v)};Graph.prototype.removeNode=function(v){var self=this;if(_.has(this._nodes,v)){var removeEdge=function(e){self.removeEdge(self._edgeObjs[e])};delete this._nodes[v];if(this._isCompound){this._removeFromParentsChildList(v);delete this._parent[v];_.each(this.children(v),function(child){this.setParent(child)},this);delete this._children[v]}_.each(_.keys(this._in[v]),removeEdge);delete this._in[v];delete this._preds[v];_.each(_.keys(this._out[v]),removeEdge);delete this._out[v];delete this._sucs[v];--this._nodeCount}return this};Graph.prototype.setParent=function(v,parent){if(!this._isCompound){throw new Error("Cannot set parent in a non-compound graph")}if(_.isUndefined(parent)){parent=GRAPH_NODE}else{for(var ancestor=parent;!_.isUndefined(ancestor);ancestor=this.parent(ancestor)){if(ancestor===v){throw new Error("Setting "+parent+" as parent of "+v+" would create create a cycle")}}this.setNode(parent)}this.setNode(v);this._removeFromParentsChildList(v);this._parent[v]=parent;this._children[parent][v]=true;return this};Graph.prototype._removeFromParentsChildList=function(v){delete this._children[this._parent[v]][v]};Graph.prototype.parent=function(v){if(this._isCompound){var parent=this._parent[v];if(parent!==GRAPH_NODE){return parent}}};Graph.prototype.children=function(v){if(_.isUndefined(v)){v=GRAPH_NODE}if(this._isCompound){var children=this._children[v];if(children){return _.keys(children)}}else if(v===GRAPH_NODE){return this.nodes()}else if(this.hasNode(v)){return[]}};Graph.prototype.predecessors=function(v){var predsV=this._preds[v];if(predsV){return _.keys(predsV)}};Graph.prototype.successors=function(v){var sucsV=this._sucs[v];if(sucsV){return _.keys(sucsV)}};Graph.prototype.neighbors=function(v){var preds=this.predecessors(v);if(preds){return _.union(preds,this.successors(v))}};Graph.prototype.setDefaultEdgeLabel=function(newDefault){if(!_.isFunction(newDefault)){newDefault=_.constant(newDefault)}this._defaultEdgeLabelFn=newDefault;return this};Graph.prototype.edgeCount=function(){return this._edgeCount};Graph.prototype.edges=function(){return _.values(this._edgeObjs)};Graph.prototype.setPath=function(vs,value){var self=this,args=arguments;_.reduce(vs,function(v,w){if(args.length>1){self.setEdge(v,w,value)}else{self.setEdge(v,w)}return w});return this};Graph.prototype.setEdge=function(v,w,value,name){var valueSpecified=arguments.length>2;v=String(v);w=String(w);if(!_.isUndefined(name)){name=String(name)}if(_.isPlainObject(arguments[0])){v=arguments[0].v;w=arguments[0].w;name=arguments[0].name;if(arguments.length===2){value=arguments[1];valueSpecified=true}}var e=edgeArgsToId(this._isDirected,v,w,name);if(_.has(this._edgeLabels,e)){if(valueSpecified){this._edgeLabels[e]=value}return this}if(!_.isUndefined(name)&&!this._isMultigraph){throw new Error("Cannot set a named edge when isMultigraph = false")}this.setNode(v);this.setNode(w);this._edgeLabels[e]=valueSpecified?value:this._defaultEdgeLabelFn(v,w,name);var edgeObj=edgeArgsToObj(this._isDirected,v,w,name);v=edgeObj.v;w=edgeObj.w;Object.freeze(edgeObj);this._edgeObjs[e]=edgeObj;incrementOrInitEntry(this._preds[w],v);incrementOrInitEntry(this._sucs[v],w);this._in[w][e]=edgeObj;this._out[v][e]=edgeObj;this._edgeCount++;return this};Graph.prototype.edge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return this._edgeLabels[e]};Graph.prototype.hasEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return _.has(this._edgeLabels,e)};Graph.prototype.removeEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name),edge=this._edgeObjs[e];if(edge){v=edge.v;w=edge.w;delete this._edgeLabels[e];delete this._edgeObjs[e];decrementOrRemoveEntry(this._preds[w],v);decrementOrRemoveEntry(this._sucs[v],w);delete this._in[w][e];delete this._out[v][e];this._edgeCount--}return this};Graph.prototype.inEdges=function(v,u){var inV=this._in[v];if(inV){var edges=_.values(inV);if(!u){return edges}return _.filter(edges,function(edge){return edge.v===u})}};Graph.prototype.outEdges=function(v,w){var outV=this._out[v];if(outV){var edges=_.values(outV);if(!w){return edges}return _.filter(edges,function(edge){return edge.w===w})}};Graph.prototype.nodeEdges=function(v,w){var inEdges=this.inEdges(v,w);if(inEdges){return inEdges.concat(this.outEdges(v,w))}};function incrementOrInitEntry(map,k){if(_.has(map,k)){map[k]++}else{map[k]=1}}function decrementOrRemoveEntry(map,k){if(!--map[k]){delete map[k]}}function edgeArgsToId(isDirected,v,w,name){if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}return v+EDGE_KEY_DELIM+w+EDGE_KEY_DELIM+(_.isUndefined(name)?DEFAULT_EDGE_NAME:name)}function edgeArgsToObj(isDirected,v,w,name){if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}var edgeObj={v:v,w:w};if(name){edgeObj.name=name}return edgeObj}function edgeObjToId(isDirected,edgeObj){return edgeArgsToId(isDirected,edgeObj.v,edgeObj.w,edgeObj.name)}},{"./lodash":75}],73:[function(require,module,exports){module.exports={Graph:require("./graph"),version:require("./version")}},{"./graph":72,"./version":76}],74:[function(require,module,exports){var _=require("./lodash"),Graph=require("./graph");module.exports={write:write,read:read};function write(g){var json={options:{directed:g.isDirected(),multigraph:g.isMultigraph(),compound:g.isCompound()},nodes:writeNodes(g),edges:writeEdges(g)};if(!_.isUndefined(g.graph())){json.value=_.clone(g.graph())}return json}function writeNodes(g){return _.map(g.nodes(),function(v){var nodeValue=g.node(v),parent=g.parent(v),node={v:v};if(!_.isUndefined(nodeValue)){node.value=nodeValue}if(!_.isUndefined(parent)){node.parent=parent}return node})}function writeEdges(g){return _.map(g.edges(),function(e){var edgeValue=g.edge(e),edge={v:e.v,w:e.w};if(!_.isUndefined(e.name)){edge.name=e.name}if(!_.isUndefined(edgeValue)){edge.value=edgeValue}return edge})}function read(json){var g=new Graph(json.options).setGraph(json.value);_.each(json.nodes,function(entry){g.setNode(entry.v,entry.value);if(entry.parent){g.setParent(entry.v,entry.parent)}});_.each(json.edges,function(entry){g.setEdge({v:entry.v,w:entry.w,name:entry.name},entry.value)});return g}},{"./graph":72,"./lodash":75}],75:[function(require,module,exports){module.exports=require(20)},{"/Users/cpettitt/projects/dagre-d3/lib/lodash.js":20,lodash:77}],76:[function(require,module,exports){module.exports="0.9.1"},{}],77:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ᠎              ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++indexother||typeof value=="undefined"){return 1}if(value/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++indexresult){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index>>1;callback(array[mid])1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments); -func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index0}},{}],14:[function(require,module,exports){module.exports=intersectNode;function intersectNode(node,point){return node.intersect(point)}},{}],15:[function(require,module,exports){var intersectLine=require("./intersect-line");module.exports=intersectPolygon;function intersectPolygon(node,polyPoints,point){var x1=node.x;var y1=node.y;var intersections=[];var minX=Number.POSITIVE_INFINITY,minY=Number.POSITIVE_INFINITY;polyPoints.forEach(function(entry){minX=Math.min(minX,entry.x);minY=Math.min(minY,entry.y)});var left=x1-node.width/2-minX;var top=y1-node.height/2-minY;for(var i=0;i1){intersections.sort(function(p,q){var pdx=p.x-point.x,pdy=p.y-point.y,distp=Math.sqrt(pdx*pdx+pdy*pdy),qdx=q.x-point.x,qdy=q.y-point.y,distq=Math.sqrt(qdx*qdx+qdy*qdy);return distpMath.abs(dx)*h){if(dy<0){h=-h}sx=dy===0?0:h*dx/dy;sy=h}else{if(dx<0){w=-w}sx=w;sy=dx===0?0:w*dy/dx}return{x:x+sx,y:y+sy}}},{}],17:[function(require,module,exports){var util=require("../util");module.exports=addHtmlLabel;function addHtmlLabel(root,node){var fo=root.append("foreignObject").attr("width","100000");var div=fo.append("xhtml:div");var label=node.label;switch(typeof label){case"function":div.insert(label);break;case"object":div.insert(function(){return label});break;default:div.html(label)}util.applyStyle(div,node.labelStyle);div.style("display","inline-block");div.style("white-space","nowrap");var w,h;div.each(function(){w=this.clientWidth;h=this.clientHeight});fo.attr("width",w).attr("height",h);return fo}},{"../util":25}],18:[function(require,module,exports){var addTextLabel=require("./add-text-label"),addHtmlLabel=require("./add-html-label");module.exports=addLabel;function addLabel(root,node){var label=node.label;var labelSvg=root.append("g");if(typeof label!=="string"||node.labelType==="html"){addHtmlLabel(labelSvg,node)}else{addTextLabel(labelSvg,node)}var labelBBox=labelSvg.node().getBBox();labelSvg.attr("transform","translate("+-labelBBox.width/2+","+-labelBBox.height/2+")");return labelSvg}},{"./add-html-label":17,"./add-text-label":19}],19:[function(require,module,exports){var util=require("../util");module.exports=addTextLabel;function addTextLabel(root,node){var domNode=root.append("text");var lines=processEscapeSequences(node.label).split("\n");for(var i=0;i0;--i){entry=buckets[i].dequeue();if(entry){results=results.concat(removeNode(g,buckets,zeroIdx,entry,true));break}}}}return results}function removeNode(g,buckets,zeroIdx,entry,collectPredecessors){var results=collectPredecessors?[]:undefined;_.each(g.inEdges(entry.v),function(edge){var weight=g.edge(edge),uEntry=g.node(edge.v);if(collectPredecessors){results.push({v:edge.v,w:edge.w})}uEntry.out-=weight;assignBucket(buckets,zeroIdx,uEntry)});_.each(g.outEdges(entry.v),function(edge){var weight=g.edge(edge),w=edge.w,wEntry=g.node(w);wEntry.in-=weight;assignBucket(buckets,zeroIdx,wEntry)});g.removeNode(entry.v);return results}function buildState(g,weightFn){var fasGraph=new Graph,maxIn=0,maxOut=0;_.each(g.nodes(),function(v){fasGraph.setNode(v,{v:v,"in":0,out:0})});_.each(g.edges(),function(e){var prevWeight=fasGraph.edge(e.v,e.w)||0,weight=weightFn(e),edgeWeight=prevWeight+weight;fasGraph.setEdge(e.v,e.w,edgeWeight);maxOut=Math.max(maxOut,fasGraph.node(e.v).out+=weight);maxIn=Math.max(maxIn,fasGraph.node(e.w).in+=weight)});var buckets=_.range(maxOut+maxIn+3).map(function(){return new List});var zeroIdx=maxIn+1;_.each(fasGraph.nodes(),function(v){assignBucket(buckets,zeroIdx,fasGraph.node(v))});return{graph:fasGraph,buckets:buckets,zeroIdx:zeroIdx}}function assignBucket(buckets,zeroIdx,entry){if(!entry.out){buckets[0].enqueue(entry)}else if(!entry.in){buckets[buckets.length-1].enqueue(entry)}else{buckets[entry.out-entry.in+zeroIdx].enqueue(entry)}}},{"./data/list":31,"./graphlib":33,"./lodash":36}],35:[function(require,module,exports){"use strict";var _=require("./lodash"),acyclic=require("./acyclic"),normalize=require("./normalize"),rank=require("./rank"),normalizeRanks=require("./util").normalizeRanks,parentDummyChains=require("./parent-dummy-chains"),removeEmptyRanks=require("./util").removeEmptyRanks,nestingGraph=require("./nesting-graph"),addBorderSegments=require("./add-border-segments"),coordinateSystem=require("./coordinate-system"),order=require("./order"),position=require("./position"),util=require("./util"),Graph=require("./graphlib").Graph;module.exports=layout;function layout(g,opts){var time=opts&&opts.debugTiming?util.time:util.notime;time("layout",function(){var layoutGraph=time(" buildLayoutGraph",function(){return buildLayoutGraph(g)});time(" runLayout",function(){runLayout(layoutGraph,time)});time(" updateInputGraph",function(){updateInputGraph(g,layoutGraph)})})}function runLayout(g,time){time(" makeSpaceForEdgeLabels",function(){makeSpaceForEdgeLabels(g)});time(" removeSelfEdges",function(){removeSelfEdges(g)});time(" acyclic",function(){acyclic.run(g)});time(" nestingGraph.run",function(){nestingGraph.run(g)});time(" rank",function(){rank(util.asNonCompoundGraph(g))});time(" injectEdgeLabelProxies",function(){injectEdgeLabelProxies(g)});time(" removeEmptyRanks",function(){removeEmptyRanks(g)});time(" nestingGraph.cleanup",function(){nestingGraph.cleanup(g)});time(" normalizeRanks",function(){normalizeRanks(g)});time(" assignRankMinMax",function(){assignRankMinMax(g)});time(" removeEdgeLabelProxies",function(){removeEdgeLabelProxies(g)});time(" normalize.run",function(){normalize.run(g)});time(" parentDummyChains",function(){parentDummyChains(g)});time(" addBorderSegments",function(){addBorderSegments(g)});time(" order",function(){order(g)});time(" insertSelfEdges",function(){insertSelfEdges(g)});time(" adjustCoordinateSystem",function(){coordinateSystem.adjust(g)});time(" position",function(){position(g)});time(" positionSelfEdges",function(){positionSelfEdges(g)});time(" removeBorderNodes",function(){removeBorderNodes(g)});time(" normalize.undo",function(){normalize.undo(g)});time(" fixupEdgeLabelCoords",function(){fixupEdgeLabelCoords(g)});time(" undoCoordinateSystem",function(){coordinateSystem.undo(g)});time(" translateGraph",function(){translateGraph(g)});time(" assignNodeIntersects",function(){assignNodeIntersects(g)});time(" reversePoints",function(){reversePointsForReversedEdges(g)});time(" acyclic.undo",function(){acyclic.undo(g)})}function updateInputGraph(inputGraph,layoutGraph){_.each(inputGraph.nodes(),function(v){var inputLabel=inputGraph.node(v),layoutLabel=layoutGraph.node(v);if(inputLabel){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y;if(layoutGraph.children(v).length){inputLabel.width=layoutLabel.width;inputLabel.height=layoutLabel.height}}});_.each(inputGraph.edges(),function(e){var inputLabel=inputGraph.edge(e),layoutLabel=layoutGraph.edge(e);inputLabel.points=layoutLabel.points;if(_.has(layoutLabel,"x")){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y}});inputGraph.graph().width=layoutGraph.graph().width;inputGraph.graph().height=layoutGraph.graph().height}var graphNumAttrs=["nodesep","edgesep","ranksep","marginx","marginy"],graphDefaults={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},graphAttrs=["acyclicer","ranker","rankdir","align"],nodeNumAttrs=["width","height"],nodeDefaults={width:0,height:0},edgeNumAttrs=["minlen","weight","width","height","labeloffset"],edgeDefaults={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},edgeAttrs=["labelpos"];function buildLayoutGraph(inputGraph){var g=new Graph({multigraph:true,compound:true}),graph=canonicalize(inputGraph.graph());g.setGraph(_.merge({},graphDefaults,selectNumberAttrs(graph,graphNumAttrs),_.pick(graph,graphAttrs)));_.each(inputGraph.nodes(),function(v){var node=canonicalize(inputGraph.node(v));g.setNode(v,_.defaults(selectNumberAttrs(node,nodeNumAttrs),nodeDefaults));g.setParent(v,inputGraph.parent(v))});_.each(inputGraph.edges(),function(e){var edge=canonicalize(inputGraph.edge(e));g.setEdge(e,_.merge({},edgeDefaults,selectNumberAttrs(edge,edgeNumAttrs),_.pick(edge,edgeAttrs)))});return g}function makeSpaceForEdgeLabels(g){var graph=g.graph();graph.ranksep/=2;_.each(g.edges(),function(e){var edge=g.edge(e);edge.minlen*=2;if(edge.labelpos.toLowerCase()!=="c"){if(graph.rankdir==="TB"||graph.rankdir==="BT"){edge.width+=edge.labeloffset}else{edge.height+=edge.labeloffset}}})}function injectEdgeLabelProxies(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.width&&edge.height){var v=g.node(e.v),w=g.node(e.w),label={rank:(w.rank-v.rank)/2+v.rank,e:e};util.addDummyNode(g,"edge-proxy",label,"_ep")}})}function assignRankMinMax(g){var maxRank=0;_.each(g.nodes(),function(v){var node=g.node(v);if(node.borderTop){node.minRank=g.node(node.borderTop).rank;node.maxRank=g.node(node.borderBottom).rank;maxRank=_.max(maxRank,node.maxRank)}});g.graph().maxRank=maxRank}function removeEdgeLabelProxies(g){_.each(g.nodes(),function(v){var node=g.node(v);if(node.dummy==="edge-proxy"){g.edge(node.e).labelRank=node.rank;g.removeNode(v)}})}function translateGraph(g){var minX=Number.POSITIVE_INFINITY,maxX=0,minY=Number.POSITIVE_INFINITY,maxY=0,graphLabel=g.graph(),marginX=graphLabel.marginx||0,marginY=graphLabel.marginy||0;function getExtremes(attrs){var x=attrs.x,y=attrs.y,w=attrs.width,h=attrs.height;minX=Math.min(minX,x-w/2);maxX=Math.max(maxX,x+w/2);minY=Math.min(minY,y-h/2); +maxY=Math.max(maxY,y+h/2)}_.each(g.nodes(),function(v){getExtremes(g.node(v))});_.each(g.edges(),function(e){var edge=g.edge(e);if(_.has(edge,"x")){getExtremes(edge)}});minX-=marginX;minY-=marginY;_.each(g.nodes(),function(v){var node=g.node(v);node.x-=minX;node.y-=minY});_.each(g.edges(),function(e){var edge=g.edge(e);_.each(edge.points,function(p){p.x-=minX;p.y-=minY});if(_.has(edge,"x")){edge.x-=minX}if(_.has(edge,"y")){edge.y-=minY}});graphLabel.width=maxX-minX+marginX;graphLabel.height=maxY-minY+marginY}function assignNodeIntersects(g){_.each(g.edges(),function(e){var edge=g.edge(e),nodeV=g.node(e.v),nodeW=g.node(e.w),p1,p2;if(!edge.points){edge.points=[];p1=nodeW;p2=nodeV}else{p1=edge.points[0];p2=edge.points[edge.points.length-1]}edge.points.unshift(util.intersectRect(nodeV,p1));edge.points.push(util.intersectRect(nodeW,p2))})}function fixupEdgeLabelCoords(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(_.has(edge,"x")){if(edge.labelpos==="l"||edge.labelpos==="r"){edge.width-=edge.labeloffset}switch(edge.labelpos){case"l":edge.x-=edge.width/2+edge.labeloffset;break;case"r":edge.x+=edge.width/2+edge.labeloffset;break}}})}function reversePointsForReversedEdges(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.reversed){edge.points.reverse()}})}function removeBorderNodes(g){_.each(g.nodes(),function(v){if(g.children(v).length){var node=g.node(v),t=g.node(node.borderTop),b=g.node(node.borderBottom),l=g.node(_.last(node.borderLeft)),r=g.node(_.last(node.borderRight));node.width=Math.abs(r.x-l.x);node.height=Math.abs(b.y-t.y);node.x=l.x+node.width/2;node.y=t.y+node.height/2}});_.each(g.nodes(),function(v){if(g.node(v).dummy==="border"){g.removeNode(v)}})}function removeSelfEdges(g){_.each(g.edges(),function(e){if(e.v===e.w){var node=g.node(e.v);if(!node.selfEdges){node.selfEdges=[]}node.selfEdges.push({e:e,label:g.edge(e)});g.removeEdge(e)}})}function insertSelfEdges(g){var layers=util.buildLayerMatrix(g);_.each(layers,function(layer){var orderShift=0;_.each(layer,function(v,i){var node=g.node(v);node.order=i+orderShift;_.each(node.selfEdges,function(selfEdge){util.addDummyNode(g,"selfedge",{width:selfEdge.label.width,height:selfEdge.label.height,rank:node.rank,order:i+ ++orderShift,e:selfEdge.e,label:selfEdge.label},"_se")});delete node.selfEdges})})}function positionSelfEdges(g){_.each(g.nodes(),function(v){var node=g.node(v);if(node.dummy==="selfedge"){var selfNode=g.node(node.e.v),x=selfNode.x+selfNode.width/2,y=selfNode.y,dx=node.x-x,dy=selfNode.height/2;g.setEdge(node.e,node.label);g.removeNode(v);node.label.points=[{x:x+2*dx/3,y:y-dy},{x:x+5*dx/6,y:y-dy},{x:x+dx,y:y},{x:x+5*dx/6,y:y+dy},{x:x+2*dx/3,y:y+dy}];node.label.x=node.x;node.label.y=node.y}})}function selectNumberAttrs(obj,attrs){return _.mapValues(_.pick(obj,attrs),Number)}function canonicalize(attrs){var newAttrs={};_.each(attrs,function(v,k){newAttrs[k.toLowerCase()]=v});return newAttrs}},{"./acyclic":28,"./add-border-segments":29,"./coordinate-system":30,"./graphlib":33,"./lodash":36,"./nesting-graph":37,"./normalize":38,"./order":43,"./parent-dummy-chains":48,"./position":50,"./rank":52,"./util":55}],36:[function(require,module,exports){module.exports=require(20)},{"/Users/cpettitt/projects/dagre-d3/lib/lodash.js":20,lodash:77}],37:[function(require,module,exports){var _=require("./lodash"),util=require("./util");module.exports={run:run,cleanup:cleanup};function run(g){var root=util.addDummyNode(g,"root",{},"_root"),depths=treeDepths(g),height=_.max(depths)-1,nodeSep=2*height+1;g.graph().nestingRoot=root;_.each(g.edges(),function(e){g.edge(e).minlen*=nodeSep});var weight=sumWeights(g)+1;_.each(g.children(),function(child){dfs(g,root,nodeSep,weight,height,depths,child)});g.graph().nodeRankFactor=nodeSep}function dfs(g,root,nodeSep,weight,height,depths,v){var children=g.children(v);if(!children.length){if(v!==root){g.setEdge(root,v,{weight:0,minlen:nodeSep})}return}var top=util.addBorderNode(g,"_bt"),bottom=util.addBorderNode(g,"_bb"),label=g.node(v);g.setParent(top,v);label.borderTop=top;g.setParent(bottom,v);label.borderBottom=bottom;_.each(children,function(child){dfs(g,root,nodeSep,weight,height,depths,child);var childNode=g.node(child),childTop=childNode.borderTop?childNode.borderTop:child,childBottom=childNode.borderBottom?childNode.borderBottom:child,thisWeight=childNode.borderTop?weight:2*weight,minlen=childTop!==childBottom?1:height-depths[v]+1;g.setEdge(top,childTop,{weight:thisWeight,minlen:minlen,nestingEdge:true});g.setEdge(childBottom,bottom,{weight:thisWeight,minlen:minlen,nestingEdge:true})});if(!g.parent(v)){g.setEdge(root,top,{weight:0,minlen:height+depths[v]})}}function treeDepths(g){var depths={};function dfs(v,depth){var children=g.children(v);if(children&&children.length){_.each(children,function(child){dfs(child,depth+1)})}depths[v]=depth}_.each(g.children(),function(v){dfs(v,1)});return depths}function sumWeights(g){return _.reduce(g.edges(),function(acc,e){return acc+g.edge(e).weight},0)}function cleanup(g){var graphLabel=g.graph();g.removeNode(graphLabel.nestingRoot);delete graphLabel.nestingRoot;_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.nestingEdge){g.removeEdge(e)}})}},{"./lodash":36,"./util":55}],38:[function(require,module,exports){"use strict";var _=require("./lodash"),util=require("./util");module.exports={run:run,undo:undo};function run(g){g.graph().dummyChains=[];_.each(g.edges(),function(edge){normalizeEdge(g,edge)})}function normalizeEdge(g,e){var v=e.v,vRank=g.node(v).rank,w=e.w,wRank=g.node(w).rank,name=e.name,edgeLabel=g.edge(e),labelRank=edgeLabel.labelRank;if(wRank===vRank+1)return;g.removeEdge(e);var dummy,attrs,i;for(i=0,++vRank;vRank0){if(index%2){weightSum+=tree[index+1]}index=index-1>>1;tree[index]+=entry.weight}cc+=entry.weight*weightSum}));return cc}},{"../lodash":36}],43:[function(require,module,exports){"use strict";var _=require("../lodash"),initOrder=require("./init-order"),crossCount=require("./cross-count"),sortSubgraph=require("./sort-subgraph"),buildLayerGraph=require("./build-layer-graph"),addSubgraphConstraints=require("./add-subgraph-constraints"),Graph=require("../graphlib").Graph,util=require("../util");module.exports=order;function order(g){var maxRank=util.maxRank(g),downLayerGraphs=buildLayerGraphs(g,_.range(1,maxRank+1),"inEdges"),upLayerGraphs=buildLayerGraphs(g,_.range(maxRank-1,-1,-1),"outEdges");var layering=initOrder(g);assignOrder(g,layering);var bestCC=Number.POSITIVE_INFINITY,best;for(var i=0,lastBest=0;lastBest<4;++i,++lastBest){sweepLayerGraphs(i%2?downLayerGraphs:upLayerGraphs,i%4>=2);layering=util.buildLayerMatrix(g);var cc=crossCount(g,layering);if(cc=vEntry.barycenter){mergeEntries(vEntry,uEntry)}}}function handleOut(vEntry){return function(wEntry){wEntry.in.push(vEntry);if(--wEntry.indegree===0){sourceSet.push(wEntry)}}}while(sourceSet.length){var entry=sourceSet.pop();entries.push(entry);_.each(entry.in.reverse(),handleIn(entry));_.each(entry.out,handleOut(entry))}return _.chain(entries).filter(function(entry){return!entry.merged}).map(function(entry){return _.pick(entry,["vs","i","barycenter","weight"])}).value()}function mergeEntries(target,source){var sum=0,weight=0;if(target.weight){sum+=target.barycenter*target.weight;weight+=target.weight}if(source.weight){sum+=source.barycenter*source.weight;weight+=source.weight}target.vs=source.vs.concat(target.vs);target.barycenter=sum/weight;target.weight=weight;target.i=Math.min(source.i,target.i);source.merged=true}},{"../lodash":36}],46:[function(require,module,exports){var _=require("../lodash"),barycenter=require("./barycenter"),resolveConflicts=require("./resolve-conflicts"),sort=require("./sort");module.exports=sortSubgraph;function sortSubgraph(g,v,cg,biasRight){var movable=g.children(v),node=g.node(v),bl=node?node.borderLeft:undefined,br=node?node.borderRight:undefined,subgraphs={};if(bl){movable=_.filter(movable,function(w){return w!==bl&&w!==br})}var barycenters=barycenter(g,movable);_.each(barycenters,function(entry){if(g.children(entry.v).length){var subgraphResult=sortSubgraph(g,entry.v,cg,biasRight);subgraphs[entry.v]=subgraphResult;if(_.has(subgraphResult,"barycenter")){mergeBarycenters(entry,subgraphResult)}}});var entries=resolveConflicts(barycenters,cg);expandSubgraphs(entries,subgraphs);var result=sort(entries,biasRight);if(bl){result.vs=_.flatten([bl,result.vs,br],true);if(g.predecessors(bl).length){var blPred=g.node(g.predecessors(bl)[0]),brPred=g.node(g.predecessors(br)[0]);if(!_.has(result,"barycenter")){result.barycenter=0;result.weight=0}result.barycenter=(result.barycenter*result.weight+blPred.order+brPred.order)/(result.weight+2);result.weight+=2}}return result}function expandSubgraphs(entries,subgraphs){_.each(entries,function(entry){entry.vs=_.flatten(entry.vs.map(function(v){if(subgraphs[v]){return subgraphs[v].vs}return v}),true)})}function mergeBarycenters(target,other){if(!_.isUndefined(target.barycenter)){target.barycenter=(target.barycenter*target.weight+other.barycenter*other.weight)/(target.weight+other.weight);target.weight+=other.weight}else{target.barycenter=other.barycenter;target.weight=other.weight}}},{"../lodash":36,"./barycenter":40,"./resolve-conflicts":45,"./sort":47}],47:[function(require,module,exports){var _=require("../lodash"),util=require("../util");module.exports=sort;function sort(entries,biasRight){var parts=util.partition(entries,function(entry){return _.has(entry,"barycenter")});var sortable=parts.lhs,unsortable=_.sortBy(parts.rhs,function(entry){return-entry.i}),vs=[],sum=0,weight=0,vsIndex=0;sortable.sort(compareWithBias(!!biasRight));vsIndex=consumeUnsortable(vs,unsortable,vsIndex);_.each(sortable,function(entry){vsIndex+=entry.vs.length;vs.push(entry.vs);sum+=entry.barycenter*entry.weight;weight+=entry.weight;vsIndex=consumeUnsortable(vs,unsortable,vsIndex)});var result={vs:_.flatten(vs,true)};if(weight){result.barycenter=sum/weight;result.weight=weight}return result}function consumeUnsortable(vs,unsortable,index){var last;while(unsortable.length&&(last=_.last(unsortable)).i<=index){unsortable.pop();vs.push(last.vs);index++}return index}function compareWithBias(bias){return function(entryV,entryW){if(entryV.barycenterentryW.barycenter){return 1}return!bias?entryV.i-entryW.i:entryW.i-entryV.i}}},{"../lodash":36,"../util":55}],48:[function(require,module,exports){var _=require("./lodash");module.exports=parentDummyChains;function parentDummyChains(g){var postorderNums=postorder(g);_.each(g.graph().dummyChains,function(v){var node=g.node(v),edgeObj=node.edgeObj,pathData=findPath(g,postorderNums,edgeObj.v,edgeObj.w),path=pathData.path,lca=pathData.lca,pathIdx=0,pathV=path[pathIdx],ascending=true;while(v!==edgeObj.w){node=g.node(v);if(ascending){while((pathV=path[pathIdx])!==lca&&g.node(pathV).maxRanklow||lim>postorderNums[parent].lim));lca=parent;parent=w;while((parent=g.parent(parent))!==lca){wPath.push(parent)}return{path:vPath.concat(wPath.reverse()),lca:lca}}function postorder(g){var result={},lim=0;function dfs(v){var low=lim;_.each(g.children(v),dfs);result[v]={low:low,lim:lim++}}_.each(g.children(),dfs);return result}},{"./lodash":36}],49:[function(require,module,exports){"use strict";var _=require("../lodash"),util=require("../util");module.exports={positionX:positionX,findType1Conflicts:findType1Conflicts,findType2Conflicts:findType2Conflicts,addConflict:addConflict,hasConflict:hasConflict,verticalAlignment:verticalAlignment,horizontalCompaction:horizontalCompaction,alignCoordinates:alignCoordinates,findSmallestWidthAlignment:findSmallestWidthAlignment,balance:balance};function findType1Conflicts(g,layering){var conflicts={};function visitLayer(prevLayer,layer){var k0=0,scanPos=0,prevLayerLength=prevLayer.length,lastNode=_.last(layer);_.each(layer,function(v,i){var w=findOtherInnerSegmentNode(g,v),k1=w?g.node(w).order:prevLayerLength;if(w||v===lastNode){_.each(layer.slice(scanPos,i+1),function(scanNode){_.each(g.predecessors(scanNode),function(u){var uLabel=g.node(u),uPos=uLabel.order;if((uPosnextNorthBorder)){addConflict(conflicts,u,v)}})}})}function visitLayer(north,south){var prevNorthPos=-1,nextNorthPos,southPos=0;_.each(south,function(v,southLookahead){if(g.node(v).dummy==="border"){var predecessors=g.predecessors(v);if(predecessors.length){nextNorthPos=g.node(predecessors[0]).order;scan(south,southPos,southLookahead,prevNorthPos,nextNorthPos);southPos=southLookahead;prevNorthPos=nextNorthPos}}scan(south,southPos,south.length,nextNorthPos,north.length)});return south}_.reduce(layering,visitLayer);return conflicts}function findOtherInnerSegmentNode(g,v){if(g.node(v).dummy){return _.find(g.predecessors(v),function(u){return g.node(u).dummy})}}function addConflict(conflicts,v,w){if(v>w){var tmp=v;v=w;w=tmp}var conflictsV=conflicts[v];if(!conflictsV){conflicts[v]=conflictsV={}}conflictsV[w]=true}function hasConflict(conflicts,v,w){if(v>w){var tmp=v;v=w;w=tmp}return _.has(conflicts[v],w)}function verticalAlignment(g,layering,conflicts,neighborFn){var root={},align={},pos={};_.each(layering,function(layer){_.each(layer,function(v,order){root[v]=v;align[v]=v;pos[v]=order})});_.each(layering,function(layer){var prevIdx=-1;_.each(layer,function(v){var ws=neighborFn(v);if(ws.length){ws=_.sortBy(ws,function(w){return pos[w]});var mp=(ws.length-1)/2;for(var i=Math.floor(mp),il=Math.ceil(mp);i<=il;++i){var w=ws[i];if(align[v]===v&&prevIdxwLabel.lim){tailLabel=wLabel;flip=true}var candidates=_.filter(g.edges(),function(edge){return flip===isDescendant(t,t.node(edge.v),tailLabel)&&flip!==isDescendant(t,t.node(edge.w),tailLabel)});return _.min(candidates,function(edge){return slack(g,edge)})}function exchangeEdges(t,g,e,f){var v=e.v,w=e.w;t.removeEdge(v,w);t.setEdge(f.v,f.w,{});initLowLimValues(t);initCutValues(t,g);updateRanks(t,g)}function updateRanks(t,g){var root=_.find(t.nodes(),function(v){return!g.node(v).parent}),vs=preorder(t,root);vs=vs.slice(1);_.each(vs,function(v){var parent=t.node(v).parent,edge=g.edge(v,parent),flipped=false;if(!edge){edge=g.edge(parent,v);flipped=true}g.node(v).rank=g.node(parent).rank+(flipped?edge.minlen:-edge.minlen)})}function isTreeEdge(tree,u,v){return tree.hasEdge(u,v)}function isDescendant(tree,vLabel,rootLabel){return rootLabel.low<=vLabel.lim&&vLabel.lim<=rootLabel.lim}},{"../graphlib":33,"../lodash":36,"../util":55,"./feasible-tree":51,"./util":54}],54:[function(require,module,exports){"use strict";var _=require("../lodash");module.exports={longestPath:longestPath,slack:slack};function longestPath(g){var visited={};function dfs(v){var label=g.node(v);if(_.has(visited,v)){return label.rank}visited[v]=true;var rank=_.min(_.map(g.outEdges(v),function(e){return dfs(e.w)-g.edge(e).minlen}));if(rank===Number.POSITIVE_INFINITY){rank=0}return label.rank=rank}_.each(g.sources(),dfs)}function slack(g,e){return g.node(e.w).rank-g.node(e.v).rank-g.edge(e).minlen}},{"../lodash":36}],55:[function(require,module,exports){"use strict";var _=require("./lodash"),Graph=require("./graphlib").Graph;module.exports={addDummyNode:addDummyNode,simplify:simplify,asNonCompoundGraph:asNonCompoundGraph,successorWeights:successorWeights,predecessorWeights:predecessorWeights,intersectRect:intersectRect,buildLayerMatrix:buildLayerMatrix,normalizeRanks:normalizeRanks,removeEmptyRanks:removeEmptyRanks,addBorderNode:addBorderNode,maxRank:maxRank,partition:partition,time:time,notime:notime};function addDummyNode(g,type,attrs,name){var v;do{v=_.uniqueId(name)}while(g.hasNode(v));attrs.dummy=type;g.setNode(v,attrs);return v}function simplify(g){var simplified=(new Graph).setGraph(g.graph());_.each(g.nodes(),function(v){simplified.setNode(v,g.node(v))});_.each(g.edges(),function(e){var simpleLabel=simplified.edge(e.v,e.w)||{weight:0,minlen:1},label=g.edge(e);simplified.setEdge(e.v,e.w,{weight:simpleLabel.weight+label.weight,minlen:Math.max(simpleLabel.minlen,label.minlen)})});return simplified}function asNonCompoundGraph(g){var simplified=new Graph({multigraph:g.isMultigraph()}).setGraph(g.graph());_.each(g.nodes(),function(v){if(!g.children(v).length){simplified.setNode(v,g.node(v))}});_.each(g.edges(),function(e){simplified.setEdge(e,g.edge(e))});return simplified}function successorWeights(g){var weightMap=_.map(g.nodes(),function(v){var sucs={};_.each(g.outEdges(v),function(e){sucs[e.w]=(sucs[e.w]||0)+g.edge(e).weight});return sucs});return _.zipObject(g.nodes(),weightMap)}function predecessorWeights(g){var weightMap=_.map(g.nodes(),function(v){var preds={};_.each(g.inEdges(v),function(e){preds[e.v]=(preds[e.v]||0)+g.edge(e).weight});return preds});return _.zipObject(g.nodes(),weightMap)}function intersectRect(rect,point){var x=rect.x;var y=rect.y;var dx=point.x-x;var dy=point.y-y;var w=rect.width/2;var h=rect.height/2;if(!dx&&!dy){throw new Error("Not possible to find intersection inside of the rectangle")}var sx,sy;if(Math.abs(dy)*w>Math.abs(dx)*h){if(dy<0){h=-h}sx=h*dx/dy;sy=h}else{if(dx<0){w=-w}sx=w;sy=w*dy/dx}return{x:x+sx,y:y+sy}}function buildLayerMatrix(g){var layering=_.map(_.range(maxRank(g)+1),function(){return[]});_.each(g.nodes(),function(v){var node=g.node(v),rank=node.rank;if(!_.isUndefined(rank)){layering[rank][node.order]=v}});return layering}function normalizeRanks(g){var min=_.min(_.map(g.nodes(),function(v){return g.node(v).rank +}));_.each(g.nodes(),function(v){var node=g.node(v);if(_.has(node,"rank")){node.rank-=min}})}function removeEmptyRanks(g){var offset=_.min(_.map(g.nodes(),function(v){return g.node(v).rank}));var layers=[];_.each(g.nodes(),function(v){var rank=g.node(v).rank-offset;if(!_.has(layers,rank)){layers[rank]=[]}layers[rank].push(v)});var delta=0,nodeRankFactor=g.graph().nodeRankFactor;_.each(layers,function(vs,i){if(_.isUndefined(vs)&&i%nodeRankFactor!==0){--delta}else if(delta){_.each(vs,function(v){g.node(v).rank+=delta})}})}function addBorderNode(g,prefix,rank,order){var node={width:0,height:0};if(arguments.length>=4){node.rank=rank;node.order=order}return addDummyNode(g,"border",node,prefix)}function maxRank(g){return _.max(_.map(g.nodes(),function(v){var rank=g.node(v).rank;if(!_.isUndefined(rank)){return rank}}))}function partition(collection,fn){var result={lhs:[],rhs:[]};_.each(collection,function(value){if(fn(value)){result.lhs.push(value)}else{result.rhs.push(value)}});return result}function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+" time: "+(_.now()-start)+"ms")}}function notime(name,fn){return fn()}},{"./graphlib":33,"./lodash":36}],56:[function(require,module,exports){module.exports="0.6.3"},{}],57:[function(require,module,exports){var lib=require("./lib");module.exports={Graph:lib.Graph,json:require("./lib/json"),alg:require("./lib/alg"),version:lib.version}},{"./lib":73,"./lib/alg":64,"./lib/json":74}],58:[function(require,module,exports){var _=require("../lodash");module.exports=components;function components(g){var visited={},cmpts=[],cmpt;function dfs(v){if(_.has(visited,v))return;visited[v]=true;cmpt.push(v);_.each(g.successors(v),dfs);_.each(g.predecessors(v),dfs)}_.each(g.nodes(),function(v){cmpt=[];dfs(v);if(cmpt.length){cmpts.push(cmpt)}});return cmpts}},{"../lodash":75}],59:[function(require,module,exports){var _=require("../lodash");module.exports=dfs;function dfs(g,vs,order){if(!_.isArray(vs)){vs=[vs]}var acc=[],visited={};_.each(vs,function(v){if(!g.hasNode(v)){throw new Error("Graph does not have node: "+v)}doDfs(g,v,order==="post",visited,acc)});return acc}function doDfs(g,v,postorder,visited,acc){if(!_.has(visited,v)){visited[v]=true;if(!postorder){acc.push(v)}_.each(g.neighbors(v),function(w){doDfs(g,w,postorder,visited,acc)});if(postorder){acc.push(v)}}}},{"../lodash":75}],60:[function(require,module,exports){var dijkstra=require("./dijkstra"),_=require("../lodash");module.exports=dijkstraAll;function dijkstraAll(g,weightFunc,edgeFunc){return _.transform(g.nodes(),function(acc,v){acc[v]=dijkstra(g,v,weightFunc,edgeFunc)},{})}},{"../lodash":75,"./dijkstra":61}],61:[function(require,module,exports){var _=require("../lodash"),PriorityQueue=require("../data/priority-queue");module.exports=dijkstra;var DEFAULT_WEIGHT_FUNC=_.constant(1);function dijkstra(g,source,weightFn,edgeFn){return runDijkstra(g,String(source),weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runDijkstra(g,source,weightFn,edgeFn){var results={},pq=new PriorityQueue,v,vEntry;var updateNeighbors=function(edge){var w=edge.v!==v?edge.v:edge.w,wEntry=results[w],weight=weightFn(edge),distance=vEntry.distance+weight;if(weight<0){throw new Error("dijkstra does not allow negative edge weights. "+"Bad edge: "+edge+" Weight: "+weight)}if(distance0){v=pq.removeMin();vEntry=results[v];if(vEntry.distance===Number.POSITIVE_INFINITY){break}edgeFn(v).forEach(updateNeighbors)}return results}},{"../data/priority-queue":71,"../lodash":75}],62:[function(require,module,exports){var _=require("../lodash"),tarjan=require("./tarjan");module.exports=findCycles;function findCycles(g){return _.filter(tarjan(g),function(cmpt){return cmpt.length>1})}},{"../lodash":75,"./tarjan":69}],63:[function(require,module,exports){var _=require("../lodash");module.exports=floydWarshall;var DEFAULT_WEIGHT_FUNC=_.constant(1);function floydWarshall(g,weightFn,edgeFn){return runFloydWarshall(g,weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runFloydWarshall(g,weightFn,edgeFn){var results={},nodes=g.nodes();nodes.forEach(function(v){results[v]={};results[v][v]={distance:0};nodes.forEach(function(w){if(v!==w){results[v][w]={distance:Number.POSITIVE_INFINITY}}});edgeFn(v).forEach(function(edge){var w=edge.v===v?edge.w:edge.v,d=weightFn(edge);results[v][w]={distance:d,predecessor:v}})});nodes.forEach(function(k){var rowK=results[k];nodes.forEach(function(i){var rowI=results[i];nodes.forEach(function(j){var ik=rowI[k];var kj=rowK[j];var ij=rowI[j];var altDistance=ik.distance+kj.distance;if(altDistance0){v=pq.removeMin();if(_.has(parents,v)){result.setEdge(v,parents[v])}else if(init){throw new Error("Input graph is not connected: "+g)}else{init=true}g.nodeEdges(v).forEach(updateNeighbors)}return result}},{"../data/priority-queue":71,"../graph":72,"../lodash":75}],69:[function(require,module,exports){var _=require("../lodash");module.exports=tarjan;function tarjan(g){var index=0,stack=[],visited={},results=[];function dfs(v){var entry=visited[v]={onStack:true,lowlink:index,index:index++};stack.push(v);g.successors(v).forEach(function(w){if(!_.has(visited,w)){dfs(w);entry.lowlink=Math.min(entry.lowlink,visited[w].lowlink)}else if(visited[w].onStack){entry.lowlink=Math.min(entry.lowlink,visited[w].index)}});if(entry.lowlink===entry.index){var cmpt=[],w;do{w=stack.pop();visited[w].onStack=false;cmpt.push(w)}while(v!==w);results.push(cmpt)}}g.nodes().forEach(function(v){if(!_.has(visited,v)){dfs(v)}});return results}},{"../lodash":75}],70:[function(require,module,exports){var _=require("../lodash");module.exports=topsort;topsort.CycleException=CycleException;function topsort(g){var visited={},stack={},results=[];function visit(node){if(_.has(stack,node)){throw new CycleException}if(!_.has(visited,node)){stack[node]=true;visited[node]=true;_.each(g.predecessors(node),visit);delete stack[node];results.push(node)}}_.each(g.sinks(),visit);if(_.size(visited)!==g.nodeCount()){throw new CycleException}return results}function CycleException(){}},{"../lodash":75}],71:[function(require,module,exports){var _=require("../lodash");module.exports=PriorityQueue;function PriorityQueue(){this._arr=[];this._keyIndices={}}PriorityQueue.prototype.size=function(){return this._arr.length};PriorityQueue.prototype.keys=function(){return this._arr.map(function(x){return x.key})};PriorityQueue.prototype.has=function(key){return _.has(this._keyIndices,key)};PriorityQueue.prototype.priority=function(key){var index=this._keyIndices[key];if(index!==undefined){return this._arr[index].priority}};PriorityQueue.prototype.min=function(){if(this.size()===0){throw new Error("Queue underflow")}return this._arr[0].key};PriorityQueue.prototype.add=function(key,priority){var keyIndices=this._keyIndices;key=String(key);if(!_.has(keyIndices,key)){var arr=this._arr;var index=arr.length;keyIndices[key]=index;arr.push({key:key,priority:priority});this._decrease(index);return true}return false};PriorityQueue.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var min=this._arr.pop();delete this._keyIndices[min.key];this._heapify(0);return min.key};PriorityQueue.prototype.decrease=function(key,priority){var index=this._keyIndices[key];if(priority>this._arr[index].priority){throw new Error("New priority is greater than current priority. "+"Key: "+key+" Old: "+this._arr[index].priority+" New: "+priority)}this._arr[index].priority=priority;this._decrease(index)};PriorityQueue.prototype._heapify=function(i){var arr=this._arr;var l=2*i,r=l+1,largest=i;if(l>1;if(arr[parent].priority1){this.setNode(v,value)}else{this.setNode(v)}},this);return this};Graph.prototype.setNode=function(v,value){if(_.has(this._nodes,v)){if(arguments.length>1){this._nodes[v]=value}return this}this._nodes[v]=arguments.length>1?value:this._defaultNodeLabelFn(v);if(this._isCompound){this._parent[v]=GRAPH_NODE;this._children[v]={};this._children[GRAPH_NODE][v]=true}this._in[v]={};this._preds[v]={};this._out[v]={};this._sucs[v]={};++this._nodeCount;return this};Graph.prototype.node=function(v){return this._nodes[v]};Graph.prototype.hasNode=function(v){return _.has(this._nodes,v)};Graph.prototype.removeNode=function(v){var self=this;if(_.has(this._nodes,v)){var removeEdge=function(e){self.removeEdge(self._edgeObjs[e])};delete this._nodes[v];if(this._isCompound){this._removeFromParentsChildList(v);delete this._parent[v];_.each(this.children(v),function(child){this.setParent(child)},this);delete this._children[v]}_.each(_.keys(this._in[v]),removeEdge);delete this._in[v];delete this._preds[v];_.each(_.keys(this._out[v]),removeEdge);delete this._out[v];delete this._sucs[v];--this._nodeCount}return this};Graph.prototype.setParent=function(v,parent){if(!this._isCompound){throw new Error("Cannot set parent in a non-compound graph")}if(_.isUndefined(parent)){parent=GRAPH_NODE}else{for(var ancestor=parent;!_.isUndefined(ancestor);ancestor=this.parent(ancestor)){if(ancestor===v){throw new Error("Setting "+parent+" as parent of "+v+" would create create a cycle")}}this.setNode(parent)}this.setNode(v);this._removeFromParentsChildList(v);this._parent[v]=parent;this._children[parent][v]=true;return this};Graph.prototype._removeFromParentsChildList=function(v){delete this._children[this._parent[v]][v]};Graph.prototype.parent=function(v){if(this._isCompound){var parent=this._parent[v];if(parent!==GRAPH_NODE){return parent}}};Graph.prototype.children=function(v){if(_.isUndefined(v)){v=GRAPH_NODE}if(this._isCompound){var children=this._children[v];if(children){return _.keys(children)}}else if(v===GRAPH_NODE){return this.nodes()}else if(this.hasNode(v)){return[]}};Graph.prototype.predecessors=function(v){var predsV=this._preds[v];if(predsV){return _.keys(predsV)}};Graph.prototype.successors=function(v){var sucsV=this._sucs[v];if(sucsV){return _.keys(sucsV)}};Graph.prototype.neighbors=function(v){var preds=this.predecessors(v);if(preds){return _.union(preds,this.successors(v))}};Graph.prototype.setDefaultEdgeLabel=function(newDefault){if(!_.isFunction(newDefault)){newDefault=_.constant(newDefault)}this._defaultEdgeLabelFn=newDefault;return this};Graph.prototype.edgeCount=function(){return this._edgeCount};Graph.prototype.edges=function(){return _.values(this._edgeObjs)};Graph.prototype.setPath=function(vs,value){var self=this,args=arguments;_.reduce(vs,function(v,w){if(args.length>1){self.setEdge(v,w,value)}else{self.setEdge(v,w)}return w});return this};Graph.prototype.setEdge=function(){var v,w,name,value,valueSpecified=false;if(_.isPlainObject(arguments[0])){v=arguments[0].v;w=arguments[0].w;name=arguments[0].name;if(arguments.length===2){value=arguments[1];valueSpecified=true}}else{v=arguments[0];w=arguments[1];name=arguments[3];if(arguments.length>2){value=arguments[2];valueSpecified=true}}v=""+v;w=""+w;if(!_.isUndefined(name)){name=""+name}var e=edgeArgsToId(this._isDirected,v,w,name);if(_.has(this._edgeLabels,e)){if(valueSpecified){this._edgeLabels[e]=value}return this}if(!_.isUndefined(name)&&!this._isMultigraph){throw new Error("Cannot set a named edge when isMultigraph = false")}this.setNode(v);this.setNode(w);this._edgeLabels[e]=valueSpecified?value:this._defaultEdgeLabelFn(v,w,name);var edgeObj=edgeArgsToObj(this._isDirected,v,w,name);v=edgeObj.v;w=edgeObj.w;Object.freeze(edgeObj);this._edgeObjs[e]=edgeObj;incrementOrInitEntry(this._preds[w],v);incrementOrInitEntry(this._sucs[v],w);this._in[w][e]=edgeObj;this._out[v][e]=edgeObj;this._edgeCount++;return this};Graph.prototype.edge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return this._edgeLabels[e]};Graph.prototype.hasEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return _.has(this._edgeLabels,e)};Graph.prototype.removeEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name),edge=this._edgeObjs[e];if(edge){v=edge.v;w=edge.w;delete this._edgeLabels[e];delete this._edgeObjs[e];decrementOrRemoveEntry(this._preds[w],v);decrementOrRemoveEntry(this._sucs[v],w);delete this._in[w][e];delete this._out[v][e];this._edgeCount--}return this};Graph.prototype.inEdges=function(v,u){var inV=this._in[v];if(inV){var edges=_.values(inV);if(!u){return edges}return _.filter(edges,function(edge){return edge.v===u})}};Graph.prototype.outEdges=function(v,w){var outV=this._out[v];if(outV){var edges=_.values(outV);if(!w){return edges}return _.filter(edges,function(edge){return edge.w===w})}};Graph.prototype.nodeEdges=function(v,w){var inEdges=this.inEdges(v,w);if(inEdges){return inEdges.concat(this.outEdges(v,w))}};function incrementOrInitEntry(map,k){if(_.has(map,k)){map[k]++}else{map[k]=1}}function decrementOrRemoveEntry(map,k){if(!--map[k]){delete map[k]}}function edgeArgsToId(isDirected,v,w,name){if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}return v+EDGE_KEY_DELIM+w+EDGE_KEY_DELIM+(_.isUndefined(name)?DEFAULT_EDGE_NAME:name)}function edgeArgsToObj(isDirected,v,w,name){if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}var edgeObj={v:v,w:w};if(name){edgeObj.name=name}return edgeObj}function edgeObjToId(isDirected,edgeObj){return edgeArgsToId(isDirected,edgeObj.v,edgeObj.w,edgeObj.name)}},{"./lodash":75}],73:[function(require,module,exports){module.exports={Graph:require("./graph"),version:require("./version")}},{"./graph":72,"./version":76}],74:[function(require,module,exports){var _=require("./lodash"),Graph=require("./graph");module.exports={write:write,read:read};function write(g){var json={options:{directed:g.isDirected(),multigraph:g.isMultigraph(),compound:g.isCompound()},nodes:writeNodes(g),edges:writeEdges(g)};if(!_.isUndefined(g.graph())){json.value=_.clone(g.graph())}return json}function writeNodes(g){return _.map(g.nodes(),function(v){var nodeValue=g.node(v),parent=g.parent(v),node={v:v};if(!_.isUndefined(nodeValue)){node.value=nodeValue}if(!_.isUndefined(parent)){node.parent=parent}return node})}function writeEdges(g){return _.map(g.edges(),function(e){var edgeValue=g.edge(e),edge={v:e.v,w:e.w};if(!_.isUndefined(e.name)){edge.name=e.name}if(!_.isUndefined(edgeValue)){edge.value=edgeValue}return edge})}function read(json){var g=new Graph(json.options).setGraph(json.value);_.each(json.nodes,function(entry){g.setNode(entry.v,entry.value);if(entry.parent){g.setParent(entry.v,entry.parent)}});_.each(json.edges,function(entry){g.setEdge({v:entry.v,w:entry.w,name:entry.name},entry.value)});return g}},{"./graph":72,"./lodash":75}],75:[function(require,module,exports){module.exports=require(20)},{"/Users/cpettitt/projects/dagre-d3/lib/lodash.js":20,lodash:77}],76:[function(require,module,exports){module.exports="1.0.1"},{}],77:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ᠎              ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++indexother||typeof value=="undefined"){return 1}if(value/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++indexresult){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index>>1;callback(array[mid])1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments) +};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index b ? 1 : a >= b ? 0 : NaN; + } + d3.descending = function(a, b) { + return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; + }; + d3.min = function(array, f) { + var i = -1, n = array.length, a, b; + if (arguments.length === 1) { + while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined; + while (++i < n) if ((b = array[i]) != null && a > b) a = b; + } else { + while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined; + while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b; + } + return a; + }; + d3.max = function(array, f) { + var i = -1, n = array.length, a, b; + if (arguments.length === 1) { + while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined; + while (++i < n) if ((b = array[i]) != null && b > a) a = b; + } else { + while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined; + while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b; + } + return a; + }; + d3.extent = function(array, f) { + var i = -1, n = array.length, a, b, c; + if (arguments.length === 1) { + while (++i < n && !((a = c = array[i]) != null && a <= a)) a = c = undefined; + while (++i < n) if ((b = array[i]) != null) { + if (a > b) a = b; + if (c < b) c = b; + } + } else { + while (++i < n && !((a = c = f.call(array, array[i], i)) != null && a <= a)) a = undefined; + while (++i < n) if ((b = f.call(array, array[i], i)) != null) { + if (a > b) a = b; + if (c < b) c = b; + } + } + return [ a, c ]; + }; + function d3_number(x) { + return x === null ? NaN : +x; + } + function d3_numeric(x) { + return !isNaN(x); + } + d3.sum = function(array, f) { + var s = 0, n = array.length, a, i = -1; + if (arguments.length === 1) { + while (++i < n) if (d3_numeric(a = +array[i])) s += a; + } else { + while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a; + } + return s; + }; + d3.mean = function(array, f) { + var s = 0, n = array.length, a, i = -1, j = n; + if (arguments.length === 1) { + while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j; + } else { + while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j; + } + return j ? s / j : undefined; + }; + d3.quantile = function(values, p) { + var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h; + return e ? v + e * (values[h] - v) : v; + }; + d3.median = function(array, f) { + var numbers = [], n = array.length, a, i = -1; + if (arguments.length === 1) { + while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a); + } else { + while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a); + } + return numbers.length ? d3.quantile(numbers.sort(d3_ascending), .5) : undefined; + }; + function d3_bisector(compare) { + return { + left: function(a, x, lo, hi) { + if (arguments.length < 3) lo = 0; + if (arguments.length < 4) hi = a.length; + while (lo < hi) { + var mid = lo + hi >>> 1; + if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid; + } + return lo; + }, + right: function(a, x, lo, hi) { + if (arguments.length < 3) lo = 0; + if (arguments.length < 4) hi = a.length; + while (lo < hi) { + var mid = lo + hi >>> 1; + if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1; + } + return lo; + } + }; + } + var d3_bisect = d3_bisector(d3_ascending); + d3.bisectLeft = d3_bisect.left; + d3.bisect = d3.bisectRight = d3_bisect.right; + d3.bisector = function(f) { + return d3_bisector(f.length === 1 ? function(d, x) { + return d3_ascending(f(d), x); + } : f); + }; + d3.shuffle = function(array) { + var m = array.length, t, i; + while (m) { + i = Math.random() * m-- | 0; + t = array[m], array[m] = array[i], array[i] = t; + } + return array; + }; + d3.permute = function(array, indexes) { + var i = indexes.length, permutes = new Array(i); + while (i--) permutes[i] = array[indexes[i]]; + return permutes; + }; + d3.pairs = function(array) { + var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n); + while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ]; + return pairs; + }; + d3.zip = function() { + if (!(n = arguments.length)) return []; + for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) { + for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) { + zip[j] = arguments[j][i]; + } + } + return zips; + }; + function d3_zipLength(d) { + return d.length; + } + d3.transpose = function(matrix) { + return d3.zip.apply(d3, matrix); + }; + d3.keys = function(map) { + var keys = []; + for (var key in map) keys.push(key); + return keys; + }; + d3.values = function(map) { + var values = []; + for (var key in map) values.push(map[key]); + return values; + }; + d3.entries = function(map) { + var entries = []; + for (var key in map) entries.push({ + key: key, + value: map[key] + }); + return entries; + }; + d3.merge = function(arrays) { + var n = arrays.length, m, i = -1, j = 0, merged, array; + while (++i < n) j += arrays[i].length; + merged = new Array(j); + while (--n >= 0) { + array = arrays[n]; + m = array.length; + while (--m >= 0) { + merged[--j] = array[m]; + } + } + return merged; + }; + var abs = Math.abs; + d3.range = function(start, stop, step) { + if (arguments.length < 3) { + step = 1; + if (arguments.length < 2) { + stop = start; + start = 0; + } + } + if ((stop - start) / step === Infinity) throw new Error("infinite range"); + var range = [], k = d3_range_integerScale(abs(step)), i = -1, j; + start *= k, stop *= k, step *= k; + if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k); + return range; + }; + function d3_range_integerScale(x) { + var k = 1; + while (x * k % 1) k *= 10; + return k; + } + function d3_class(ctor, properties) { + for (var key in properties) { + Object.defineProperty(ctor.prototype, key, { + value: properties[key], + enumerable: false + }); + } + } + d3.map = function(object) { + var map = new d3_Map(); + if (object instanceof d3_Map) object.forEach(function(key, value) { + map.set(key, value); + }); else for (var key in object) map.set(key, object[key]); + return map; + }; + function d3_Map() { + this._ = Object.create(null); + } + var d3_map_proto = "__proto__", d3_map_zero = "\x00"; + d3_class(d3_Map, { + has: d3_map_has, + get: function(key) { + return this._[d3_map_escape(key)]; + }, + set: function(key, value) { + return this._[d3_map_escape(key)] = value; + }, + remove: d3_map_remove, + keys: d3_map_keys, + values: function() { + var values = []; + for (var key in this._) values.push(this._[key]); + return values; + }, + entries: function() { + var entries = []; + for (var key in this._) entries.push({ + key: d3_map_unescape(key), + value: this._[key] + }); + return entries; + }, + size: d3_map_size, + empty: d3_map_empty, + forEach: function(f) { + for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]); + } + }); + function d3_map_escape(key) { + return (key += "") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key; + } + function d3_map_unescape(key) { + return (key += "")[0] === d3_map_zero ? key.slice(1) : key; + } + function d3_map_has(key) { + return d3_map_escape(key) in this._; + } + function d3_map_remove(key) { + return (key = d3_map_escape(key)) in this._ && delete this._[key]; + } + function d3_map_keys() { + var keys = []; + for (var key in this._) keys.push(d3_map_unescape(key)); + return keys; + } + function d3_map_size() { + var size = 0; + for (var key in this._) ++size; + return size; + } + function d3_map_empty() { + for (var key in this._) return false; + return true; + } + d3.nest = function() { + var nest = {}, keys = [], sortKeys = [], sortValues, rollup; + function map(mapType, array, depth) { + if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array; + var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values; + while (++i < n) { + if (values = valuesByKey.get(keyValue = key(object = array[i]))) { + values.push(object); + } else { + valuesByKey.set(keyValue, [ object ]); + } + } + if (mapType) { + object = mapType(); + setter = function(keyValue, values) { + object.set(keyValue, map(mapType, values, depth)); + }; + } else { + object = {}; + setter = function(keyValue, values) { + object[keyValue] = map(mapType, values, depth); + }; + } + valuesByKey.forEach(setter); + return object; + } + function entries(map, depth) { + if (depth >= keys.length) return map; + var array = [], sortKey = sortKeys[depth++]; + map.forEach(function(key, keyMap) { + array.push({ + key: key, + values: entries(keyMap, depth) + }); + }); + return sortKey ? array.sort(function(a, b) { + return sortKey(a.key, b.key); + }) : array; + } + nest.map = function(array, mapType) { + return map(mapType, array, 0); + }; + nest.entries = function(array) { + return entries(map(d3.map, array, 0), 0); + }; + nest.key = function(d) { + keys.push(d); + return nest; + }; + nest.sortKeys = function(order) { + sortKeys[keys.length - 1] = order; + return nest; + }; + nest.sortValues = function(order) { + sortValues = order; + return nest; + }; + nest.rollup = function(f) { + rollup = f; + return nest; + }; + return nest; + }; + d3.set = function(array) { + var set = new d3_Set(); + if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]); + return set; + }; + function d3_Set() { + this._ = Object.create(null); + } + d3_class(d3_Set, { + has: d3_map_has, + add: function(key) { + this._[d3_map_escape(key += "")] = true; + return key; + }, + remove: d3_map_remove, + values: d3_map_keys, + size: d3_map_size, + empty: d3_map_empty, + forEach: function(f) { + for (var key in this._) f.call(this, d3_map_unescape(key)); + } + }); + d3.behavior = {}; + d3.rebind = function(target, source) { + var i = 1, n = arguments.length, method; + while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]); + return target; + }; + function d3_rebind(target, source, method) { + return function() { + var value = method.apply(source, arguments); + return value === source ? target : value; + }; + } + function d3_vendorSymbol(object, name) { + if (name in object) return name; + name = name.charAt(0).toUpperCase() + name.slice(1); + for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) { + var prefixName = d3_vendorPrefixes[i] + name; + if (prefixName in object) return prefixName; + } + } + var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ]; + function d3_noop() {} + d3.dispatch = function() { + var dispatch = new d3_dispatch(), i = -1, n = arguments.length; + while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); + return dispatch; + }; + function d3_dispatch() {} + d3_dispatch.prototype.on = function(type, listener) { + var i = type.indexOf("."), name = ""; + if (i >= 0) { + name = type.slice(i + 1); + type = type.slice(0, i); + } + if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener); + if (arguments.length === 2) { + if (listener == null) for (type in this) { + if (this.hasOwnProperty(type)) this[type].on(name, null); + } + return this; + } + }; + function d3_dispatch_event(dispatch) { + var listeners = [], listenerByName = new d3_Map(); + function event() { + var z = listeners, i = -1, n = z.length, l; + while (++i < n) if (l = z[i].on) l.apply(this, arguments); + return dispatch; + } + event.on = function(name, listener) { + var l = listenerByName.get(name), i; + if (arguments.length < 2) return l && l.on; + if (l) { + l.on = null; + listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1)); + listenerByName.remove(name); + } + if (listener) listeners.push(listenerByName.set(name, { + on: listener + })); + return dispatch; + }; + return event; + } + d3.event = null; + function d3_eventPreventDefault() { + d3.event.preventDefault(); + } + function d3_eventSource() { + var e = d3.event, s; + while (s = e.sourceEvent) e = s; + return e; + } + function d3_eventDispatch(target) { + var dispatch = new d3_dispatch(), i = 0, n = arguments.length; + while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); + dispatch.of = function(thiz, argumentz) { + return function(e1) { + try { + var e0 = e1.sourceEvent = d3.event; + e1.target = target; + d3.event = e1; + dispatch[e1.type].apply(thiz, argumentz); + } finally { + d3.event = e0; + } + }; + }; + return dispatch; + } + d3.requote = function(s) { + return s.replace(d3_requote_re, "\\$&"); + }; + var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; + var d3_subclass = {}.__proto__ ? function(object, prototype) { + object.__proto__ = prototype; + } : function(object, prototype) { + for (var property in prototype) object[property] = prototype[property]; + }; + function d3_selection(groups) { + d3_subclass(groups, d3_selectionPrototype); + return groups; + } + var d3_select = function(s, n) { + return n.querySelector(s); + }, d3_selectAll = function(s, n) { + return n.querySelectorAll(s); + }, d3_selectMatcher = d3_documentElement.matches || d3_documentElement[d3_vendorSymbol(d3_documentElement, "matchesSelector")], d3_selectMatches = function(n, s) { + return d3_selectMatcher.call(n, s); + }; + if (typeof Sizzle === "function") { + d3_select = function(s, n) { + return Sizzle(s, n)[0] || null; + }; + d3_selectAll = Sizzle; + d3_selectMatches = Sizzle.matchesSelector; + } + d3.selection = function() { + return d3_selectionRoot; + }; + var d3_selectionPrototype = d3.selection.prototype = []; + d3_selectionPrototype.select = function(selector) { + var subgroups = [], subgroup, subnode, group, node; + selector = d3_selection_selector(selector); + for (var j = -1, m = this.length; ++j < m; ) { + subgroups.push(subgroup = []); + subgroup.parentNode = (group = this[j]).parentNode; + for (var i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + subgroup.push(subnode = selector.call(node, node.__data__, i, j)); + if (subnode && "__data__" in node) subnode.__data__ = node.__data__; + } else { + subgroup.push(null); + } + } + } + return d3_selection(subgroups); + }; + function d3_selection_selector(selector) { + return typeof selector === "function" ? selector : function() { + return d3_select(selector, this); + }; + } + d3_selectionPrototype.selectAll = function(selector) { + var subgroups = [], subgroup, node; + selector = d3_selection_selectorAll(selector); + for (var j = -1, m = this.length; ++j < m; ) { + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j))); + subgroup.parentNode = node; + } + } + } + return d3_selection(subgroups); + }; + function d3_selection_selectorAll(selector) { + return typeof selector === "function" ? selector : function() { + return d3_selectAll(selector, this); + }; + } + var d3_nsPrefix = { + svg: "http://www.w3.org/2000/svg", + xhtml: "http://www.w3.org/1999/xhtml", + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" + }; + d3.ns = { + prefix: d3_nsPrefix, + qualify: function(name) { + var i = name.indexOf(":"), prefix = name; + if (i >= 0) { + prefix = name.slice(0, i); + name = name.slice(i + 1); + } + return d3_nsPrefix.hasOwnProperty(prefix) ? { + space: d3_nsPrefix[prefix], + local: name + } : name; + } + }; + d3_selectionPrototype.attr = function(name, value) { + if (arguments.length < 2) { + if (typeof name === "string") { + var node = this.node(); + name = d3.ns.qualify(name); + return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name); + } + for (value in name) this.each(d3_selection_attr(value, name[value])); + return this; + } + return this.each(d3_selection_attr(name, value)); + }; + function d3_selection_attr(name, value) { + name = d3.ns.qualify(name); + function attrNull() { + this.removeAttribute(name); + } + function attrNullNS() { + this.removeAttributeNS(name.space, name.local); + } + function attrConstant() { + this.setAttribute(name, value); + } + function attrConstantNS() { + this.setAttributeNS(name.space, name.local, value); + } + function attrFunction() { + var x = value.apply(this, arguments); + if (x == null) this.removeAttribute(name); else this.setAttribute(name, x); + } + function attrFunctionNS() { + var x = value.apply(this, arguments); + if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x); + } + return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant; + } + function d3_collapse(s) { + return s.trim().replace(/\s+/g, " "); + } + d3_selectionPrototype.classed = function(name, value) { + if (arguments.length < 2) { + if (typeof name === "string") { + var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1; + if (value = node.classList) { + while (++i < n) if (!value.contains(name[i])) return false; + } else { + value = node.getAttribute("class"); + while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false; + } + return true; + } + for (value in name) this.each(d3_selection_classed(value, name[value])); + return this; + } + return this.each(d3_selection_classed(name, value)); + }; + function d3_selection_classedRe(name) { + return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g"); + } + function d3_selection_classes(name) { + return (name + "").trim().split(/^|\s+/); + } + function d3_selection_classed(name, value) { + name = d3_selection_classes(name).map(d3_selection_classedName); + var n = name.length; + function classedConstant() { + var i = -1; + while (++i < n) name[i](this, value); + } + function classedFunction() { + var i = -1, x = value.apply(this, arguments); + while (++i < n) name[i](this, x); + } + return typeof value === "function" ? classedFunction : classedConstant; + } + function d3_selection_classedName(name) { + var re = d3_selection_classedRe(name); + return function(node, value) { + if (c = node.classList) return value ? c.add(name) : c.remove(name); + var c = node.getAttribute("class") || ""; + if (value) { + re.lastIndex = 0; + if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name)); + } else { + node.setAttribute("class", d3_collapse(c.replace(re, " "))); + } + }; + } + d3_selectionPrototype.style = function(name, value, priority) { + var n = arguments.length; + if (n < 3) { + if (typeof name !== "string") { + if (n < 2) value = ""; + for (priority in name) this.each(d3_selection_style(priority, name[priority], value)); + return this; + } + if (n < 2) return d3_window.getComputedStyle(this.node(), null).getPropertyValue(name); + priority = ""; + } + return this.each(d3_selection_style(name, value, priority)); + }; + function d3_selection_style(name, value, priority) { + function styleNull() { + this.style.removeProperty(name); + } + function styleConstant() { + this.style.setProperty(name, value, priority); + } + function styleFunction() { + var x = value.apply(this, arguments); + if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority); + } + return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant; + } + d3_selectionPrototype.property = function(name, value) { + if (arguments.length < 2) { + if (typeof name === "string") return this.node()[name]; + for (value in name) this.each(d3_selection_property(value, name[value])); + return this; + } + return this.each(d3_selection_property(name, value)); + }; + function d3_selection_property(name, value) { + function propertyNull() { + delete this[name]; + } + function propertyConstant() { + this[name] = value; + } + function propertyFunction() { + var x = value.apply(this, arguments); + if (x == null) delete this[name]; else this[name] = x; + } + return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant; + } + d3_selectionPrototype.text = function(value) { + return arguments.length ? this.each(typeof value === "function" ? function() { + var v = value.apply(this, arguments); + this.textContent = v == null ? "" : v; + } : value == null ? function() { + this.textContent = ""; + } : function() { + this.textContent = value; + }) : this.node().textContent; + }; + d3_selectionPrototype.html = function(value) { + return arguments.length ? this.each(typeof value === "function" ? function() { + var v = value.apply(this, arguments); + this.innerHTML = v == null ? "" : v; + } : value == null ? function() { + this.innerHTML = ""; + } : function() { + this.innerHTML = value; + }) : this.node().innerHTML; + }; + d3_selectionPrototype.append = function(name) { + name = d3_selection_creator(name); + return this.select(function() { + return this.appendChild(name.apply(this, arguments)); + }); + }; + function d3_selection_creator(name) { + return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? function() { + return this.ownerDocument.createElementNS(name.space, name.local); + } : function() { + return this.ownerDocument.createElementNS(this.namespaceURI, name); + }; + } + d3_selectionPrototype.insert = function(name, before) { + name = d3_selection_creator(name); + before = d3_selection_selector(before); + return this.select(function() { + return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null); + }); + }; + d3_selectionPrototype.remove = function() { + return this.each(function() { + var parent = this.parentNode; + if (parent) parent.removeChild(this); + }); + }; + d3_selectionPrototype.data = function(value, key) { + var i = -1, n = this.length, group, node; + if (!arguments.length) { + value = new Array(n = (group = this[0]).length); + while (++i < n) { + if (node = group[i]) { + value[i] = node.__data__; + } + } + return value; + } + function bind(group, groupData) { + var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData; + if (key) { + var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue; + for (i = -1; ++i < n; ) { + if (nodeByKeyValue.has(keyValue = key.call(node = group[i], node.__data__, i))) { + exitNodes[i] = node; + } else { + nodeByKeyValue.set(keyValue, node); + } + keyValues[i] = keyValue; + } + for (i = -1; ++i < m; ) { + if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) { + enterNodes[i] = d3_selection_dataNode(nodeData); + } else if (node !== true) { + updateNodes[i] = node; + node.__data__ = nodeData; + } + nodeByKeyValue.set(keyValue, true); + } + for (i = -1; ++i < n; ) { + if (nodeByKeyValue.get(keyValues[i]) !== true) { + exitNodes[i] = group[i]; + } + } + } else { + for (i = -1; ++i < n0; ) { + node = group[i]; + nodeData = groupData[i]; + if (node) { + node.__data__ = nodeData; + updateNodes[i] = node; + } else { + enterNodes[i] = d3_selection_dataNode(nodeData); + } + } + for (;i < m; ++i) { + enterNodes[i] = d3_selection_dataNode(groupData[i]); + } + for (;i < n; ++i) { + exitNodes[i] = group[i]; + } + } + enterNodes.update = updateNodes; + enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode; + enter.push(enterNodes); + update.push(updateNodes); + exit.push(exitNodes); + } + var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]); + if (typeof value === "function") { + while (++i < n) { + bind(group = this[i], value.call(group, group.parentNode.__data__, i)); + } + } else { + while (++i < n) { + bind(group = this[i], value); + } + } + update.enter = function() { + return enter; + }; + update.exit = function() { + return exit; + }; + return update; + }; + function d3_selection_dataNode(data) { + return { + __data__: data + }; + } + d3_selectionPrototype.datum = function(value) { + return arguments.length ? this.property("__data__", value) : this.property("__data__"); + }; + d3_selectionPrototype.filter = function(filter) { + var subgroups = [], subgroup, group, node; + if (typeof filter !== "function") filter = d3_selection_filter(filter); + for (var j = 0, m = this.length; j < m; j++) { + subgroups.push(subgroup = []); + subgroup.parentNode = (group = this[j]).parentNode; + for (var i = 0, n = group.length; i < n; i++) { + if ((node = group[i]) && filter.call(node, node.__data__, i, j)) { + subgroup.push(node); + } + } + } + return d3_selection(subgroups); + }; + function d3_selection_filter(selector) { + return function() { + return d3_selectMatches(this, selector); + }; + } + d3_selectionPrototype.order = function() { + for (var j = -1, m = this.length; ++j < m; ) { + for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) { + if (node = group[i]) { + if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next); + next = node; + } + } + } + return this; + }; + d3_selectionPrototype.sort = function(comparator) { + comparator = d3_selection_sortComparator.apply(this, arguments); + for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator); + return this.order(); + }; + function d3_selection_sortComparator(comparator) { + if (!arguments.length) comparator = d3_ascending; + return function(a, b) { + return a && b ? comparator(a.__data__, b.__data__) : !a - !b; + }; + } + d3_selectionPrototype.each = function(callback) { + return d3_selection_each(this, function(node, i, j) { + callback.call(node, node.__data__, i, j); + }); + }; + function d3_selection_each(groups, callback) { + for (var j = 0, m = groups.length; j < m; j++) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) { + if (node = group[i]) callback(node, i, j); + } + } + return groups; + } + d3_selectionPrototype.call = function(callback) { + var args = d3_array(arguments); + callback.apply(args[0] = this, args); + return this; + }; + d3_selectionPrototype.empty = function() { + return !this.node(); + }; + d3_selectionPrototype.node = function() { + for (var j = 0, m = this.length; j < m; j++) { + for (var group = this[j], i = 0, n = group.length; i < n; i++) { + var node = group[i]; + if (node) return node; + } + } + return null; + }; + d3_selectionPrototype.size = function() { + var n = 0; + d3_selection_each(this, function() { + ++n; + }); + return n; + }; + function d3_selection_enter(selection) { + d3_subclass(selection, d3_selection_enterPrototype); + return selection; + } + var d3_selection_enterPrototype = []; + d3.selection.enter = d3_selection_enter; + d3.selection.enter.prototype = d3_selection_enterPrototype; + d3_selection_enterPrototype.append = d3_selectionPrototype.append; + d3_selection_enterPrototype.empty = d3_selectionPrototype.empty; + d3_selection_enterPrototype.node = d3_selectionPrototype.node; + d3_selection_enterPrototype.call = d3_selectionPrototype.call; + d3_selection_enterPrototype.size = d3_selectionPrototype.size; + d3_selection_enterPrototype.select = function(selector) { + var subgroups = [], subgroup, subnode, upgroup, group, node; + for (var j = -1, m = this.length; ++j < m; ) { + upgroup = (group = this[j]).update; + subgroups.push(subgroup = []); + subgroup.parentNode = group.parentNode; + for (var i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j)); + subnode.__data__ = node.__data__; + } else { + subgroup.push(null); + } + } + } + return d3_selection(subgroups); + }; + d3_selection_enterPrototype.insert = function(name, before) { + if (arguments.length < 2) before = d3_selection_enterInsertBefore(this); + return d3_selectionPrototype.insert.call(this, name, before); + }; + function d3_selection_enterInsertBefore(enter) { + var i0, j0; + return function(d, i, j) { + var group = enter[j].update, n = group.length, node; + if (j != j0) j0 = j, i0 = 0; + if (i >= i0) i0 = i + 1; + while (!(node = group[i0]) && ++i0 < n) ; + return node; + }; + } + d3_selectionPrototype.transition = function() { + var id = d3_transitionInheritId || ++d3_transitionId, subgroups = [], subgroup, node, transition = d3_transitionInherit || { + time: Date.now(), + ease: d3_ease_cubicInOut, + delay: 0, + duration: 250 + }; + for (var j = -1, m = this.length; ++j < m; ) { + subgroups.push(subgroup = []); + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) d3_transitionNode(node, i, id, transition); + subgroup.push(node); + } + } + return d3_transition(subgroups, id); + }; + d3_selectionPrototype.interrupt = function() { + return this.each(d3_selection_interrupt); + }; + function d3_selection_interrupt() { + var lock = this.__transition__; + if (lock) ++lock.active; + } + d3.select = function(node) { + var group = [ typeof node === "string" ? d3_select(node, d3_document) : node ]; + group.parentNode = d3_documentElement; + return d3_selection([ group ]); + }; + d3.selectAll = function(nodes) { + var group = d3_array(typeof nodes === "string" ? d3_selectAll(nodes, d3_document) : nodes); + group.parentNode = d3_documentElement; + return d3_selection([ group ]); + }; + var d3_selectionRoot = d3.select(d3_documentElement); + d3_selectionPrototype.on = function(type, listener, capture) { + var n = arguments.length; + if (n < 3) { + if (typeof type !== "string") { + if (n < 2) listener = false; + for (capture in type) this.each(d3_selection_on(capture, type[capture], listener)); + return this; + } + if (n < 2) return (n = this.node()["__on" + type]) && n._; + capture = false; + } + return this.each(d3_selection_on(type, listener, capture)); + }; + function d3_selection_on(type, listener, capture) { + var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener; + if (i > 0) type = type.slice(0, i); + var filter = d3_selection_onFilters.get(type); + if (filter) type = filter, wrap = d3_selection_onFilter; + function onRemove() { + var l = this[name]; + if (l) { + this.removeEventListener(type, l, l.$); + delete this[name]; + } + } + function onAdd() { + var l = wrap(listener, d3_array(arguments)); + onRemove.call(this); + this.addEventListener(type, this[name] = l, l.$ = capture); + l._ = listener; + } + function removeAll() { + var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match; + for (var name in this) { + if (match = name.match(re)) { + var l = this[name]; + this.removeEventListener(match[1], l, l.$); + delete this[name]; + } + } + } + return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll; + } + var d3_selection_onFilters = d3.map({ + mouseenter: "mouseover", + mouseleave: "mouseout" + }); + d3_selection_onFilters.forEach(function(k) { + if ("on" + k in d3_document) d3_selection_onFilters.remove(k); + }); + function d3_selection_onListener(listener, argumentz) { + return function(e) { + var o = d3.event; + d3.event = e; + argumentz[0] = this.__data__; + try { + listener.apply(this, argumentz); + } finally { + d3.event = o; + } + }; + } + function d3_selection_onFilter(listener, argumentz) { + var l = d3_selection_onListener(listener, argumentz); + return function(e) { + var target = this, related = e.relatedTarget; + if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) { + l.call(target, e); + } + }; + } + var d3_event_dragSelect = "onselectstart" in d3_document ? null : d3_vendorSymbol(d3_documentElement.style, "userSelect"), d3_event_dragId = 0; + function d3_event_dragSuppress() { + var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault); + if (d3_event_dragSelect) { + var style = d3_documentElement.style, select = style[d3_event_dragSelect]; + style[d3_event_dragSelect] = "none"; + } + return function(suppressClick) { + w.on(name, null); + if (d3_event_dragSelect) style[d3_event_dragSelect] = select; + if (suppressClick) { + function off() { + w.on(click, null); + } + w.on(click, function() { + d3_eventPreventDefault(); + off(); + }, true); + setTimeout(off, 0); + } + }; + } + d3.mouse = function(container) { + return d3_mousePoint(container, d3_eventSource()); + }; + var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0; + function d3_mousePoint(container, e) { + if (e.changedTouches) e = e.changedTouches[0]; + var svg = container.ownerSVGElement || container; + if (svg.createSVGPoint) { + var point = svg.createSVGPoint(); + if (d3_mouse_bug44083 < 0 && (d3_window.scrollX || d3_window.scrollY)) { + svg = d3.select("body").append("svg").style({ + position: "absolute", + top: 0, + left: 0, + margin: 0, + padding: 0, + border: "none" + }, "important"); + var ctm = svg[0][0].getScreenCTM(); + d3_mouse_bug44083 = !(ctm.f || ctm.e); + svg.remove(); + } + if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX, + point.y = e.clientY; + point = point.matrixTransform(container.getScreenCTM().inverse()); + return [ point.x, point.y ]; + } + var rect = container.getBoundingClientRect(); + return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ]; + } + d3.touch = function(container, touches, identifier) { + if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches; + if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) { + if ((touch = touches[i]).identifier === identifier) { + return d3_mousePoint(container, touch); + } + } + }; + d3.behavior.drag = function() { + var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_behavior_dragMouseSubject, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_behavior_dragTouchSubject, "touchmove", "touchend"); + function drag() { + this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart); + } + function dragstart(id, position, subject, move, end) { + return function() { + var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject()).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(), position0 = position(parent, dragId); + if (origin) { + dragOffset = origin.apply(that, arguments); + dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ]; + } else { + dragOffset = [ 0, 0 ]; + } + dispatch({ + type: "dragstart" + }); + function moved() { + var position1 = position(parent, dragId), dx, dy; + if (!position1) return; + dx = position1[0] - position0[0]; + dy = position1[1] - position0[1]; + dragged |= dx | dy; + position0 = position1; + dispatch({ + type: "drag", + x: position1[0] + dragOffset[0], + y: position1[1] + dragOffset[1], + dx: dx, + dy: dy + }); + } + function ended() { + if (!position(parent, dragId)) return; + dragSubject.on(move + dragName, null).on(end + dragName, null); + dragRestore(dragged && d3.event.target === target); + dispatch({ + type: "dragend" + }); + } + }; + } + drag.origin = function(x) { + if (!arguments.length) return origin; + origin = x; + return drag; + }; + return d3.rebind(drag, event, "on"); + }; + function d3_behavior_dragTouchId() { + return d3.event.changedTouches[0].identifier; + } + function d3_behavior_dragTouchSubject() { + return d3.event.target; + } + function d3_behavior_dragMouseSubject() { + return d3_window; + } + d3.touches = function(container, touches) { + if (arguments.length < 2) touches = d3_eventSource().touches; + return touches ? d3_array(touches).map(function(touch) { + var point = d3_mousePoint(container, touch); + point.identifier = touch.identifier; + return point; + }) : []; + }; + var π = Math.PI, τ = 2 * π, halfπ = π / 2, ε = 1e-6, ε2 = ε * ε, d3_radians = π / 180, d3_degrees = 180 / π; + function d3_sgn(x) { + return x > 0 ? 1 : x < 0 ? -1 : 0; + } + function d3_cross2d(a, b, c) { + return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]); + } + function d3_acos(x) { + return x > 1 ? 0 : x < -1 ? π : Math.acos(x); + } + function d3_asin(x) { + return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x); + } + function d3_sinh(x) { + return ((x = Math.exp(x)) - 1 / x) / 2; + } + function d3_cosh(x) { + return ((x = Math.exp(x)) + 1 / x) / 2; + } + function d3_tanh(x) { + return ((x = Math.exp(2 * x)) - 1) / (x + 1); + } + function d3_haversin(x) { + return (x = Math.sin(x / 2)) * x; + } + var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4; + d3.interpolateZoom = function(p0, p1) { + var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2]; + var dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1), dr = r1 - r0, S = (dr || Math.log(w1 / w0)) / ρ; + function interpolate(t) { + var s = t * S; + if (dr) { + var coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0)); + return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ]; + } + return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * s) ]; + } + interpolate.duration = S * 1e3; + return interpolate; + }; + d3.behavior.zoom = function() { + var view = { + x: 0, + y: 0, + k: 1 + }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1; + function zoom(g) { + g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted); + } + zoom.event = function(g) { + g.each(function() { + var dispatch = event.of(this, arguments), view1 = view; + if (d3_transitionInheritId) { + d3.select(this).transition().each("start.zoom", function() { + view = this.__chart__ || { + x: 0, + y: 0, + k: 1 + }; + zoomstarted(dispatch); + }).tween("zoom:zoom", function() { + var dx = size[0], dy = size[1], cx = dx / 2, cy = dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]); + return function(t) { + var l = i(t), k = dx / l[2]; + this.__chart__ = view = { + x: cx - l[0] * k, + y: cy - l[1] * k, + k: k + }; + zoomed(dispatch); + }; + }).each("end.zoom", function() { + zoomended(dispatch); + }); + } else { + this.__chart__ = view; + zoomstarted(dispatch); + zoomed(dispatch); + zoomended(dispatch); + } + }); + }; + zoom.translate = function(_) { + if (!arguments.length) return [ view.x, view.y ]; + view = { + x: +_[0], + y: +_[1], + k: view.k + }; + rescale(); + return zoom; + }; + zoom.scale = function(_) { + if (!arguments.length) return view.k; + view = { + x: view.x, + y: view.y, + k: +_ + }; + rescale(); + return zoom; + }; + zoom.scaleExtent = function(_) { + if (!arguments.length) return scaleExtent; + scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ]; + return zoom; + }; + zoom.center = function(_) { + if (!arguments.length) return center; + center = _ && [ +_[0], +_[1] ]; + return zoom; + }; + zoom.size = function(_) { + if (!arguments.length) return size; + size = _ && [ +_[0], +_[1] ]; + return zoom; + }; + zoom.x = function(z) { + if (!arguments.length) return x1; + x1 = z; + x0 = z.copy(); + view = { + x: 0, + y: 0, + k: 1 + }; + return zoom; + }; + zoom.y = function(z) { + if (!arguments.length) return y1; + y1 = z; + y0 = z.copy(); + view = { + x: 0, + y: 0, + k: 1 + }; + return zoom; + }; + function location(p) { + return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ]; + } + function point(l) { + return [ l[0] * view.k + view.x, l[1] * view.k + view.y ]; + } + function scaleTo(s) { + view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s)); + } + function translateTo(p, l) { + l = point(l); + view.x += p[0] - l[0]; + view.y += p[1] - l[1]; + } + function rescale() { + if (x1) x1.domain(x0.range().map(function(x) { + return (x - view.x) / view.k; + }).map(x0.invert)); + if (y1) y1.domain(y0.range().map(function(y) { + return (y - view.y) / view.k; + }).map(y0.invert)); + } + function zoomstarted(dispatch) { + dispatch({ + type: "zoomstart" + }); + } + function zoomed(dispatch) { + rescale(); + dispatch({ + type: "zoom", + scale: view.k, + translate: [ view.x, view.y ] + }); + } + function zoomended(dispatch) { + dispatch({ + type: "zoomend" + }); + } + function mousedowned() { + var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(); + d3_selection_interrupt.call(that); + zoomstarted(dispatch); + function moved() { + dragged = 1; + translateTo(d3.mouse(that), location0); + zoomed(dispatch); + } + function ended() { + subject.on(mousemove, null).on(mouseup, null); + dragRestore(dragged && d3.event.target === target); + zoomended(dispatch); + } + } + function touchstarted() { + var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(); + d3_selection_interrupt.call(that); + started(); + zoomstarted(dispatch); + subject.on(mousedown, null).on(touchstart, started); + function relocate() { + var touches = d3.touches(that); + scale0 = view.k; + touches.forEach(function(t) { + if (t.identifier in locations0) locations0[t.identifier] = location(t); + }); + return touches; + } + function started() { + var target = d3.event.target; + d3.select(target).on(touchmove, moved).on(touchend, ended); + targets.push(target); + var changed = d3.event.changedTouches; + for (var i = 0, n = changed.length; i < n; ++i) { + locations0[changed[i].identifier] = null; + } + var touches = relocate(), now = Date.now(); + if (touches.length === 1) { + if (now - touchtime < 500) { + var p = touches[0], l = locations0[p.identifier]; + scaleTo(view.k * 2); + translateTo(p, l); + d3_eventPreventDefault(); + zoomed(dispatch); + } + touchtime = now; + } else if (touches.length > 1) { + var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1]; + distance0 = dx * dx + dy * dy; + } + } + function moved() { + var touches = d3.touches(that), p0, l0, p1, l1; + for (var i = 0, n = touches.length; i < n; ++i, l1 = null) { + p1 = touches[i]; + if (l1 = locations0[p1.identifier]) { + if (l0) break; + p0 = p1, l0 = l1; + } + } + if (l1) { + var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0); + p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ]; + l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ]; + scaleTo(scale1 * scale0); + } + touchtime = null; + translateTo(p0, l0); + zoomed(dispatch); + } + function ended() { + if (d3.event.touches.length) { + var changed = d3.event.changedTouches; + for (var i = 0, n = changed.length; i < n; ++i) { + delete locations0[changed[i].identifier]; + } + for (var identifier in locations0) { + return void relocate(); + } + } + d3.selectAll(targets).on(zoomName, null); + subject.on(mousedown, mousedowned).on(touchstart, touchstarted); + dragRestore(); + zoomended(dispatch); + } + } + function mousewheeled() { + var dispatch = event.of(this, arguments); + if (mousewheelTimer) clearTimeout(mousewheelTimer); else translate0 = location(center0 = center || d3.mouse(this)), + d3_selection_interrupt.call(this), zoomstarted(dispatch); + mousewheelTimer = setTimeout(function() { + mousewheelTimer = null; + zoomended(dispatch); + }, 50); + d3_eventPreventDefault(); + scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k); + translateTo(center0, translate0); + zoomed(dispatch); + } + function dblclicked() { + var dispatch = event.of(this, arguments), p = d3.mouse(this), l = location(p), k = Math.log(view.k) / Math.LN2; + zoomstarted(dispatch); + scaleTo(Math.pow(2, d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1)); + translateTo(p, l); + zoomed(dispatch); + zoomended(dispatch); + } + return d3.rebind(zoom, event, "on"); + }; + var d3_behavior_zoomInfinity = [ 0, Infinity ]; + var d3_behavior_zoomDelta, d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() { + return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1); + }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() { + return d3.event.wheelDelta; + }, "mousewheel") : (d3_behavior_zoomDelta = function() { + return -d3.event.detail; + }, "MozMousePixelScroll"); + d3.color = d3_color; + function d3_color() {} + d3_color.prototype.toString = function() { + return this.rgb() + ""; + }; + d3.hsl = d3_hsl; + function d3_hsl(h, s, l) { + return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l); + } + var d3_hslPrototype = d3_hsl.prototype = new d3_color(); + d3_hslPrototype.brighter = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + return new d3_hsl(this.h, this.s, this.l / k); + }; + d3_hslPrototype.darker = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + return new d3_hsl(this.h, this.s, k * this.l); + }; + d3_hslPrototype.rgb = function() { + return d3_hsl_rgb(this.h, this.s, this.l); + }; + function d3_hsl_rgb(h, s, l) { + var m1, m2; + h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h; + s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s; + l = l < 0 ? 0 : l > 1 ? 1 : l; + m2 = l <= .5 ? l * (1 + s) : l + s - l * s; + m1 = 2 * l - m2; + function v(h) { + if (h > 360) h -= 360; else if (h < 0) h += 360; + if (h < 60) return m1 + (m2 - m1) * h / 60; + if (h < 180) return m2; + if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60; + return m1; + } + function vv(h) { + return Math.round(v(h) * 255); + } + return new d3_rgb(vv(h + 120), vv(h), vv(h - 120)); + } + d3.hcl = d3_hcl; + function d3_hcl(h, c, l) { + return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l); + } + var d3_hclPrototype = d3_hcl.prototype = new d3_color(); + d3_hclPrototype.brighter = function(k) { + return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1))); + }; + d3_hclPrototype.darker = function(k) { + return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1))); + }; + d3_hclPrototype.rgb = function() { + return d3_hcl_lab(this.h, this.c, this.l).rgb(); + }; + function d3_hcl_lab(h, c, l) { + if (isNaN(h)) h = 0; + if (isNaN(c)) c = 0; + return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c); + } + d3.lab = d3_lab; + function d3_lab(l, a, b) { + return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b); + } + var d3_lab_K = 18; + var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883; + var d3_labPrototype = d3_lab.prototype = new d3_color(); + d3_labPrototype.brighter = function(k) { + return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); + }; + d3_labPrototype.darker = function(k) { + return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); + }; + d3_labPrototype.rgb = function() { + return d3_lab_rgb(this.l, this.a, this.b); + }; + function d3_lab_rgb(l, a, b) { + var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200; + x = d3_lab_xyz(x) * d3_lab_X; + y = d3_lab_xyz(y) * d3_lab_Y; + z = d3_lab_xyz(z) * d3_lab_Z; + return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z)); + } + function d3_lab_hcl(l, a, b) { + return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l); + } + function d3_lab_xyz(x) { + return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037; + } + function d3_xyz_lab(x) { + return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29; + } + function d3_xyz_rgb(r) { + return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055)); + } + d3.rgb = d3_rgb; + function d3_rgb(r, g, b) { + return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b); + } + function d3_rgbNumber(value) { + return new d3_rgb(value >> 16, value >> 8 & 255, value & 255); + } + function d3_rgbString(value) { + return d3_rgbNumber(value) + ""; + } + var d3_rgbPrototype = d3_rgb.prototype = new d3_color(); + d3_rgbPrototype.brighter = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + var r = this.r, g = this.g, b = this.b, i = 30; + if (!r && !g && !b) return new d3_rgb(i, i, i); + if (r && r < i) r = i; + if (g && g < i) g = i; + if (b && b < i) b = i; + return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k)); + }; + d3_rgbPrototype.darker = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + return new d3_rgb(k * this.r, k * this.g, k * this.b); + }; + d3_rgbPrototype.hsl = function() { + return d3_rgb_hsl(this.r, this.g, this.b); + }; + d3_rgbPrototype.toString = function() { + return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b); + }; + function d3_rgb_hex(v) { + return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16); + } + function d3_rgb_parse(format, rgb, hsl) { + var r = 0, g = 0, b = 0, m1, m2, color; + m1 = /([a-z]+)\((.*)\)/i.exec(format); + if (m1) { + m2 = m1[2].split(","); + switch (m1[1]) { + case "hsl": + { + return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100); + } + + case "rgb": + { + return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2])); + } + } + } + if (color = d3_rgb_names.get(format)) return rgb(color.r, color.g, color.b); + if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) { + if (format.length === 4) { + r = (color & 3840) >> 4; + r = r >> 4 | r; + g = color & 240; + g = g >> 4 | g; + b = color & 15; + b = b << 4 | b; + } else if (format.length === 7) { + r = (color & 16711680) >> 16; + g = (color & 65280) >> 8; + b = color & 255; + } + } + return rgb(r, g, b); + } + function d3_rgb_hsl(r, g, b) { + var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2; + if (d) { + s = l < .5 ? d / (max + min) : d / (2 - max - min); + if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4; + h *= 60; + } else { + h = NaN; + s = l > 0 && l < 1 ? 0 : h; + } + return new d3_hsl(h, s, l); + } + function d3_rgb_lab(r, g, b) { + r = d3_rgb_xyz(r); + g = d3_rgb_xyz(g); + b = d3_rgb_xyz(b); + var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z); + return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z)); + } + function d3_rgb_xyz(r) { + return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4); + } + function d3_rgb_parseNumber(c) { + var f = parseFloat(c); + return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f; + } + var d3_rgb_names = d3.map({ + aliceblue: 15792383, + antiquewhite: 16444375, + aqua: 65535, + aquamarine: 8388564, + azure: 15794175, + beige: 16119260, + bisque: 16770244, + black: 0, + blanchedalmond: 16772045, + blue: 255, + blueviolet: 9055202, + brown: 10824234, + burlywood: 14596231, + cadetblue: 6266528, + chartreuse: 8388352, + chocolate: 13789470, + coral: 16744272, + cornflowerblue: 6591981, + cornsilk: 16775388, + crimson: 14423100, + cyan: 65535, + darkblue: 139, + darkcyan: 35723, + darkgoldenrod: 12092939, + darkgray: 11119017, + darkgreen: 25600, + darkgrey: 11119017, + darkkhaki: 12433259, + darkmagenta: 9109643, + darkolivegreen: 5597999, + darkorange: 16747520, + darkorchid: 10040012, + darkred: 9109504, + darksalmon: 15308410, + darkseagreen: 9419919, + darkslateblue: 4734347, + darkslategray: 3100495, + darkslategrey: 3100495, + darkturquoise: 52945, + darkviolet: 9699539, + deeppink: 16716947, + deepskyblue: 49151, + dimgray: 6908265, + dimgrey: 6908265, + dodgerblue: 2003199, + firebrick: 11674146, + floralwhite: 16775920, + forestgreen: 2263842, + fuchsia: 16711935, + gainsboro: 14474460, + ghostwhite: 16316671, + gold: 16766720, + goldenrod: 14329120, + gray: 8421504, + green: 32768, + greenyellow: 11403055, + grey: 8421504, + honeydew: 15794160, + hotpink: 16738740, + indianred: 13458524, + indigo: 4915330, + ivory: 16777200, + khaki: 15787660, + lavender: 15132410, + lavenderblush: 16773365, + lawngreen: 8190976, + lemonchiffon: 16775885, + lightblue: 11393254, + lightcoral: 15761536, + lightcyan: 14745599, + lightgoldenrodyellow: 16448210, + lightgray: 13882323, + lightgreen: 9498256, + lightgrey: 13882323, + lightpink: 16758465, + lightsalmon: 16752762, + lightseagreen: 2142890, + lightskyblue: 8900346, + lightslategray: 7833753, + lightslategrey: 7833753, + lightsteelblue: 11584734, + lightyellow: 16777184, + lime: 65280, + limegreen: 3329330, + linen: 16445670, + magenta: 16711935, + maroon: 8388608, + mediumaquamarine: 6737322, + mediumblue: 205, + mediumorchid: 12211667, + mediumpurple: 9662683, + mediumseagreen: 3978097, + mediumslateblue: 8087790, + mediumspringgreen: 64154, + mediumturquoise: 4772300, + mediumvioletred: 13047173, + midnightblue: 1644912, + mintcream: 16121850, + mistyrose: 16770273, + moccasin: 16770229, + navajowhite: 16768685, + navy: 128, + oldlace: 16643558, + olive: 8421376, + olivedrab: 7048739, + orange: 16753920, + orangered: 16729344, + orchid: 14315734, + palegoldenrod: 15657130, + palegreen: 10025880, + paleturquoise: 11529966, + palevioletred: 14381203, + papayawhip: 16773077, + peachpuff: 16767673, + peru: 13468991, + pink: 16761035, + plum: 14524637, + powderblue: 11591910, + purple: 8388736, + red: 16711680, + rosybrown: 12357519, + royalblue: 4286945, + saddlebrown: 9127187, + salmon: 16416882, + sandybrown: 16032864, + seagreen: 3050327, + seashell: 16774638, + sienna: 10506797, + silver: 12632256, + skyblue: 8900331, + slateblue: 6970061, + slategray: 7372944, + slategrey: 7372944, + snow: 16775930, + springgreen: 65407, + steelblue: 4620980, + tan: 13808780, + teal: 32896, + thistle: 14204888, + tomato: 16737095, + turquoise: 4251856, + violet: 15631086, + wheat: 16113331, + white: 16777215, + whitesmoke: 16119285, + yellow: 16776960, + yellowgreen: 10145074 + }); + d3_rgb_names.forEach(function(key, value) { + d3_rgb_names.set(key, d3_rgbNumber(value)); + }); + function d3_functor(v) { + return typeof v === "function" ? v : function() { + return v; + }; + } + d3.functor = d3_functor; + function d3_identity(d) { + return d; + } + d3.xhr = d3_xhrType(d3_identity); + function d3_xhrType(response) { + return function(url, mimeType, callback) { + if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType, + mimeType = null; + return d3_xhr(url, mimeType, response, callback); + }; + } + function d3_xhr(url, mimeType, response, callback) { + var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null; + if (d3_window.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest(); + "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() { + request.readyState > 3 && respond(); + }; + function respond() { + var status = request.status, result; + if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) { + try { + result = response.call(xhr, request); + } catch (e) { + dispatch.error.call(xhr, e); + return; + } + dispatch.load.call(xhr, result); + } else { + dispatch.error.call(xhr, request); + } + } + request.onprogress = function(event) { + var o = d3.event; + d3.event = event; + try { + dispatch.progress.call(xhr, request); + } finally { + d3.event = o; + } + }; + xhr.header = function(name, value) { + name = (name + "").toLowerCase(); + if (arguments.length < 2) return headers[name]; + if (value == null) delete headers[name]; else headers[name] = value + ""; + return xhr; + }; + xhr.mimeType = function(value) { + if (!arguments.length) return mimeType; + mimeType = value == null ? null : value + ""; + return xhr; + }; + xhr.responseType = function(value) { + if (!arguments.length) return responseType; + responseType = value; + return xhr; + }; + xhr.response = function(value) { + response = value; + return xhr; + }; + [ "get", "post" ].forEach(function(method) { + xhr[method] = function() { + return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments))); + }; + }); + xhr.send = function(method, data, callback) { + if (arguments.length === 2 && typeof data === "function") callback = data, data = null; + request.open(method, url, true); + if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*"; + if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]); + if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType); + if (responseType != null) request.responseType = responseType; + if (callback != null) xhr.on("error", callback).on("load", function(request) { + callback(null, request); + }); + dispatch.beforesend.call(xhr, request); + request.send(data == null ? null : data); + return xhr; + }; + xhr.abort = function() { + request.abort(); + return xhr; + }; + d3.rebind(xhr, dispatch, "on"); + return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback)); + } + function d3_xhr_fixCallback(callback) { + return callback.length === 1 ? function(error, request) { + callback(error == null ? request : null); + } : callback; + } + function d3_xhrHasResponse(request) { + var type = request.responseType; + return type && type !== "text" ? request.response : request.responseText; + } + d3.dsv = function(delimiter, mimeType) { + var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0); + function dsv(url, row, callback) { + if (arguments.length < 3) callback = row, row = null; + var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback); + xhr.row = function(_) { + return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row; + }; + return xhr; + } + function response(request) { + return dsv.parse(request.responseText); + } + function typedResponse(f) { + return function(request) { + return dsv.parse(request.responseText, f); + }; + } + dsv.parse = function(text, f) { + var o; + return dsv.parseRows(text, function(row, i) { + if (o) return o(row, i - 1); + var a = new Function("d", "return {" + row.map(function(name, i) { + return JSON.stringify(name) + ": d[" + i + "]"; + }).join(",") + "}"); + o = f ? function(row, i) { + return f(a(row), i); + } : a; + }); + }; + dsv.parseRows = function(text, f) { + var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol; + function token() { + if (I >= N) return EOF; + if (eol) return eol = false, EOL; + var j = I; + if (text.charCodeAt(j) === 34) { + var i = j; + while (i++ < N) { + if (text.charCodeAt(i) === 34) { + if (text.charCodeAt(i + 1) !== 34) break; + ++i; + } + } + I = i + 2; + var c = text.charCodeAt(i + 1); + if (c === 13) { + eol = true; + if (text.charCodeAt(i + 2) === 10) ++I; + } else if (c === 10) { + eol = true; + } + return text.slice(j + 1, i).replace(/""/g, '"'); + } + while (I < N) { + var c = text.charCodeAt(I++), k = 1; + if (c === 10) eol = true; else if (c === 13) { + eol = true; + if (text.charCodeAt(I) === 10) ++I, ++k; + } else if (c !== delimiterCode) continue; + return text.slice(j, I - k); + } + return text.slice(j); + } + while ((t = token()) !== EOF) { + var a = []; + while (t !== EOL && t !== EOF) { + a.push(t); + t = token(); + } + if (f && (a = f(a, n++)) == null) continue; + rows.push(a); + } + return rows; + }; + dsv.format = function(rows) { + if (Array.isArray(rows[0])) return dsv.formatRows(rows); + var fieldSet = new d3_Set(), fields = []; + rows.forEach(function(row) { + for (var field in row) { + if (!fieldSet.has(field)) { + fields.push(fieldSet.add(field)); + } + } + }); + return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) { + return fields.map(function(field) { + return formatValue(row[field]); + }).join(delimiter); + })).join("\n"); + }; + dsv.formatRows = function(rows) { + return rows.map(formatRow).join("\n"); + }; + function formatRow(row) { + return row.map(formatValue).join(delimiter); + } + function formatValue(text) { + return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text; + } + return dsv; + }; + d3.csv = d3.dsv(",", "text/csv"); + d3.tsv = d3.dsv(" ", "text/tab-separated-values"); + var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = d3_window[d3_vendorSymbol(d3_window, "requestAnimationFrame")] || function(callback) { + setTimeout(callback, 17); + }; + d3.timer = function(callback, delay, then) { + var n = arguments.length; + if (n < 2) delay = 0; + if (n < 3) then = Date.now(); + var time = then + delay, timer = { + c: callback, + t: time, + f: false, + n: null + }; + if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer; + d3_timer_queueTail = timer; + if (!d3_timer_interval) { + d3_timer_timeout = clearTimeout(d3_timer_timeout); + d3_timer_interval = 1; + d3_timer_frame(d3_timer_step); + } + }; + function d3_timer_step() { + var now = d3_timer_mark(), delay = d3_timer_sweep() - now; + if (delay > 24) { + if (isFinite(delay)) { + clearTimeout(d3_timer_timeout); + d3_timer_timeout = setTimeout(d3_timer_step, delay); + } + d3_timer_interval = 0; + } else { + d3_timer_interval = 1; + d3_timer_frame(d3_timer_step); + } + } + d3.timer.flush = function() { + d3_timer_mark(); + d3_timer_sweep(); + }; + function d3_timer_mark() { + var now = Date.now(); + d3_timer_active = d3_timer_queueHead; + while (d3_timer_active) { + if (now >= d3_timer_active.t) d3_timer_active.f = d3_timer_active.c(now - d3_timer_active.t); + d3_timer_active = d3_timer_active.n; + } + return now; + } + function d3_timer_sweep() { + var t0, t1 = d3_timer_queueHead, time = Infinity; + while (t1) { + if (t1.f) { + t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n; + } else { + if (t1.t < time) time = t1.t; + t1 = (t0 = t1).n; + } + } + d3_timer_queueTail = t0; + return time; + } + function d3_format_precision(x, p) { + return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1); + } + d3.round = function(x, n) { + return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x); + }; + var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix); + d3.formatPrefix = function(value, precision) { + var i = 0; + if (value) { + if (value < 0) value *= -1; + if (precision) value = d3.round(value, d3_format_precision(value, precision)); + i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10); + i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3)); + } + return d3_formatPrefixes[8 + i / 3]; + }; + function d3_formatPrefix(d, i) { + var k = Math.pow(10, abs(8 - i) * 3); + return { + scale: i > 8 ? function(d) { + return d / k; + } : function(d) { + return d * k; + }, + symbol: d + }; + } + function d3_locale_numberFormat(locale) { + var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) { + var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0; + while (i > 0 && g > 0) { + if (length + g + 1 > width) g = Math.max(1, width - length); + t.push(value.substring(i -= g, i + g)); + if ((length += g + 1) > width) break; + g = locale_grouping[j = (j + 1) % locale_grouping.length]; + } + return t.reverse().join(locale_thousands); + } : d3_identity; + return function(specifier) { + var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "-", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false, exponent = true; + if (precision) precision = +precision.substring(1); + if (zfill || fill === "0" && align === "=") { + zfill = fill = "0"; + align = "="; + } + switch (type) { + case "n": + comma = true; + type = "g"; + break; + + case "%": + scale = 100; + suffix = "%"; + type = "f"; + break; + + case "p": + scale = 100; + suffix = "%"; + type = "r"; + break; + + case "b": + case "o": + case "x": + case "X": + if (symbol === "#") prefix = "0" + type.toLowerCase(); + + case "c": + exponent = false; + + case "d": + integer = true; + precision = 0; + break; + + case "s": + scale = -1; + type = "r"; + break; + } + if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1]; + if (type == "r" && !precision) type = "g"; + if (precision != null) { + if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision)); + } + type = d3_format_types.get(type) || d3_format_typeDefault; + var zcomma = zfill && comma; + return function(value) { + var fullSuffix = suffix; + if (integer && value % 1) return ""; + var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign === "-" ? "" : sign; + if (scale < 0) { + var unit = d3.formatPrefix(value, precision); + value = unit.scale(value); + fullSuffix = unit.symbol + suffix; + } else { + value *= scale; + } + value = type(value, precision); + var i = value.lastIndexOf("."), before, after; + if (i < 0) { + var j = exponent ? value.lastIndexOf("e") : -1; + if (j < 0) before = value, after = ""; else before = value.substring(0, j), after = value.substring(j); + } else { + before = value.substring(0, i); + after = locale_decimal + value.substring(i + 1); + } + if (!zfill && comma) before = formatGroup(before, Infinity); + var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : ""; + if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity); + negative += prefix; + value = before + after; + return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix; + }; + }; + } + var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i; + var d3_format_types = d3.map({ + b: function(x) { + return x.toString(2); + }, + c: function(x) { + return String.fromCharCode(x); + }, + o: function(x) { + return x.toString(8); + }, + x: function(x) { + return x.toString(16); + }, + X: function(x) { + return x.toString(16).toUpperCase(); + }, + g: function(x, p) { + return x.toPrecision(p); + }, + e: function(x, p) { + return x.toExponential(p); + }, + f: function(x, p) { + return x.toFixed(p); + }, + r: function(x, p) { + return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p)))); + } + }); + function d3_format_typeDefault(x) { + return x + ""; + } + var d3_time = d3.time = {}, d3_date = Date; + function d3_date_utc() { + this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]); + } + d3_date_utc.prototype = { + getDate: function() { + return this._.getUTCDate(); + }, + getDay: function() { + return this._.getUTCDay(); + }, + getFullYear: function() { + return this._.getUTCFullYear(); + }, + getHours: function() { + return this._.getUTCHours(); + }, + getMilliseconds: function() { + return this._.getUTCMilliseconds(); + }, + getMinutes: function() { + return this._.getUTCMinutes(); + }, + getMonth: function() { + return this._.getUTCMonth(); + }, + getSeconds: function() { + return this._.getUTCSeconds(); + }, + getTime: function() { + return this._.getTime(); + }, + getTimezoneOffset: function() { + return 0; + }, + valueOf: function() { + return this._.valueOf(); + }, + setDate: function() { + d3_time_prototype.setUTCDate.apply(this._, arguments); + }, + setDay: function() { + d3_time_prototype.setUTCDay.apply(this._, arguments); + }, + setFullYear: function() { + d3_time_prototype.setUTCFullYear.apply(this._, arguments); + }, + setHours: function() { + d3_time_prototype.setUTCHours.apply(this._, arguments); + }, + setMilliseconds: function() { + d3_time_prototype.setUTCMilliseconds.apply(this._, arguments); + }, + setMinutes: function() { + d3_time_prototype.setUTCMinutes.apply(this._, arguments); + }, + setMonth: function() { + d3_time_prototype.setUTCMonth.apply(this._, arguments); + }, + setSeconds: function() { + d3_time_prototype.setUTCSeconds.apply(this._, arguments); + }, + setTime: function() { + d3_time_prototype.setTime.apply(this._, arguments); + } + }; + var d3_time_prototype = Date.prototype; + function d3_time_interval(local, step, number) { + function round(date) { + var d0 = local(date), d1 = offset(d0, 1); + return date - d0 < d1 - date ? d0 : d1; + } + function ceil(date) { + step(date = local(new d3_date(date - 1)), 1); + return date; + } + function offset(date, k) { + step(date = new d3_date(+date), k); + return date; + } + function range(t0, t1, dt) { + var time = ceil(t0), times = []; + if (dt > 1) { + while (time < t1) { + if (!(number(time) % dt)) times.push(new Date(+time)); + step(time, 1); + } + } else { + while (time < t1) times.push(new Date(+time)), step(time, 1); + } + return times; + } + function range_utc(t0, t1, dt) { + try { + d3_date = d3_date_utc; + var utc = new d3_date_utc(); + utc._ = t0; + return range(utc, t1, dt); + } finally { + d3_date = Date; + } + } + local.floor = local; + local.round = round; + local.ceil = ceil; + local.offset = offset; + local.range = range; + var utc = local.utc = d3_time_interval_utc(local); + utc.floor = utc; + utc.round = d3_time_interval_utc(round); + utc.ceil = d3_time_interval_utc(ceil); + utc.offset = d3_time_interval_utc(offset); + utc.range = range_utc; + return local; + } + function d3_time_interval_utc(method) { + return function(date, k) { + try { + d3_date = d3_date_utc; + var utc = new d3_date_utc(); + utc._ = date; + return method(utc, k)._; + } finally { + d3_date = Date; + } + }; + } + d3_time.year = d3_time_interval(function(date) { + date = d3_time.day(date); + date.setMonth(0, 1); + return date; + }, function(date, offset) { + date.setFullYear(date.getFullYear() + offset); + }, function(date) { + return date.getFullYear(); + }); + d3_time.years = d3_time.year.range; + d3_time.years.utc = d3_time.year.utc.range; + d3_time.day = d3_time_interval(function(date) { + var day = new d3_date(2e3, 0); + day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); + return day; + }, function(date, offset) { + date.setDate(date.getDate() + offset); + }, function(date) { + return date.getDate() - 1; + }); + d3_time.days = d3_time.day.range; + d3_time.days.utc = d3_time.day.utc.range; + d3_time.dayOfYear = function(date) { + var year = d3_time.year(date); + return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5); + }; + [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) { + i = 7 - i; + var interval = d3_time[day] = d3_time_interval(function(date) { + (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7); + return date; + }, function(date, offset) { + date.setDate(date.getDate() + Math.floor(offset) * 7); + }, function(date) { + var day = d3_time.year(date).getDay(); + return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i); + }); + d3_time[day + "s"] = interval.range; + d3_time[day + "s"].utc = interval.utc.range; + d3_time[day + "OfYear"] = function(date) { + var day = d3_time.year(date).getDay(); + return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7); + }; + }); + d3_time.week = d3_time.sunday; + d3_time.weeks = d3_time.sunday.range; + d3_time.weeks.utc = d3_time.sunday.utc.range; + d3_time.weekOfYear = d3_time.sundayOfYear; + function d3_locale_timeFormat(locale) { + var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths; + function d3_time_format(template) { + var n = template.length; + function format(date) { + var string = [], i = -1, j = 0, c, p, f; + while (++i < n) { + if (template.charCodeAt(i) === 37) { + string.push(template.slice(j, i)); + if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i); + if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p); + string.push(c); + j = i + 1; + } + } + string.push(template.slice(j, i)); + return string.join(""); + } + format.parse = function(string) { + var d = { + y: 1900, + m: 0, + d: 1, + H: 0, + M: 0, + S: 0, + L: 0, + Z: null + }, i = d3_time_parse(d, template, string, 0); + if (i != string.length) return null; + if ("p" in d) d.H = d.H % 12 + d.p * 12; + var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)(); + if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("w" in d && ("W" in d || "U" in d)) { + date.setFullYear(d.y, 0, 1); + date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7); + } else date.setFullYear(d.y, d.m, d.d); + date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L); + return localZ ? date._ : date; + }; + format.toString = function() { + return template; + }; + return format; + } + function d3_time_parse(date, template, string, j) { + var c, p, t, i = 0, n = template.length, m = string.length; + while (i < n) { + if (j >= m) return -1; + c = template.charCodeAt(i++); + if (c === 37) { + t = template.charAt(i++); + p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t]; + if (!p || (j = p(date, string, j)) < 0) return -1; + } else if (c != string.charCodeAt(j++)) { + return -1; + } + } + return j; + } + d3_time_format.utc = function(template) { + var local = d3_time_format(template); + function format(date) { + try { + d3_date = d3_date_utc; + var utc = new d3_date(); + utc._ = date; + return local(utc); + } finally { + d3_date = Date; + } + } + format.parse = function(string) { + try { + d3_date = d3_date_utc; + var date = local.parse(string); + return date && date._; + } finally { + d3_date = Date; + } + }; + format.toString = local.toString; + return format; + }; + d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti; + var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths); + locale_periods.forEach(function(p, i) { + d3_time_periodLookup.set(p.toLowerCase(), i); + }); + var d3_time_formats = { + a: function(d) { + return locale_shortDays[d.getDay()]; + }, + A: function(d) { + return locale_days[d.getDay()]; + }, + b: function(d) { + return locale_shortMonths[d.getMonth()]; + }, + B: function(d) { + return locale_months[d.getMonth()]; + }, + c: d3_time_format(locale_dateTime), + d: function(d, p) { + return d3_time_formatPad(d.getDate(), p, 2); + }, + e: function(d, p) { + return d3_time_formatPad(d.getDate(), p, 2); + }, + H: function(d, p) { + return d3_time_formatPad(d.getHours(), p, 2); + }, + I: function(d, p) { + return d3_time_formatPad(d.getHours() % 12 || 12, p, 2); + }, + j: function(d, p) { + return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3); + }, + L: function(d, p) { + return d3_time_formatPad(d.getMilliseconds(), p, 3); + }, + m: function(d, p) { + return d3_time_formatPad(d.getMonth() + 1, p, 2); + }, + M: function(d, p) { + return d3_time_formatPad(d.getMinutes(), p, 2); + }, + p: function(d) { + return locale_periods[+(d.getHours() >= 12)]; + }, + S: function(d, p) { + return d3_time_formatPad(d.getSeconds(), p, 2); + }, + U: function(d, p) { + return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2); + }, + w: function(d) { + return d.getDay(); + }, + W: function(d, p) { + return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2); + }, + x: d3_time_format(locale_date), + X: d3_time_format(locale_time), + y: function(d, p) { + return d3_time_formatPad(d.getFullYear() % 100, p, 2); + }, + Y: function(d, p) { + return d3_time_formatPad(d.getFullYear() % 1e4, p, 4); + }, + Z: d3_time_zone, + "%": function() { + return "%"; + } + }; + var d3_time_parsers = { + a: d3_time_parseWeekdayAbbrev, + A: d3_time_parseWeekday, + b: d3_time_parseMonthAbbrev, + B: d3_time_parseMonth, + c: d3_time_parseLocaleFull, + d: d3_time_parseDay, + e: d3_time_parseDay, + H: d3_time_parseHour24, + I: d3_time_parseHour24, + j: d3_time_parseDayOfYear, + L: d3_time_parseMilliseconds, + m: d3_time_parseMonthNumber, + M: d3_time_parseMinutes, + p: d3_time_parseAmPm, + S: d3_time_parseSeconds, + U: d3_time_parseWeekNumberSunday, + w: d3_time_parseWeekdayNumber, + W: d3_time_parseWeekNumberMonday, + x: d3_time_parseLocaleDate, + X: d3_time_parseLocaleTime, + y: d3_time_parseYear, + Y: d3_time_parseFullYear, + Z: d3_time_parseZone, + "%": d3_time_parseLiteralPercent + }; + function d3_time_parseWeekdayAbbrev(date, string, i) { + d3_time_dayAbbrevRe.lastIndex = 0; + var n = d3_time_dayAbbrevRe.exec(string.slice(i)); + return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseWeekday(date, string, i) { + d3_time_dayRe.lastIndex = 0; + var n = d3_time_dayRe.exec(string.slice(i)); + return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseMonthAbbrev(date, string, i) { + d3_time_monthAbbrevRe.lastIndex = 0; + var n = d3_time_monthAbbrevRe.exec(string.slice(i)); + return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseMonth(date, string, i) { + d3_time_monthRe.lastIndex = 0; + var n = d3_time_monthRe.exec(string.slice(i)); + return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseLocaleFull(date, string, i) { + return d3_time_parse(date, d3_time_formats.c.toString(), string, i); + } + function d3_time_parseLocaleDate(date, string, i) { + return d3_time_parse(date, d3_time_formats.x.toString(), string, i); + } + function d3_time_parseLocaleTime(date, string, i) { + return d3_time_parse(date, d3_time_formats.X.toString(), string, i); + } + function d3_time_parseAmPm(date, string, i) { + var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase()); + return n == null ? -1 : (date.p = n, i); + } + return d3_time_format; + } + var d3_time_formatPads = { + "-": "", + _: " ", + "0": "0" + }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/; + function d3_time_formatPad(value, fill, width) { + var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length; + return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string); + } + function d3_time_formatRe(names) { + return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i"); + } + function d3_time_formatLookup(names) { + var map = new d3_Map(), i = -1, n = names.length; + while (++i < n) map.set(names[i].toLowerCase(), i); + return map; + } + function d3_time_parseWeekdayNumber(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 1)); + return n ? (date.w = +n[0], i + n[0].length) : -1; + } + function d3_time_parseWeekNumberSunday(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i)); + return n ? (date.U = +n[0], i + n[0].length) : -1; + } + function d3_time_parseWeekNumberMonday(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i)); + return n ? (date.W = +n[0], i + n[0].length) : -1; + } + function d3_time_parseFullYear(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 4)); + return n ? (date.y = +n[0], i + n[0].length) : -1; + } + function d3_time_parseYear(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1; + } + function d3_time_parseZone(date, string, i) { + return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string, + i + 5) : -1; + } + function d3_time_expandYear(d) { + return d + (d > 68 ? 1900 : 2e3); + } + function d3_time_parseMonthNumber(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.m = n[0] - 1, i + n[0].length) : -1; + } + function d3_time_parseDay(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.d = +n[0], i + n[0].length) : -1; + } + function d3_time_parseDayOfYear(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 3)); + return n ? (date.j = +n[0], i + n[0].length) : -1; + } + function d3_time_parseHour24(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.H = +n[0], i + n[0].length) : -1; + } + function d3_time_parseMinutes(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.M = +n[0], i + n[0].length) : -1; + } + function d3_time_parseSeconds(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.S = +n[0], i + n[0].length) : -1; + } + function d3_time_parseMilliseconds(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 3)); + return n ? (date.L = +n[0], i + n[0].length) : -1; + } + function d3_time_zone(d) { + var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = abs(z) / 60 | 0, zm = abs(z) % 60; + return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2); + } + function d3_time_parseLiteralPercent(date, string, i) { + d3_time_percentRe.lastIndex = 0; + var n = d3_time_percentRe.exec(string.slice(i, i + 1)); + return n ? i + n[0].length : -1; + } + function d3_time_formatMulti(formats) { + var n = formats.length, i = -1; + while (++i < n) formats[i][0] = this(formats[i][0]); + return function(date) { + var i = 0, f = formats[i]; + while (!f[1](date)) f = formats[++i]; + return f[0](date); + }; + } + d3.locale = function(locale) { + return { + numberFormat: d3_locale_numberFormat(locale), + timeFormat: d3_locale_timeFormat(locale) + }; + }; + var d3_locale_enUS = d3.locale({ + decimal: ".", + thousands: ",", + grouping: [ 3 ], + currency: [ "$", "" ], + dateTime: "%a %b %e %X %Y", + date: "%m/%d/%Y", + time: "%H:%M:%S", + periods: [ "AM", "PM" ], + days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], + shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], + months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], + shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ] + }); + d3.format = d3_locale_enUS.numberFormat; + d3.geo = {}; + function d3_adder() {} + d3_adder.prototype = { + s: 0, + t: 0, + add: function(y) { + d3_adderSum(y, this.t, d3_adderTemp); + d3_adderSum(d3_adderTemp.s, this.s, this); + if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t; + }, + reset: function() { + this.s = this.t = 0; + }, + valueOf: function() { + return this.s; + } + }; + var d3_adderTemp = new d3_adder(); + function d3_adderSum(a, b, o) { + var x = o.s = a + b, bv = x - a, av = x - bv; + o.t = a - av + (b - bv); + } + d3.geo.stream = function(object, listener) { + if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) { + d3_geo_streamObjectType[object.type](object, listener); + } else { + d3_geo_streamGeometry(object, listener); + } + }; + function d3_geo_streamGeometry(geometry, listener) { + if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) { + d3_geo_streamGeometryType[geometry.type](geometry, listener); + } + } + var d3_geo_streamObjectType = { + Feature: function(feature, listener) { + d3_geo_streamGeometry(feature.geometry, listener); + }, + FeatureCollection: function(object, listener) { + var features = object.features, i = -1, n = features.length; + while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener); + } + }; + var d3_geo_streamGeometryType = { + Sphere: function(object, listener) { + listener.sphere(); + }, + Point: function(object, listener) { + object = object.coordinates; + listener.point(object[0], object[1], object[2]); + }, + MultiPoint: function(object, listener) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]); + }, + LineString: function(object, listener) { + d3_geo_streamLine(object.coordinates, listener, 0); + }, + MultiLineString: function(object, listener) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0); + }, + Polygon: function(object, listener) { + d3_geo_streamPolygon(object.coordinates, listener); + }, + MultiPolygon: function(object, listener) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) d3_geo_streamPolygon(coordinates[i], listener); + }, + GeometryCollection: function(object, listener) { + var geometries = object.geometries, i = -1, n = geometries.length; + while (++i < n) d3_geo_streamGeometry(geometries[i], listener); + } + }; + function d3_geo_streamLine(coordinates, listener, closed) { + var i = -1, n = coordinates.length - closed, coordinate; + listener.lineStart(); + while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]); + listener.lineEnd(); + } + function d3_geo_streamPolygon(coordinates, listener) { + var i = -1, n = coordinates.length; + listener.polygonStart(); + while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1); + listener.polygonEnd(); + } + d3.geo.area = function(object) { + d3_geo_areaSum = 0; + d3.geo.stream(object, d3_geo_area); + return d3_geo_areaSum; + }; + var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder(); + var d3_geo_area = { + sphere: function() { + d3_geo_areaSum += 4 * π; + }, + point: d3_noop, + lineStart: d3_noop, + lineEnd: d3_noop, + polygonStart: function() { + d3_geo_areaRingSum.reset(); + d3_geo_area.lineStart = d3_geo_areaRingStart; + }, + polygonEnd: function() { + var area = 2 * d3_geo_areaRingSum; + d3_geo_areaSum += area < 0 ? 4 * π + area : area; + d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop; + } + }; + function d3_geo_areaRingStart() { + var λ00, φ00, λ0, cosφ0, sinφ0; + d3_geo_area.point = function(λ, φ) { + d3_geo_area.point = nextPoint; + λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), + sinφ0 = Math.sin(φ); + }; + function nextPoint(λ, φ) { + λ *= d3_radians; + φ = φ * d3_radians / 2 + π / 4; + var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ); + d3_geo_areaRingSum.add(Math.atan2(v, u)); + λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ; + } + d3_geo_area.lineEnd = function() { + nextPoint(λ00, φ00); + }; + } + function d3_geo_cartesian(spherical) { + var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ); + return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ]; + } + function d3_geo_cartesianDot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + function d3_geo_cartesianCross(a, b) { + return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ]; + } + function d3_geo_cartesianAdd(a, b) { + a[0] += b[0]; + a[1] += b[1]; + a[2] += b[2]; + } + function d3_geo_cartesianScale(vector, k) { + return [ vector[0] * k, vector[1] * k, vector[2] * k ]; + } + function d3_geo_cartesianNormalize(d) { + var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); + d[0] /= l; + d[1] /= l; + d[2] /= l; + } + function d3_geo_spherical(cartesian) { + return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ]; + } + function d3_geo_sphericalEqual(a, b) { + return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε; + } + d3.geo.bounds = function() { + var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range; + var bound = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + bound.point = ringPoint; + bound.lineStart = ringStart; + bound.lineEnd = ringEnd; + dλSum = 0; + d3_geo_area.polygonStart(); + }, + polygonEnd: function() { + d3_geo_area.polygonEnd(); + bound.point = point; + bound.lineStart = lineStart; + bound.lineEnd = lineEnd; + if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90; + range[0] = λ0, range[1] = λ1; + } + }; + function point(λ, φ) { + ranges.push(range = [ λ0 = λ, λ1 = λ ]); + if (φ < φ0) φ0 = φ; + if (φ > φ1) φ1 = φ; + } + function linePoint(λ, φ) { + var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]); + if (p0) { + var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal); + d3_geo_cartesianNormalize(inflection); + inflection = d3_geo_spherical(inflection); + var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180; + if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) { + var φi = inflection[1] * d3_degrees; + if (φi > φ1) φ1 = φi; + } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) { + var φi = -inflection[1] * d3_degrees; + if (φi < φ0) φ0 = φi; + } else { + if (φ < φ0) φ0 = φ; + if (φ > φ1) φ1 = φ; + } + if (antimeridian) { + if (λ < λ_) { + if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; + } else { + if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; + } + } else { + if (λ1 >= λ0) { + if (λ < λ0) λ0 = λ; + if (λ > λ1) λ1 = λ; + } else { + if (λ > λ_) { + if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; + } else { + if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; + } + } + } + } else { + point(λ, φ); + } + p0 = p, λ_ = λ; + } + function lineStart() { + bound.point = linePoint; + } + function lineEnd() { + range[0] = λ0, range[1] = λ1; + bound.point = point; + p0 = null; + } + function ringPoint(λ, φ) { + if (p0) { + var dλ = λ - λ_; + dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ; + } else λ__ = λ, φ__ = φ; + d3_geo_area.point(λ, φ); + linePoint(λ, φ); + } + function ringStart() { + d3_geo_area.lineStart(); + } + function ringEnd() { + ringPoint(λ__, φ__); + d3_geo_area.lineEnd(); + if (abs(dλSum) > ε) λ0 = -(λ1 = 180); + range[0] = λ0, range[1] = λ1; + p0 = null; + } + function angle(λ0, λ1) { + return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1; + } + function compareRanges(a, b) { + return a[0] - b[0]; + } + function withinRange(x, range) { + return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x; + } + return function(feature) { + φ1 = λ1 = -(λ0 = φ0 = Infinity); + ranges = []; + d3.geo.stream(feature, bound); + var n = ranges.length; + if (n) { + ranges.sort(compareRanges); + for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) { + b = ranges[i]; + if (withinRange(b[0], a) || withinRange(b[1], a)) { + if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1]; + if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0]; + } else { + merged.push(a = b); + } + } + var best = -Infinity, dλ; + for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) { + b = merged[i]; + if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1]; + } + } + ranges = range = null; + return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ]; + }; + }(); + d3.geo.centroid = function(object) { + d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; + d3.geo.stream(object, d3_geo_centroid); + var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z; + if (m < ε2) { + x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1; + if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0; + m = x * x + y * y + z * z; + if (m < ε2) return [ NaN, NaN ]; + } + return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ]; + }; + var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2; + var d3_geo_centroid = { + sphere: d3_noop, + point: d3_geo_centroidPoint, + lineStart: d3_geo_centroidLineStart, + lineEnd: d3_geo_centroidLineEnd, + polygonStart: function() { + d3_geo_centroid.lineStart = d3_geo_centroidRingStart; + }, + polygonEnd: function() { + d3_geo_centroid.lineStart = d3_geo_centroidLineStart; + } + }; + function d3_geo_centroidPoint(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians); + d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ)); + } + function d3_geo_centroidPointXYZ(x, y, z) { + ++d3_geo_centroidW0; + d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0; + d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0; + d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0; + } + function d3_geo_centroidLineStart() { + var x0, y0, z0; + d3_geo_centroid.point = function(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians); + x0 = cosφ * Math.cos(λ); + y0 = cosφ * Math.sin(λ); + z0 = Math.sin(φ); + d3_geo_centroid.point = nextPoint; + d3_geo_centroidPointXYZ(x0, y0, z0); + }; + function nextPoint(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z); + d3_geo_centroidW1 += w; + d3_geo_centroidX1 += w * (x0 + (x0 = x)); + d3_geo_centroidY1 += w * (y0 + (y0 = y)); + d3_geo_centroidZ1 += w * (z0 + (z0 = z)); + d3_geo_centroidPointXYZ(x0, y0, z0); + } + } + function d3_geo_centroidLineEnd() { + d3_geo_centroid.point = d3_geo_centroidPoint; + } + function d3_geo_centroidRingStart() { + var λ00, φ00, x0, y0, z0; + d3_geo_centroid.point = function(λ, φ) { + λ00 = λ, φ00 = φ; + d3_geo_centroid.point = nextPoint; + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians); + x0 = cosφ * Math.cos(λ); + y0 = cosφ * Math.sin(λ); + z0 = Math.sin(φ); + d3_geo_centroidPointXYZ(x0, y0, z0); + }; + d3_geo_centroid.lineEnd = function() { + nextPoint(λ00, φ00); + d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd; + d3_geo_centroid.point = d3_geo_centroidPoint; + }; + function nextPoint(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u); + d3_geo_centroidX2 += v * cx; + d3_geo_centroidY2 += v * cy; + d3_geo_centroidZ2 += v * cz; + d3_geo_centroidW1 += w; + d3_geo_centroidX1 += w * (x0 + (x0 = x)); + d3_geo_centroidY1 += w * (y0 + (y0 = y)); + d3_geo_centroidZ1 += w * (z0 + (z0 = z)); + d3_geo_centroidPointXYZ(x0, y0, z0); + } + } + function d3_true() { + return true; + } + function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) { + var subject = [], clip = []; + segments.forEach(function(segment) { + if ((n = segment.length - 1) <= 0) return; + var n, p0 = segment[0], p1 = segment[n]; + if (d3_geo_sphericalEqual(p0, p1)) { + listener.lineStart(); + for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]); + listener.lineEnd(); + return; + } + var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false); + a.o = b; + subject.push(a); + clip.push(b); + a = new d3_geo_clipPolygonIntersection(p1, segment, null, false); + b = new d3_geo_clipPolygonIntersection(p1, null, a, true); + a.o = b; + subject.push(a); + clip.push(b); + }); + clip.sort(compare); + d3_geo_clipPolygonLinkCircular(subject); + d3_geo_clipPolygonLinkCircular(clip); + if (!subject.length) return; + for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) { + clip[i].e = entry = !entry; + } + var start = subject[0], points, point; + while (1) { + var current = start, isSubject = true; + while (current.v) if ((current = current.n) === start) return; + points = current.z; + listener.lineStart(); + do { + current.v = current.o.v = true; + if (current.e) { + if (isSubject) { + for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]); + } else { + interpolate(current.x, current.n.x, 1, listener); + } + current = current.n; + } else { + if (isSubject) { + points = current.p.z; + for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]); + } else { + interpolate(current.x, current.p.x, -1, listener); + } + current = current.p; + } + current = current.o; + points = current.z; + isSubject = !isSubject; + } while (!current.v); + listener.lineEnd(); + } + } + function d3_geo_clipPolygonLinkCircular(array) { + if (!(n = array.length)) return; + var n, i = 0, a = array[0], b; + while (++i < n) { + a.n = b = array[i]; + b.p = a; + a = b; + } + a.n = b = array[0]; + b.p = a; + } + function d3_geo_clipPolygonIntersection(point, points, other, entry) { + this.x = point; + this.z = points; + this.o = other; + this.e = entry; + this.v = false; + this.n = this.p = null; + } + function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) { + return function(rotate, listener) { + var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]); + var clip = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + clip.point = pointRing; + clip.lineStart = ringStart; + clip.lineEnd = ringEnd; + segments = []; + polygon = []; + }, + polygonEnd: function() { + clip.point = point; + clip.lineStart = lineStart; + clip.lineEnd = lineEnd; + segments = d3.merge(segments); + var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon); + if (segments.length) { + if (!polygonStarted) listener.polygonStart(), polygonStarted = true; + d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener); + } else if (clipStartInside) { + if (!polygonStarted) listener.polygonStart(), polygonStarted = true; + listener.lineStart(); + interpolate(null, null, 1, listener); + listener.lineEnd(); + } + if (polygonStarted) listener.polygonEnd(), polygonStarted = false; + segments = polygon = null; + }, + sphere: function() { + listener.polygonStart(); + listener.lineStart(); + interpolate(null, null, 1, listener); + listener.lineEnd(); + listener.polygonEnd(); + } + }; + function point(λ, φ) { + var point = rotate(λ, φ); + if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ); + } + function pointLine(λ, φ) { + var point = rotate(λ, φ); + line.point(point[0], point[1]); + } + function lineStart() { + clip.point = pointLine; + line.lineStart(); + } + function lineEnd() { + clip.point = point; + line.lineEnd(); + } + var segments; + var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring; + function pointRing(λ, φ) { + ring.push([ λ, φ ]); + var point = rotate(λ, φ); + ringListener.point(point[0], point[1]); + } + function ringStart() { + ringListener.lineStart(); + ring = []; + } + function ringEnd() { + pointRing(ring[0][0], ring[0][1]); + ringListener.lineEnd(); + var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length; + ring.pop(); + polygon.push(ring); + ring = null; + if (!n) return; + if (clean & 1) { + segment = ringSegments[0]; + var n = segment.length - 1, i = -1, point; + if (n > 0) { + if (!polygonStarted) listener.polygonStart(), polygonStarted = true; + listener.lineStart(); + while (++i < n) listener.point((point = segment[i])[0], point[1]); + listener.lineEnd(); + } + return; + } + if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); + segments.push(ringSegments.filter(d3_geo_clipSegmentLength1)); + } + return clip; + }; + } + function d3_geo_clipSegmentLength1(segment) { + return segment.length > 1; + } + function d3_geo_clipBufferListener() { + var lines = [], line; + return { + lineStart: function() { + lines.push(line = []); + }, + point: function(λ, φ) { + line.push([ λ, φ ]); + }, + lineEnd: d3_noop, + buffer: function() { + var buffer = lines; + lines = []; + line = null; + return buffer; + }, + rejoin: function() { + if (lines.length > 1) lines.push(lines.pop().concat(lines.shift())); + } + }; + } + function d3_geo_clipSort(a, b) { + return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]); + } + var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]); + function d3_geo_clipAntimeridianLine(listener) { + var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean; + return { + lineStart: function() { + listener.lineStart(); + clean = 1; + }, + point: function(λ1, φ1) { + var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0); + if (abs(dλ - π) < ε) { + listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ); + listener.point(sλ0, φ0); + listener.lineEnd(); + listener.lineStart(); + listener.point(sλ1, φ0); + listener.point(λ1, φ0); + clean = 0; + } else if (sλ0 !== sλ1 && dλ >= π) { + if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε; + if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε; + φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1); + listener.point(sλ0, φ0); + listener.lineEnd(); + listener.lineStart(); + listener.point(sλ1, φ0); + clean = 0; + } + listener.point(λ0 = λ1, φ0 = φ1); + sλ0 = sλ1; + }, + lineEnd: function() { + listener.lineEnd(); + λ0 = φ0 = NaN; + }, + clean: function() { + return 2 - clean; + } + }; + } + function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) { + var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1); + return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2; + } + function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) { + var φ; + if (from == null) { + φ = direction * halfπ; + listener.point(-π, φ); + listener.point(0, φ); + listener.point(π, φ); + listener.point(π, 0); + listener.point(π, -φ); + listener.point(0, -φ); + listener.point(-π, -φ); + listener.point(-π, 0); + listener.point(-π, φ); + } else if (abs(from[0] - to[0]) > ε) { + var s = from[0] < to[0] ? π : -π; + φ = direction * s / 2; + listener.point(-s, φ); + listener.point(0, φ); + listener.point(s, φ); + } else { + listener.point(to[0], to[1]); + } + } + function d3_geo_pointInPolygon(point, polygon) { + var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0; + d3_geo_areaRingSum.reset(); + for (var i = 0, n = polygon.length; i < n; ++i) { + var ring = polygon[i], m = ring.length; + if (!m) continue; + var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1; + while (true) { + if (j === m) j = 0; + point = ring[j]; + var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ; + d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ))); + polarAngle += antimeridian ? dλ + sdλ * τ : dλ; + if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) { + var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point)); + d3_geo_cartesianNormalize(arc); + var intersection = d3_geo_cartesianCross(meridianNormal, arc); + d3_geo_cartesianNormalize(intersection); + var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]); + if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) { + winding += antimeridian ^ dλ >= 0 ? 1 : -1; + } + } + if (!j++) break; + λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point; + } + } + return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1; + } + function d3_geo_clipCircle(radius) { + var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians); + return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]); + function visible(λ, φ) { + return Math.cos(λ) * Math.cos(φ) > cr; + } + function clipLine(listener) { + var point0, c0, v0, v00, clean; + return { + lineStart: function() { + v00 = v0 = false; + clean = 1; + }, + point: function(λ, φ) { + var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0; + if (!point0 && (v00 = v0 = v)) listener.lineStart(); + if (v !== v0) { + point2 = intersect(point0, point1); + if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) { + point1[0] += ε; + point1[1] += ε; + v = visible(point1[0], point1[1]); + } + } + if (v !== v0) { + clean = 0; + if (v) { + listener.lineStart(); + point2 = intersect(point1, point0); + listener.point(point2[0], point2[1]); + } else { + point2 = intersect(point0, point1); + listener.point(point2[0], point2[1]); + listener.lineEnd(); + } + point0 = point2; + } else if (notHemisphere && point0 && smallRadius ^ v) { + var t; + if (!(c & c0) && (t = intersect(point1, point0, true))) { + clean = 0; + if (smallRadius) { + listener.lineStart(); + listener.point(t[0][0], t[0][1]); + listener.point(t[1][0], t[1][1]); + listener.lineEnd(); + } else { + listener.point(t[1][0], t[1][1]); + listener.lineEnd(); + listener.lineStart(); + listener.point(t[0][0], t[0][1]); + } + } + } + if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) { + listener.point(point1[0], point1[1]); + } + point0 = point1, v0 = v, c0 = c; + }, + lineEnd: function() { + if (v0) listener.lineEnd(); + point0 = null; + }, + clean: function() { + return clean | (v00 && v0) << 1; + } + }; + } + function intersect(a, b, two) { + var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b); + var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2; + if (!determinant) return !two && a; + var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2); + d3_geo_cartesianAdd(A, B); + var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1); + if (t2 < 0) return; + var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu); + d3_geo_cartesianAdd(q, A); + q = d3_geo_spherical(q); + if (!two) return q; + var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z; + if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z; + var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε; + if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z; + if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) { + var q1 = d3_geo_cartesianScale(u, (-w + t) / uu); + d3_geo_cartesianAdd(q1, A); + return [ q, d3_geo_spherical(q1) ]; + } + } + function code(λ, φ) { + var r = smallRadius ? radius : π - radius, code = 0; + if (λ < -r) code |= 1; else if (λ > r) code |= 2; + if (φ < -r) code |= 4; else if (φ > r) code |= 8; + return code; + } + } + function d3_geom_clipLine(x0, y0, x1, y1) { + return function(line) { + var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r; + r = x0 - ax; + if (!dx && r > 0) return; + r /= dx; + if (dx < 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } else if (dx > 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } + r = x1 - ax; + if (!dx && r < 0) return; + r /= dx; + if (dx < 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } else if (dx > 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } + r = y0 - ay; + if (!dy && r > 0) return; + r /= dy; + if (dy < 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } else if (dy > 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } + r = y1 - ay; + if (!dy && r < 0) return; + r /= dy; + if (dy < 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } else if (dy > 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } + if (t0 > 0) line.a = { + x: ax + t0 * dx, + y: ay + t0 * dy + }; + if (t1 < 1) line.b = { + x: ax + t1 * dx, + y: ay + t1 * dy + }; + return line; + }; + } + var d3_geo_clipExtentMAX = 1e9; + d3.geo.clipExtent = function() { + var x0, y0, x1, y1, stream, clip, clipExtent = { + stream: function(output) { + if (stream) stream.valid = false; + stream = clip(output); + stream.valid = true; + return stream; + }, + extent: function(_) { + if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; + clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]); + if (stream) stream.valid = false, stream = null; + return clipExtent; + } + }; + return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]); + }; + function d3_geo_clipExtent(x0, y0, x1, y1) { + return function(listener) { + var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring; + var clip = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + listener = bufferListener; + segments = []; + polygon = []; + clean = true; + }, + polygonEnd: function() { + listener = listener_; + segments = d3.merge(segments); + var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length; + if (inside || visible) { + listener.polygonStart(); + if (inside) { + listener.lineStart(); + interpolate(null, null, 1, listener); + listener.lineEnd(); + } + if (visible) { + d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener); + } + listener.polygonEnd(); + } + segments = polygon = ring = null; + } + }; + function insidePolygon(p) { + var wn = 0, n = polygon.length, y = p[1]; + for (var i = 0; i < n; ++i) { + for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) { + b = v[j]; + if (a[1] <= y) { + if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn; + } else { + if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn; + } + a = b; + } + } + return wn !== 0; + } + function interpolate(from, to, direction, listener) { + var a = 0, a1 = 0; + if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) { + do { + listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0); + } while ((a = (a + direction + 4) % 4) !== a1); + } else { + listener.point(to[0], to[1]); + } + } + function pointVisible(x, y) { + return x0 <= x && x <= x1 && y0 <= y && y <= y1; + } + function point(x, y) { + if (pointVisible(x, y)) listener.point(x, y); + } + var x__, y__, v__, x_, y_, v_, first, clean; + function lineStart() { + clip.point = linePoint; + if (polygon) polygon.push(ring = []); + first = true; + v_ = false; + x_ = y_ = NaN; + } + function lineEnd() { + if (segments) { + linePoint(x__, y__); + if (v__ && v_) bufferListener.rejoin(); + segments.push(bufferListener.buffer()); + } + clip.point = point; + if (v_) listener.lineEnd(); + } + function linePoint(x, y) { + x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x)); + y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y)); + var v = pointVisible(x, y); + if (polygon) ring.push([ x, y ]); + if (first) { + x__ = x, y__ = y, v__ = v; + first = false; + if (v) { + listener.lineStart(); + listener.point(x, y); + } + } else { + if (v && v_) listener.point(x, y); else { + var l = { + a: { + x: x_, + y: y_ + }, + b: { + x: x, + y: y + } + }; + if (clipLine(l)) { + if (!v_) { + listener.lineStart(); + listener.point(l.a.x, l.a.y); + } + listener.point(l.b.x, l.b.y); + if (!v) listener.lineEnd(); + clean = false; + } else if (v) { + listener.lineStart(); + listener.point(x, y); + clean = false; + } + } + } + x_ = x, y_ = y, v_ = v; + } + return clip; + }; + function corner(p, direction) { + return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2; + } + function compare(a, b) { + return comparePoints(a.x, b.x); + } + function comparePoints(a, b) { + var ca = corner(a, 1), cb = corner(b, 1); + return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0]; + } + } + function d3_geo_compose(a, b) { + function compose(x, y) { + return x = a(x, y), b(x[0], x[1]); + } + if (a.invert && b.invert) compose.invert = function(x, y) { + return x = b.invert(x, y), x && a.invert(x[0], x[1]); + }; + return compose; + } + function d3_geo_conic(projectAt) { + var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1); + p.parallels = function(_) { + if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ]; + return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180); + }; + return p; + } + function d3_geo_conicEqualArea(φ0, φ1) { + var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n; + function forward(λ, φ) { + var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n; + return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ]; + } + forward.invert = function(x, y) { + var ρ0_y = ρ0 - y; + return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ]; + }; + return forward; + } + (d3.geo.conicEqualArea = function() { + return d3_geo_conic(d3_geo_conicEqualArea); + }).raw = d3_geo_conicEqualArea; + d3.geo.albers = function() { + return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070); + }; + d3.geo.albersUsa = function() { + var lower48 = d3.geo.albers(); + var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]); + var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]); + var point, pointStream = { + point: function(x, y) { + point = [ x, y ]; + } + }, lower48Point, alaskaPoint, hawaiiPoint; + function albersUsa(coordinates) { + var x = coordinates[0], y = coordinates[1]; + point = null; + (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y); + return point; + } + albersUsa.invert = function(coordinates) { + var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k; + return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates); + }; + albersUsa.stream = function(stream) { + var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream); + return { + point: function(x, y) { + lower48Stream.point(x, y); + alaskaStream.point(x, y); + hawaiiStream.point(x, y); + }, + sphere: function() { + lower48Stream.sphere(); + alaskaStream.sphere(); + hawaiiStream.sphere(); + }, + lineStart: function() { + lower48Stream.lineStart(); + alaskaStream.lineStart(); + hawaiiStream.lineStart(); + }, + lineEnd: function() { + lower48Stream.lineEnd(); + alaskaStream.lineEnd(); + hawaiiStream.lineEnd(); + }, + polygonStart: function() { + lower48Stream.polygonStart(); + alaskaStream.polygonStart(); + hawaiiStream.polygonStart(); + }, + polygonEnd: function() { + lower48Stream.polygonEnd(); + alaskaStream.polygonEnd(); + hawaiiStream.polygonEnd(); + } + }; + }; + albersUsa.precision = function(_) { + if (!arguments.length) return lower48.precision(); + lower48.precision(_); + alaska.precision(_); + hawaii.precision(_); + return albersUsa; + }; + albersUsa.scale = function(_) { + if (!arguments.length) return lower48.scale(); + lower48.scale(_); + alaska.scale(_ * .35); + hawaii.scale(_); + return albersUsa.translate(lower48.translate()); + }; + albersUsa.translate = function(_) { + if (!arguments.length) return lower48.translate(); + var k = lower48.scale(), x = +_[0], y = +_[1]; + lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point; + alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; + hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; + return albersUsa; + }; + return albersUsa.scale(1070); + }; + var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = { + point: d3_noop, + lineStart: d3_noop, + lineEnd: d3_noop, + polygonStart: function() { + d3_geo_pathAreaPolygon = 0; + d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart; + }, + polygonEnd: function() { + d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop; + d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2); + } + }; + function d3_geo_pathAreaRingStart() { + var x00, y00, x0, y0; + d3_geo_pathArea.point = function(x, y) { + d3_geo_pathArea.point = nextPoint; + x00 = x0 = x, y00 = y0 = y; + }; + function nextPoint(x, y) { + d3_geo_pathAreaPolygon += y0 * x - x0 * y; + x0 = x, y0 = y; + } + d3_geo_pathArea.lineEnd = function() { + nextPoint(x00, y00); + }; + } + var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1; + var d3_geo_pathBounds = { + point: d3_geo_pathBoundsPoint, + lineStart: d3_noop, + lineEnd: d3_noop, + polygonStart: d3_noop, + polygonEnd: d3_noop + }; + function d3_geo_pathBoundsPoint(x, y) { + if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x; + if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x; + if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y; + if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y; + } + function d3_geo_pathBuffer() { + var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = []; + var stream = { + point: point, + lineStart: function() { + stream.point = pointLineStart; + }, + lineEnd: lineEnd, + polygonStart: function() { + stream.lineEnd = lineEndPolygon; + }, + polygonEnd: function() { + stream.lineEnd = lineEnd; + stream.point = point; + }, + pointRadius: function(_) { + pointCircle = d3_geo_pathBufferCircle(_); + return stream; + }, + result: function() { + if (buffer.length) { + var result = buffer.join(""); + buffer = []; + return result; + } + } + }; + function point(x, y) { + buffer.push("M", x, ",", y, pointCircle); + } + function pointLineStart(x, y) { + buffer.push("M", x, ",", y); + stream.point = pointLine; + } + function pointLine(x, y) { + buffer.push("L", x, ",", y); + } + function lineEnd() { + stream.point = point; + } + function lineEndPolygon() { + buffer.push("Z"); + } + return stream; + } + function d3_geo_pathBufferCircle(radius) { + return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z"; + } + var d3_geo_pathCentroid = { + point: d3_geo_pathCentroidPoint, + lineStart: d3_geo_pathCentroidLineStart, + lineEnd: d3_geo_pathCentroidLineEnd, + polygonStart: function() { + d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart; + }, + polygonEnd: function() { + d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; + d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart; + d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd; + } + }; + function d3_geo_pathCentroidPoint(x, y) { + d3_geo_centroidX0 += x; + d3_geo_centroidY0 += y; + ++d3_geo_centroidZ0; + } + function d3_geo_pathCentroidLineStart() { + var x0, y0; + d3_geo_pathCentroid.point = function(x, y) { + d3_geo_pathCentroid.point = nextPoint; + d3_geo_pathCentroidPoint(x0 = x, y0 = y); + }; + function nextPoint(x, y) { + var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); + d3_geo_centroidX1 += z * (x0 + x) / 2; + d3_geo_centroidY1 += z * (y0 + y) / 2; + d3_geo_centroidZ1 += z; + d3_geo_pathCentroidPoint(x0 = x, y0 = y); + } + } + function d3_geo_pathCentroidLineEnd() { + d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; + } + function d3_geo_pathCentroidRingStart() { + var x00, y00, x0, y0; + d3_geo_pathCentroid.point = function(x, y) { + d3_geo_pathCentroid.point = nextPoint; + d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y); + }; + function nextPoint(x, y) { + var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); + d3_geo_centroidX1 += z * (x0 + x) / 2; + d3_geo_centroidY1 += z * (y0 + y) / 2; + d3_geo_centroidZ1 += z; + z = y0 * x - x0 * y; + d3_geo_centroidX2 += z * (x0 + x); + d3_geo_centroidY2 += z * (y0 + y); + d3_geo_centroidZ2 += z * 3; + d3_geo_pathCentroidPoint(x0 = x, y0 = y); + } + d3_geo_pathCentroid.lineEnd = function() { + nextPoint(x00, y00); + }; + } + function d3_geo_pathContext(context) { + var pointRadius = 4.5; + var stream = { + point: point, + lineStart: function() { + stream.point = pointLineStart; + }, + lineEnd: lineEnd, + polygonStart: function() { + stream.lineEnd = lineEndPolygon; + }, + polygonEnd: function() { + stream.lineEnd = lineEnd; + stream.point = point; + }, + pointRadius: function(_) { + pointRadius = _; + return stream; + }, + result: d3_noop + }; + function point(x, y) { + context.moveTo(x, y); + context.arc(x, y, pointRadius, 0, τ); + } + function pointLineStart(x, y) { + context.moveTo(x, y); + stream.point = pointLine; + } + function pointLine(x, y) { + context.lineTo(x, y); + } + function lineEnd() { + stream.point = point; + } + function lineEndPolygon() { + context.closePath(); + } + return stream; + } + function d3_geo_resample(project) { + var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16; + function resample(stream) { + return (maxDepth ? resampleRecursive : resampleNone)(stream); + } + function resampleNone(stream) { + return d3_geo_transformPoint(stream, function(x, y) { + x = project(x, y); + stream.point(x[0], x[1]); + }); + } + function resampleRecursive(stream) { + var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0; + var resample = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + stream.polygonStart(); + resample.lineStart = ringStart; + }, + polygonEnd: function() { + stream.polygonEnd(); + resample.lineStart = lineStart; + } + }; + function point(x, y) { + x = project(x, y); + stream.point(x[0], x[1]); + } + function lineStart() { + x0 = NaN; + resample.point = linePoint; + stream.lineStart(); + } + function linePoint(λ, φ) { + var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ); + resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream); + stream.point(x0, y0); + } + function lineEnd() { + resample.point = point; + stream.lineEnd(); + } + function ringStart() { + lineStart(); + resample.point = ringPoint; + resample.lineEnd = ringEnd; + } + function ringPoint(λ, φ) { + linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0; + resample.point = linePoint; + } + function ringEnd() { + resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream); + resample.lineEnd = lineEnd; + lineEnd(); + } + return resample; + } + function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) { + var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy; + if (d2 > 4 * δ2 && depth--) { + var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2; + if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { + resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream); + stream.point(x2, y2); + resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream); + } + } + } + resample.precision = function(_) { + if (!arguments.length) return Math.sqrt(δ2); + maxDepth = (δ2 = _ * _) > 0 && 16; + return resample; + }; + return resample; + } + d3.geo.path = function() { + var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream; + function path(object) { + if (object) { + if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments)); + if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream); + d3.geo.stream(object, cacheStream); + } + return contextStream.result(); + } + path.area = function(object) { + d3_geo_pathAreaSum = 0; + d3.geo.stream(object, projectStream(d3_geo_pathArea)); + return d3_geo_pathAreaSum; + }; + path.centroid = function(object) { + d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; + d3.geo.stream(object, projectStream(d3_geo_pathCentroid)); + return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ]; + }; + path.bounds = function(object) { + d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity); + d3.geo.stream(object, projectStream(d3_geo_pathBounds)); + return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ]; + }; + path.projection = function(_) { + if (!arguments.length) return projection; + projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity; + return reset(); + }; + path.context = function(_) { + if (!arguments.length) return context; + contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_); + if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius); + return reset(); + }; + path.pointRadius = function(_) { + if (!arguments.length) return pointRadius; + pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_); + return path; + }; + function reset() { + cacheStream = null; + return path; + } + return path.projection(d3.geo.albersUsa()).context(null); + }; + function d3_geo_pathProjectStream(project) { + var resample = d3_geo_resample(function(x, y) { + return project([ x * d3_degrees, y * d3_degrees ]); + }); + return function(stream) { + return d3_geo_projectionRadians(resample(stream)); + }; + } + d3.geo.transform = function(methods) { + return { + stream: function(stream) { + var transform = new d3_geo_transform(stream); + for (var k in methods) transform[k] = methods[k]; + return transform; + } + }; + }; + function d3_geo_transform(stream) { + this.stream = stream; + } + d3_geo_transform.prototype = { + point: function(x, y) { + this.stream.point(x, y); + }, + 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(); + } + }; + function d3_geo_transformPoint(stream, point) { + return { + point: point, + sphere: function() { + stream.sphere(); + }, + lineStart: function() { + stream.lineStart(); + }, + lineEnd: function() { + stream.lineEnd(); + }, + polygonStart: function() { + stream.polygonStart(); + }, + polygonEnd: function() { + stream.polygonEnd(); + } + }; + } + d3.geo.projection = d3_geo_projection; + d3.geo.projectionMutator = d3_geo_projectionMutator; + function d3_geo_projection(project) { + return d3_geo_projectionMutator(function() { + return project; + })(); + } + function d3_geo_projectionMutator(projectAt) { + var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) { + x = project(x, y); + return [ x[0] * k + δx, δy - x[1] * k ]; + }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream; + function projection(point) { + point = projectRotate(point[0] * d3_radians, point[1] * d3_radians); + return [ point[0] * k + δx, δy - point[1] * k ]; + } + function invert(point) { + point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k); + return point && [ point[0] * d3_degrees, point[1] * d3_degrees ]; + } + projection.stream = function(output) { + if (stream) stream.valid = false; + stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output)))); + stream.valid = true; + return stream; + }; + projection.clipAngle = function(_) { + if (!arguments.length) return clipAngle; + preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians); + return invalidate(); + }; + projection.clipExtent = function(_) { + if (!arguments.length) return clipExtent; + clipExtent = _; + postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity; + return invalidate(); + }; + projection.scale = function(_) { + if (!arguments.length) return k; + k = +_; + return reset(); + }; + projection.translate = function(_) { + if (!arguments.length) return [ x, y ]; + x = +_[0]; + y = +_[1]; + return reset(); + }; + projection.center = function(_) { + if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ]; + λ = _[0] % 360 * d3_radians; + φ = _[1] % 360 * d3_radians; + return reset(); + }; + projection.rotate = function(_) { + if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ]; + δλ = _[0] % 360 * d3_radians; + δφ = _[1] % 360 * d3_radians; + δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0; + return reset(); + }; + d3.rebind(projection, projectResample, "precision"); + function reset() { + projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project); + var center = project(λ, φ); + δx = x - center[0] * k; + δy = y + center[1] * k; + return invalidate(); + } + function invalidate() { + if (stream) stream.valid = false, stream = null; + return projection; + } + return function() { + project = projectAt.apply(this, arguments); + projection.invert = project.invert && invert; + return reset(); + }; + } + function d3_geo_projectionRadians(stream) { + return d3_geo_transformPoint(stream, function(x, y) { + stream.point(x * d3_radians, y * d3_radians); + }); + } + function d3_geo_equirectangular(λ, φ) { + return [ λ, φ ]; + } + (d3.geo.equirectangular = function() { + return d3_geo_projection(d3_geo_equirectangular); + }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular; + d3.geo.rotation = function(rotate) { + rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0); + function forward(coordinates) { + coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians); + return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; + } + forward.invert = function(coordinates) { + coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians); + return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; + }; + return forward; + }; + function d3_geo_identityRotation(λ, φ) { + return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ]; + } + d3_geo_identityRotation.invert = d3_geo_equirectangular; + function d3_geo_rotation(δλ, δφ, δγ) { + return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation; + } + function d3_geo_forwardRotationλ(δλ) { + return function(λ, φ) { + return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ]; + }; + } + function d3_geo_rotationλ(δλ) { + var rotation = d3_geo_forwardRotationλ(δλ); + rotation.invert = d3_geo_forwardRotationλ(-δλ); + return rotation; + } + function d3_geo_rotationφγ(δφ, δγ) { + var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ); + function rotation(λ, φ) { + var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ; + return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ]; + } + rotation.invert = function(λ, φ) { + var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ; + return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ]; + }; + return rotation; + } + d3.geo.circle = function() { + var origin = [ 0, 0 ], angle, precision = 6, interpolate; + function circle() { + var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = []; + interpolate(null, null, 1, { + point: function(x, y) { + ring.push(x = rotate(x, y)); + x[0] *= d3_degrees, x[1] *= d3_degrees; + } + }); + return { + type: "Polygon", + coordinates: [ ring ] + }; + } + circle.origin = function(x) { + if (!arguments.length) return origin; + origin = x; + return circle; + }; + circle.angle = function(x) { + if (!arguments.length) return angle; + interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians); + return circle; + }; + circle.precision = function(_) { + if (!arguments.length) return precision; + interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians); + return circle; + }; + return circle.angle(90); + }; + function d3_geo_circleInterpolate(radius, precision) { + var cr = Math.cos(radius), sr = Math.sin(radius); + return function(from, to, direction, listener) { + var step = direction * precision; + if (from != null) { + from = d3_geo_circleAngle(cr, from); + to = d3_geo_circleAngle(cr, to); + if (direction > 0 ? from < to : from > to) from += direction * τ; + } else { + from = radius + direction * τ; + to = radius - .5 * step; + } + for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) { + listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]); + } + }; + } + function d3_geo_circleAngle(cr, point) { + var a = d3_geo_cartesian(point); + a[0] -= cr; + d3_geo_cartesianNormalize(a); + var angle = d3_acos(-a[1]); + return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI); + } + d3.geo.distance = function(a, b) { + var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t; + return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ); + }; + d3.geo.graticule = function() { + var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5; + function graticule() { + return { + type: "MultiLineString", + coordinates: lines() + }; + } + function lines() { + return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) { + return abs(x % DX) > ε; + }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) { + return abs(y % DY) > ε; + }).map(y)); + } + graticule.lines = function() { + return lines().map(function(coordinates) { + return { + type: "LineString", + coordinates: coordinates + }; + }); + }; + graticule.outline = function() { + return { + type: "Polygon", + coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ] + }; + }; + graticule.extent = function(_) { + if (!arguments.length) return graticule.minorExtent(); + return graticule.majorExtent(_).minorExtent(_); + }; + graticule.majorExtent = function(_) { + if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ]; + X0 = +_[0][0], X1 = +_[1][0]; + Y0 = +_[0][1], Y1 = +_[1][1]; + if (X0 > X1) _ = X0, X0 = X1, X1 = _; + if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _; + return graticule.precision(precision); + }; + graticule.minorExtent = function(_) { + if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; + x0 = +_[0][0], x1 = +_[1][0]; + y0 = +_[0][1], y1 = +_[1][1]; + if (x0 > x1) _ = x0, x0 = x1, x1 = _; + if (y0 > y1) _ = y0, y0 = y1, y1 = _; + return graticule.precision(precision); + }; + graticule.step = function(_) { + if (!arguments.length) return graticule.minorStep(); + return graticule.majorStep(_).minorStep(_); + }; + graticule.majorStep = function(_) { + if (!arguments.length) return [ DX, DY ]; + DX = +_[0], DY = +_[1]; + return graticule; + }; + graticule.minorStep = function(_) { + if (!arguments.length) return [ dx, dy ]; + dx = +_[0], dy = +_[1]; + return graticule; + }; + graticule.precision = function(_) { + if (!arguments.length) return precision; + precision = +_; + x = d3_geo_graticuleX(y0, y1, 90); + y = d3_geo_graticuleY(x0, x1, precision); + X = d3_geo_graticuleX(Y0, Y1, 90); + Y = d3_geo_graticuleY(X0, X1, precision); + return graticule; + }; + return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]); + }; + function d3_geo_graticuleX(y0, y1, dy) { + var y = d3.range(y0, y1 - ε, dy).concat(y1); + return function(x) { + return y.map(function(y) { + return [ x, y ]; + }); + }; + } + function d3_geo_graticuleY(x0, x1, dx) { + var x = d3.range(x0, x1 - ε, dx).concat(x1); + return function(y) { + return x.map(function(x) { + return [ x, y ]; + }); + }; + } + function d3_source(d) { + return d.source; + } + function d3_target(d) { + return d.target; + } + d3.geo.greatArc = function() { + var source = d3_source, source_, target = d3_target, target_; + function greatArc() { + return { + type: "LineString", + coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ] + }; + } + greatArc.distance = function() { + return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments)); + }; + greatArc.source = function(_) { + if (!arguments.length) return source; + source = _, source_ = typeof _ === "function" ? null : _; + return greatArc; + }; + greatArc.target = function(_) { + if (!arguments.length) return target; + target = _, target_ = typeof _ === "function" ? null : _; + return greatArc; + }; + greatArc.precision = function() { + return arguments.length ? greatArc : 0; + }; + return greatArc; + }; + d3.geo.interpolate = function(source, target) { + return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians); + }; + function d3_geo_interpolate(x0, y0, x1, y1) { + var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d); + var interpolate = d ? function(t) { + var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1; + return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ]; + } : function() { + return [ x0 * d3_degrees, y0 * d3_degrees ]; + }; + interpolate.distance = d; + return interpolate; + } + d3.geo.length = function(object) { + d3_geo_lengthSum = 0; + d3.geo.stream(object, d3_geo_length); + return d3_geo_lengthSum; + }; + var d3_geo_lengthSum; + var d3_geo_length = { + sphere: d3_noop, + point: d3_noop, + lineStart: d3_geo_lengthLineStart, + lineEnd: d3_noop, + polygonStart: d3_noop, + polygonEnd: d3_noop + }; + function d3_geo_lengthLineStart() { + var λ0, sinφ0, cosφ0; + d3_geo_length.point = function(λ, φ) { + λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ); + d3_geo_length.point = nextPoint; + }; + d3_geo_length.lineEnd = function() { + d3_geo_length.point = d3_geo_length.lineEnd = d3_noop; + }; + function nextPoint(λ, φ) { + var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t); + d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ); + λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ; + } + } + function d3_geo_azimuthal(scale, angle) { + function azimuthal(λ, φ) { + var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ); + return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ]; + } + azimuthal.invert = function(x, y) { + var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c); + return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ]; + }; + return azimuthal; + } + var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) { + return Math.sqrt(2 / (1 + cosλcosφ)); + }, function(ρ) { + return 2 * Math.asin(ρ / 2); + }); + (d3.geo.azimuthalEqualArea = function() { + return d3_geo_projection(d3_geo_azimuthalEqualArea); + }).raw = d3_geo_azimuthalEqualArea; + var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) { + var c = Math.acos(cosλcosφ); + return c && c / Math.sin(c); + }, d3_identity); + (d3.geo.azimuthalEquidistant = function() { + return d3_geo_projection(d3_geo_azimuthalEquidistant); + }).raw = d3_geo_azimuthalEquidistant; + function d3_geo_conicConformal(φ0, φ1) { + var cosφ0 = Math.cos(φ0), t = function(φ) { + return Math.tan(π / 4 + φ / 2); + }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n; + if (!n) return d3_geo_mercator; + function forward(λ, φ) { + if (F > 0) { + if (φ < -halfπ + ε) φ = -halfπ + ε; + } else { + if (φ > halfπ - ε) φ = halfπ - ε; + } + var ρ = F / Math.pow(t(φ), n); + return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ]; + } + forward.invert = function(x, y) { + var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y); + return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ]; + }; + return forward; + } + (d3.geo.conicConformal = function() { + return d3_geo_conic(d3_geo_conicConformal); + }).raw = d3_geo_conicConformal; + function d3_geo_conicEquidistant(φ0, φ1) { + var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0; + if (abs(n) < ε) return d3_geo_equirectangular; + function forward(λ, φ) { + var ρ = G - φ; + return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ]; + } + forward.invert = function(x, y) { + var ρ0_y = G - y; + return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ]; + }; + return forward; + } + (d3.geo.conicEquidistant = function() { + return d3_geo_conic(d3_geo_conicEquidistant); + }).raw = d3_geo_conicEquidistant; + var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) { + return 1 / cosλcosφ; + }, Math.atan); + (d3.geo.gnomonic = function() { + return d3_geo_projection(d3_geo_gnomonic); + }).raw = d3_geo_gnomonic; + function d3_geo_mercator(λ, φ) { + return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ]; + } + d3_geo_mercator.invert = function(x, y) { + return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ]; + }; + function d3_geo_mercatorProjection(project) { + var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto; + m.scale = function() { + var v = scale.apply(m, arguments); + return v === m ? clipAuto ? m.clipExtent(null) : m : v; + }; + m.translate = function() { + var v = translate.apply(m, arguments); + return v === m ? clipAuto ? m.clipExtent(null) : m : v; + }; + m.clipExtent = function(_) { + var v = clipExtent.apply(m, arguments); + if (v === m) { + if (clipAuto = _ == null) { + var k = π * scale(), t = translate(); + clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]); + } + } else if (clipAuto) { + v = null; + } + return v; + }; + return m.clipExtent(null); + } + (d3.geo.mercator = function() { + return d3_geo_mercatorProjection(d3_geo_mercator); + }).raw = d3_geo_mercator; + var d3_geo_orthographic = d3_geo_azimuthal(function() { + return 1; + }, Math.asin); + (d3.geo.orthographic = function() { + return d3_geo_projection(d3_geo_orthographic); + }).raw = d3_geo_orthographic; + var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) { + return 1 / (1 + cosλcosφ); + }, function(ρ) { + return 2 * Math.atan(ρ); + }); + (d3.geo.stereographic = function() { + return d3_geo_projection(d3_geo_stereographic); + }).raw = d3_geo_stereographic; + function d3_geo_transverseMercator(λ, φ) { + return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ]; + } + d3_geo_transverseMercator.invert = function(x, y) { + return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ]; + }; + (d3.geo.transverseMercator = function() { + var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate; + projection.center = function(_) { + return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]); + }; + projection.rotate = function(_) { + return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), + [ _[0], _[1], _[2] - 90 ]); + }; + return rotate([ 0, 0, 90 ]); + }).raw = d3_geo_transverseMercator; + d3.geom = {}; + function d3_geom_pointX(d) { + return d[0]; + } + function d3_geom_pointY(d) { + return d[1]; + } + d3.geom.hull = function(vertices) { + var x = d3_geom_pointX, y = d3_geom_pointY; + if (arguments.length) return hull(vertices); + function hull(data) { + if (data.length < 3) return []; + var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = []; + for (i = 0; i < n; i++) { + points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]); + } + points.sort(d3_geom_hullOrder); + for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]); + var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints); + var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = []; + for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]); + for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]); + return polygon; + } + hull.x = function(_) { + return arguments.length ? (x = _, hull) : x; + }; + hull.y = function(_) { + return arguments.length ? (y = _, hull) : y; + }; + return hull; + }; + function d3_geom_hullUpper(points) { + var n = points.length, hull = [ 0, 1 ], hs = 2; + for (var i = 2; i < n; i++) { + while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs; + hull[hs++] = i; + } + return hull.slice(0, hs); + } + function d3_geom_hullOrder(a, b) { + return a[0] - b[0] || a[1] - b[1]; + } + d3.geom.polygon = function(coordinates) { + d3_subclass(coordinates, d3_geom_polygonPrototype); + return coordinates; + }; + var d3_geom_polygonPrototype = d3.geom.polygon.prototype = []; + d3_geom_polygonPrototype.area = function() { + var i = -1, n = this.length, a, b = this[n - 1], area = 0; + while (++i < n) { + a = b; + b = this[i]; + area += a[1] * b[0] - a[0] * b[1]; + } + return area * .5; + }; + d3_geom_polygonPrototype.centroid = function(k) { + var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c; + if (!arguments.length) k = -1 / (6 * this.area()); + while (++i < n) { + a = b; + b = this[i]; + c = a[0] * b[1] - b[0] * a[1]; + x += (a[0] + b[0]) * c; + y += (a[1] + b[1]) * c; + } + return [ x * k, y * k ]; + }; + d3_geom_polygonPrototype.clip = function(subject) { + var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d; + while (++i < n) { + input = subject.slice(); + subject.length = 0; + b = this[i]; + c = input[(m = input.length - closed) - 1]; + j = -1; + while (++j < m) { + d = input[j]; + if (d3_geom_polygonInside(d, a, b)) { + if (!d3_geom_polygonInside(c, a, b)) { + subject.push(d3_geom_polygonIntersect(c, d, a, b)); + } + subject.push(d); + } else if (d3_geom_polygonInside(c, a, b)) { + subject.push(d3_geom_polygonIntersect(c, d, a, b)); + } + c = d; + } + if (closed) subject.push(subject[0]); + a = b; + } + return subject; + }; + function d3_geom_polygonInside(p, a, b) { + return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]); + } + function d3_geom_polygonIntersect(c, d, a, b) { + var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21); + return [ x1 + ua * x21, y1 + ua * y21 ]; + } + function d3_geom_polygonClosed(coordinates) { + var a = coordinates[0], b = coordinates[coordinates.length - 1]; + return !(a[0] - b[0] || a[1] - b[1]); + } + var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = []; + function d3_geom_voronoiBeach() { + d3_geom_voronoiRedBlackNode(this); + this.edge = this.site = this.circle = null; + } + function d3_geom_voronoiCreateBeach(site) { + var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach(); + beach.site = site; + return beach; + } + function d3_geom_voronoiDetachBeach(beach) { + d3_geom_voronoiDetachCircle(beach); + d3_geom_voronoiBeaches.remove(beach); + d3_geom_voronoiBeachPool.push(beach); + d3_geom_voronoiRedBlackNode(beach); + } + function d3_geom_voronoiRemoveBeach(beach) { + var circle = beach.circle, x = circle.x, y = circle.cy, vertex = { + x: x, + y: y + }, previous = beach.P, next = beach.N, disappearing = [ beach ]; + d3_geom_voronoiDetachBeach(beach); + var lArc = previous; + while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) { + previous = lArc.P; + disappearing.unshift(lArc); + d3_geom_voronoiDetachBeach(lArc); + lArc = previous; + } + disappearing.unshift(lArc); + d3_geom_voronoiDetachCircle(lArc); + var rArc = next; + while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) { + next = rArc.N; + disappearing.push(rArc); + d3_geom_voronoiDetachBeach(rArc); + rArc = next; + } + disappearing.push(rArc); + d3_geom_voronoiDetachCircle(rArc); + var nArcs = disappearing.length, iArc; + for (iArc = 1; iArc < nArcs; ++iArc) { + rArc = disappearing[iArc]; + lArc = disappearing[iArc - 1]; + d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex); + } + lArc = disappearing[0]; + rArc = disappearing[nArcs - 1]; + rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex); + d3_geom_voronoiAttachCircle(lArc); + d3_geom_voronoiAttachCircle(rArc); + } + function d3_geom_voronoiAddBeach(site) { + var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._; + while (node) { + dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x; + if (dxl > ε) node = node.L; else { + dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix); + if (dxr > ε) { + if (!node.R) { + lArc = node; + break; + } + node = node.R; + } else { + if (dxl > -ε) { + lArc = node.P; + rArc = node; + } else if (dxr > -ε) { + lArc = node; + rArc = node.N; + } else { + lArc = rArc = node; + } + break; + } + } + } + var newArc = d3_geom_voronoiCreateBeach(site); + d3_geom_voronoiBeaches.insert(lArc, newArc); + if (!lArc && !rArc) return; + if (lArc === rArc) { + d3_geom_voronoiDetachCircle(lArc); + rArc = d3_geom_voronoiCreateBeach(lArc.site); + d3_geom_voronoiBeaches.insert(newArc, rArc); + newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site); + d3_geom_voronoiAttachCircle(lArc); + d3_geom_voronoiAttachCircle(rArc); + return; + } + if (!rArc) { + newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site); + return; + } + d3_geom_voronoiDetachCircle(lArc); + d3_geom_voronoiDetachCircle(rArc); + var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = { + x: (cy * hb - by * hc) / d + ax, + y: (bx * hc - cx * hb) / d + ay + }; + d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex); + newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex); + rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex); + d3_geom_voronoiAttachCircle(lArc); + d3_geom_voronoiAttachCircle(rArc); + } + function d3_geom_voronoiLeftBreakPoint(arc, directrix) { + var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix; + if (!pby2) return rfocx; + var lArc = arc.P; + if (!lArc) return -Infinity; + site = lArc.site; + var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix; + if (!plby2) return lfocx; + var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2; + if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx; + return (rfocx + lfocx) / 2; + } + function d3_geom_voronoiRightBreakPoint(arc, directrix) { + var rArc = arc.N; + if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix); + var site = arc.site; + return site.y === directrix ? site.x : Infinity; + } + function d3_geom_voronoiCell(site) { + this.site = site; + this.edges = []; + } + d3_geom_voronoiCell.prototype.prepare = function() { + var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge; + while (iHalfEdge--) { + edge = halfEdges[iHalfEdge].edge; + if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1); + } + halfEdges.sort(d3_geom_voronoiHalfEdgeOrder); + return halfEdges.length; + }; + function d3_geom_voronoiCloseCells(extent) { + var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end; + while (iCell--) { + cell = cells[iCell]; + if (!cell || !cell.prepare()) continue; + halfEdges = cell.edges; + nHalfEdges = halfEdges.length; + iHalfEdge = 0; + while (iHalfEdge < nHalfEdges) { + end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y; + start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y; + if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) { + halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? { + x: x0, + y: abs(x2 - x0) < ε ? y2 : y1 + } : abs(y3 - y1) < ε && x1 - x3 > ε ? { + x: abs(y2 - y1) < ε ? x2 : x1, + y: y1 + } : abs(x3 - x1) < ε && y3 - y0 > ε ? { + x: x1, + y: abs(x2 - x1) < ε ? y2 : y0 + } : abs(y3 - y0) < ε && x3 - x0 > ε ? { + x: abs(y2 - y0) < ε ? x2 : x0, + y: y0 + } : null), cell.site, null)); + ++nHalfEdges; + } + } + } + } + function d3_geom_voronoiHalfEdgeOrder(a, b) { + return b.angle - a.angle; + } + function d3_geom_voronoiCircle() { + d3_geom_voronoiRedBlackNode(this); + this.x = this.y = this.arc = this.site = this.cy = null; + } + function d3_geom_voronoiAttachCircle(arc) { + var lArc = arc.P, rArc = arc.N; + if (!lArc || !rArc) return; + var lSite = lArc.site, cSite = arc.site, rSite = rArc.site; + if (lSite === rSite) return; + var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by; + var d = 2 * (ax * cy - ay * cx); + if (d >= -ε2) return; + var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by; + var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle(); + circle.arc = arc; + circle.site = cSite; + circle.x = x + bx; + circle.y = cy + Math.sqrt(x * x + y * y); + circle.cy = cy; + arc.circle = circle; + var before = null, node = d3_geom_voronoiCircles._; + while (node) { + if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) { + if (node.L) node = node.L; else { + before = node.P; + break; + } + } else { + if (node.R) node = node.R; else { + before = node; + break; + } + } + } + d3_geom_voronoiCircles.insert(before, circle); + if (!before) d3_geom_voronoiFirstCircle = circle; + } + function d3_geom_voronoiDetachCircle(arc) { + var circle = arc.circle; + if (circle) { + if (!circle.P) d3_geom_voronoiFirstCircle = circle.N; + d3_geom_voronoiCircles.remove(circle); + d3_geom_voronoiCirclePool.push(circle); + d3_geom_voronoiRedBlackNode(circle); + arc.circle = null; + } + } + function d3_geom_voronoiClipEdges(extent) { + var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e; + while (i--) { + e = edges[i]; + if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) { + e.a = e.b = null; + edges.splice(i, 1); + } + } + } + function d3_geom_voronoiConnectEdge(edge, extent) { + var vb = edge.b; + if (vb) return true; + var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb; + if (ry === ly) { + if (fx < x0 || fx >= x1) return; + if (lx > rx) { + if (!va) va = { + x: fx, + y: y0 + }; else if (va.y >= y1) return; + vb = { + x: fx, + y: y1 + }; + } else { + if (!va) va = { + x: fx, + y: y1 + }; else if (va.y < y0) return; + vb = { + x: fx, + y: y0 + }; + } + } else { + fm = (lx - rx) / (ry - ly); + fb = fy - fm * fx; + if (fm < -1 || fm > 1) { + if (lx > rx) { + if (!va) va = { + x: (y0 - fb) / fm, + y: y0 + }; else if (va.y >= y1) return; + vb = { + x: (y1 - fb) / fm, + y: y1 + }; + } else { + if (!va) va = { + x: (y1 - fb) / fm, + y: y1 + }; else if (va.y < y0) return; + vb = { + x: (y0 - fb) / fm, + y: y0 + }; + } + } else { + if (ly < ry) { + if (!va) va = { + x: x0, + y: fm * x0 + fb + }; else if (va.x >= x1) return; + vb = { + x: x1, + y: fm * x1 + fb + }; + } else { + if (!va) va = { + x: x1, + y: fm * x1 + fb + }; else if (va.x < x0) return; + vb = { + x: x0, + y: fm * x0 + fb + }; + } + } + } + edge.a = va; + edge.b = vb; + return true; + } + function d3_geom_voronoiEdge(lSite, rSite) { + this.l = lSite; + this.r = rSite; + this.a = this.b = null; + } + function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) { + var edge = new d3_geom_voronoiEdge(lSite, rSite); + d3_geom_voronoiEdges.push(edge); + if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va); + if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb); + d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite)); + d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite)); + return edge; + } + function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) { + var edge = new d3_geom_voronoiEdge(lSite, null); + edge.a = va; + edge.b = vb; + d3_geom_voronoiEdges.push(edge); + return edge; + } + function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) { + if (!edge.a && !edge.b) { + edge.a = vertex; + edge.l = lSite; + edge.r = rSite; + } else if (edge.l === rSite) { + edge.b = vertex; + } else { + edge.a = vertex; + } + } + function d3_geom_voronoiHalfEdge(edge, lSite, rSite) { + var va = edge.a, vb = edge.b; + this.edge = edge; + this.site = lSite; + this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y); + } + d3_geom_voronoiHalfEdge.prototype = { + start: function() { + return this.edge.l === this.site ? this.edge.a : this.edge.b; + }, + end: function() { + return this.edge.l === this.site ? this.edge.b : this.edge.a; + } + }; + function d3_geom_voronoiRedBlackTree() { + this._ = null; + } + function d3_geom_voronoiRedBlackNode(node) { + node.U = node.C = node.L = node.R = node.P = node.N = null; + } + d3_geom_voronoiRedBlackTree.prototype = { + insert: function(after, node) { + var parent, grandpa, uncle; + if (after) { + node.P = after; + node.N = after.N; + if (after.N) after.N.P = node; + after.N = node; + if (after.R) { + after = after.R; + while (after.L) after = after.L; + after.L = node; + } else { + after.R = node; + } + parent = after; + } else if (this._) { + after = d3_geom_voronoiRedBlackFirst(this._); + node.P = null; + node.N = after; + after.P = after.L = node; + parent = after; + } else { + node.P = node.N = null; + this._ = node; + parent = null; + } + node.L = node.R = null; + node.U = parent; + node.C = true; + after = node; + while (parent && parent.C) { + grandpa = parent.U; + if (parent === grandpa.L) { + uncle = grandpa.R; + if (uncle && uncle.C) { + parent.C = uncle.C = false; + grandpa.C = true; + after = grandpa; + } else { + if (after === parent.R) { + d3_geom_voronoiRedBlackRotateLeft(this, parent); + after = parent; + parent = after.U; + } + parent.C = false; + grandpa.C = true; + d3_geom_voronoiRedBlackRotateRight(this, grandpa); + } + } else { + uncle = grandpa.L; + if (uncle && uncle.C) { + parent.C = uncle.C = false; + grandpa.C = true; + after = grandpa; + } else { + if (after === parent.L) { + d3_geom_voronoiRedBlackRotateRight(this, parent); + after = parent; + parent = after.U; + } + parent.C = false; + grandpa.C = true; + d3_geom_voronoiRedBlackRotateLeft(this, grandpa); + } + } + parent = after.U; + } + this._.C = false; + }, + remove: function(node) { + if (node.N) node.N.P = node.P; + if (node.P) node.P.N = node.N; + node.N = node.P = null; + var parent = node.U, sibling, left = node.L, right = node.R, next, red; + if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right); + if (parent) { + if (parent.L === node) parent.L = next; else parent.R = next; + } else { + this._ = next; + } + if (left && right) { + red = next.C; + next.C = node.C; + next.L = left; + left.U = next; + if (next !== right) { + parent = next.U; + next.U = node.U; + node = next.R; + parent.L = node; + next.R = right; + right.U = next; + } else { + next.U = parent; + parent = next; + node = next.R; + } + } else { + red = node.C; + node = next; + } + if (node) node.U = parent; + if (red) return; + if (node && node.C) { + node.C = false; + return; + } + do { + if (node === this._) break; + if (node === parent.L) { + sibling = parent.R; + if (sibling.C) { + sibling.C = false; + parent.C = true; + d3_geom_voronoiRedBlackRotateLeft(this, parent); + sibling = parent.R; + } + if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) { + if (!sibling.R || !sibling.R.C) { + sibling.L.C = false; + sibling.C = true; + d3_geom_voronoiRedBlackRotateRight(this, sibling); + sibling = parent.R; + } + sibling.C = parent.C; + parent.C = sibling.R.C = false; + d3_geom_voronoiRedBlackRotateLeft(this, parent); + node = this._; + break; + } + } else { + sibling = parent.L; + if (sibling.C) { + sibling.C = false; + parent.C = true; + d3_geom_voronoiRedBlackRotateRight(this, parent); + sibling = parent.L; + } + if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) { + if (!sibling.L || !sibling.L.C) { + sibling.R.C = false; + sibling.C = true; + d3_geom_voronoiRedBlackRotateLeft(this, sibling); + sibling = parent.L; + } + sibling.C = parent.C; + parent.C = sibling.L.C = false; + d3_geom_voronoiRedBlackRotateRight(this, parent); + node = this._; + break; + } + } + sibling.C = true; + node = parent; + parent = parent.U; + } while (!node.C); + if (node) node.C = false; + } + }; + function d3_geom_voronoiRedBlackRotateLeft(tree, node) { + var p = node, q = node.R, parent = p.U; + if (parent) { + if (parent.L === p) parent.L = q; else parent.R = q; + } else { + tree._ = q; + } + q.U = parent; + p.U = q; + p.R = q.L; + if (p.R) p.R.U = p; + q.L = p; + } + function d3_geom_voronoiRedBlackRotateRight(tree, node) { + var p = node, q = node.L, parent = p.U; + if (parent) { + if (parent.L === p) parent.L = q; else parent.R = q; + } else { + tree._ = q; + } + q.U = parent; + p.U = q; + p.L = q.R; + if (p.L) p.L.U = p; + q.R = p; + } + function d3_geom_voronoiRedBlackFirst(node) { + while (node.L) node = node.L; + return node; + } + function d3_geom_voronoi(sites, bbox) { + var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle; + d3_geom_voronoiEdges = []; + d3_geom_voronoiCells = new Array(sites.length); + d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree(); + d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree(); + while (true) { + circle = d3_geom_voronoiFirstCircle; + if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) { + if (site.x !== x0 || site.y !== y0) { + d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site); + d3_geom_voronoiAddBeach(site); + x0 = site.x, y0 = site.y; + } + site = sites.pop(); + } else if (circle) { + d3_geom_voronoiRemoveBeach(circle.arc); + } else { + break; + } + } + if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox); + var diagram = { + cells: d3_geom_voronoiCells, + edges: d3_geom_voronoiEdges + }; + d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null; + return diagram; + } + function d3_geom_voronoiVertexOrder(a, b) { + return b.y - a.y || b.x - a.x; + } + d3.geom.voronoi = function(points) { + var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent; + if (points) return voronoi(points); + function voronoi(data) { + var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1]; + d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) { + var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) { + var s = e.start(); + return [ s.x, s.y ]; + }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : []; + polygon.point = data[i]; + }); + return polygons; + } + function sites(data) { + return data.map(function(d, i) { + return { + x: Math.round(fx(d, i) / ε) * ε, + y: Math.round(fy(d, i) / ε) * ε, + i: i + }; + }); + } + voronoi.links = function(data) { + return d3_geom_voronoi(sites(data)).edges.filter(function(edge) { + return edge.l && edge.r; + }).map(function(edge) { + return { + source: data[edge.l.i], + target: data[edge.r.i] + }; + }); + }; + voronoi.triangles = function(data) { + var triangles = []; + d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) { + var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l; + while (++j < m) { + e0 = e1; + s0 = s1; + e1 = edges[j].edge; + s1 = e1.l === site ? e1.r : e1.l; + if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) { + triangles.push([ data[i], data[s0.i], data[s1.i] ]); + } + } + }); + return triangles; + }; + voronoi.x = function(_) { + return arguments.length ? (fx = d3_functor(x = _), voronoi) : x; + }; + voronoi.y = function(_) { + return arguments.length ? (fy = d3_functor(y = _), voronoi) : y; + }; + voronoi.clipExtent = function(_) { + if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent; + clipExtent = _ == null ? d3_geom_voronoiClipExtent : _; + return voronoi; + }; + voronoi.size = function(_) { + if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1]; + return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]); + }; + return voronoi; + }; + var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ]; + function d3_geom_voronoiTriangleArea(a, b, c) { + return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y); + } + d3.geom.delaunay = function(vertices) { + return d3.geom.voronoi().triangles(vertices); + }; + d3.geom.quadtree = function(points, x1, y1, x2, y2) { + var x = d3_geom_pointX, y = d3_geom_pointY, compat; + if (compat = arguments.length) { + x = d3_geom_quadtreeCompatX; + y = d3_geom_quadtreeCompatY; + if (compat === 3) { + y2 = y1; + x2 = x1; + y1 = x1 = 0; + } + return quadtree(points); + } + function quadtree(data) { + var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_; + if (x1 != null) { + x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2; + } else { + x2_ = y2_ = -(x1_ = y1_ = Infinity); + xs = [], ys = []; + n = data.length; + if (compat) for (i = 0; i < n; ++i) { + d = data[i]; + if (d.x < x1_) x1_ = d.x; + if (d.y < y1_) y1_ = d.y; + if (d.x > x2_) x2_ = d.x; + if (d.y > y2_) y2_ = d.y; + xs.push(d.x); + ys.push(d.y); + } else for (i = 0; i < n; ++i) { + var x_ = +fx(d = data[i], i), y_ = +fy(d, i); + if (x_ < x1_) x1_ = x_; + if (y_ < y1_) y1_ = y_; + if (x_ > x2_) x2_ = x_; + if (y_ > y2_) y2_ = y_; + xs.push(x_); + ys.push(y_); + } + } + var dx = x2_ - x1_, dy = y2_ - y1_; + if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy; + function insert(n, d, x, y, x1, y1, x2, y2) { + if (isNaN(x) || isNaN(y)) return; + if (n.leaf) { + var nx = n.x, ny = n.y; + if (nx != null) { + if (abs(nx - x) + abs(ny - y) < .01) { + insertChild(n, d, x, y, x1, y1, x2, y2); + } else { + var nPoint = n.point; + n.x = n.y = n.point = null; + insertChild(n, nPoint, nx, ny, x1, y1, x2, y2); + insertChild(n, d, x, y, x1, y1, x2, y2); + } + } else { + n.x = x, n.y = y, n.point = d; + } + } else { + insertChild(n, d, x, y, x1, y1, x2, y2); + } + } + function insertChild(n, d, x, y, x1, y1, x2, y2) { + var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, right = x >= sx, bottom = y >= sy, i = (bottom << 1) + right; + n.leaf = false; + n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode()); + if (right) x1 = sx; else x2 = sx; + if (bottom) y1 = sy; else y2 = sy; + insert(n, d, x, y, x1, y1, x2, y2); + } + var root = d3_geom_quadtreeNode(); + root.add = function(d) { + insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_); + }; + root.visit = function(f) { + d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_); + }; + i = -1; + if (x1 == null) { + while (++i < n) { + insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_); + } + --i; + } else data.forEach(root.add); + xs = ys = data = d = null; + return root; + } + quadtree.x = function(_) { + return arguments.length ? (x = _, quadtree) : x; + }; + quadtree.y = function(_) { + return arguments.length ? (y = _, quadtree) : y; + }; + quadtree.extent = function(_) { + if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ]; + if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], + y2 = +_[1][1]; + return quadtree; + }; + quadtree.size = function(_) { + if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ]; + if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1]; + return quadtree; + }; + return quadtree; + }; + function d3_geom_quadtreeCompatX(d) { + return d.x; + } + function d3_geom_quadtreeCompatY(d) { + return d.y; + } + function d3_geom_quadtreeNode() { + return { + leaf: true, + nodes: [], + point: null, + x: null, + y: null + }; + } + function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) { + if (!f(node, x1, y1, x2, y2)) { + var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes; + if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy); + if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy); + if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2); + if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2); + } + } + d3.interpolateRgb = d3_interpolateRgb; + function d3_interpolateRgb(a, b) { + a = d3.rgb(a); + b = d3.rgb(b); + var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab; + return function(t) { + return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t)); + }; + } + d3.interpolateObject = d3_interpolateObject; + function d3_interpolateObject(a, b) { + var i = {}, c = {}, k; + for (k in a) { + if (k in b) { + i[k] = d3_interpolate(a[k], b[k]); + } else { + c[k] = a[k]; + } + } + for (k in b) { + if (!(k in a)) { + c[k] = b[k]; + } + } + return function(t) { + for (k in i) c[k] = i[k](t); + return c; + }; + } + d3.interpolateNumber = d3_interpolateNumber; + function d3_interpolateNumber(a, b) { + a = +a, b = +b; + return function(t) { + return a * (1 - t) + b * t; + }; + } + d3.interpolateString = d3_interpolateString; + function d3_interpolateString(a, b) { + var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = []; + a = a + "", b = b + ""; + while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) { + if ((bs = bm.index) > bi) { + bs = b.slice(bi, bs); + if (s[i]) s[i] += bs; else s[++i] = bs; + } + if ((am = am[0]) === (bm = bm[0])) { + if (s[i]) s[i] += bm; else s[++i] = bm; + } else { + s[++i] = null; + q.push({ + i: i, + x: d3_interpolateNumber(am, bm) + }); + } + bi = d3_interpolate_numberB.lastIndex; + } + if (bi < b.length) { + bs = b.slice(bi); + if (s[i]) s[i] += bs; else s[++i] = bs; + } + return s.length < 2 ? q[0] ? (b = q[0].x, function(t) { + return b(t) + ""; + }) : function() { + return b; + } : (b = q.length, function(t) { + for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }); + } + var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g"); + d3.interpolate = d3_interpolate; + function d3_interpolate(a, b) { + var i = d3.interpolators.length, f; + while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ; + return f; + } + d3.interpolators = [ function(a, b) { + var t = typeof b; + return (t === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b); + } ]; + d3.interpolateArray = d3_interpolateArray; + function d3_interpolateArray(a, b) { + var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i; + for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i])); + for (;i < na; ++i) c[i] = a[i]; + for (;i < nb; ++i) c[i] = b[i]; + return function(t) { + for (i = 0; i < n0; ++i) c[i] = x[i](t); + return c; + }; + } + var d3_ease_default = function() { + return d3_identity; + }; + var d3_ease = d3.map({ + linear: d3_ease_default, + poly: d3_ease_poly, + quad: function() { + return d3_ease_quad; + }, + cubic: function() { + return d3_ease_cubic; + }, + sin: function() { + return d3_ease_sin; + }, + exp: function() { + return d3_ease_exp; + }, + circle: function() { + return d3_ease_circle; + }, + elastic: d3_ease_elastic, + back: d3_ease_back, + bounce: function() { + return d3_ease_bounce; + } + }); + var d3_ease_mode = d3.map({ + "in": d3_identity, + out: d3_ease_reverse, + "in-out": d3_ease_reflect, + "out-in": function(f) { + return d3_ease_reflect(d3_ease_reverse(f)); + } + }); + d3.ease = function(name) { + var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in"; + t = d3_ease.get(t) || d3_ease_default; + m = d3_ease_mode.get(m) || d3_identity; + return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1)))); + }; + function d3_ease_clamp(f) { + return function(t) { + return t <= 0 ? 0 : t >= 1 ? 1 : f(t); + }; + } + function d3_ease_reverse(f) { + return function(t) { + return 1 - f(1 - t); + }; + } + function d3_ease_reflect(f) { + return function(t) { + return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t)); + }; + } + function d3_ease_quad(t) { + return t * t; + } + function d3_ease_cubic(t) { + return t * t * t; + } + function d3_ease_cubicInOut(t) { + if (t <= 0) return 0; + if (t >= 1) return 1; + var t2 = t * t, t3 = t2 * t; + return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75); + } + function d3_ease_poly(e) { + return function(t) { + return Math.pow(t, e); + }; + } + function d3_ease_sin(t) { + return 1 - Math.cos(t * halfπ); + } + function d3_ease_exp(t) { + return Math.pow(2, 10 * (t - 1)); + } + function d3_ease_circle(t) { + return 1 - Math.sqrt(1 - t * t); + } + function d3_ease_elastic(a, p) { + var s; + if (arguments.length < 2) p = .45; + if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4; + return function(t) { + return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p); + }; + } + function d3_ease_back(s) { + if (!s) s = 1.70158; + return function(t) { + return t * t * ((s + 1) * t - s); + }; + } + function d3_ease_bounce(t) { + return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375; + } + d3.interpolateHcl = d3_interpolateHcl; + function d3_interpolateHcl(a, b) { + a = d3.hcl(a); + b = d3.hcl(b); + var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al; + if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac; + if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; + return function(t) { + return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + ""; + }; + } + d3.interpolateHsl = d3_interpolateHsl; + function d3_interpolateHsl(a, b) { + a = d3.hsl(a); + b = d3.hsl(b); + var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al; + if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as; + if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; + return function(t) { + return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + ""; + }; + } + d3.interpolateLab = d3_interpolateLab; + function d3_interpolateLab(a, b) { + a = d3.lab(a); + b = d3.lab(b); + var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab; + return function(t) { + return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + ""; + }; + } + d3.interpolateRound = d3_interpolateRound; + function d3_interpolateRound(a, b) { + b -= a; + return function(t) { + return Math.round(a + b * t); + }; + } + d3.transform = function(string) { + var g = d3_document.createElementNS(d3.ns.prefix.svg, "g"); + return (d3.transform = function(string) { + if (string != null) { + g.setAttribute("transform", string); + var t = g.transform.baseVal.consolidate(); + } + return new d3_transform(t ? t.matrix : d3_transformIdentity); + })(string); + }; + function d3_transform(m) { + var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0; + if (r0[0] * r1[1] < r1[0] * r0[1]) { + r0[0] *= -1; + r0[1] *= -1; + kx *= -1; + kz *= -1; + } + this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees; + this.translate = [ m.e, m.f ]; + this.scale = [ kx, ky ]; + this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0; + } + d3_transform.prototype.toString = function() { + return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")"; + }; + function d3_transformDot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + function d3_transformNormalize(a) { + var k = Math.sqrt(d3_transformDot(a, a)); + if (k) { + a[0] /= k; + a[1] /= k; + } + return k; + } + function d3_transformCombine(a, b, k) { + a[0] += k * b[0]; + a[1] += k * b[1]; + return a; + } + var d3_transformIdentity = { + a: 1, + b: 0, + c: 0, + d: 1, + e: 0, + f: 0 + }; + d3.interpolateTransform = d3_interpolateTransform; + function d3_interpolateTransform(a, b) { + var s = [], q = [], n, A = d3.transform(a), B = d3.transform(b), ta = A.translate, tb = B.translate, ra = A.rotate, rb = B.rotate, wa = A.skew, wb = B.skew, ka = A.scale, kb = B.scale; + if (ta[0] != tb[0] || ta[1] != tb[1]) { + s.push("translate(", null, ",", null, ")"); + q.push({ + i: 1, + x: d3_interpolateNumber(ta[0], tb[0]) + }, { + i: 3, + x: d3_interpolateNumber(ta[1], tb[1]) + }); + } else if (tb[0] || tb[1]) { + s.push("translate(" + tb + ")"); + } else { + s.push(""); + } + if (ra != rb) { + if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360; + q.push({ + i: s.push(s.pop() + "rotate(", null, ")") - 2, + x: d3_interpolateNumber(ra, rb) + }); + } else if (rb) { + s.push(s.pop() + "rotate(" + rb + ")"); + } + if (wa != wb) { + q.push({ + i: s.push(s.pop() + "skewX(", null, ")") - 2, + x: d3_interpolateNumber(wa, wb) + }); + } else if (wb) { + s.push(s.pop() + "skewX(" + wb + ")"); + } + if (ka[0] != kb[0] || ka[1] != kb[1]) { + n = s.push(s.pop() + "scale(", null, ",", null, ")"); + q.push({ + i: n - 4, + x: d3_interpolateNumber(ka[0], kb[0]) + }, { + i: n - 2, + x: d3_interpolateNumber(ka[1], kb[1]) + }); + } else if (kb[0] != 1 || kb[1] != 1) { + s.push(s.pop() + "scale(" + kb + ")"); + } + n = q.length; + return function(t) { + var i = -1, o; + while (++i < n) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }; + } + function d3_uninterpolateNumber(a, b) { + b = (b -= a = +a) || 1 / b; + return function(x) { + return (x - a) / b; + }; + } + function d3_uninterpolateClamp(a, b) { + b = (b -= a = +a) || 1 / b; + return function(x) { + return Math.max(0, Math.min(1, (x - a) / b)); + }; + } + d3.layout = {}; + d3.layout.bundle = function() { + return function(links) { + var paths = [], i = -1, n = links.length; + while (++i < n) paths.push(d3_layout_bundlePath(links[i])); + return paths; + }; + }; + function d3_layout_bundlePath(link) { + var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ]; + while (start !== lca) { + start = start.parent; + points.push(start); + } + var k = points.length; + while (end !== lca) { + points.splice(k, 0, end); + end = end.parent; + } + return points; + } + function d3_layout_bundleAncestors(node) { + var ancestors = [], parent = node.parent; + while (parent != null) { + ancestors.push(node); + node = parent; + parent = parent.parent; + } + ancestors.push(node); + return ancestors; + } + function d3_layout_bundleLeastCommonAncestor(a, b) { + if (a === b) return a; + var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null; + while (aNode === bNode) { + sharedNode = aNode; + aNode = aNodes.pop(); + bNode = bNodes.pop(); + } + return sharedNode; + } + d3.layout.chord = function() { + var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords; + function relayout() { + var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j; + chords = []; + groups = []; + k = 0, i = -1; + while (++i < n) { + x = 0, j = -1; + while (++j < n) { + x += matrix[i][j]; + } + groupSums.push(x); + subgroupIndex.push(d3.range(n)); + k += x; + } + if (sortGroups) { + groupIndex.sort(function(a, b) { + return sortGroups(groupSums[a], groupSums[b]); + }); + } + if (sortSubgroups) { + subgroupIndex.forEach(function(d, i) { + d.sort(function(a, b) { + return sortSubgroups(matrix[i][a], matrix[i][b]); + }); + }); + } + k = (τ - padding * n) / k; + x = 0, i = -1; + while (++i < n) { + x0 = x, j = -1; + while (++j < n) { + var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k; + subgroups[di + "-" + dj] = { + index: di, + subindex: dj, + startAngle: a0, + endAngle: a1, + value: v + }; + } + groups[di] = { + index: di, + startAngle: x0, + endAngle: x, + value: (x - x0) / k + }; + x += padding; + } + i = -1; + while (++i < n) { + j = i - 1; + while (++j < n) { + var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i]; + if (source.value || target.value) { + chords.push(source.value < target.value ? { + source: target, + target: source + } : { + source: source, + target: target + }); + } + } + } + if (sortChords) resort(); + } + function resort() { + chords.sort(function(a, b) { + return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2); + }); + } + chord.matrix = function(x) { + if (!arguments.length) return matrix; + n = (matrix = x) && matrix.length; + chords = groups = null; + return chord; + }; + chord.padding = function(x) { + if (!arguments.length) return padding; + padding = x; + chords = groups = null; + return chord; + }; + chord.sortGroups = function(x) { + if (!arguments.length) return sortGroups; + sortGroups = x; + chords = groups = null; + return chord; + }; + chord.sortSubgroups = function(x) { + if (!arguments.length) return sortSubgroups; + sortSubgroups = x; + chords = null; + return chord; + }; + chord.sortChords = function(x) { + if (!arguments.length) return sortChords; + sortChords = x; + if (chords) resort(); + return chord; + }; + chord.chords = function() { + if (!chords) relayout(); + return chords; + }; + chord.groups = function() { + if (!groups) relayout(); + return groups; + }; + return chord; + }; + d3.layout.force = function() { + var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges; + function repulse(node) { + return function(quad, x1, _, x2) { + if (quad.point !== node) { + var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy; + if (dw * dw / theta2 < dn) { + if (dn < chargeDistance2) { + var k = quad.charge / dn; + node.px -= dx * k; + node.py -= dy * k; + } + return true; + } + if (quad.point && dn && dn < chargeDistance2) { + var k = quad.pointCharge / dn; + node.px -= dx * k; + node.py -= dy * k; + } + } + return !quad.charge; + }; + } + force.tick = function() { + if ((alpha *= .99) < .005) { + event.end({ + type: "end", + alpha: alpha = 0 + }); + return true; + } + var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y; + for (i = 0; i < m; ++i) { + o = links[i]; + s = o.source; + t = o.target; + x = t.x - s.x; + y = t.y - s.y; + if (l = x * x + y * y) { + l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l; + x *= l; + y *= l; + t.x -= x * (k = s.weight / (t.weight + s.weight)); + t.y -= y * k; + s.x += x * (k = 1 - k); + s.y += y * k; + } + } + if (k = alpha * gravity) { + x = size[0] / 2; + y = size[1] / 2; + i = -1; + if (k) while (++i < n) { + o = nodes[i]; + o.x += (x - o.x) * k; + o.y += (y - o.y) * k; + } + } + if (charge) { + d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges); + i = -1; + while (++i < n) { + if (!(o = nodes[i]).fixed) { + q.visit(repulse(o)); + } + } + } + i = -1; + while (++i < n) { + o = nodes[i]; + if (o.fixed) { + o.x = o.px; + o.y = o.py; + } else { + o.x -= (o.px - (o.px = o.x)) * friction; + o.y -= (o.py - (o.py = o.y)) * friction; + } + } + event.tick({ + type: "tick", + alpha: alpha + }); + }; + force.nodes = function(x) { + if (!arguments.length) return nodes; + nodes = x; + return force; + }; + force.links = function(x) { + if (!arguments.length) return links; + links = x; + return force; + }; + force.size = function(x) { + if (!arguments.length) return size; + size = x; + return force; + }; + force.linkDistance = function(x) { + if (!arguments.length) return linkDistance; + linkDistance = typeof x === "function" ? x : +x; + return force; + }; + force.distance = force.linkDistance; + force.linkStrength = function(x) { + if (!arguments.length) return linkStrength; + linkStrength = typeof x === "function" ? x : +x; + return force; + }; + force.friction = function(x) { + if (!arguments.length) return friction; + friction = +x; + return force; + }; + force.charge = function(x) { + if (!arguments.length) return charge; + charge = typeof x === "function" ? x : +x; + return force; + }; + force.chargeDistance = function(x) { + if (!arguments.length) return Math.sqrt(chargeDistance2); + chargeDistance2 = x * x; + return force; + }; + force.gravity = function(x) { + if (!arguments.length) return gravity; + gravity = +x; + return force; + }; + force.theta = function(x) { + if (!arguments.length) return Math.sqrt(theta2); + theta2 = x * x; + return force; + }; + force.alpha = function(x) { + if (!arguments.length) return alpha; + x = +x; + if (alpha) { + if (x > 0) alpha = x; else alpha = 0; + } else if (x > 0) { + event.start({ + type: "start", + alpha: alpha = x + }); + d3.timer(force.tick); + } + return force; + }; + force.start = function() { + var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o; + for (i = 0; i < n; ++i) { + (o = nodes[i]).index = i; + o.weight = 0; + } + for (i = 0; i < m; ++i) { + o = links[i]; + if (typeof o.source == "number") o.source = nodes[o.source]; + if (typeof o.target == "number") o.target = nodes[o.target]; + ++o.source.weight; + ++o.target.weight; + } + for (i = 0; i < n; ++i) { + o = nodes[i]; + if (isNaN(o.x)) o.x = position("x", w); + if (isNaN(o.y)) o.y = position("y", h); + if (isNaN(o.px)) o.px = o.x; + if (isNaN(o.py)) o.py = o.y; + } + distances = []; + if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance; + strengths = []; + if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength; + charges = []; + if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge; + function position(dimension, size) { + if (!neighbors) { + neighbors = new Array(n); + for (j = 0; j < n; ++j) { + neighbors[j] = []; + } + for (j = 0; j < m; ++j) { + var o = links[j]; + neighbors[o.source.index].push(o.target); + neighbors[o.target.index].push(o.source); + } + } + var candidates = neighbors[i], j = -1, m = candidates.length, x; + while (++j < m) if (!isNaN(x = candidates[j][dimension])) return x; + return Math.random() * size; + } + return force.resume(); + }; + force.resume = function() { + return force.alpha(.1); + }; + force.stop = function() { + return force.alpha(0); + }; + force.drag = function() { + if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend); + if (!arguments.length) return drag; + this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag); + }; + function dragmove(d) { + d.px = d3.event.x, d.py = d3.event.y; + force.resume(); + } + return d3.rebind(force, event, "on"); + }; + function d3_layout_forceDragstart(d) { + d.fixed |= 2; + } + function d3_layout_forceDragend(d) { + d.fixed &= ~6; + } + function d3_layout_forceMouseover(d) { + d.fixed |= 4; + d.px = d.x, d.py = d.y; + } + function d3_layout_forceMouseout(d) { + d.fixed &= ~4; + } + function d3_layout_forceAccumulate(quad, alpha, charges) { + var cx = 0, cy = 0; + quad.charge = 0; + if (!quad.leaf) { + var nodes = quad.nodes, n = nodes.length, i = -1, c; + while (++i < n) { + c = nodes[i]; + if (c == null) continue; + d3_layout_forceAccumulate(c, alpha, charges); + quad.charge += c.charge; + cx += c.charge * c.cx; + cy += c.charge * c.cy; + } + } + if (quad.point) { + if (!quad.leaf) { + quad.point.x += Math.random() - .5; + quad.point.y += Math.random() - .5; + } + var k = alpha * charges[quad.point.index]; + quad.charge += quad.pointCharge = k; + cx += k * quad.point.x; + cy += k * quad.point.y; + } + quad.cx = cx / quad.charge; + quad.cy = cy / quad.charge; + } + var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity; + d3.layout.hierarchy = function() { + var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue; + function hierarchy(root) { + var stack = [ root ], nodes = [], node; + root.depth = 0; + while ((node = stack.pop()) != null) { + nodes.push(node); + if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) { + var n, childs, child; + while (--n >= 0) { + stack.push(child = childs[n]); + child.parent = node; + child.depth = node.depth + 1; + } + if (value) node.value = 0; + node.children = childs; + } else { + if (value) node.value = +value.call(hierarchy, node, node.depth) || 0; + delete node.children; + } + } + d3_layout_hierarchyVisitAfter(root, function(node) { + var childs, parent; + if (sort && (childs = node.children)) childs.sort(sort); + if (value && (parent = node.parent)) parent.value += node.value; + }); + return nodes; + } + hierarchy.sort = function(x) { + if (!arguments.length) return sort; + sort = x; + return hierarchy; + }; + hierarchy.children = function(x) { + if (!arguments.length) return children; + children = x; + return hierarchy; + }; + hierarchy.value = function(x) { + if (!arguments.length) return value; + value = x; + return hierarchy; + }; + hierarchy.revalue = function(root) { + if (value) { + d3_layout_hierarchyVisitBefore(root, function(node) { + if (node.children) node.value = 0; + }); + d3_layout_hierarchyVisitAfter(root, function(node) { + var parent; + if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0; + if (parent = node.parent) parent.value += node.value; + }); + } + return root; + }; + return hierarchy; + }; + function d3_layout_hierarchyRebind(object, hierarchy) { + d3.rebind(object, hierarchy, "sort", "children", "value"); + object.nodes = object; + object.links = d3_layout_hierarchyLinks; + return object; + } + function d3_layout_hierarchyVisitBefore(node, callback) { + var nodes = [ node ]; + while ((node = nodes.pop()) != null) { + callback(node); + if ((children = node.children) && (n = children.length)) { + var n, children; + while (--n >= 0) nodes.push(children[n]); + } + } + } + function d3_layout_hierarchyVisitAfter(node, callback) { + var nodes = [ node ], nodes2 = []; + while ((node = nodes.pop()) != null) { + nodes2.push(node); + if ((children = node.children) && (n = children.length)) { + var i = -1, n, children; + while (++i < n) nodes.push(children[i]); + } + } + while ((node = nodes2.pop()) != null) { + callback(node); + } + } + function d3_layout_hierarchyChildren(d) { + return d.children; + } + function d3_layout_hierarchyValue(d) { + return d.value; + } + function d3_layout_hierarchySort(a, b) { + return b.value - a.value; + } + function d3_layout_hierarchyLinks(nodes) { + return d3.merge(nodes.map(function(parent) { + return (parent.children || []).map(function(child) { + return { + source: parent, + target: child + }; + }); + })); + } + d3.layout.partition = function() { + var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ]; + function position(node, x, dx, dy) { + var children = node.children; + node.x = x; + node.y = node.depth * dy; + node.dx = dx; + node.dy = dy; + if (children && (n = children.length)) { + var i = -1, n, c, d; + dx = node.value ? dx / node.value : 0; + while (++i < n) { + position(c = children[i], x, d = c.value * dx, dy); + x += d; + } + } + } + function depth(node) { + var children = node.children, d = 0; + if (children && (n = children.length)) { + var i = -1, n; + while (++i < n) d = Math.max(d, depth(children[i])); + } + return 1 + d; + } + function partition(d, i) { + var nodes = hierarchy.call(this, d, i); + position(nodes[0], 0, size[0], size[1] / depth(nodes[0])); + return nodes; + } + partition.size = function(x) { + if (!arguments.length) return size; + size = x; + return partition; + }; + return d3_layout_hierarchyRebind(partition, hierarchy); + }; + d3.layout.pie = function() { + var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ; + function pie(data) { + var values = data.map(function(d, i) { + return +value.call(pie, d, i); + }); + var a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle); + var k = ((typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a) / d3.sum(values); + var index = d3.range(data.length); + if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) { + return values[j] - values[i]; + } : function(i, j) { + return sort(data[i], data[j]); + }); + var arcs = []; + index.forEach(function(i) { + var d; + arcs[i] = { + data: data[i], + value: d = values[i], + startAngle: a, + endAngle: a += d * k + }; + }); + return arcs; + } + pie.value = function(x) { + if (!arguments.length) return value; + value = x; + return pie; + }; + pie.sort = function(x) { + if (!arguments.length) return sort; + sort = x; + return pie; + }; + pie.startAngle = function(x) { + if (!arguments.length) return startAngle; + startAngle = x; + return pie; + }; + pie.endAngle = function(x) { + if (!arguments.length) return endAngle; + endAngle = x; + return pie; + }; + return pie; + }; + var d3_layout_pieSortByValue = {}; + d3.layout.stack = function() { + var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY; + function stack(data, index) { + if (!(n = data.length)) return data; + var series = data.map(function(d, i) { + return values.call(stack, d, i); + }); + var points = series.map(function(d) { + return d.map(function(v, i) { + return [ x.call(stack, v, i), y.call(stack, v, i) ]; + }); + }); + var orders = order.call(stack, points, index); + series = d3.permute(series, orders); + points = d3.permute(points, orders); + var offsets = offset.call(stack, points, index); + var m = series[0].length, n, i, j, o; + for (j = 0; j < m; ++j) { + out.call(stack, series[0][j], o = offsets[j], points[0][j][1]); + for (i = 1; i < n; ++i) { + out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]); + } + } + return data; + } + stack.values = function(x) { + if (!arguments.length) return values; + values = x; + return stack; + }; + stack.order = function(x) { + if (!arguments.length) return order; + order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault; + return stack; + }; + stack.offset = function(x) { + if (!arguments.length) return offset; + offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero; + return stack; + }; + stack.x = function(z) { + if (!arguments.length) return x; + x = z; + return stack; + }; + stack.y = function(z) { + if (!arguments.length) return y; + y = z; + return stack; + }; + stack.out = function(z) { + if (!arguments.length) return out; + out = z; + return stack; + }; + return stack; + }; + function d3_layout_stackX(d) { + return d.x; + } + function d3_layout_stackY(d) { + return d.y; + } + function d3_layout_stackOut(d, y0, y) { + d.y0 = y0; + d.y = y; + } + var d3_layout_stackOrders = d3.map({ + "inside-out": function(data) { + var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) { + return max[a] - max[b]; + }), top = 0, bottom = 0, tops = [], bottoms = []; + for (i = 0; i < n; ++i) { + j = index[i]; + if (top < bottom) { + top += sums[j]; + tops.push(j); + } else { + bottom += sums[j]; + bottoms.push(j); + } + } + return bottoms.reverse().concat(tops); + }, + reverse: function(data) { + return d3.range(data.length).reverse(); + }, + "default": d3_layout_stackOrderDefault + }); + var d3_layout_stackOffsets = d3.map({ + silhouette: function(data) { + var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = []; + for (j = 0; j < m; ++j) { + for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; + if (o > max) max = o; + sums.push(o); + } + for (j = 0; j < m; ++j) { + y0[j] = (max - sums[j]) / 2; + } + return y0; + }, + wiggle: function(data) { + var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = []; + y0[0] = o = o0 = 0; + for (j = 1; j < m; ++j) { + for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1]; + for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) { + for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) { + s3 += (data[k][j][1] - data[k][j - 1][1]) / dx; + } + s2 += s3 * data[i][j][1]; + } + y0[j] = o -= s1 ? s2 / s1 * dx : 0; + if (o < o0) o0 = o; + } + for (j = 0; j < m; ++j) y0[j] -= o0; + return y0; + }, + expand: function(data) { + var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = []; + for (j = 0; j < m; ++j) { + for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; + if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k; + } + for (j = 0; j < m; ++j) y0[j] = 0; + return y0; + }, + zero: d3_layout_stackOffsetZero + }); + function d3_layout_stackOrderDefault(data) { + return d3.range(data.length); + } + function d3_layout_stackOffsetZero(data) { + var j = -1, m = data[0].length, y0 = []; + while (++j < m) y0[j] = 0; + return y0; + } + function d3_layout_stackMaxIndex(array) { + var i = 1, j = 0, v = array[0][1], k, n = array.length; + for (;i < n; ++i) { + if ((k = array[i][1]) > v) { + j = i; + v = k; + } + } + return j; + } + function d3_layout_stackReduceSum(d) { + return d.reduce(d3_layout_stackSum, 0); + } + function d3_layout_stackSum(p, d) { + return p + d[1]; + } + d3.layout.histogram = function() { + var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges; + function histogram(data, i) { + var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x; + while (++i < m) { + bin = bins[i] = []; + bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]); + bin.y = 0; + } + if (m > 0) { + i = -1; + while (++i < n) { + x = values[i]; + if (x >= range[0] && x <= range[1]) { + bin = bins[d3.bisect(thresholds, x, 1, m) - 1]; + bin.y += k; + bin.push(data[i]); + } + } + } + return bins; + } + histogram.value = function(x) { + if (!arguments.length) return valuer; + valuer = x; + return histogram; + }; + histogram.range = function(x) { + if (!arguments.length) return ranger; + ranger = d3_functor(x); + return histogram; + }; + histogram.bins = function(x) { + if (!arguments.length) return binner; + binner = typeof x === "number" ? function(range) { + return d3_layout_histogramBinFixed(range, x); + } : d3_functor(x); + return histogram; + }; + histogram.frequency = function(x) { + if (!arguments.length) return frequency; + frequency = !!x; + return histogram; + }; + return histogram; + }; + function d3_layout_histogramBinSturges(range, values) { + return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1)); + } + function d3_layout_histogramBinFixed(range, n) { + var x = -1, b = +range[0], m = (range[1] - b) / n, f = []; + while (++x <= n) f[x] = m * x + b; + return f; + } + function d3_layout_histogramRange(values) { + return [ d3.min(values), d3.max(values) ]; + } + d3.layout.pack = function() { + var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius; + function pack(d, i) { + var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() { + return radius; + }; + root.x = root.y = 0; + d3_layout_hierarchyVisitAfter(root, function(d) { + d.r = +r(d.value); + }); + d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings); + if (padding) { + var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2; + d3_layout_hierarchyVisitAfter(root, function(d) { + d.r += dr; + }); + d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings); + d3_layout_hierarchyVisitAfter(root, function(d) { + d.r -= dr; + }); + } + d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h)); + return nodes; + } + pack.size = function(_) { + if (!arguments.length) return size; + size = _; + return pack; + }; + pack.radius = function(_) { + if (!arguments.length) return radius; + radius = _ == null || typeof _ === "function" ? _ : +_; + return pack; + }; + pack.padding = function(_) { + if (!arguments.length) return padding; + padding = +_; + return pack; + }; + return d3_layout_hierarchyRebind(pack, hierarchy); + }; + function d3_layout_packSort(a, b) { + return a.value - b.value; + } + function d3_layout_packInsert(a, b) { + var c = a._pack_next; + a._pack_next = b; + b._pack_prev = a; + b._pack_next = c; + c._pack_prev = b; + } + function d3_layout_packSplice(a, b) { + a._pack_next = b; + b._pack_prev = a; + } + function d3_layout_packIntersects(a, b) { + var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r; + return .999 * dr * dr > dx * dx + dy * dy; + } + function d3_layout_packSiblings(node) { + if (!(nodes = node.children) || !(n = nodes.length)) return; + var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n; + function bound(node) { + xMin = Math.min(node.x - node.r, xMin); + xMax = Math.max(node.x + node.r, xMax); + yMin = Math.min(node.y - node.r, yMin); + yMax = Math.max(node.y + node.r, yMax); + } + nodes.forEach(d3_layout_packLink); + a = nodes[0]; + a.x = -a.r; + a.y = 0; + bound(a); + if (n > 1) { + b = nodes[1]; + b.x = b.r; + b.y = 0; + bound(b); + if (n > 2) { + c = nodes[2]; + d3_layout_packPlace(a, b, c); + bound(c); + d3_layout_packInsert(a, c); + a._pack_prev = c; + d3_layout_packInsert(c, b); + b = a._pack_next; + for (i = 3; i < n; i++) { + d3_layout_packPlace(a, b, c = nodes[i]); + var isect = 0, s1 = 1, s2 = 1; + for (j = b._pack_next; j !== b; j = j._pack_next, s1++) { + if (d3_layout_packIntersects(j, c)) { + isect = 1; + break; + } + } + if (isect == 1) { + for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) { + if (d3_layout_packIntersects(k, c)) { + break; + } + } + } + if (isect) { + if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b); + i--; + } else { + d3_layout_packInsert(a, c); + b = c; + bound(c); + } + } + } + } + var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0; + for (i = 0; i < n; i++) { + c = nodes[i]; + c.x -= cx; + c.y -= cy; + cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y)); + } + node.r = cr; + nodes.forEach(d3_layout_packUnlink); + } + function d3_layout_packLink(node) { + node._pack_next = node._pack_prev = node; + } + function d3_layout_packUnlink(node) { + delete node._pack_next; + delete node._pack_prev; + } + function d3_layout_packTransform(node, x, y, k) { + var children = node.children; + node.x = x += k * node.x; + node.y = y += k * node.y; + node.r *= k; + if (children) { + var i = -1, n = children.length; + while (++i < n) d3_layout_packTransform(children[i], x, y, k); + } + } + function d3_layout_packPlace(a, b, c) { + var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y; + if (db && (dx || dy)) { + var da = b.r + c.r, dc = dx * dx + dy * dy; + da *= da; + db *= db; + var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc); + c.x = a.x + x * dx + y * dy; + c.y = a.y + x * dy - y * dx; + } else { + c.x = a.x + db; + c.y = a.y; + } + } + d3.layout.tree = function() { + var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null; + function tree(d, i) { + var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0); + d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z; + d3_layout_hierarchyVisitBefore(root1, secondWalk); + if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else { + var left = root0, right = root0, bottom = root0; + d3_layout_hierarchyVisitBefore(root0, function(node) { + if (node.x < left.x) left = node; + if (node.x > right.x) right = node; + if (node.depth > bottom.depth) bottom = node; + }); + var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1); + d3_layout_hierarchyVisitBefore(root0, function(node) { + node.x = (node.x + tx) * kx; + node.y = node.depth * ky; + }); + } + return nodes; + } + function wrapTree(root0) { + var root1 = { + A: null, + children: [ root0 ] + }, queue = [ root1 ], node1; + while ((node1 = queue.pop()) != null) { + for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) { + queue.push((children[i] = child = { + _: children[i], + parent: node1, + children: (child = children[i].children) && child.slice() || [], + A: null, + a: null, + z: 0, + m: 0, + c: 0, + s: 0, + t: null, + i: i + }).a = child); + } + } + return root1.children[0]; + } + function firstWalk(v) { + var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null; + if (children.length) { + d3_layout_treeShift(v); + var midpoint = (children[0].z + children[children.length - 1].z) / 2; + if (w) { + v.z = w.z + separation(v._, w._); + v.m = v.z - midpoint; + } else { + v.z = midpoint; + } + } else if (w) { + v.z = w.z + separation(v._, w._); + } + v.parent.A = apportion(v, w, v.parent.A || siblings[0]); + } + function secondWalk(v) { + v._.x = v.z + v.parent.m; + v.m += v.parent.m; + } + function apportion(v, w, ancestor) { + if (w) { + var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift; + while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) { + vom = d3_layout_treeLeft(vom); + vop = d3_layout_treeRight(vop); + vop.a = v; + shift = vim.z + sim - vip.z - sip + separation(vim._, vip._); + if (shift > 0) { + d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift); + sip += shift; + sop += shift; + } + sim += vim.m; + sip += vip.m; + som += vom.m; + sop += vop.m; + } + if (vim && !d3_layout_treeRight(vop)) { + vop.t = vim; + vop.m += sim - sop; + } + if (vip && !d3_layout_treeLeft(vom)) { + vom.t = vip; + vom.m += sip - som; + ancestor = v; + } + } + return ancestor; + } + function sizeNode(node) { + node.x *= size[0]; + node.y = node.depth * size[1]; + } + tree.separation = function(x) { + if (!arguments.length) return separation; + separation = x; + return tree; + }; + tree.size = function(x) { + if (!arguments.length) return nodeSize ? null : size; + nodeSize = (size = x) == null ? sizeNode : null; + return tree; + }; + tree.nodeSize = function(x) { + if (!arguments.length) return nodeSize ? size : null; + nodeSize = (size = x) == null ? null : sizeNode; + return tree; + }; + return d3_layout_hierarchyRebind(tree, hierarchy); + }; + function d3_layout_treeSeparation(a, b) { + return a.parent == b.parent ? 1 : 2; + } + function d3_layout_treeLeft(v) { + var children = v.children; + return children.length ? children[0] : v.t; + } + function d3_layout_treeRight(v) { + var children = v.children, n; + return (n = children.length) ? children[n - 1] : v.t; + } + function d3_layout_treeMove(wm, wp, shift) { + var change = shift / (wp.i - wm.i); + wp.c -= change; + wp.s += shift; + wm.c += change; + wp.z += shift; + wp.m += shift; + } + function d3_layout_treeShift(v) { + var shift = 0, change = 0, children = v.children, i = children.length, w; + while (--i >= 0) { + w = children[i]; + w.z += shift; + w.m += shift; + shift += w.s + (change += w.c); + } + } + function d3_layout_treeAncestor(vim, v, ancestor) { + return vim.a.parent === v.parent ? vim.a : ancestor; + } + d3.layout.cluster = function() { + var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false; + function cluster(d, i) { + var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0; + d3_layout_hierarchyVisitAfter(root, function(node) { + var children = node.children; + if (children && children.length) { + node.x = d3_layout_clusterX(children); + node.y = d3_layout_clusterY(children); + } else { + node.x = previousNode ? x += separation(node, previousNode) : 0; + node.y = 0; + previousNode = node; + } + }); + var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2; + d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) { + node.x = (node.x - root.x) * size[0]; + node.y = (root.y - node.y) * size[1]; + } : function(node) { + node.x = (node.x - x0) / (x1 - x0) * size[0]; + node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1]; + }); + return nodes; + } + cluster.separation = function(x) { + if (!arguments.length) return separation; + separation = x; + return cluster; + }; + cluster.size = function(x) { + if (!arguments.length) return nodeSize ? null : size; + nodeSize = (size = x) == null; + return cluster; + }; + cluster.nodeSize = function(x) { + if (!arguments.length) return nodeSize ? size : null; + nodeSize = (size = x) != null; + return cluster; + }; + return d3_layout_hierarchyRebind(cluster, hierarchy); + }; + function d3_layout_clusterY(children) { + return 1 + d3.max(children, function(child) { + return child.y; + }); + } + function d3_layout_clusterX(children) { + return children.reduce(function(x, child) { + return x + child.x; + }, 0) / children.length; + } + function d3_layout_clusterLeft(node) { + var children = node.children; + return children && children.length ? d3_layout_clusterLeft(children[0]) : node; + } + function d3_layout_clusterRight(node) { + var children = node.children, n; + return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node; + } + d3.layout.treemap = function() { + var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5)); + function scale(children, k) { + var i = -1, n = children.length, child, area; + while (++i < n) { + area = (child = children[i]).value * (k < 0 ? 0 : k); + child.area = isNaN(area) || area <= 0 ? 0 : area; + } + } + function squarify(node) { + var children = node.children; + if (children && children.length) { + var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n; + scale(remaining, rect.dx * rect.dy / node.value); + row.area = 0; + while ((n = remaining.length) > 0) { + row.push(child = remaining[n - 1]); + row.area += child.area; + if (mode !== "squarify" || (score = worst(row, u)) <= best) { + remaining.pop(); + best = score; + } else { + row.area -= row.pop().area; + position(row, u, rect, false); + u = Math.min(rect.dx, rect.dy); + row.length = row.area = 0; + best = Infinity; + } + } + if (row.length) { + position(row, u, rect, true); + row.length = row.area = 0; + } + children.forEach(squarify); + } + } + function stickify(node) { + var children = node.children; + if (children && children.length) { + var rect = pad(node), remaining = children.slice(), child, row = []; + scale(remaining, rect.dx * rect.dy / node.value); + row.area = 0; + while (child = remaining.pop()) { + row.push(child); + row.area += child.area; + if (child.z != null) { + position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length); + row.length = row.area = 0; + } + } + children.forEach(stickify); + } + } + function worst(row, u) { + var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length; + while (++i < n) { + if (!(r = row[i].area)) continue; + if (r < rmin) rmin = r; + if (r > rmax) rmax = r; + } + s *= s; + u *= u; + return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity; + } + function position(row, u, rect, flush) { + var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o; + if (u == rect.dx) { + if (flush || v > rect.dy) v = rect.dy; + while (++i < n) { + o = row[i]; + o.x = x; + o.y = y; + o.dy = v; + x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0); + } + o.z = true; + o.dx += rect.x + rect.dx - x; + rect.y += v; + rect.dy -= v; + } else { + if (flush || v > rect.dx) v = rect.dx; + while (++i < n) { + o = row[i]; + o.x = x; + o.y = y; + o.dx = v; + y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0); + } + o.z = false; + o.dy += rect.y + rect.dy - y; + rect.x += v; + rect.dx -= v; + } + } + function treemap(d) { + var nodes = stickies || hierarchy(d), root = nodes[0]; + root.x = 0; + root.y = 0; + root.dx = size[0]; + root.dy = size[1]; + if (stickies) hierarchy.revalue(root); + scale([ root ], root.dx * root.dy / root.value); + (stickies ? stickify : squarify)(root); + if (sticky) stickies = nodes; + return nodes; + } + treemap.size = function(x) { + if (!arguments.length) return size; + size = x; + return treemap; + }; + treemap.padding = function(x) { + if (!arguments.length) return padding; + function padFunction(node) { + var p = x.call(treemap, node, node.depth); + return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p); + } + function padConstant(node) { + return d3_layout_treemapPad(node, x); + } + var type; + pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ], + padConstant) : padConstant; + return treemap; + }; + treemap.round = function(x) { + if (!arguments.length) return round != Number; + round = x ? Math.round : Number; + return treemap; + }; + treemap.sticky = function(x) { + if (!arguments.length) return sticky; + sticky = x; + stickies = null; + return treemap; + }; + treemap.ratio = function(x) { + if (!arguments.length) return ratio; + ratio = x; + return treemap; + }; + treemap.mode = function(x) { + if (!arguments.length) return mode; + mode = x + ""; + return treemap; + }; + return d3_layout_hierarchyRebind(treemap, hierarchy); + }; + function d3_layout_treemapPadNull(node) { + return { + x: node.x, + y: node.y, + dx: node.dx, + dy: node.dy + }; + } + function d3_layout_treemapPad(node, padding) { + var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2]; + if (dx < 0) { + x += dx / 2; + dx = 0; + } + if (dy < 0) { + y += dy / 2; + dy = 0; + } + return { + x: x, + y: y, + dx: dx, + dy: dy + }; + } + d3.random = { + normal: function(µ, σ) { + var n = arguments.length; + if (n < 2) σ = 1; + if (n < 1) µ = 0; + return function() { + var x, y, r; + do { + x = Math.random() * 2 - 1; + y = Math.random() * 2 - 1; + r = x * x + y * y; + } while (!r || r > 1); + return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r); + }; + }, + logNormal: function() { + var random = d3.random.normal.apply(d3, arguments); + return function() { + return Math.exp(random()); + }; + }, + bates: function(m) { + var random = d3.random.irwinHall(m); + return function() { + return random() / m; + }; + }, + irwinHall: function(m) { + return function() { + for (var s = 0, j = 0; j < m; j++) s += Math.random(); + return s; + }; + } + }; + d3.scale = {}; + function d3_scaleExtent(domain) { + var start = domain[0], stop = domain[domain.length - 1]; + return start < stop ? [ start, stop ] : [ stop, start ]; + } + function d3_scaleRange(scale) { + return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range()); + } + function d3_scale_bilinear(domain, range, uninterpolate, interpolate) { + var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]); + return function(x) { + return i(u(x)); + }; + } + function d3_scale_nice(domain, nice) { + var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx; + if (x1 < x0) { + dx = i0, i0 = i1, i1 = dx; + dx = x0, x0 = x1, x1 = dx; + } + domain[i0] = nice.floor(x0); + domain[i1] = nice.ceil(x1); + return domain; + } + function d3_scale_niceStep(step) { + return step ? { + floor: function(x) { + return Math.floor(x / step) * step; + }, + ceil: function(x) { + return Math.ceil(x / step) * step; + } + } : d3_scale_niceIdentity; + } + var d3_scale_niceIdentity = { + floor: d3_identity, + ceil: d3_identity + }; + function d3_scale_polylinear(domain, range, uninterpolate, interpolate) { + var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1; + if (domain[k] < domain[0]) { + domain = domain.slice().reverse(); + range = range.slice().reverse(); + } + while (++j <= k) { + u.push(uninterpolate(domain[j - 1], domain[j])); + i.push(interpolate(range[j - 1], range[j])); + } + return function(x) { + var j = d3.bisect(domain, x, 1, k) - 1; + return i[j](u[j](x)); + }; + } + d3.scale.linear = function() { + return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false); + }; + function d3_scale_linear(domain, range, interpolate, clamp) { + var output, input; + function rescale() { + var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber; + output = linear(domain, range, uninterpolate, interpolate); + input = linear(range, domain, uninterpolate, d3_interpolate); + return scale; + } + function scale(x) { + return output(x); + } + scale.invert = function(y) { + return input(y); + }; + scale.domain = function(x) { + if (!arguments.length) return domain; + domain = x.map(Number); + return rescale(); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + return rescale(); + }; + scale.rangeRound = function(x) { + return scale.range(x).interpolate(d3_interpolateRound); + }; + scale.clamp = function(x) { + if (!arguments.length) return clamp; + clamp = x; + return rescale(); + }; + scale.interpolate = function(x) { + if (!arguments.length) return interpolate; + interpolate = x; + return rescale(); + }; + scale.ticks = function(m) { + return d3_scale_linearTicks(domain, m); + }; + scale.tickFormat = function(m, format) { + return d3_scale_linearTickFormat(domain, m, format); + }; + scale.nice = function(m) { + d3_scale_linearNice(domain, m); + return rescale(); + }; + scale.copy = function() { + return d3_scale_linear(domain, range, interpolate, clamp); + }; + return rescale(); + } + function d3_scale_linearRebind(scale, linear) { + return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp"); + } + function d3_scale_linearNice(domain, m) { + return d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2])); + } + function d3_scale_linearTickRange(domain, m) { + if (m == null) m = 10; + var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step; + if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2; + extent[0] = Math.ceil(extent[0] / step) * step; + extent[1] = Math.floor(extent[1] / step) * step + step * .5; + extent[2] = step; + return extent; + } + function d3_scale_linearTicks(domain, m) { + return d3.range.apply(d3, d3_scale_linearTickRange(domain, m)); + } + function d3_scale_linearTickFormat(domain, m, format) { + var range = d3_scale_linearTickRange(domain, m); + if (format) { + var match = d3_format_re.exec(format); + match.shift(); + if (match[8] === "s") { + var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1]))); + if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2])); + match[8] = "f"; + format = d3.format(match.join("")); + return function(d) { + return format(prefix.scale(d)) + prefix.symbol; + }; + } + if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range); + format = match.join(""); + } else { + format = ",." + d3_scale_linearPrecision(range[2]) + "f"; + } + return d3.format(format); + } + var d3_scale_linearFormatSignificant = { + s: 1, + g: 1, + p: 1, + r: 1, + e: 1 + }; + function d3_scale_linearPrecision(value) { + return -Math.floor(Math.log(value) / Math.LN10 + .01); + } + function d3_scale_linearFormatPrecision(type, range) { + var p = d3_scale_linearPrecision(range[2]); + return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2; + } + d3.scale.log = function() { + return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]); + }; + function d3_scale_log(linear, base, positive, domain) { + function log(x) { + return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base); + } + function pow(x) { + return positive ? Math.pow(base, x) : -Math.pow(base, -x); + } + function scale(x) { + return linear(log(x)); + } + scale.invert = function(x) { + return pow(linear.invert(x)); + }; + scale.domain = function(x) { + if (!arguments.length) return domain; + positive = x[0] >= 0; + linear.domain((domain = x.map(Number)).map(log)); + return scale; + }; + scale.base = function(_) { + if (!arguments.length) return base; + base = +_; + linear.domain(domain.map(log)); + return scale; + }; + scale.nice = function() { + var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative); + linear.domain(niced); + domain = niced.map(pow); + return scale; + }; + scale.ticks = function() { + var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base; + if (isFinite(j - i)) { + if (positive) { + for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k); + ticks.push(pow(i)); + } else { + ticks.push(pow(i)); + for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k); + } + for (i = 0; ticks[i] < u; i++) {} + for (j = ticks.length; ticks[j - 1] > v; j--) {} + ticks = ticks.slice(i, j); + } + return ticks; + }; + scale.tickFormat = function(n, format) { + if (!arguments.length) return d3_scale_logFormat; + if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format); + var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12, + Math.floor), e; + return function(d) { + return d / pow(f(log(d) + e)) <= k ? format(d) : ""; + }; + }; + scale.copy = function() { + return d3_scale_log(linear.copy(), base, positive, domain); + }; + return d3_scale_linearRebind(scale, linear); + } + var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = { + floor: function(x) { + return -Math.ceil(-x); + }, + ceil: function(x) { + return -Math.floor(-x); + } + }; + d3.scale.pow = function() { + return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]); + }; + function d3_scale_pow(linear, exponent, domain) { + var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent); + function scale(x) { + return linear(powp(x)); + } + scale.invert = function(x) { + return powb(linear.invert(x)); + }; + scale.domain = function(x) { + if (!arguments.length) return domain; + linear.domain((domain = x.map(Number)).map(powp)); + return scale; + }; + scale.ticks = function(m) { + return d3_scale_linearTicks(domain, m); + }; + scale.tickFormat = function(m, format) { + return d3_scale_linearTickFormat(domain, m, format); + }; + scale.nice = function(m) { + return scale.domain(d3_scale_linearNice(domain, m)); + }; + scale.exponent = function(x) { + if (!arguments.length) return exponent; + powp = d3_scale_powPow(exponent = x); + powb = d3_scale_powPow(1 / exponent); + linear.domain(domain.map(powp)); + return scale; + }; + scale.copy = function() { + return d3_scale_pow(linear.copy(), exponent, domain); + }; + return d3_scale_linearRebind(scale, linear); + } + function d3_scale_powPow(e) { + return function(x) { + return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e); + }; + } + d3.scale.sqrt = function() { + return d3.scale.pow().exponent(.5); + }; + d3.scale.ordinal = function() { + return d3_scale_ordinal([], { + t: "range", + a: [ [] ] + }); + }; + function d3_scale_ordinal(domain, ranger) { + var index, range, rangeBand; + function scale(x) { + return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length]; + } + function steps(start, step) { + return d3.range(domain.length).map(function(i) { + return start + step * i; + }); + } + scale.domain = function(x) { + if (!arguments.length) return domain; + domain = []; + index = new d3_Map(); + var i = -1, n = x.length, xi; + while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi)); + return scale[ranger.t].apply(scale, ranger.a); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + rangeBand = 0; + ranger = { + t: "range", + a: arguments + }; + return scale; + }; + scale.rangePoints = function(x, padding) { + if (arguments.length < 2) padding = 0; + var start = x[0], stop = x[1], step = (stop - start) / (Math.max(1, domain.length - 1) + padding); + range = steps(domain.length < 2 ? (start + stop) / 2 : start + step * padding / 2, step); + rangeBand = 0; + ranger = { + t: "rangePoints", + a: arguments + }; + return scale; + }; + scale.rangeBands = function(x, padding, outerPadding) { + if (arguments.length < 2) padding = 0; + if (arguments.length < 3) outerPadding = padding; + var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding); + range = steps(start + step * outerPadding, step); + if (reverse) range.reverse(); + rangeBand = step * (1 - padding); + ranger = { + t: "rangeBands", + a: arguments + }; + return scale; + }; + scale.rangeRoundBands = function(x, padding, outerPadding) { + if (arguments.length < 2) padding = 0; + if (arguments.length < 3) outerPadding = padding; + var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding)), error = stop - start - (domain.length - padding) * step; + range = steps(start + Math.round(error / 2), step); + if (reverse) range.reverse(); + rangeBand = Math.round(step * (1 - padding)); + ranger = { + t: "rangeRoundBands", + a: arguments + }; + return scale; + }; + scale.rangeBand = function() { + return rangeBand; + }; + scale.rangeExtent = function() { + return d3_scaleExtent(ranger.a[0]); + }; + scale.copy = function() { + return d3_scale_ordinal(domain, ranger); + }; + return scale.domain(domain); + } + d3.scale.category10 = function() { + return d3.scale.ordinal().range(d3_category10); + }; + d3.scale.category20 = function() { + return d3.scale.ordinal().range(d3_category20); + }; + d3.scale.category20b = function() { + return d3.scale.ordinal().range(d3_category20b); + }; + d3.scale.category20c = function() { + return d3.scale.ordinal().range(d3_category20c); + }; + var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString); + var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString); + var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString); + var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString); + d3.scale.quantile = function() { + return d3_scale_quantile([], []); + }; + function d3_scale_quantile(domain, range) { + var thresholds; + function rescale() { + var k = 0, q = range.length; + thresholds = []; + while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q); + return scale; + } + function scale(x) { + if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)]; + } + scale.domain = function(x) { + if (!arguments.length) return domain; + domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending); + return rescale(); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + return rescale(); + }; + scale.quantiles = function() { + return thresholds; + }; + scale.invertExtent = function(y) { + y = range.indexOf(y); + return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ]; + }; + scale.copy = function() { + return d3_scale_quantile(domain, range); + }; + return rescale(); + } + d3.scale.quantize = function() { + return d3_scale_quantize(0, 1, [ 0, 1 ]); + }; + function d3_scale_quantize(x0, x1, range) { + var kx, i; + function scale(x) { + return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))]; + } + function rescale() { + kx = range.length / (x1 - x0); + i = range.length - 1; + return scale; + } + scale.domain = function(x) { + if (!arguments.length) return [ x0, x1 ]; + x0 = +x[0]; + x1 = +x[x.length - 1]; + return rescale(); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + return rescale(); + }; + scale.invertExtent = function(y) { + y = range.indexOf(y); + y = y < 0 ? NaN : y / kx + x0; + return [ y, y + 1 / kx ]; + }; + scale.copy = function() { + return d3_scale_quantize(x0, x1, range); + }; + return rescale(); + } + d3.scale.threshold = function() { + return d3_scale_threshold([ .5 ], [ 0, 1 ]); + }; + function d3_scale_threshold(domain, range) { + function scale(x) { + if (x <= x) return range[d3.bisect(domain, x)]; + } + scale.domain = function(_) { + if (!arguments.length) return domain; + domain = _; + return scale; + }; + scale.range = function(_) { + if (!arguments.length) return range; + range = _; + return scale; + }; + scale.invertExtent = function(y) { + y = range.indexOf(y); + return [ domain[y - 1], domain[y] ]; + }; + scale.copy = function() { + return d3_scale_threshold(domain, range); + }; + return scale; + } + d3.scale.identity = function() { + return d3_scale_identity([ 0, 1 ]); + }; + function d3_scale_identity(domain) { + function identity(x) { + return +x; + } + identity.invert = identity; + identity.domain = identity.range = function(x) { + if (!arguments.length) return domain; + domain = x.map(identity); + return identity; + }; + identity.ticks = function(m) { + return d3_scale_linearTicks(domain, m); + }; + identity.tickFormat = function(m, format) { + return d3_scale_linearTickFormat(domain, m, format); + }; + identity.copy = function() { + return d3_scale_identity(domain); + }; + return identity; + } + d3.svg = {}; + d3.svg.arc = function() { + var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle; + function arc() { + var r0 = innerRadius.apply(this, arguments), r1 = outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset, a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset, da = (a1 < a0 && (da = a0, + a0 = a1, a1 = da), a1 - a0), df = da < π ? "0" : "1", c0 = Math.cos(a0), s0 = Math.sin(a0), c1 = Math.cos(a1), s1 = Math.sin(a1); + return da >= d3_svg_arcMax ? r0 ? "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "M0," + r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + -r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + r0 + "Z" : "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "Z" : r0 ? "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L" + r0 * c1 + "," + r0 * s1 + "A" + r0 + "," + r0 + " 0 " + df + ",0 " + r0 * c0 + "," + r0 * s0 + "Z" : "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L0,0" + "Z"; + } + arc.innerRadius = function(v) { + if (!arguments.length) return innerRadius; + innerRadius = d3_functor(v); + return arc; + }; + arc.outerRadius = function(v) { + if (!arguments.length) return outerRadius; + outerRadius = d3_functor(v); + return arc; + }; + arc.startAngle = function(v) { + if (!arguments.length) return startAngle; + startAngle = d3_functor(v); + return arc; + }; + arc.endAngle = function(v) { + if (!arguments.length) return endAngle; + endAngle = d3_functor(v); + return arc; + }; + arc.centroid = function() { + var r = (innerRadius.apply(this, arguments) + outerRadius.apply(this, arguments)) / 2, a = (startAngle.apply(this, arguments) + endAngle.apply(this, arguments)) / 2 + d3_svg_arcOffset; + return [ Math.cos(a) * r, Math.sin(a) * r ]; + }; + return arc; + }; + var d3_svg_arcOffset = -halfπ, d3_svg_arcMax = τ - ε; + function d3_svg_arcInnerRadius(d) { + return d.innerRadius; + } + function d3_svg_arcOuterRadius(d) { + return d.outerRadius; + } + function d3_svg_arcStartAngle(d) { + return d.startAngle; + } + function d3_svg_arcEndAngle(d) { + return d.endAngle; + } + function d3_svg_line(projection) { + var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7; + function line(data) { + var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y); + function segment() { + segments.push("M", interpolate(projection(points), tension)); + } + while (++i < n) { + if (defined.call(this, d = data[i], i)) { + points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]); + } else if (points.length) { + segment(); + points = []; + } + } + if (points.length) segment(); + return segments.length ? segments.join("") : null; + } + line.x = function(_) { + if (!arguments.length) return x; + x = _; + return line; + }; + line.y = function(_) { + if (!arguments.length) return y; + y = _; + return line; + }; + line.defined = function(_) { + if (!arguments.length) return defined; + defined = _; + return line; + }; + line.interpolate = function(_) { + if (!arguments.length) return interpolateKey; + if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; + return line; + }; + line.tension = function(_) { + if (!arguments.length) return tension; + tension = _; + return line; + }; + return line; + } + d3.svg.line = function() { + return d3_svg_line(d3_identity); + }; + var d3_svg_lineInterpolators = d3.map({ + linear: d3_svg_lineLinear, + "linear-closed": d3_svg_lineLinearClosed, + step: d3_svg_lineStep, + "step-before": d3_svg_lineStepBefore, + "step-after": d3_svg_lineStepAfter, + basis: d3_svg_lineBasis, + "basis-open": d3_svg_lineBasisOpen, + "basis-closed": d3_svg_lineBasisClosed, + bundle: d3_svg_lineBundle, + cardinal: d3_svg_lineCardinal, + "cardinal-open": d3_svg_lineCardinalOpen, + "cardinal-closed": d3_svg_lineCardinalClosed, + monotone: d3_svg_lineMonotone + }); + d3_svg_lineInterpolators.forEach(function(key, value) { + value.key = key; + value.closed = /-closed$/.test(key); + }); + function d3_svg_lineLinear(points) { + return points.join("L"); + } + function d3_svg_lineLinearClosed(points) { + return d3_svg_lineLinear(points) + "Z"; + } + function d3_svg_lineStep(points) { + var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; + while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]); + if (n > 1) path.push("H", p[0]); + return path.join(""); + } + function d3_svg_lineStepBefore(points) { + var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; + while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]); + return path.join(""); + } + function d3_svg_lineStepAfter(points) { + var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; + while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]); + return path.join(""); + } + function d3_svg_lineCardinalOpen(points, tension) { + return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, points.length - 1), d3_svg_lineCardinalTangents(points, tension)); + } + function d3_svg_lineCardinalClosed(points, tension) { + return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), + points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension)); + } + function d3_svg_lineCardinal(points, tension) { + return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension)); + } + function d3_svg_lineHermite(points, tangents) { + if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) { + return d3_svg_lineLinear(points); + } + var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1; + if (quad) { + path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1]; + p0 = points[1]; + pi = 2; + } + if (tangents.length > 1) { + t = tangents[1]; + p = points[pi]; + pi++; + path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; + for (var i = 2; i < tangents.length; i++, pi++) { + p = points[pi]; + t = tangents[i]; + path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; + } + } + if (quad) { + var lp = points[pi]; + path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1]; + } + return path; + } + function d3_svg_lineCardinalTangents(points, tension) { + var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length; + while (++i < n) { + p0 = p1; + p1 = p2; + p2 = points[i]; + tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]); + } + return tangents; + } + function d3_svg_lineBasis(points) { + if (points.length < 3) return d3_svg_lineLinear(points); + var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; + points.push(points[n - 1]); + while (++i <= n) { + pi = points[i]; + px.shift(); + px.push(pi[0]); + py.shift(); + py.push(pi[1]); + d3_svg_lineBasisBezier(path, px, py); + } + points.pop(); + path.push("L", pi); + return path.join(""); + } + function d3_svg_lineBasisOpen(points) { + if (points.length < 4) return d3_svg_lineLinear(points); + var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ]; + while (++i < 3) { + pi = points[i]; + px.push(pi[0]); + py.push(pi[1]); + } + path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py)); + --i; + while (++i < n) { + pi = points[i]; + px.shift(); + px.push(pi[0]); + py.shift(); + py.push(pi[1]); + d3_svg_lineBasisBezier(path, px, py); + } + return path.join(""); + } + function d3_svg_lineBasisClosed(points) { + var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = []; + while (++i < 4) { + pi = points[i % n]; + px.push(pi[0]); + py.push(pi[1]); + } + path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; + --i; + while (++i < m) { + pi = points[i % n]; + px.shift(); + px.push(pi[0]); + py.shift(); + py.push(pi[1]); + d3_svg_lineBasisBezier(path, px, py); + } + return path.join(""); + } + function d3_svg_lineBundle(points, tension) { + var n = points.length - 1; + if (n) { + var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t; + while (++i <= n) { + p = points[i]; + t = i / n; + p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx); + p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy); + } + } + return d3_svg_lineBasis(points); + } + function d3_svg_lineDot4(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ]; + function d3_svg_lineBasisBezier(path, x, y) { + path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y)); + } + function d3_svg_lineSlope(p0, p1) { + return (p1[1] - p0[1]) / (p1[0] - p0[0]); + } + function d3_svg_lineFiniteDifferences(points) { + var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1); + while (++i < j) { + m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2; + } + m[i] = d; + return m; + } + function d3_svg_lineMonotoneTangents(points) { + var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1; + while (++i < j) { + d = d3_svg_lineSlope(points[i], points[i + 1]); + if (abs(d) < ε) { + m[i] = m[i + 1] = 0; + } else { + a = m[i] / d; + b = m[i + 1] / d; + s = a * a + b * b; + if (s > 9) { + s = d * 3 / Math.sqrt(s); + m[i] = s * a; + m[i + 1] = s * b; + } + } + } + i = -1; + while (++i <= j) { + s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i])); + tangents.push([ s || 0, m[i] * s || 0 ]); + } + return tangents; + } + function d3_svg_lineMonotone(points) { + return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points)); + } + d3.svg.line.radial = function() { + var line = d3_svg_line(d3_svg_lineRadial); + line.radius = line.x, delete line.x; + line.angle = line.y, delete line.y; + return line; + }; + function d3_svg_lineRadial(points) { + var point, i = -1, n = points.length, r, a; + while (++i < n) { + point = points[i]; + r = point[0]; + a = point[1] + d3_svg_arcOffset; + point[0] = r * Math.cos(a); + point[1] = r * Math.sin(a); + } + return points; + } + function d3_svg_area(projection) { + var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7; + function area(data) { + var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() { + return x; + } : d3_functor(x1), fy1 = y0 === y1 ? function() { + return y; + } : d3_functor(y1), x, y; + function segment() { + segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z"); + } + while (++i < n) { + if (defined.call(this, d = data[i], i)) { + points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]); + points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]); + } else if (points0.length) { + segment(); + points0 = []; + points1 = []; + } + } + if (points0.length) segment(); + return segments.length ? segments.join("") : null; + } + area.x = function(_) { + if (!arguments.length) return x1; + x0 = x1 = _; + return area; + }; + area.x0 = function(_) { + if (!arguments.length) return x0; + x0 = _; + return area; + }; + area.x1 = function(_) { + if (!arguments.length) return x1; + x1 = _; + return area; + }; + area.y = function(_) { + if (!arguments.length) return y1; + y0 = y1 = _; + return area; + }; + area.y0 = function(_) { + if (!arguments.length) return y0; + y0 = _; + return area; + }; + area.y1 = function(_) { + if (!arguments.length) return y1; + y1 = _; + return area; + }; + area.defined = function(_) { + if (!arguments.length) return defined; + defined = _; + return area; + }; + area.interpolate = function(_) { + if (!arguments.length) return interpolateKey; + if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; + interpolateReverse = interpolate.reverse || interpolate; + L = interpolate.closed ? "M" : "L"; + return area; + }; + area.tension = function(_) { + if (!arguments.length) return tension; + tension = _; + return area; + }; + return area; + } + d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter; + d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore; + d3.svg.area = function() { + return d3_svg_area(d3_identity); + }; + d3.svg.area.radial = function() { + var area = d3_svg_area(d3_svg_lineRadial); + area.radius = area.x, delete area.x; + area.innerRadius = area.x0, delete area.x0; + area.outerRadius = area.x1, delete area.x1; + area.angle = area.y, delete area.y; + area.startAngle = area.y0, delete area.y0; + area.endAngle = area.y1, delete area.y1; + return area; + }; + d3.svg.chord = function() { + var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle; + function chord(d, i) { + var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i); + return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z"; + } + function subgroup(self, f, d, i) { + var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) + d3_svg_arcOffset, a1 = endAngle.call(self, subgroup, i) + d3_svg_arcOffset; + return { + r: r, + a0: a0, + a1: a1, + p0: [ r * Math.cos(a0), r * Math.sin(a0) ], + p1: [ r * Math.cos(a1), r * Math.sin(a1) ] + }; + } + function equals(a, b) { + return a.a0 == b.a0 && a.a1 == b.a1; + } + function arc(r, p, a) { + return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p; + } + function curve(r0, p0, r1, p1) { + return "Q 0,0 " + p1; + } + chord.radius = function(v) { + if (!arguments.length) return radius; + radius = d3_functor(v); + return chord; + }; + chord.source = function(v) { + if (!arguments.length) return source; + source = d3_functor(v); + return chord; + }; + chord.target = function(v) { + if (!arguments.length) return target; + target = d3_functor(v); + return chord; + }; + chord.startAngle = function(v) { + if (!arguments.length) return startAngle; + startAngle = d3_functor(v); + return chord; + }; + chord.endAngle = function(v) { + if (!arguments.length) return endAngle; + endAngle = d3_functor(v); + return chord; + }; + return chord; + }; + function d3_svg_chordRadius(d) { + return d.radius; + } + d3.svg.diagonal = function() { + var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection; + function diagonal(d, i) { + var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, { + x: p0.x, + y: m + }, { + x: p3.x, + y: m + }, p3 ]; + p = p.map(projection); + return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3]; + } + diagonal.source = function(x) { + if (!arguments.length) return source; + source = d3_functor(x); + return diagonal; + }; + diagonal.target = function(x) { + if (!arguments.length) return target; + target = d3_functor(x); + return diagonal; + }; + diagonal.projection = function(x) { + if (!arguments.length) return projection; + projection = x; + return diagonal; + }; + return diagonal; + }; + function d3_svg_diagonalProjection(d) { + return [ d.x, d.y ]; + } + d3.svg.diagonal.radial = function() { + var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection; + diagonal.projection = function(x) { + return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection; + }; + return diagonal; + }; + function d3_svg_diagonalRadialProjection(projection) { + return function() { + var d = projection.apply(this, arguments), r = d[0], a = d[1] + d3_svg_arcOffset; + return [ r * Math.cos(a), r * Math.sin(a) ]; + }; + } + d3.svg.symbol = function() { + var type = d3_svg_symbolType, size = d3_svg_symbolSize; + function symbol(d, i) { + return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i)); + } + symbol.type = function(x) { + if (!arguments.length) return type; + type = d3_functor(x); + return symbol; + }; + symbol.size = function(x) { + if (!arguments.length) return size; + size = d3_functor(x); + return symbol; + }; + return symbol; + }; + function d3_svg_symbolSize() { + return 64; + } + function d3_svg_symbolType() { + return "circle"; + } + function d3_svg_symbolCircle(size) { + var r = Math.sqrt(size / π); + return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z"; + } + var d3_svg_symbols = d3.map({ + circle: d3_svg_symbolCircle, + cross: function(size) { + var r = Math.sqrt(size / 5) / 2; + return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z"; + }, + diamond: function(size) { + var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30; + return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z"; + }, + square: function(size) { + var r = Math.sqrt(size) / 2; + return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z"; + }, + "triangle-down": function(size) { + var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; + return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z"; + }, + "triangle-up": function(size) { + var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; + return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z"; + } + }); + d3.svg.symbolTypes = d3_svg_symbols.keys(); + var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians); + function d3_transition(groups, id) { + d3_subclass(groups, d3_transitionPrototype); + groups.id = id; + return groups; + } + var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit; + d3_transitionPrototype.call = d3_selectionPrototype.call; + d3_transitionPrototype.empty = d3_selectionPrototype.empty; + d3_transitionPrototype.node = d3_selectionPrototype.node; + d3_transitionPrototype.size = d3_selectionPrototype.size; + d3.transition = function(selection) { + return arguments.length ? d3_transitionInheritId ? selection.transition() : selection : d3_selectionRoot.transition(); + }; + d3.transition.prototype = d3_transitionPrototype; + d3_transitionPrototype.select = function(selector) { + var id = this.id, subgroups = [], subgroup, subnode, node; + selector = d3_selection_selector(selector); + for (var j = -1, m = this.length; ++j < m; ) { + subgroups.push(subgroup = []); + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) { + if ("__data__" in node) subnode.__data__ = node.__data__; + d3_transitionNode(subnode, i, id, node.__transition__[id]); + subgroup.push(subnode); + } else { + subgroup.push(null); + } + } + } + return d3_transition(subgroups, id); + }; + d3_transitionPrototype.selectAll = function(selector) { + var id = this.id, subgroups = [], subgroup, subnodes, node, subnode, transition; + selector = d3_selection_selectorAll(selector); + for (var j = -1, m = this.length; ++j < m; ) { + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + transition = node.__transition__[id]; + subnodes = selector.call(node, node.__data__, i, j); + subgroups.push(subgroup = []); + for (var k = -1, o = subnodes.length; ++k < o; ) { + if (subnode = subnodes[k]) d3_transitionNode(subnode, k, id, transition); + subgroup.push(subnode); + } + } + } + } + return d3_transition(subgroups, id); + }; + d3_transitionPrototype.filter = function(filter) { + var subgroups = [], subgroup, group, node; + if (typeof filter !== "function") filter = d3_selection_filter(filter); + for (var j = 0, m = this.length; j < m; j++) { + subgroups.push(subgroup = []); + for (var group = this[j], i = 0, n = group.length; i < n; i++) { + if ((node = group[i]) && filter.call(node, node.__data__, i, j)) { + subgroup.push(node); + } + } + } + return d3_transition(subgroups, this.id); + }; + d3_transitionPrototype.tween = function(name, tween) { + var id = this.id; + if (arguments.length < 2) return this.node().__transition__[id].tween.get(name); + return d3_selection_each(this, tween == null ? function(node) { + node.__transition__[id].tween.remove(name); + } : function(node) { + node.__transition__[id].tween.set(name, tween); + }); + }; + function d3_transition_tween(groups, name, value, tween) { + var id = groups.id; + return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) { + node.__transition__[id].tween.set(name, tween(value.call(node, node.__data__, i, j))); + } : (value = tween(value), function(node) { + node.__transition__[id].tween.set(name, value); + })); + } + d3_transitionPrototype.attr = function(nameNS, value) { + if (arguments.length < 2) { + for (value in nameNS) this.attr(value, nameNS[value]); + return this; + } + var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS); + function attrNull() { + this.removeAttribute(name); + } + function attrNullNS() { + this.removeAttributeNS(name.space, name.local); + } + function attrTween(b) { + return b == null ? attrNull : (b += "", function() { + var a = this.getAttribute(name), i; + return a !== b && (i = interpolate(a, b), function(t) { + this.setAttribute(name, i(t)); + }); + }); + } + function attrTweenNS(b) { + return b == null ? attrNullNS : (b += "", function() { + var a = this.getAttributeNS(name.space, name.local), i; + return a !== b && (i = interpolate(a, b), function(t) { + this.setAttributeNS(name.space, name.local, i(t)); + }); + }); + } + return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween); + }; + d3_transitionPrototype.attrTween = function(nameNS, tween) { + var name = d3.ns.qualify(nameNS); + function attrTween(d, i) { + var f = tween.call(this, d, i, this.getAttribute(name)); + return f && function(t) { + this.setAttribute(name, f(t)); + }; + } + function attrTweenNS(d, i) { + var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local)); + return f && function(t) { + this.setAttributeNS(name.space, name.local, f(t)); + }; + } + return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween); + }; + d3_transitionPrototype.style = function(name, value, priority) { + var n = arguments.length; + if (n < 3) { + if (typeof name !== "string") { + if (n < 2) value = ""; + for (priority in name) this.style(priority, name[priority], value); + return this; + } + priority = ""; + } + function styleNull() { + this.style.removeProperty(name); + } + function styleString(b) { + return b == null ? styleNull : (b += "", function() { + var a = d3_window.getComputedStyle(this, null).getPropertyValue(name), i; + return a !== b && (i = d3_interpolate(a, b), function(t) { + this.style.setProperty(name, i(t), priority); + }); + }); + } + return d3_transition_tween(this, "style." + name, value, styleString); + }; + d3_transitionPrototype.styleTween = function(name, tween, priority) { + if (arguments.length < 3) priority = ""; + function styleTween(d, i) { + var f = tween.call(this, d, i, d3_window.getComputedStyle(this, null).getPropertyValue(name)); + return f && function(t) { + this.style.setProperty(name, f(t), priority); + }; + } + return this.tween("style." + name, styleTween); + }; + d3_transitionPrototype.text = function(value) { + return d3_transition_tween(this, "text", value, d3_transition_text); + }; + function d3_transition_text(b) { + if (b == null) b = ""; + return function() { + this.textContent = b; + }; + } + d3_transitionPrototype.remove = function() { + return this.each("end.transition", function() { + var p; + if (this.__transition__.count < 2 && (p = this.parentNode)) p.removeChild(this); + }); + }; + d3_transitionPrototype.ease = function(value) { + var id = this.id; + if (arguments.length < 1) return this.node().__transition__[id].ease; + if (typeof value !== "function") value = d3.ease.apply(d3, arguments); + return d3_selection_each(this, function(node) { + node.__transition__[id].ease = value; + }); + }; + d3_transitionPrototype.delay = function(value) { + var id = this.id; + if (arguments.length < 1) return this.node().__transition__[id].delay; + return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { + node.__transition__[id].delay = +value.call(node, node.__data__, i, j); + } : (value = +value, function(node) { + node.__transition__[id].delay = value; + })); + }; + d3_transitionPrototype.duration = function(value) { + var id = this.id; + if (arguments.length < 1) return this.node().__transition__[id].duration; + return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { + node.__transition__[id].duration = Math.max(1, value.call(node, node.__data__, i, j)); + } : (value = Math.max(1, value), function(node) { + node.__transition__[id].duration = value; + })); + }; + d3_transitionPrototype.each = function(type, listener) { + var id = this.id; + if (arguments.length < 2) { + var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId; + d3_transitionInheritId = id; + d3_selection_each(this, function(node, i, j) { + d3_transitionInherit = node.__transition__[id]; + type.call(node, node.__data__, i, j); + }); + d3_transitionInherit = inherit; + d3_transitionInheritId = inheritId; + } else { + d3_selection_each(this, function(node) { + var transition = node.__transition__[id]; + (transition.event || (transition.event = d3.dispatch("start", "end"))).on(type, listener); + }); + } + return this; + }; + d3_transitionPrototype.transition = function() { + var id0 = this.id, id1 = ++d3_transitionId, subgroups = [], subgroup, group, node, transition; + for (var j = 0, m = this.length; j < m; j++) { + subgroups.push(subgroup = []); + for (var group = this[j], i = 0, n = group.length; i < n; i++) { + if (node = group[i]) { + transition = Object.create(node.__transition__[id0]); + transition.delay += transition.duration; + d3_transitionNode(node, i, id1, transition); + } + subgroup.push(node); + } + } + return d3_transition(subgroups, id1); + }; + function d3_transitionNode(node, i, id, inherit) { + var lock = node.__transition__ || (node.__transition__ = { + active: 0, + count: 0 + }), transition = lock[id]; + if (!transition) { + var time = inherit.time; + transition = lock[id] = { + tween: new d3_Map(), + time: time, + ease: inherit.ease, + delay: inherit.delay, + duration: inherit.duration + }; + ++lock.count; + d3.timer(function(elapsed) { + var d = node.__data__, ease = transition.ease, delay = transition.delay, duration = transition.duration, timer = d3_timer_active, tweened = []; + timer.t = delay + time; + if (delay <= elapsed) return start(elapsed - delay); + timer.c = start; + function start(elapsed) { + if (lock.active > id) return stop(); + lock.active = id; + transition.event && transition.event.start.call(node, d, i); + transition.tween.forEach(function(key, value) { + if (value = value.call(node, d, i)) { + tweened.push(value); + } + }); + d3.timer(function() { + timer.c = tick(elapsed || 1) ? d3_true : tick; + return 1; + }, 0, time); + } + function tick(elapsed) { + if (lock.active !== id) return stop(); + var t = elapsed / duration, e = ease(t), n = tweened.length; + while (n > 0) { + tweened[--n].call(node, e); + } + if (t >= 1) { + transition.event && transition.event.end.call(node, d, i); + return stop(); + } + } + function stop() { + if (--lock.count) delete lock[id]; else delete node.__transition__; + return 1; + } + }, 0, time); + } + } + d3.svg.axis = function() { + var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_; + function axis(g) { + g.each(function() { + var g = d3.select(this); + var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy(); + var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform; + var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), + d3.transition(path)); + tickEnter.append("line"); + tickEnter.append("text"); + var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"), sign = orient === "top" || orient === "left" ? -1 : 1, x1, x2, y1, y2; + if (orient === "bottom" || orient === "top") { + tickTransform = d3_svg_axisX, x1 = "x", y1 = "y", x2 = "x2", y2 = "y2"; + text.attr("dy", sign < 0 ? "0em" : ".71em").style("text-anchor", "middle"); + pathUpdate.attr("d", "M" + range[0] + "," + sign * outerTickSize + "V0H" + range[1] + "V" + sign * outerTickSize); + } else { + tickTransform = d3_svg_axisY, x1 = "y", y1 = "x", x2 = "y2", y2 = "x2"; + text.attr("dy", ".32em").style("text-anchor", sign < 0 ? "end" : "start"); + pathUpdate.attr("d", "M" + sign * outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + sign * outerTickSize); + } + lineEnter.attr(y2, sign * innerTickSize); + textEnter.attr(y1, sign * tickSpacing); + lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize); + textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing); + if (scale1.rangeBand) { + var x = scale1, dx = x.rangeBand() / 2; + scale0 = scale1 = function(d) { + return x(d) + dx; + }; + } else if (scale0.rangeBand) { + scale0 = scale1; + } else { + tickExit.call(tickTransform, scale1, scale0); + } + tickEnter.call(tickTransform, scale0, scale1); + tickUpdate.call(tickTransform, scale1, scale1); + }); + } + axis.scale = function(x) { + if (!arguments.length) return scale; + scale = x; + return axis; + }; + axis.orient = function(x) { + if (!arguments.length) return orient; + orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient; + return axis; + }; + axis.ticks = function() { + if (!arguments.length) return tickArguments_; + tickArguments_ = arguments; + return axis; + }; + axis.tickValues = function(x) { + if (!arguments.length) return tickValues; + tickValues = x; + return axis; + }; + axis.tickFormat = function(x) { + if (!arguments.length) return tickFormat_; + tickFormat_ = x; + return axis; + }; + axis.tickSize = function(x) { + var n = arguments.length; + if (!n) return innerTickSize; + innerTickSize = +x; + outerTickSize = +arguments[n - 1]; + return axis; + }; + axis.innerTickSize = function(x) { + if (!arguments.length) return innerTickSize; + innerTickSize = +x; + return axis; + }; + axis.outerTickSize = function(x) { + if (!arguments.length) return outerTickSize; + outerTickSize = +x; + return axis; + }; + axis.tickPadding = function(x) { + if (!arguments.length) return tickPadding; + tickPadding = +x; + return axis; + }; + axis.tickSubdivide = function() { + return arguments.length && axis; + }; + return axis; + }; + var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = { + top: 1, + right: 1, + bottom: 1, + left: 1 + }; + function d3_svg_axisX(selection, x0, x1) { + selection.attr("transform", function(d) { + var v0 = x0(d); + return "translate(" + (isFinite(v0) ? v0 : x1(d)) + ",0)"; + }); + } + function d3_svg_axisY(selection, y0, y1) { + selection.attr("transform", function(d) { + var v0 = y0(d); + return "translate(0," + (isFinite(v0) ? v0 : y1(d)) + ")"; + }); + } + d3.svg.brush = function() { + var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0]; + function brush(g) { + g.each(function() { + var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart); + var background = g.selectAll(".background").data([ 0 ]); + background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"); + g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move"); + var resize = g.selectAll(".resize").data(resizes, d3_identity); + resize.exit().remove(); + resize.enter().append("g").attr("class", function(d) { + return "resize " + d; + }).style("cursor", function(d) { + return d3_svg_brushCursor[d]; + }).append("rect").attr("x", function(d) { + return /[ew]$/.test(d) ? -3 : null; + }).attr("y", function(d) { + return /^[ns]/.test(d) ? -3 : null; + }).attr("width", 6).attr("height", 6).style("visibility", "hidden"); + resize.style("display", brush.empty() ? "none" : null); + var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range; + if (x) { + range = d3_scaleRange(x); + backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]); + redrawX(gUpdate); + } + if (y) { + range = d3_scaleRange(y); + backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]); + redrawY(gUpdate); + } + redraw(gUpdate); + }); + } + brush.event = function(g) { + g.each(function() { + var event_ = event.of(this, arguments), extent1 = { + x: xExtent, + y: yExtent, + i: xExtentDomain, + j: yExtentDomain + }, extent0 = this.__chart__ || extent1; + this.__chart__ = extent1; + if (d3_transitionInheritId) { + d3.select(this).transition().each("start.brush", function() { + xExtentDomain = extent0.i; + yExtentDomain = extent0.j; + xExtent = extent0.x; + yExtent = extent0.y; + event_({ + type: "brushstart" + }); + }).tween("brush:brush", function() { + var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y); + xExtentDomain = yExtentDomain = null; + return function(t) { + xExtent = extent1.x = xi(t); + yExtent = extent1.y = yi(t); + event_({ + type: "brush", + mode: "resize" + }); + }; + }).each("end.brush", function() { + xExtentDomain = extent1.i; + yExtentDomain = extent1.j; + event_({ + type: "brush", + mode: "resize" + }); + event_({ + type: "brushend" + }); + }); + } else { + event_({ + type: "brushstart" + }); + event_({ + type: "brush", + mode: "resize" + }); + event_({ + type: "brushend" + }); + } + }); + }; + function redraw(g) { + g.selectAll(".resize").attr("transform", function(d) { + return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")"; + }); + } + function redrawX(g) { + g.select(".extent").attr("x", xExtent[0]); + g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]); + } + function redrawY(g) { + g.select(".extent").attr("y", yExtent[0]); + g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]); + } + function brushstart() { + var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(), center, origin = d3.mouse(target), offset; + var w = d3.select(d3_window).on("keydown.brush", keydown).on("keyup.brush", keyup); + if (d3.event.changedTouches) { + w.on("touchmove.brush", brushmove).on("touchend.brush", brushend); + } else { + w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend); + } + g.interrupt().selectAll("*").interrupt(); + if (dragging) { + origin[0] = xExtent[0] - origin[0]; + origin[1] = yExtent[0] - origin[1]; + } else if (resizing) { + var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing); + offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ]; + origin[0] = xExtent[ex]; + origin[1] = yExtent[ey]; + } else if (d3.event.altKey) center = origin.slice(); + g.style("pointer-events", "none").selectAll(".resize").style("display", null); + d3.select("body").style("cursor", eventTarget.style("cursor")); + event_({ + type: "brushstart" + }); + brushmove(); + function keydown() { + if (d3.event.keyCode == 32) { + if (!dragging) { + center = null; + origin[0] -= xExtent[1]; + origin[1] -= yExtent[1]; + dragging = 2; + } + d3_eventPreventDefault(); + } + } + function keyup() { + if (d3.event.keyCode == 32 && dragging == 2) { + origin[0] += xExtent[1]; + origin[1] += yExtent[1]; + dragging = 0; + d3_eventPreventDefault(); + } + } + function brushmove() { + var point = d3.mouse(target), moved = false; + if (offset) { + point[0] += offset[0]; + point[1] += offset[1]; + } + if (!dragging) { + if (d3.event.altKey) { + if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ]; + origin[0] = xExtent[+(point[0] < center[0])]; + origin[1] = yExtent[+(point[1] < center[1])]; + } else center = null; + } + if (resizingX && move1(point, x, 0)) { + redrawX(g); + moved = true; + } + if (resizingY && move1(point, y, 1)) { + redrawY(g); + moved = true; + } + if (moved) { + redraw(g); + event_({ + type: "brush", + mode: dragging ? "move" : "resize" + }); + } + } + function move1(point, scale, i) { + var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max; + if (dragging) { + r0 -= position; + r1 -= size + position; + } + min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i]; + if (dragging) { + max = (min += position) + size; + } else { + if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min)); + if (position < min) { + max = min; + min = position; + } else { + max = position; + } + } + if (extent[0] != min || extent[1] != max) { + if (i) yExtentDomain = null; else xExtentDomain = null; + extent[0] = min; + extent[1] = max; + return true; + } + } + function brushend() { + brushmove(); + g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null); + d3.select("body").style("cursor", null); + w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null); + dragRestore(); + event_({ + type: "brushend" + }); + } + } + brush.x = function(z) { + if (!arguments.length) return x; + x = z; + resizes = d3_svg_brushResizes[!x << 1 | !y]; + return brush; + }; + brush.y = function(z) { + if (!arguments.length) return y; + y = z; + resizes = d3_svg_brushResizes[!x << 1 | !y]; + return brush; + }; + brush.clamp = function(z) { + if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null; + if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z; + return brush; + }; + brush.extent = function(z) { + var x0, x1, y0, y1, t; + if (!arguments.length) { + if (x) { + if (xExtentDomain) { + x0 = xExtentDomain[0], x1 = xExtentDomain[1]; + } else { + x0 = xExtent[0], x1 = xExtent[1]; + if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1); + if (x1 < x0) t = x0, x0 = x1, x1 = t; + } + } + if (y) { + if (yExtentDomain) { + y0 = yExtentDomain[0], y1 = yExtentDomain[1]; + } else { + y0 = yExtent[0], y1 = yExtent[1]; + if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1); + if (y1 < y0) t = y0, y0 = y1, y1 = t; + } + } + return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ]; + } + if (x) { + x0 = z[0], x1 = z[1]; + if (y) x0 = x0[0], x1 = x1[0]; + xExtentDomain = [ x0, x1 ]; + if (x.invert) x0 = x(x0), x1 = x(x1); + if (x1 < x0) t = x0, x0 = x1, x1 = t; + if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ]; + } + if (y) { + y0 = z[0], y1 = z[1]; + if (x) y0 = y0[1], y1 = y1[1]; + yExtentDomain = [ y0, y1 ]; + if (y.invert) y0 = y(y0), y1 = y(y1); + if (y1 < y0) t = y0, y0 = y1, y1 = t; + if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ]; + } + return brush; + }; + brush.clear = function() { + if (!brush.empty()) { + xExtent = [ 0, 0 ], yExtent = [ 0, 0 ]; + xExtentDomain = yExtentDomain = null; + } + return brush; + }; + brush.empty = function() { + return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1]; + }; + return d3.rebind(brush, event, "on"); + }; + var d3_svg_brushCursor = { + n: "ns-resize", + e: "ew-resize", + s: "ns-resize", + w: "ew-resize", + nw: "nwse-resize", + ne: "nesw-resize", + se: "nwse-resize", + sw: "nesw-resize" + }; + var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ]; + var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat; + var d3_time_formatUtc = d3_time_format.utc; + var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ"); + d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso; + function d3_time_formatIsoNative(date) { + return date.toISOString(); + } + d3_time_formatIsoNative.parse = function(string) { + var date = new Date(string); + return isNaN(date) ? null : date; + }; + d3_time_formatIsoNative.toString = d3_time_formatIso.toString; + d3_time.second = d3_time_interval(function(date) { + return new d3_date(Math.floor(date / 1e3) * 1e3); + }, function(date, offset) { + date.setTime(date.getTime() + Math.floor(offset) * 1e3); + }, function(date) { + return date.getSeconds(); + }); + d3_time.seconds = d3_time.second.range; + d3_time.seconds.utc = d3_time.second.utc.range; + d3_time.minute = d3_time_interval(function(date) { + return new d3_date(Math.floor(date / 6e4) * 6e4); + }, function(date, offset) { + date.setTime(date.getTime() + Math.floor(offset) * 6e4); + }, function(date) { + return date.getMinutes(); + }); + d3_time.minutes = d3_time.minute.range; + d3_time.minutes.utc = d3_time.minute.utc.range; + d3_time.hour = d3_time_interval(function(date) { + var timezone = date.getTimezoneOffset() / 60; + return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5); + }, function(date, offset) { + date.setTime(date.getTime() + Math.floor(offset) * 36e5); + }, function(date) { + return date.getHours(); + }); + d3_time.hours = d3_time.hour.range; + d3_time.hours.utc = d3_time.hour.utc.range; + d3_time.month = d3_time_interval(function(date) { + date = d3_time.day(date); + date.setDate(1); + return date; + }, function(date, offset) { + date.setMonth(date.getMonth() + offset); + }, function(date) { + return date.getMonth(); + }); + d3_time.months = d3_time.month.range; + d3_time.months.utc = d3_time.month.utc.range; + function d3_time_scale(linear, methods, format) { + function scale(x) { + return linear(x); + } + scale.invert = function(x) { + return d3_time_scaleDate(linear.invert(x)); + }; + scale.domain = function(x) { + if (!arguments.length) return linear.domain().map(d3_time_scaleDate); + linear.domain(x); + return scale; + }; + function tickMethod(extent, count) { + var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target); + return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) { + return d / 31536e6; + }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i]; + } + scale.nice = function(interval, skip) { + var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval); + if (method) interval = method[0], skip = method[1]; + function skipped(date) { + return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length; + } + return scale.domain(d3_scale_nice(domain, skip > 1 ? { + floor: function(date) { + while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1); + return date; + }, + ceil: function(date) { + while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1); + return date; + } + } : interval)); + }; + scale.ticks = function(interval, skip) { + var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ { + range: interval + }, skip ]; + if (method) interval = method[0], skip = method[1]; + return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip); + }; + scale.tickFormat = function() { + return format; + }; + scale.copy = function() { + return d3_time_scale(linear.copy(), methods, format); + }; + return d3_scale_linearRebind(scale, linear); + } + function d3_time_scaleDate(t) { + return new Date(t); + } + var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ]; + var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ]; + var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) { + return d.getMilliseconds(); + } ], [ ":%S", function(d) { + return d.getSeconds(); + } ], [ "%I:%M", function(d) { + return d.getMinutes(); + } ], [ "%I %p", function(d) { + return d.getHours(); + } ], [ "%a %d", function(d) { + return d.getDay() && d.getDate() != 1; + } ], [ "%b %d", function(d) { + return d.getDate() != 1; + } ], [ "%B", function(d) { + return d.getMonth(); + } ], [ "%Y", d3_true ] ]); + var d3_time_scaleMilliseconds = { + range: function(start, stop, step) { + return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate); + }, + floor: d3_identity, + ceil: d3_identity + }; + d3_time_scaleLocalMethods.year = d3_time.year; + d3_time.scale = function() { + return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat); + }; + var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) { + return [ m[0].utc, m[1] ]; + }); + var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) { + return d.getUTCMilliseconds(); + } ], [ ":%S", function(d) { + return d.getUTCSeconds(); + } ], [ "%I:%M", function(d) { + return d.getUTCMinutes(); + } ], [ "%I %p", function(d) { + return d.getUTCHours(); + } ], [ "%a %d", function(d) { + return d.getUTCDay() && d.getUTCDate() != 1; + } ], [ "%b %d", function(d) { + return d.getUTCDate() != 1; + } ], [ "%B", function(d) { + return d.getUTCMonth(); + } ], [ "%Y", d3_true ] ]); + d3_time_scaleUtcMethods.year = d3_time.year.utc; + d3_time.scale.utc = function() { + return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat); + }; + d3.text = d3_xhrType(function(request) { + return request.responseText; + }); + d3.json = function(url, callback) { + return d3_xhr(url, "application/json", d3_json, callback); + }; + function d3_json(request) { + return JSON.parse(request.responseText); + } + d3.html = function(url, callback) { + return d3_xhr(url, "text/html", d3_html, callback); + }; + function d3_html(request) { + var range = d3_document.createRange(); + range.selectNode(d3_document.body); + return range.createContextualFragment(request.responseText); + } + d3.xml = d3_xhrType(function(request) { + return request.responseXML; + }); + if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; + this.d3 = d3; +}(); +},{}],2:[function(require,module,exports){ /** * @license * Copyright (c) 2012-2013 Chris Pettitt @@ -62,7 +9278,7 @@ module.exports = { version: require("./lib/version") }; -},{"./lib/dagre":8,"./lib/graphlib":9,"./lib/intersect":10,"./lib/render":23,"./lib/util":25,"./lib/version":26}],2:[function(require,module,exports){ +},{"./lib/dagre":9,"./lib/graphlib":10,"./lib/intersect":11,"./lib/render":24,"./lib/util":26,"./lib/version":27}],3:[function(require,module,exports){ var util = require("./util"); module.exports = { @@ -107,7 +9323,7 @@ function vee(parent, id, edge, type) { util.applyStyle(path, edge[type + "Style"]); } -},{"./util":25}],3:[function(require,module,exports){ +},{"./util":26}],4:[function(require,module,exports){ var util = require("./util"); module.exports = createClusters; @@ -142,7 +9358,7 @@ function createClusters(selection, g) { }); } -},{"./util":25}],4:[function(require,module,exports){ +},{"./util":26}],5:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -179,7 +9395,7 @@ function createEdgeLabels(selection, g) { return svgEdgeLabels; } -},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],5:[function(require,module,exports){ +},{"./d3":8,"./label/add-label":19,"./lodash":21,"./util":26}],6:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -298,7 +9514,7 @@ function exit(svgPaths, g) { }); } -},{"./d3":7,"./intersect/intersect-node":14,"./lodash":20,"./util":25}],6:[function(require,module,exports){ +},{"./d3":8,"./intersect/intersect-node":15,"./lodash":21,"./util":26}],7:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -325,7 +9541,7 @@ function createNodes(selection, g, shapes) { labelGroup = thisGroup.append("g").attr("class", "label"), labelDom = addLabel(labelGroup, node), shape = shapes[node.shape], - bbox = labelDom.node().getBBox(); + bbox = _.pick(labelDom.node().getBBox(), "width", "height"); node.elem = this; @@ -357,11 +9573,11 @@ function createNodes(selection, g, shapes) { return svgNodes; } -},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],7:[function(require,module,exports){ +},{"./d3":8,"./label/add-label":19,"./lodash":21,"./util":26}],8:[function(require,module,exports){ // Stub to get D3 either via NPM or from the global object module.exports = window.d3; -},{}],8:[function(require,module,exports){ +},{}],9:[function(require,module,exports){ /* global window */ var dagre; @@ -378,7 +9594,7 @@ if (!dagre) { module.exports = dagre; -},{"dagre":27}],9:[function(require,module,exports){ +},{"dagre":28}],10:[function(require,module,exports){ /* global window */ var graphlib; @@ -395,7 +9611,7 @@ if (!graphlib) { module.exports = graphlib; -},{"graphlib":77}],10:[function(require,module,exports){ +},{"graphlib":58}],11:[function(require,module,exports){ module.exports = { node: require("./intersect-node"), circle: require("./intersect-circle"), @@ -404,7 +9620,7 @@ module.exports = { rect: require("./intersect-rect") }; -},{"./intersect-circle":11,"./intersect-ellipse":12,"./intersect-node":14,"./intersect-polygon":15,"./intersect-rect":16}],11:[function(require,module,exports){ +},{"./intersect-circle":12,"./intersect-ellipse":13,"./intersect-node":15,"./intersect-polygon":16,"./intersect-rect":17}],12:[function(require,module,exports){ var intersectEllipse = require("./intersect-ellipse"); module.exports = intersectCircle; @@ -413,7 +9629,7 @@ function intersectCircle(node, rx, point) { return intersectEllipse(node, rx, rx, point); } -},{"./intersect-ellipse":12}],12:[function(require,module,exports){ +},{"./intersect-ellipse":13}],13:[function(require,module,exports){ module.exports = intersectEllipse; function intersectEllipse(node, rx, ry, point) { @@ -440,7 +9656,7 @@ function intersectEllipse(node, rx, ry, point) { } -},{}],13:[function(require,module,exports){ +},{}],14:[function(require,module,exports){ module.exports = intersectLine; /* @@ -512,14 +9728,14 @@ function sameSign(r1, r2) { return r1 * r2 > 0; } -},{}],14:[function(require,module,exports){ +},{}],15:[function(require,module,exports){ module.exports = intersectNode; function intersectNode(node, point) { return node.intersect(point); } -},{}],15:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ var intersectLine = require("./intersect-line"); module.exports = intersectPolygon; @@ -576,7 +9792,7 @@ function intersectPolygon(node, polyPoints, point) { return intersections[0]; } -},{"./intersect-line":13}],16:[function(require,module,exports){ +},{"./intersect-line":14}],17:[function(require,module,exports){ module.exports = intersectRect; function intersectRect(node, point) { @@ -610,7 +9826,7 @@ function intersectRect(node, point) { return {x: x + sx, y: y + sy}; } -},{}],17:[function(require,module,exports){ +},{}],18:[function(require,module,exports){ var util = require("../util"); module.exports = addHtmlLabel; @@ -655,7 +9871,7 @@ function addHtmlLabel(root, node) { return fo; } -},{"../util":25}],18:[function(require,module,exports){ +},{"../util":26}],19:[function(require,module,exports){ var addTextLabel = require("./add-text-label"), addHtmlLabel = require("./add-html-label"); @@ -680,7 +9896,7 @@ function addLabel(root, node) { return labelSvg; } -},{"./add-html-label":17,"./add-text-label":19}],19:[function(require,module,exports){ +},{"./add-html-label":18,"./add-text-label":20}],20:[function(require,module,exports){ var util = require("../util"); module.exports = addTextLabel; @@ -727,7 +9943,7 @@ function processEscapeSequences(text) { return newText; } -},{"../util":25}],20:[function(require,module,exports){ +},{"../util":26}],21:[function(require,module,exports){ /* global window */ var lodash; @@ -744,7 +9960,7 @@ if (!lodash) { module.exports = lodash; -},{"lodash":101}],21:[function(require,module,exports){ +},{"lodash":82}],22:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -768,7 +9984,7 @@ function positionEdgeLabels(selection, g) { .attr("transform", translate); } -},{"./d3":7,"./lodash":20,"./util":25}],22:[function(require,module,exports){ +},{"./d3":8,"./lodash":21,"./util":26}],23:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -791,7 +10007,7 @@ function positionNodes(selection, g) { .attr("transform", translate); } -},{"./d3":7,"./util":25}],23:[function(require,module,exports){ +},{"./d3":8,"./util":26}],24:[function(require,module,exports){ var _ = require("./lodash"), layout = require("./dagre").layout; @@ -957,7 +10173,7 @@ function createOrSelectGroup(root, name) { return selection; } -},{"./arrows":2,"./create-clusters":3,"./create-edge-labels":4,"./create-edge-paths":5,"./create-nodes":6,"./dagre":8,"./lodash":20,"./position-edge-labels":21,"./position-nodes":22,"./shapes":24}],24:[function(require,module,exports){ +},{"./arrows":3,"./create-clusters":4,"./create-edge-labels":5,"./create-edge-paths":6,"./create-nodes":7,"./dagre":9,"./lodash":21,"./position-edge-labels":22,"./position-nodes":23,"./shapes":25}],25:[function(require,module,exports){ "use strict"; var intersectRect = require("./intersect/intersect-rect"), @@ -1016,7 +10232,7 @@ function circle(parent, bbox, node) { return shapeSvg; } -},{"./intersect/intersect-circle":11,"./intersect/intersect-ellipse":12,"./intersect/intersect-rect":16}],25:[function(require,module,exports){ +},{"./intersect/intersect-circle":12,"./intersect/intersect-ellipse":13,"./intersect/intersect-rect":17}],26:[function(require,module,exports){ var _ = require("./lodash"); // Public utility functions @@ -1072,10 +10288,10 @@ function applyTransition(selection, g) { return selection; } -},{"./lodash":20}],26:[function(require,module,exports){ -module.exports = "0.3.2"; +},{"./lodash":21}],27:[function(require,module,exports){ +module.exports = "0.3.3"; -},{}],27:[function(require,module,exports){ +},{}],28:[function(require,module,exports){ /* Copyright (c) 2012-2014 Chris Pettitt @@ -1110,7 +10326,7 @@ module.exports = { version: require("./lib/version") }; -},{"./lib/debug":32,"./lib/graphlib":33,"./lib/layout":35,"./lib/util":55,"./lib/version":56}],28:[function(require,module,exports){ +},{"./lib/debug":33,"./lib/graphlib":34,"./lib/layout":36,"./lib/util":56,"./lib/version":57}],29:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -1179,7 +10395,7 @@ function undo(g) { }); } -},{"./greedy-fas":34,"./lodash":36}],29:[function(require,module,exports){ +},{"./greedy-fas":35,"./lodash":37}],30:[function(require,module,exports){ var _ = require("./lodash"), util = require("./util"); @@ -1219,7 +10435,7 @@ function addBorderNode(g, prop, prefix, sg, sgNode, rank) { } } -},{"./lodash":36,"./util":55}],30:[function(require,module,exports){ +},{"./lodash":37,"./util":56}],31:[function(require,module,exports){ "use strict"; var _ = require("./lodash"); @@ -1293,7 +10509,7 @@ function swapXYOne(attrs) { attrs.y = x; } -},{"./lodash":36}],31:[function(require,module,exports){ +},{"./lodash":37}],32:[function(require,module,exports){ /* * Simple doubly linked list implementation derived from Cormen, et al., * "Introduction to Algorithms". @@ -1351,7 +10567,7 @@ function filterOutLinks(k, v) { } } -},{}],32:[function(require,module,exports){ +},{}],33:[function(require,module,exports){ var _ = require("./lodash"), util = require("./util"), Graph = require("./graphlib").Graph; @@ -1387,9 +10603,9 @@ function debugOrdering(g) { return h; } -},{"./graphlib":33,"./lodash":36,"./util":55}],33:[function(require,module,exports){ -module.exports=require(9) -},{"graphlib":57}],34:[function(require,module,exports){ +},{"./graphlib":34,"./lodash":37,"./util":56}],34:[function(require,module,exports){ +module.exports=require(10) +},{"graphlib":58}],35:[function(require,module,exports){ var _ = require("./lodash"), Graph = require("./graphlib").Graph, List = require("./data/list"); @@ -1509,7 +10725,7 @@ function assignBucket(buckets, zeroIdx, entry) { } } -},{"./data/list":31,"./graphlib":33,"./lodash":36}],35:[function(require,module,exports){ +},{"./data/list":32,"./graphlib":34,"./lodash":37}],36:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -1903,9 +11119,9 @@ function canonicalize(attrs) { return newAttrs; } -},{"./acyclic":28,"./add-border-segments":29,"./coordinate-system":30,"./graphlib":33,"./lodash":36,"./nesting-graph":37,"./normalize":38,"./order":43,"./parent-dummy-chains":48,"./position":50,"./rank":52,"./util":55}],36:[function(require,module,exports){ -module.exports=require(20) -},{"lodash":101}],37:[function(require,module,exports){ +},{"./acyclic":29,"./add-border-segments":30,"./coordinate-system":31,"./graphlib":34,"./lodash":37,"./nesting-graph":38,"./normalize":39,"./order":44,"./parent-dummy-chains":49,"./position":51,"./rank":53,"./util":56}],37:[function(require,module,exports){ +module.exports=require(21) +},{"lodash":82}],38:[function(require,module,exports){ var _ = require("./lodash"), util = require("./util"); @@ -2039,7 +11255,7 @@ function cleanup(g) { }); } -},{"./lodash":36,"./util":55}],38:[function(require,module,exports){ +},{"./lodash":37,"./util":56}],39:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -2131,7 +11347,7 @@ function undo(g) { }); } -},{"./lodash":36,"./util":55}],39:[function(require,module,exports){ +},{"./lodash":37,"./util":56}],40:[function(require,module,exports){ var _ = require("../lodash"); module.exports = addSubgraphConstraints; @@ -2186,7 +11402,7 @@ function addSubgraphConstraints(g, cg, vs) { */ } -},{"../lodash":36}],40:[function(require,module,exports){ +},{"../lodash":37}],41:[function(require,module,exports){ var _ = require("../lodash"); module.exports = barycenter; @@ -2216,7 +11432,7 @@ function barycenter(g, movable) { } -},{"../lodash":36}],41:[function(require,module,exports){ +},{"../lodash":37}],42:[function(require,module,exports){ var _ = require("../lodash"), Graph = require("../graphlib").Graph; @@ -2291,7 +11507,7 @@ function createRootNode(g) { return v; } -},{"../graphlib":33,"../lodash":36}],42:[function(require,module,exports){ +},{"../graphlib":34,"../lodash":37}],43:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -2363,7 +11579,7 @@ function twoLayerCrossCount(g, northLayer, southLayer) { return cc; } -},{"../lodash":36}],43:[function(require,module,exports){ +},{"../lodash":37}],44:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -2444,7 +11660,7 @@ function assignOrder(g, layering) { }); } -},{"../graphlib":33,"../lodash":36,"../util":55,"./add-subgraph-constraints":39,"./build-layer-graph":41,"./cross-count":42,"./init-order":44,"./sort-subgraph":46}],44:[function(require,module,exports){ +},{"../graphlib":34,"../lodash":37,"../util":56,"./add-subgraph-constraints":40,"./build-layer-graph":42,"./cross-count":43,"./init-order":45,"./sort-subgraph":47}],45:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -2484,7 +11700,7 @@ function initOrder(g) { return layers; } -},{"../lodash":36}],45:[function(require,module,exports){ +},{"../lodash":37}],46:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -2609,7 +11825,7 @@ function mergeEntries(target, source) { source.merged = true; } -},{"../lodash":36}],46:[function(require,module,exports){ +},{"../lodash":37}],47:[function(require,module,exports){ var _ = require("../lodash"), barycenter = require("./barycenter"), resolveConflicts = require("./resolve-conflicts"), @@ -2687,7 +11903,7 @@ function mergeBarycenters(target, other) { } } -},{"../lodash":36,"./barycenter":40,"./resolve-conflicts":45,"./sort":47}],47:[function(require,module,exports){ +},{"../lodash":37,"./barycenter":41,"./resolve-conflicts":46,"./sort":48}],48:[function(require,module,exports){ var _ = require("../lodash"), util = require("../util"); @@ -2746,7 +11962,7 @@ function compareWithBias(bias) { }; } -},{"../lodash":36,"../util":55}],48:[function(require,module,exports){ +},{"../lodash":37,"../util":56}],49:[function(require,module,exports){ var _ = require("./lodash"); module.exports = parentDummyChains; @@ -2834,7 +12050,7 @@ function postorder(g) { return result; } -},{"./lodash":36}],49:[function(require,module,exports){ +},{"./lodash":37}],50:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -3235,7 +12451,7 @@ function width(g, v) { return g.node(v).width; } -},{"../lodash":36,"../util":55}],50:[function(require,module,exports){ +},{"../lodash":37,"../util":56}],51:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -3267,7 +12483,7 @@ function positionY(g) { } -},{"../lodash":36,"../util":55,"./bk":49}],51:[function(require,module,exports){ +},{"../lodash":37,"../util":56,"./bk":50}],52:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -3358,7 +12574,7 @@ function shiftRanks(t, g, delta) { }); } -},{"../graphlib":33,"../lodash":36,"./util":54}],52:[function(require,module,exports){ +},{"../graphlib":34,"../lodash":37,"./util":55}],53:[function(require,module,exports){ "use strict"; var rankUtil = require("./util"), @@ -3408,7 +12624,7 @@ function networkSimplexRanker(g) { networkSimplex(g); } -},{"./feasible-tree":51,"./network-simplex":53,"./util":54}],53:[function(require,module,exports){ +},{"./feasible-tree":52,"./network-simplex":54,"./util":55}],54:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -3644,7 +12860,7 @@ function isDescendant(tree, vLabel, rootLabel) { return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; } -},{"../graphlib":33,"../lodash":36,"../util":55,"./feasible-tree":51,"./util":54}],54:[function(require,module,exports){ +},{"../graphlib":34,"../lodash":37,"../util":56,"./feasible-tree":52,"./util":55}],55:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -3707,7 +12923,7 @@ function slack(g, e) { return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; } -},{"../lodash":36}],55:[function(require,module,exports){ +},{"../lodash":37}],56:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -3945,10 +13161,10 @@ function notime(name, fn) { return fn(); } -},{"./graphlib":33,"./lodash":36}],56:[function(require,module,exports){ +},{"./graphlib":34,"./lodash":37}],57:[function(require,module,exports){ module.exports = "0.6.4"; -},{}],57:[function(require,module,exports){ +},{}],58:[function(require,module,exports){ /** * Copyright (c) 2014, Chris Pettitt * All rights reserved. @@ -3988,7 +13204,7 @@ module.exports = { version: lib.version }; -},{"./lib":73,"./lib/alg":64,"./lib/json":74}],58:[function(require,module,exports){ +},{"./lib":74,"./lib/alg":65,"./lib/json":75}],59:[function(require,module,exports){ var _ = require("../lodash"); module.exports = components; @@ -4017,7 +13233,7 @@ function components(g) { return cmpts; } -},{"../lodash":75}],59:[function(require,module,exports){ +},{"../lodash":76}],60:[function(require,module,exports){ var _ = require("../lodash"); module.exports = dfs; @@ -4058,7 +13274,7 @@ function doDfs(g, v, postorder, visited, acc) { } } -},{"../lodash":75}],60:[function(require,module,exports){ +},{"../lodash":76}],61:[function(require,module,exports){ var dijkstra = require("./dijkstra"), _ = require("../lodash"); @@ -4070,7 +13286,7 @@ function dijkstraAll(g, weightFunc, edgeFunc) { }, {}); } -},{"../lodash":75,"./dijkstra":61}],61:[function(require,module,exports){ +},{"../lodash":76,"./dijkstra":62}],62:[function(require,module,exports){ var _ = require("../lodash"), PriorityQueue = require("../data/priority-queue"); @@ -4126,7 +13342,7 @@ function runDijkstra(g, source, weightFn, edgeFn) { return results; } -},{"../data/priority-queue":71,"../lodash":75}],62:[function(require,module,exports){ +},{"../data/priority-queue":72,"../lodash":76}],63:[function(require,module,exports){ var _ = require("../lodash"), tarjan = require("./tarjan"); @@ -4136,7 +13352,7 @@ function findCycles(g) { return _.filter(tarjan(g), function(cmpt) { return cmpt.length > 1; }); } -},{"../lodash":75,"./tarjan":69}],63:[function(require,module,exports){ +},{"../lodash":76,"./tarjan":70}],64:[function(require,module,exports){ var _ = require("../lodash"); module.exports = floydWarshall; @@ -4188,7 +13404,7 @@ function runFloydWarshall(g, weightFn, edgeFn) { return results; } -},{"../lodash":75}],64:[function(require,module,exports){ +},{"../lodash":76}],65:[function(require,module,exports){ module.exports = { components: require("./components"), dijkstra: require("./dijkstra"), @@ -4203,7 +13419,7 @@ module.exports = { topsort: require("./topsort") }; -},{"./components":58,"./dijkstra":61,"./dijkstra-all":60,"./find-cycles":62,"./floyd-warshall":63,"./is-acyclic":65,"./postorder":66,"./preorder":67,"./prim":68,"./tarjan":69,"./topsort":70}],65:[function(require,module,exports){ +},{"./components":59,"./dijkstra":62,"./dijkstra-all":61,"./find-cycles":63,"./floyd-warshall":64,"./is-acyclic":66,"./postorder":67,"./preorder":68,"./prim":69,"./tarjan":70,"./topsort":71}],66:[function(require,module,exports){ var topsort = require("./topsort"); module.exports = isAcyclic; @@ -4220,7 +13436,7 @@ function isAcyclic(g) { return true; } -},{"./topsort":70}],66:[function(require,module,exports){ +},{"./topsort":71}],67:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = postorder; @@ -4229,7 +13445,7 @@ function postorder(g, vs) { return dfs(g, vs, "post"); } -},{"./dfs":59}],67:[function(require,module,exports){ +},{"./dfs":60}],68:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = preorder; @@ -4238,7 +13454,7 @@ function preorder(g, vs) { return dfs(g, vs, "pre"); } -},{"./dfs":59}],68:[function(require,module,exports){ +},{"./dfs":60}],69:[function(require,module,exports){ var _ = require("../lodash"), Graph = require("../graph"), PriorityQueue = require("../data/priority-queue"); @@ -4292,7 +13508,7 @@ function prim(g, weightFunc) { return result; } -},{"../data/priority-queue":71,"../graph":72,"../lodash":75}],69:[function(require,module,exports){ +},{"../data/priority-queue":72,"../graph":73,"../lodash":76}],70:[function(require,module,exports){ var _ = require("../lodash"); module.exports = tarjan; @@ -4341,7 +13557,7 @@ function tarjan(g) { return results; } -},{"../lodash":75}],70:[function(require,module,exports){ +},{"../lodash":76}],71:[function(require,module,exports){ var _ = require("../lodash"); module.exports = topsort; @@ -4377,7 +13593,7 @@ function topsort(g) { function CycleException() {} -},{"../lodash":75}],71:[function(require,module,exports){ +},{"../lodash":76}],72:[function(require,module,exports){ var _ = require("../lodash"); module.exports = PriorityQueue; @@ -4531,7 +13747,7 @@ PriorityQueue.prototype._swap = function(i, j) { keyIndices[origArrI.key] = j; }; -},{"../lodash":75}],72:[function(require,module,exports){ +},{"../lodash":76}],73:[function(require,module,exports){ "use strict"; var _ = require("./lodash"); @@ -5001,14 +14217,14 @@ function edgeObjToId(isDirected, edgeObj) { return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); } -},{"./lodash":75}],73:[function(require,module,exports){ +},{"./lodash":76}],74:[function(require,module,exports){ // Includes only the "core" of graphlib module.exports = { Graph: require("./graph"), version: require("./version") }; -},{"./graph":72,"./version":76}],74:[function(require,module,exports){ +},{"./graph":73,"./version":77}],75:[function(require,module,exports){ var _ = require("./lodash"), Graph = require("./graph"); @@ -5076,514 +14292,14 @@ function read(json) { return g; } -},{"./graph":72,"./lodash":75}],75:[function(require,module,exports){ -module.exports=require(20) -},{"lodash":101}],76:[function(require,module,exports){ +},{"./graph":73,"./lodash":76}],76:[function(require,module,exports){ +module.exports=require(21) +},{"lodash":82}],77:[function(require,module,exports){ module.exports = '1.0.1'; -},{}],77:[function(require,module,exports){ -arguments[4][57][0].apply(exports,arguments) -},{"./lib":93,"./lib/alg":84,"./lib/json":94}],78:[function(require,module,exports){ -module.exports=require(58) -},{"../lodash":95}],79:[function(require,module,exports){ -module.exports=require(59) -},{"../lodash":95}],80:[function(require,module,exports){ -module.exports=require(60) -},{"../lodash":95,"./dijkstra":81}],81:[function(require,module,exports){ -module.exports=require(61) -},{"../data/priority-queue":91,"../lodash":95}],82:[function(require,module,exports){ -module.exports=require(62) -},{"../lodash":95,"./tarjan":89}],83:[function(require,module,exports){ -module.exports=require(63) -},{"../lodash":95}],84:[function(require,module,exports){ -arguments[4][64][0].apply(exports,arguments) -},{"./components":78,"./dijkstra":81,"./dijkstra-all":80,"./find-cycles":82,"./floyd-warshall":83,"./is-acyclic":85,"./postorder":86,"./preorder":87,"./prim":88,"./tarjan":89,"./topsort":90}],85:[function(require,module,exports){ -module.exports=require(65) -},{"./topsort":90}],86:[function(require,module,exports){ -module.exports=require(66) -},{"./dfs":79}],87:[function(require,module,exports){ -module.exports=require(67) -},{"./dfs":79}],88:[function(require,module,exports){ -arguments[4][68][0].apply(exports,arguments) -},{"../data/priority-queue":91,"../graph":92,"../lodash":95}],89:[function(require,module,exports){ -module.exports=require(69) -},{"../lodash":95}],90:[function(require,module,exports){ -module.exports=require(70) -},{"../lodash":95}],91:[function(require,module,exports){ -module.exports=require(71) -},{"../lodash":95}],92:[function(require,module,exports){ -"use strict"; +},{}],78:[function(require,module,exports){ -var _ = require("./lodash"); - -module.exports = Graph; - -var DEFAULT_EDGE_NAME = "\x00", - GRAPH_NODE = "\x00", - EDGE_KEY_DELIM = "\x01"; - -// Implementation notes: -// -// * Node id query functions should return string ids for the nodes -// * Edge id query functions should return an "edgeObj", edge object, that is -// composed of enough information to uniquely identify an edge: {v, w, name}. -// * Internally we use an "edgeId", a stringified form of the edgeObj, to -// reference edges. This is because we need a performant way to look these -// edges up and, object properties, which have string keys, are the closest -// we're going to get to a performant hashtable in JavaScript. - -function Graph(opts) { - this._isDirected = _.has(opts, "directed") ? opts.directed : true; - this._isMultigraph = _.has(opts, "multigraph") ? opts.multigraph : false; - this._isCompound = _.has(opts, "compound") ? opts.compound : false; - - // Label for the graph itself - this._label = undefined; - - // Defaults to be set when creating a new node - this._defaultNodeLabelFn = _.constant(undefined); - - // Defaults to be set when creating a new edge - this._defaultEdgeLabelFn = _.constant(undefined); - - // v -> label - this._nodes = {}; - - if (this._isCompound) { - // v -> parent - this._parent = {}; - - // v -> children - this._children = {}; - this._children[GRAPH_NODE] = {}; - } - - // v -> edgeObj - this._in = {}; - - // u -> v -> Number - this._preds = {}; - - // v -> edgeObj - this._out = {}; - - // v -> w -> Number - this._sucs = {}; - - // e -> edgeObj - this._edgeObjs = {}; - - // e -> label - this._edgeLabels = {}; -} - -/* Number of nodes in the graph. Should only be changed by the implementation. */ -Graph.prototype._nodeCount = 0; - -/* Number of edges in the graph. Should only be changed by the implementation. */ -Graph.prototype._edgeCount = 0; - - -/* === Graph functions ========= */ - -Graph.prototype.isDirected = function() { - return this._isDirected; -}; - -Graph.prototype.isMultigraph = function() { - return this._isMultigraph; -}; - -Graph.prototype.isCompound = function() { - return this._isCompound; -}; - -Graph.prototype.setGraph = function(label) { - this._label = label; - return this; -}; - -Graph.prototype.graph = function() { - return this._label; -}; - - -/* === Node functions ========== */ - -Graph.prototype.setDefaultNodeLabel = function(newDefault) { - if (!_.isFunction(newDefault)) { - newDefault = _.constant(newDefault); - } - this._defaultNodeLabelFn = newDefault; - return this; -}; - -Graph.prototype.nodeCount = function() { - return this._nodeCount; -}; - -Graph.prototype.nodes = function() { - return _.keys(this._nodes); -}; - -Graph.prototype.sources = function() { - return _.filter(this.nodes(), function(v) { - return _.isEmpty(this._in[v]); - }, this); -}; - -Graph.prototype.sinks = function() { - return _.filter(this.nodes(), function(v) { - return _.isEmpty(this._out[v]); - }, this); -}; - -Graph.prototype.setNodes = function(vs, value) { - var args = arguments; - _.each(vs, function(v) { - if (args.length > 1) { - this.setNode(v, value); - } else { - this.setNode(v); - } - }, this); - return this; -}; - -Graph.prototype.setNode = function(v, value) { - if (_.has(this._nodes, v)) { - if (arguments.length > 1) { - this._nodes[v] = value; - } - return this; - } - - this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v); - if (this._isCompound) { - this._parent[v] = GRAPH_NODE; - this._children[v] = {}; - this._children[GRAPH_NODE][v] = true; - } - this._in[v] = {}; - this._preds[v] = {}; - this._out[v] = {}; - this._sucs[v] = {}; - ++this._nodeCount; - return this; -}; - -Graph.prototype.node = function(v) { - return this._nodes[v]; -}; - -Graph.prototype.hasNode = function(v) { - return _.has(this._nodes, v); -}; - -Graph.prototype.removeNode = function(v) { - var self = this; - if (_.has(this._nodes, v)) { - var removeEdge = function(e) { self.removeEdge(self._edgeObjs[e]); }; - delete this._nodes[v]; - if (this._isCompound) { - this._removeFromParentsChildList(v); - delete this._parent[v]; - _.each(this.children(v), function(child) { - this.setParent(child); - }, this); - delete this._children[v]; - } - _.each(_.keys(this._in[v]), removeEdge); - delete this._in[v]; - delete this._preds[v]; - _.each(_.keys(this._out[v]), removeEdge); - delete this._out[v]; - delete this._sucs[v]; - --this._nodeCount; - } - return this; -}; - -Graph.prototype.setParent = function(v, parent) { - if (!this._isCompound) { - throw new Error("Cannot set parent in a non-compound graph"); - } - - if (_.isUndefined(parent)) { - parent = GRAPH_NODE; - } else { - for (var ancestor = parent; - !_.isUndefined(ancestor); - ancestor = this.parent(ancestor)) { - if (ancestor === v) { - throw new Error("Setting " + parent+ " as parent of " + v + - " would create create a cycle"); - } - } - - this.setNode(parent); - } - - this.setNode(v); - this._removeFromParentsChildList(v); - this._parent[v] = parent; - this._children[parent][v] = true; - return this; -}; - -Graph.prototype._removeFromParentsChildList = function(v) { - delete this._children[this._parent[v]][v]; -}; - -Graph.prototype.parent = function(v) { - if (this._isCompound) { - var parent = this._parent[v]; - if (parent !== GRAPH_NODE) { - return parent; - } - } -}; - -Graph.prototype.children = function(v) { - if (_.isUndefined(v)) { - v = GRAPH_NODE; - } - - if (this._isCompound) { - var children = this._children[v]; - if (children) { - return _.keys(children); - } - } else if (v === GRAPH_NODE) { - return this.nodes(); - } else if (this.hasNode(v)) { - return []; - } -}; - -Graph.prototype.predecessors = function(v) { - var predsV = this._preds[v]; - if (predsV) { - return _.keys(predsV); - } -}; - -Graph.prototype.successors = function(v) { - var sucsV = this._sucs[v]; - if (sucsV) { - return _.keys(sucsV); - } -}; - -Graph.prototype.neighbors = function(v) { - var preds = this.predecessors(v); - if (preds) { - return _.union(preds, this.successors(v)); - } -}; - -/* === Edge functions ========== */ - -Graph.prototype.setDefaultEdgeLabel = function(newDefault) { - if (!_.isFunction(newDefault)) { - newDefault = _.constant(newDefault); - } - this._defaultEdgeLabelFn = newDefault; - return this; -}; - -Graph.prototype.edgeCount = function() { - return this._edgeCount; -}; - -Graph.prototype.edges = function() { - return _.values(this._edgeObjs); -}; - -Graph.prototype.setPath = function(vs, value) { - var self = this, - args = arguments; - _.reduce(vs, function(v, w) { - if (args.length > 1) { - self.setEdge(v, w, value); - } else { - self.setEdge(v, w); - } - return w; - }); - return this; -}; - -/* - * setEdge(v, w, [value, [name]]) - * setEdge({ v, w, [name] }, [value]) - */ -Graph.prototype.setEdge = function(v, w, value, name) { - var valueSpecified = arguments.length > 2; - - v = String(v); - w = String(w); - if (!_.isUndefined(name)) { - name = String(name); - } - - if (_.isPlainObject(arguments[0])) { - v = arguments[0].v; - w = arguments[0].w; - name = arguments[0].name; - if (arguments.length === 2) { - value = arguments[1]; - valueSpecified = true; - } - } - - var e = edgeArgsToId(this._isDirected, v, w, name); - if (_.has(this._edgeLabels, e)) { - if (valueSpecified) { - this._edgeLabels[e] = value; - } - return this; - } - - if (!_.isUndefined(name) && !this._isMultigraph) { - throw new Error("Cannot set a named edge when isMultigraph = false"); - } - - // It didn't exist, so we need to create it. - // First ensure the nodes exist. - this.setNode(v); - this.setNode(w); - - this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name); - - var edgeObj = edgeArgsToObj(this._isDirected, v, w, name); - // Ensure we add undirected edges in a consistent way. - v = edgeObj.v; - w = edgeObj.w; - - Object.freeze(edgeObj); - this._edgeObjs[e] = edgeObj; - incrementOrInitEntry(this._preds[w], v); - incrementOrInitEntry(this._sucs[v], w); - this._in[w][e] = edgeObj; - this._out[v][e] = edgeObj; - this._edgeCount++; - return this; -}; - -Graph.prototype.edge = function(v, w, name) { - var e = (arguments.length === 1 - ? edgeObjToId(this._isDirected, arguments[0]) - : edgeArgsToId(this._isDirected, v, w, name)); - return this._edgeLabels[e]; -}; - -Graph.prototype.hasEdge = function(v, w, name) { - var e = (arguments.length === 1 - ? edgeObjToId(this._isDirected, arguments[0]) - : edgeArgsToId(this._isDirected, v, w, name)); - return _.has(this._edgeLabels, e); -}; - -Graph.prototype.removeEdge = function(v, w, name) { - var e = (arguments.length === 1 - ? edgeObjToId(this._isDirected, arguments[0]) - : edgeArgsToId(this._isDirected, v, w, name)), - edge = this._edgeObjs[e]; - if (edge) { - v = edge.v; - w = edge.w; - delete this._edgeLabels[e]; - delete this._edgeObjs[e]; - decrementOrRemoveEntry(this._preds[w], v); - decrementOrRemoveEntry(this._sucs[v], w); - delete this._in[w][e]; - delete this._out[v][e]; - this._edgeCount--; - } - return this; -}; - -Graph.prototype.inEdges = function(v, u) { - var inV = this._in[v]; - if (inV) { - var edges = _.values(inV); - if (!u) { - return edges; - } - return _.filter(edges, function(edge) { return edge.v === u; }); - } -}; - -Graph.prototype.outEdges = function(v, w) { - var outV = this._out[v]; - if (outV) { - var edges = _.values(outV); - if (!w) { - return edges; - } - return _.filter(edges, function(edge) { return edge.w === w; }); - } -}; - -Graph.prototype.nodeEdges = function(v, w) { - var inEdges = this.inEdges(v, w); - if (inEdges) { - return inEdges.concat(this.outEdges(v, w)); - } -}; - -function incrementOrInitEntry(map, k) { - if (_.has(map, k)) { - map[k]++; - } else { - map[k] = 1; - } -} - -function decrementOrRemoveEntry(map, k) { - if (!--map[k]) { delete map[k]; } -} - -function edgeArgsToId(isDirected, v, w, name) { - if (!isDirected && v > w) { - var tmp = v; - v = w; - w = tmp; - } - return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM + - (_.isUndefined(name) ? DEFAULT_EDGE_NAME : name); -} - -function edgeArgsToObj(isDirected, v, w, name) { - if (!isDirected && v > w) { - var tmp = v; - v = w; - w = tmp; - } - var edgeObj = { v: v, w: w }; - if (name) { - edgeObj.name = name; - } - return edgeObj; -} - -function edgeObjToId(isDirected, edgeObj) { - return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); -} - -},{"./lodash":95}],93:[function(require,module,exports){ -arguments[4][73][0].apply(exports,arguments) -},{"./graph":92,"./version":96}],94:[function(require,module,exports){ -arguments[4][74][0].apply(exports,arguments) -},{"./graph":92,"./lodash":95}],95:[function(require,module,exports){ -module.exports=require(20) -},{"lodash":101}],96:[function(require,module,exports){ -module.exports = '0.9.1'; - -},{}],97:[function(require,module,exports){ - -},{}],98:[function(require,module,exports){ +},{}],79:[function(require,module,exports){ (function (process){ // Copyright Joyent, Inc. and other Node contributors. // @@ -5811,7 +14527,7 @@ var substr = 'ab'.substr(-1) === 'b' ; }).call(this,require("1YiZ5S")) -},{"1YiZ5S":99}],99:[function(require,module,exports){ +},{"1YiZ5S":80}],80:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -5876,7 +14592,7 @@ process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; -},{}],100:[function(require,module,exports){ +},{}],81:[function(require,module,exports){ (function (global){ /*! http://mths.be/he v0.5.0 by @mathias | MIT license */ ;(function(root) { @@ -6209,7 +14925,7 @@ process.chdir = function (dir) { }(this)); }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],101:[function(require,module,exports){ +},{}],82:[function(require,module,exports){ (function (global){ /** * @license @@ -12998,7 +21714,7 @@ process.chdir = function (dir) { }.call(this)); }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],102:[function(require,module,exports){ +},{}],83:[function(require,module,exports){ module.exports={ "name": "mermaid", "version": "0.3.2", @@ -13018,6 +21734,7 @@ module.exports={ "license": "MIT", "dependencies": { "chalk": "^0.5.1", + "d3": "~3.4.13", "dagre-d3": "~0.3.2", "he": "^0.5.0", "minimist": "^1.1.0", @@ -13072,6 +21789,7 @@ module.exports={ "mock-browser": "^0.90.27", "path": "^0.4.9", "phantomjs": "^1.9.12", + "proxyquire": "^1.3.1", "rewire": "^2.1.3", "rimraf": "^2.2.8", "semantic-ui": "^1.4.1", @@ -13079,704 +21797,7 @@ module.exports={ } } -},{}],103:[function(require,module,exports){ -/** - * Created by knut on 15-01-14. - */ - -var message = ''; -var info = false; - -exports.setMessage = function(txt){ - message = txt; -}; - -exports.getMessage = function(){ - return message; -}; - -exports.setInfo = function(inf){ - info = inf; -}; - -exports.getInfo = function(){ - return info; -}; - - -},{}],104:[function(require,module,exports){ -/** - * Created by knut on 14-12-11. - */ -var db = require('./exampleDb'); -var exampleParser = require('./parser/example.js'); - - -/** - * Draws a an info picture in the tag with id: id based on the graph definition in text. - * @param text - * @param id - */ -exports.draw = function (txt, id, ver) { - var parser; - parser = exampleParser.parser; - parser.yy = db; - - // Parse the graph definition - parser.parse(txt); - - // Fetch the default direction, use TD if none was found - var svg = d3.select('#'+id); - - var textstring = "mermaid!"; - var g = svg.append("g"); - - g.append("text") // text label for the x axis - .attr("x", 100) - .attr("y", 40) - .attr('class','version') - .attr('font-size','32px') - .style("text-anchor", "middle") - .text('mermaid '+ ver); - - /* - var box = exports.bounds.getBounds(); - - var height = box.stopy-box.starty+2*conf.diagramMarginY; - var width = box.stopx-box.startx+2*conf.diagramMarginX;*/ - - svg.attr("height",100); - svg.attr("width", 400 ); - //svg.attr("viewBox", '0 0 300 150'); -}; -},{"./exampleDb":103,"./parser/example.js":105}],105:[function(require,module,exports){ -(function (process){ -/* parser generated by jison 0.4.15 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10,12]; -var parser = {trace: function trace() { }, -yy: {}, -symbols_: {"error":2,"start":3,"info":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"showInfo":10,"message":11,"say":12,"TXT":13,"$accept":0,"$end":1}, -terminals_: {2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"}, -productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1: - return yy; -break; -case 4: - -break; -case 6: - yy.setInfo(true); -break; -case 7: - yy.setMessage($$[$0]); -break; -case 8: - this.$ = $$[$0-1].substring(1).trim().replace(/\\n/gm, "\n"); -break; -} -}, -table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6]),o($V0,[2,7]),{13:[1,11]},o($V0,[2,8])], -defaultActions: {4:[2,1]}, -parseError: function parseError(str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - throw new Error(str); - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - _token_stack: - function lex() { - var token; - token = lexer.lex() || EOF; - if (typeof token !== 'number') { - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - 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 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = 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); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return 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 - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function (match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - 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 - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin(condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState(condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {"case-insensitive":true}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { - // Pre-lexer code can go here - -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0:return 9; -break; -case 1:return 10; -break; -case 2:return 4; -break; -case 3:return 12; -break; -case 4:return 13; -break; -case 5:return 6; -break; -case 6:return 'INVALID'; -break; -} -}, -rules: [/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i], -conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (typeof require !== 'undefined' && typeof exports !== 'undefined') { -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain(args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if (typeof module !== 'undefined' && require.main === module) { - exports.main(process.argv.slice(1)); -} -} -}).call(this,require("1YiZ5S")) -},{"1YiZ5S":99,"fs":97,"path":98}],106:[function(require,module,exports){ +},{}],84:[function(require,module,exports){ /* global window */ var dagreD3; @@ -13793,7 +21814,7 @@ if (!dagreD3) { module.exports = dagreD3; -},{"dagre-d3":1}],107:[function(require,module,exports){ +},{"dagre-d3":2}],85:[function(require,module,exports){ (function (global){ /** * Created by knut on 14-12-11. @@ -14190,14 +22211,18 @@ exports.draw = function (text, id,isDot) { setTimeout(function(){ + console.log('Fixing titles'); var i = 0; subGraphs.forEach(function(subG){ + console.log('Setting id '+id); + var clusterRects = document.querySelectorAll('#' + id + ' .clusters rect'); var clusters = document.querySelectorAll('#' + id + ' .cluster'); if(subG.title !== 'undefined'){ + console.log(clusterRects[i]); var xPos = clusterRects[i].x.baseVal.value; var yPos = clusterRects[i].y.baseVal.value; var width = clusterRects[i].width.baseVal.value; @@ -14209,6 +22234,10 @@ exports.draw = function (text, id,isDot) { te.attr('stroke','none'); te.attr('id', id+'Text'); te.style('text-anchor', 'middle'); + console.log('Title '+subG.title); + console.log('i',i); + console.log('x'+xPos+width/2); + console.log('y'+xPos); te.text(subG.title); } i = i + 1; @@ -14216,7 +22245,7 @@ exports.draw = function (text, id,isDot) { },200); }; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./dagre-d3":106,"./graphDb":108,"./parser/dot":109,"./parser/flow":110}],108:[function(require,module,exports){ +},{"./dagre-d3":84,"./graphDb":86,"./parser/dot":87,"./parser/flow":88}],86:[function(require,module,exports){ /** * Created by knut on 14-11-03. */ @@ -14455,7 +22484,7 @@ exports.getSubGraphs = function (list) { return subGraphs; }; -},{}],109:[function(require,module,exports){ +},{}],87:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -15193,7 +23222,7 @@ if (typeof module !== 'undefined' && require.main === module) { } } }).call(this,require("1YiZ5S")) -},{"1YiZ5S":99,"fs":97,"path":98}],110:[function(require,module,exports){ +},{"1YiZ5S":80,"fs":78,"path":79}],88:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -16078,7 +24107,24 @@ if (typeof module !== 'undefined' && require.main === module) { } } }).call(this,require("1YiZ5S")) -},{"1YiZ5S":99,"fs":97,"path":98}],111:[function(require,module,exports){ +},{"1YiZ5S":80,"fs":78,"path":79}],89:[function(require,module,exports){ +/* global window */ + +var d3; + +if (require) { + try { + d3 = require("d3"); + } catch (e) {} +} + +if (!d3) { + d3 = window.d3; +} + +module.exports = d3; + +},{"d3":1}],90:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -16822,7 +24868,7 @@ if (typeof module !== 'undefined' && require.main === module) { } } }).call(this,require("1YiZ5S")) -},{"1YiZ5S":99,"fs":97,"path":98}],112:[function(require,module,exports){ +},{"1YiZ5S":80,"fs":78,"path":79}],91:[function(require,module,exports){ /** * Created by knut on 14-11-19. */ @@ -16955,8 +25001,7 @@ exports.apply = function(param){ // console.log('xxx',param); } }; -},{}],113:[function(require,module,exports){ -/* globals d3 */ +},{}],92:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -16964,6 +25009,7 @@ exports.apply = function(param){ var sq = require('./parser/sequenceDiagram').parser; sq.yy = require('./sequenceDb'); var svgDraw = require('./svgDraw'); +var d3 = require('./d3'); var conf = { diagramMarginX:50, @@ -17302,7 +25348,7 @@ module.exports.draw = function (text, id) { diagram.attr("viewBox", (box.startx-conf.diagramMarginX) + ' -' +conf.diagramMarginY + ' ' + width + ' ' + height); }; -},{"./parser/sequenceDiagram":111,"./sequenceDb":112,"./svgDraw":114}],114:[function(require,module,exports){ +},{"./d3":89,"./parser/sequenceDiagram":90,"./sequenceDb":91,"./svgDraw":93}],93:[function(require,module,exports){ /** * Created by knut on 14-12-20. */ @@ -17532,14 +25578,13 @@ exports.getNoteRect = function(){ return rect; }; -},{}],115:[function(require,module,exports){ +},{}],94:[function(require,module,exports){ (function (global){ var graph = require('./diagrams/flowchart/graphDb'); var flow = require('./diagrams/flowchart/parser/flow'); var utils = require('./utils'); var flowRenderer = require('./diagrams/flowchart/flowRenderer'); var seq = require('./diagrams/sequenceDiagram/sequenceRenderer'); -var info = require('./diagrams/example/exampleRenderer'); var he = require('he'); /** @@ -17559,7 +25604,7 @@ var init = function (sequenceConfig) { var arr = document.querySelectorAll('.mermaid'); var i; - if (sequenceConfig !== 'undefined' && (typeof sequenceConfig !== 'undefined')) { + if (sequenceConfig !== 'undefined') { seq.setConf(JSON.parse(sequenceConfig)); } @@ -17608,10 +25653,6 @@ var init = function (sequenceConfig) { // TODO - Get styles for sequence diagram utils.cloneCssStyles(element.firstChild, []); break; - case 'info': - info.draw(txt,id,exports.version()); - utils.cloneCssStyles(element.firstChild, []); - break; } } @@ -17690,7 +25731,7 @@ if(typeof document !== 'undefined'){ }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../package.json":102,"./diagrams/example/exampleRenderer":104,"./diagrams/flowchart/flowRenderer":107,"./diagrams/flowchart/graphDb":108,"./diagrams/flowchart/parser/flow":110,"./diagrams/sequenceDiagram/sequenceRenderer":113,"./utils":116,"he":100}],116:[function(require,module,exports){ +},{"../package.json":83,"./diagrams/flowchart/flowRenderer":85,"./diagrams/flowchart/graphDb":86,"./diagrams/flowchart/parser/flow":88,"./diagrams/sequenceDiagram/sequenceRenderer":92,"./utils":95,"he":81}],95:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -17711,15 +25752,10 @@ module.exports.detectType = function(text,a){ } if(text.match(/^\s*digraph/)) { - console.log('Detected dot syntax'); + console.log('Detected flow syntax'); return "dotGraph"; } - if(text.match(/^\s*info/)) { - //console.log('Detected info syntax'); - return "info"; - } - return "graph"; }; @@ -17793,4 +25829,4 @@ module.exports.cloneCssStyles = function(svg, classes){ } }; -},{}]},{},[115]) \ No newline at end of file +},{}]},{},[94]) \ No newline at end of file diff --git a/dist/mermaid.full.min.js b/dist/mermaid.full.min.js index 6e459f3aa..c59d12267 100644 --- a/dist/mermaid.full.min.js +++ b/dist/mermaid.full.min.js @@ -25,15 +25,19 @@ var t=x.length;if(t){x.sort(c);for(var e,r=1,u=x[0],i=[u];t>r;++r)e=x[r],l(e[0], * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -module.exports={graphlib:require("./lib/graphlib"),dagre:require("./lib/dagre"),intersect:require("./lib/intersect"),render:require("./lib/render"),util:require("./lib/util"),version:require("./lib/version")}},{"./lib/dagre":8,"./lib/graphlib":9,"./lib/intersect":10,"./lib/render":23,"./lib/util":25,"./lib/version":26}],2:[function(require,module,exports){var util=require("./util");module.exports={"default":normal,normal:normal,vee:vee};function normal(parent,id,edge,type){var marker=parent.append("marker").attr("id",id).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto");var path=marker.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");util.applyStyle(path,edge[type+"Style"])}function vee(parent,id,edge,type){var marker=parent.append("marker").attr("id",id).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto");var path=marker.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");util.applyStyle(path,edge[type+"Style"])}},{"./util":25}],3:[function(require,module,exports){var util=require("./util");module.exports=createClusters;function createClusters(selection,g){var clusters=g.nodes().filter(function(v){return util.isSubgraph(g,v)}),svgClusters=selection.selectAll("g.cluster").data(clusters,function(v){return v});svgClusters.enter().append("g").attr("class","cluster").style("opacity",0).append("rect");util.applyTransition(svgClusters.exit(),g).style("opacity",0).remove();util.applyTransition(svgClusters,g).style("opacity",1);util.applyTransition(svgClusters.selectAll("rect"),g).attr("width",function(v){return g.node(v).width}).attr("height",function(v){return g.node(v).height}).attr("x",function(v){var node=g.node(v);return node.x-node.width/2}).attr("y",function(v){var node=g.node(v);return node.y-node.height/2})}},{"./util":25}],4:[function(require,module,exports){"use strict";var _=require("./lodash"),addLabel=require("./label/add-label"),util=require("./util"),d3=require("./d3");module.exports=createEdgeLabels;function createEdgeLabels(selection,g){var svgEdgeLabels=selection.selectAll("g.edgeLabel").data(g.edges(),function(e){return util.edgeToId(e)}).classed("update",true);svgEdgeLabels.selectAll("*").remove();svgEdgeLabels.enter().append("g").classed("edgeLabel",true).style("opacity",0);svgEdgeLabels.each(function(e){var edge=g.edge(e),label=addLabel(d3.select(this),g.edge(e),0,0).classed("label",true),bbox=label.node().getBBox();if(edge.labelId){label.attr("id",edge.labelId)}if(!_.has(edge,"width")){edge.width=bbox.width}if(!_.has(edge,"height")){edge.height=bbox.height}});util.applyTransition(svgEdgeLabels.exit(),g).style("opacity",0).remove();return svgEdgeLabels}},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],5:[function(require,module,exports){"use strict";var _=require("./lodash"),intersectNode=require("./intersect/intersect-node"),util=require("./util"),d3=require("./d3");module.exports=createEdgePaths;function createEdgePaths(selection,g,arrows){var svgPaths=selection.selectAll("g.edgePath").data(g.edges(),function(e){return util.edgeToId(e)}).classed("update",true);enter(svgPaths,g);exit(svgPaths,g);util.applyTransition(svgPaths,g).style("opacity",1);svgPaths.selectAll("path.path").each(function(e){var edge=g.edge(e);edge.arrowheadId=_.uniqueId("arrowhead");var domEdge=d3.select(this).attr("marker-end",function(){return"url(#"+edge.arrowheadId+")"}).style("fill","none");util.applyTransition(domEdge,g).attr("d",function(e){return calcPoints(g,e)});if(edge.id){domEdge.attr("id",edge.id)}util.applyStyle(domEdge,edge.style)});svgPaths.selectAll("defs *").remove();svgPaths.selectAll("defs").each(function(e){var edge=g.edge(e),arrowhead=arrows[edge.arrowhead];arrowhead(d3.select(this),edge.arrowheadId,edge,"arrowhead")});return svgPaths}function calcPoints(g,e){var edge=g.edge(e),tail=g.node(e.v),head=g.node(e.w),points=edge.points.slice(1,edge.points.length-1);points.unshift(intersectNode(tail,points[0]));points.push(intersectNode(head,points[points.length-1]));return createLine(edge,points)}function createLine(edge,points){var line=d3.svg.line().x(function(d){return d.x}).y(function(d){return d.y});if(_.has(edge,"lineInterpolate")){line.interpolate(edge.lineInterpolate)}if(_.has(edge,"lineTension")){line.tension(Number(edge.lineTension))}return line(points)}function getCoords(elem){var bbox=elem.getBBox(),matrix=elem.getTransformToElement(elem.ownerSVGElement).translate(bbox.width/2,bbox.height/2);return{x:matrix.e,y:matrix.f}}function enter(svgPaths,g){var svgPathsEnter=svgPaths.enter().append("g").attr("class","edgePath").style("opacity",0);svgPathsEnter.append("path").attr("class","path").attr("d",function(e){var edge=g.edge(e),sourceElem=g.node(e.v).elem,points=_.range(edge.points.length).map(function(){return getCoords(sourceElem)});return createLine(edge,points)});svgPathsEnter.append("defs")}function exit(svgPaths,g){var svgPathExit=svgPaths.exit();util.applyTransition(svgPathExit,g).style("opacity",0).remove();util.applyTransition(svgPathExit.select("path.path"),g).attr("d",function(e){var source=g.node(e.v);if(source){var points=_.range(this.pathSegList.length).map(function(){return source});return createLine({},points)}else{return d3.select(this).attr("d")}})}},{"./d3":7,"./intersect/intersect-node":14,"./lodash":20,"./util":25}],6:[function(require,module,exports){"use strict";var _=require("./lodash"),addLabel=require("./label/add-label"),util=require("./util"),d3=require("./d3");module.exports=createNodes;function createNodes(selection,g,shapes){var simpleNodes=g.nodes().filter(function(v){return!util.isSubgraph(g,v)});var svgNodes=selection.selectAll("g.node").data(simpleNodes,function(v){return v}).classed("update",true);svgNodes.selectAll("*").remove();svgNodes.enter().append("g").attr("class","node").style("opacity",0);svgNodes.each(function(v){var node=g.node(v),thisGroup=d3.select(this),labelGroup=thisGroup.append("g").attr("class","label"),labelDom=addLabel(labelGroup,node),shape=shapes[node.shape],bbox=labelDom.node().getBBox();node.elem=this;if(node.id){thisGroup.attr("id",node.id)}if(node.labelId){labelGroup.attr("id",node.labelId)}util.applyClass(thisGroup,node.class,(thisGroup.classed("update")?"update ":"")+"node");if(_.has(node,"width")){bbox.width=node.width}if(_.has(node,"height")){bbox.height=node.height}bbox.width+=node.paddingLeft+node.paddingRight;bbox.height+=node.paddingTop+node.paddingBottom;labelGroup.attr("transform","translate("+(node.paddingLeft-node.paddingRight)/2+","+(node.paddingTop-node.paddingBottom)/2+")");var shapeSvg=shape(d3.select(this),bbox,node);util.applyStyle(shapeSvg,node.style);var shapeBBox=shapeSvg.node().getBBox();node.width=shapeBBox.width;node.height=shapeBBox.height});util.applyTransition(svgNodes.exit(),g).style("opacity",0).remove();return svgNodes}},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],7:[function(require,module,exports){module.exports=window.d3},{}],8:[function(require,module,exports){var dagre;if(require){try{dagre=require("dagre")}catch(e){}}if(!dagre){dagre=window.dagre}module.exports=dagre},{dagre:27}],9:[function(require,module,exports){var graphlib;if(require){try{graphlib=require("graphlib")}catch(e){}}if(!graphlib){graphlib=window.graphlib}module.exports=graphlib},{graphlib:57}],10:[function(require,module,exports){module.exports={node:require("./intersect-node"),circle:require("./intersect-circle"),ellipse:require("./intersect-ellipse"),polygon:require("./intersect-polygon"),rect:require("./intersect-rect")}},{"./intersect-circle":11,"./intersect-ellipse":12,"./intersect-node":14,"./intersect-polygon":15,"./intersect-rect":16}],11:[function(require,module,exports){var intersectEllipse=require("./intersect-ellipse");module.exports=intersectCircle;function intersectCircle(node,rx,point){return intersectEllipse(node,rx,rx,point)}},{"./intersect-ellipse":12}],12:[function(require,module,exports){module.exports=intersectEllipse;function intersectEllipse(node,rx,ry,point){var cx=node.x;var cy=node.y;var px=cx-point.x;var py=cy-point.y;var det=Math.sqrt(rx*rx*py*py+ry*ry*px*px);var dx=Math.abs(rx*ry*px/det);if(point.x0}},{}],14:[function(require,module,exports){module.exports=intersectNode;function intersectNode(node,point){return node.intersect(point)}},{}],15:[function(require,module,exports){var intersectLine=require("./intersect-line");module.exports=intersectPolygon;function intersectPolygon(node,polyPoints,point){var x1=node.x;var y1=node.y;var intersections=[];var minX=Number.POSITIVE_INFINITY,minY=Number.POSITIVE_INFINITY;polyPoints.forEach(function(entry){minX=Math.min(minX,entry.x);minY=Math.min(minY,entry.y)});var left=x1-node.width/2-minX;var top=y1-node.height/2-minY;for(var i=0;i1){intersections.sort(function(p,q){var pdx=p.x-point.x,pdy=p.y-point.y,distp=Math.sqrt(pdx*pdx+pdy*pdy),qdx=q.x-point.x,qdy=q.y-point.y,distq=Math.sqrt(qdx*qdx+qdy*qdy);return distpMath.abs(dx)*h){if(dy<0){h=-h}sx=dy===0?0:h*dx/dy;sy=h}else{if(dx<0){w=-w}sx=w;sy=dx===0?0:w*dy/dx}return{x:x+sx,y:y+sy}}},{}],17:[function(require,module,exports){var util=require("../util");module.exports=addHtmlLabel;function addHtmlLabel(root,node){var fo=root.append("foreignObject").attr("width","100000");var div=fo.append("xhtml:div");var label=node.label;switch(typeof label){case"function":div.insert(label);break;case"object":div.insert(function(){return label});break;default:div.html(label)}util.applyStyle(div,node.labelStyle);div.style("display","inline-block");div.style("white-space","nowrap");var w,h;div.each(function(){w=this.clientWidth;h=this.clientHeight});fo.attr("width",w).attr("height",h);return fo}},{"../util":25}],18:[function(require,module,exports){var addTextLabel=require("./add-text-label"),addHtmlLabel=require("./add-html-label");module.exports=addLabel;function addLabel(root,node){var label=node.label;var labelSvg=root.append("g");if(typeof label!=="string"||node.labelType==="html"){addHtmlLabel(labelSvg,node)}else{addTextLabel(labelSvg,node)}var labelBBox=labelSvg.node().getBBox();labelSvg.attr("transform","translate("+-labelBBox.width/2+","+-labelBBox.height/2+")");return labelSvg}},{"./add-html-label":17,"./add-text-label":19}],19:[function(require,module,exports){var util=require("../util");module.exports=addTextLabel;function addTextLabel(root,node){var domNode=root.append("text");var lines=processEscapeSequences(node.label).split("\n");for(var i=0;i0;--i){entry=buckets[i].dequeue();if(entry){results=results.concat(removeNode(g,buckets,zeroIdx,entry,true));break}}}}return results}function removeNode(g,buckets,zeroIdx,entry,collectPredecessors){var results=collectPredecessors?[]:undefined;_.each(g.inEdges(entry.v),function(edge){var weight=g.edge(edge),uEntry=g.node(edge.v);if(collectPredecessors){results.push({v:edge.v,w:edge.w})}uEntry.out-=weight;assignBucket(buckets,zeroIdx,uEntry)});_.each(g.outEdges(entry.v),function(edge){var weight=g.edge(edge),w=edge.w,wEntry=g.node(w);wEntry.in-=weight;assignBucket(buckets,zeroIdx,wEntry)});g.removeNode(entry.v);return results}function buildState(g,weightFn){var fasGraph=new Graph,maxIn=0,maxOut=0;_.each(g.nodes(),function(v){fasGraph.setNode(v,{v:v,"in":0,out:0})});_.each(g.edges(),function(e){var prevWeight=fasGraph.edge(e.v,e.w)||0,weight=weightFn(e),edgeWeight=prevWeight+weight;fasGraph.setEdge(e.v,e.w,edgeWeight);maxOut=Math.max(maxOut,fasGraph.node(e.v).out+=weight);maxIn=Math.max(maxIn,fasGraph.node(e.w).in+=weight)});var buckets=_.range(maxOut+maxIn+3).map(function(){return new List});var zeroIdx=maxIn+1;_.each(fasGraph.nodes(),function(v){assignBucket(buckets,zeroIdx,fasGraph.node(v))});return{graph:fasGraph,buckets:buckets,zeroIdx:zeroIdx}}function assignBucket(buckets,zeroIdx,entry){if(!entry.out){buckets[0].enqueue(entry)}else if(!entry.in){buckets[buckets.length-1].enqueue(entry)}else{buckets[entry.out-entry.in+zeroIdx].enqueue(entry)}}},{"./data/list":31,"./graphlib":33,"./lodash":36}],35:[function(require,module,exports){"use strict";var _=require("./lodash"),acyclic=require("./acyclic"),normalize=require("./normalize"),rank=require("./rank"),normalizeRanks=require("./util").normalizeRanks,parentDummyChains=require("./parent-dummy-chains"),removeEmptyRanks=require("./util").removeEmptyRanks,nestingGraph=require("./nesting-graph"),addBorderSegments=require("./add-border-segments"),coordinateSystem=require("./coordinate-system"),order=require("./order"),position=require("./position"),util=require("./util"),Graph=require("./graphlib").Graph;module.exports=layout;function layout(g,opts){var time=opts&&opts.debugTiming?util.time:util.notime;time("layout",function(){var layoutGraph=time(" buildLayoutGraph",function(){return buildLayoutGraph(g)});time(" runLayout",function(){runLayout(layoutGraph,time)});time(" updateInputGraph",function(){updateInputGraph(g,layoutGraph)})})}function runLayout(g,time){time(" makeSpaceForEdgeLabels",function(){makeSpaceForEdgeLabels(g)});time(" removeSelfEdges",function(){removeSelfEdges(g)});time(" acyclic",function(){acyclic.run(g)});time(" nestingGraph.run",function(){nestingGraph.run(g)});time(" rank",function(){rank(util.asNonCompoundGraph(g))});time(" injectEdgeLabelProxies",function(){injectEdgeLabelProxies(g)});time(" removeEmptyRanks",function(){removeEmptyRanks(g)});time(" nestingGraph.cleanup",function(){nestingGraph.cleanup(g)});time(" normalizeRanks",function(){normalizeRanks(g)});time(" assignRankMinMax",function(){assignRankMinMax(g)});time(" removeEdgeLabelProxies",function(){removeEdgeLabelProxies(g)});time(" normalize.run",function(){normalize.run(g)});time(" parentDummyChains",function(){parentDummyChains(g)});time(" addBorderSegments",function(){addBorderSegments(g)});time(" order",function(){order(g)});time(" insertSelfEdges",function(){insertSelfEdges(g)});time(" adjustCoordinateSystem",function(){coordinateSystem.adjust(g)});time(" position",function(){position(g)});time(" positionSelfEdges",function(){positionSelfEdges(g)});time(" removeBorderNodes",function(){removeBorderNodes(g)});time(" normalize.undo",function(){normalize.undo(g)});time(" fixupEdgeLabelCoords",function(){fixupEdgeLabelCoords(g)});time(" undoCoordinateSystem",function(){coordinateSystem.undo(g)});time(" translateGraph",function(){translateGraph(g)});time(" assignNodeIntersects",function(){assignNodeIntersects(g)});time(" reversePoints",function(){reversePointsForReversedEdges(g)});time(" acyclic.undo",function(){acyclic.undo(g)})}function updateInputGraph(inputGraph,layoutGraph){_.each(inputGraph.nodes(),function(v){var inputLabel=inputGraph.node(v),layoutLabel=layoutGraph.node(v);if(inputLabel){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y;if(layoutGraph.children(v).length){inputLabel.width=layoutLabel.width;inputLabel.height=layoutLabel.height}}});_.each(inputGraph.edges(),function(e){var inputLabel=inputGraph.edge(e),layoutLabel=layoutGraph.edge(e);inputLabel.points=layoutLabel.points;if(_.has(layoutLabel,"x")){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y}});inputGraph.graph().width=layoutGraph.graph().width;inputGraph.graph().height=layoutGraph.graph().height}var graphNumAttrs=["nodesep","edgesep","ranksep","marginx","marginy"],graphDefaults={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},graphAttrs=["acyclicer","ranker","rankdir","align"],nodeNumAttrs=["width","height"],nodeDefaults={width:0,height:0},edgeNumAttrs=["minlen","weight","width","height","labeloffset"],edgeDefaults={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},edgeAttrs=["labelpos"];function buildLayoutGraph(inputGraph){var g=new Graph({multigraph:true,compound:true}),graph=canonicalize(inputGraph.graph());g.setGraph(_.merge({},graphDefaults,selectNumberAttrs(graph,graphNumAttrs),_.pick(graph,graphAttrs)));_.each(inputGraph.nodes(),function(v){var node=canonicalize(inputGraph.node(v));g.setNode(v,_.defaults(selectNumberAttrs(node,nodeNumAttrs),nodeDefaults));g.setParent(v,inputGraph.parent(v))});_.each(inputGraph.edges(),function(e){var edge=canonicalize(inputGraph.edge(e));g.setEdge(e,_.merge({},edgeDefaults,selectNumberAttrs(edge,edgeNumAttrs),_.pick(edge,edgeAttrs)))});return g}function makeSpaceForEdgeLabels(g){var graph=g.graph();graph.ranksep/=2;_.each(g.edges(),function(e){var edge=g.edge(e);edge.minlen*=2;if(edge.labelpos.toLowerCase()!=="c"){if(graph.rankdir==="TB"||graph.rankdir==="BT"){edge.width+=edge.labeloffset}else{edge.height+=edge.labeloffset}}})}function injectEdgeLabelProxies(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.width&&edge.height){var v=g.node(e.v),w=g.node(e.w),label={rank:(w.rank-v.rank)/2+v.rank,e:e};util.addDummyNode(g,"edge-proxy",label,"_ep")}})}function assignRankMinMax(g){var maxRank=0;_.each(g.nodes(),function(v){var node=g.node(v);if(node.borderTop){node.minRank=g.node(node.borderTop).rank;node.maxRank=g.node(node.borderBottom).rank;maxRank=_.max(maxRank,node.maxRank)}});g.graph().maxRank=maxRank}function removeEdgeLabelProxies(g){_.each(g.nodes(),function(v){var node=g.node(v);if(node.dummy==="edge-proxy"){g.edge(node.e).labelRank=node.rank;g.removeNode(v)}})}function translateGraph(g){var minX=Number.POSITIVE_INFINITY,maxX=0,minY=Number.POSITIVE_INFINITY,maxY=0,graphLabel=g.graph(),marginX=graphLabel.marginx||0,marginY=graphLabel.marginy||0;function getExtremes(attrs){var x=attrs.x,y=attrs.y,w=attrs.width,h=attrs.height;minX=Math.min(minX,x-w/2);maxX=Math.max(maxX,x+w/2);minY=Math.min(minY,y-h/2);maxY=Math.max(maxY,y+h/2) -}_.each(g.nodes(),function(v){getExtremes(g.node(v))});_.each(g.edges(),function(e){var edge=g.edge(e);if(_.has(edge,"x")){getExtremes(edge)}});minX-=marginX;minY-=marginY;_.each(g.nodes(),function(v){var node=g.node(v);node.x-=minX;node.y-=minY});_.each(g.edges(),function(e){var edge=g.edge(e);_.each(edge.points,function(p){p.x-=minX;p.y-=minY});if(_.has(edge,"x")){edge.x-=minX}if(_.has(edge,"y")){edge.y-=minY}});graphLabel.width=maxX-minX+marginX;graphLabel.height=maxY-minY+marginY}function assignNodeIntersects(g){_.each(g.edges(),function(e){var edge=g.edge(e),nodeV=g.node(e.v),nodeW=g.node(e.w),p1,p2;if(!edge.points){edge.points=[];p1=nodeW;p2=nodeV}else{p1=edge.points[0];p2=edge.points[edge.points.length-1]}edge.points.unshift(util.intersectRect(nodeV,p1));edge.points.push(util.intersectRect(nodeW,p2))})}function fixupEdgeLabelCoords(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(_.has(edge,"x")){if(edge.labelpos==="l"||edge.labelpos==="r"){edge.width-=edge.labeloffset}switch(edge.labelpos){case"l":edge.x-=edge.width/2+edge.labeloffset;break;case"r":edge.x+=edge.width/2+edge.labeloffset;break}}})}function reversePointsForReversedEdges(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.reversed){edge.points.reverse()}})}function removeBorderNodes(g){_.each(g.nodes(),function(v){if(g.children(v).length){var node=g.node(v),t=g.node(node.borderTop),b=g.node(node.borderBottom),l=g.node(_.last(node.borderLeft)),r=g.node(_.last(node.borderRight));node.width=Math.abs(r.x-l.x);node.height=Math.abs(b.y-t.y);node.x=l.x+node.width/2;node.y=t.y+node.height/2}});_.each(g.nodes(),function(v){if(g.node(v).dummy==="border"){g.removeNode(v)}})}function removeSelfEdges(g){_.each(g.edges(),function(e){if(e.v===e.w){var node=g.node(e.v);if(!node.selfEdges){node.selfEdges=[]}node.selfEdges.push({e:e,label:g.edge(e)});g.removeEdge(e)}})}function insertSelfEdges(g){var layers=util.buildLayerMatrix(g);_.each(layers,function(layer){var orderShift=0;_.each(layer,function(v,i){var node=g.node(v);node.order=i+orderShift;_.each(node.selfEdges,function(selfEdge){util.addDummyNode(g,"selfedge",{width:selfEdge.label.width,height:selfEdge.label.height,rank:node.rank,order:i+ ++orderShift,e:selfEdge.e,label:selfEdge.label},"_se")});delete node.selfEdges})})}function positionSelfEdges(g){_.each(g.nodes(),function(v){var node=g.node(v);if(node.dummy==="selfedge"){var selfNode=g.node(node.e.v),x=selfNode.x+selfNode.width/2,y=selfNode.y,dx=node.x-x,dy=selfNode.height/2;g.setEdge(node.e,node.label);g.removeNode(v);node.label.points=[{x:x+2*dx/3,y:y-dy},{x:x+5*dx/6,y:y-dy},{x:x+dx,y:y},{x:x+5*dx/6,y:y+dy},{x:x+2*dx/3,y:y+dy}];node.label.x=node.x;node.label.y=node.y}})}function selectNumberAttrs(obj,attrs){return _.mapValues(_.pick(obj,attrs),Number)}function canonicalize(attrs){var newAttrs={};_.each(attrs,function(v,k){newAttrs[k.toLowerCase()]=v});return newAttrs}},{"./acyclic":28,"./add-border-segments":29,"./coordinate-system":30,"./graphlib":33,"./lodash":36,"./nesting-graph":37,"./normalize":38,"./order":43,"./parent-dummy-chains":48,"./position":50,"./rank":52,"./util":55}],36:[function(require,module,exports){module.exports=require(20)},{"/Users/cpettitt/projects/dagre-d3/lib/lodash.js":20,lodash:77}],37:[function(require,module,exports){var _=require("./lodash"),util=require("./util");module.exports={run:run,cleanup:cleanup};function run(g){var root=util.addDummyNode(g,"root",{},"_root"),depths=treeDepths(g),height=_.max(depths)-1,nodeSep=2*height+1;g.graph().nestingRoot=root;_.each(g.edges(),function(e){g.edge(e).minlen*=nodeSep});var weight=sumWeights(g)+1;_.each(g.children(),function(child){dfs(g,root,nodeSep,weight,height,depths,child)});g.graph().nodeRankFactor=nodeSep}function dfs(g,root,nodeSep,weight,height,depths,v){var children=g.children(v);if(!children.length){if(v!==root){g.setEdge(root,v,{weight:0,minlen:nodeSep})}return}var top=util.addBorderNode(g,"_bt"),bottom=util.addBorderNode(g,"_bb"),label=g.node(v);g.setParent(top,v);label.borderTop=top;g.setParent(bottom,v);label.borderBottom=bottom;_.each(children,function(child){dfs(g,root,nodeSep,weight,height,depths,child);var childNode=g.node(child),childTop=childNode.borderTop?childNode.borderTop:child,childBottom=childNode.borderBottom?childNode.borderBottom:child,thisWeight=childNode.borderTop?weight:2*weight,minlen=childTop!==childBottom?1:height-depths[v]+1;g.setEdge(top,childTop,{weight:thisWeight,minlen:minlen,nestingEdge:true});g.setEdge(childBottom,bottom,{weight:thisWeight,minlen:minlen,nestingEdge:true})});if(!g.parent(v)){g.setEdge(root,top,{weight:0,minlen:height+depths[v]})}}function treeDepths(g){var depths={};function dfs(v,depth){var children=g.children(v);if(children&&children.length){_.each(children,function(child){dfs(child,depth+1)})}depths[v]=depth}_.each(g.children(),function(v){dfs(v,1)});return depths}function sumWeights(g){return _.reduce(g.edges(),function(acc,e){return acc+g.edge(e).weight},0)}function cleanup(g){var graphLabel=g.graph();g.removeNode(graphLabel.nestingRoot);delete graphLabel.nestingRoot;_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.nestingEdge){g.removeEdge(e)}})}},{"./lodash":36,"./util":55}],38:[function(require,module,exports){"use strict";var _=require("./lodash"),util=require("./util");module.exports={run:run,undo:undo};function run(g){g.graph().dummyChains=[];_.each(g.edges(),function(edge){normalizeEdge(g,edge)})}function normalizeEdge(g,e){var v=e.v,vRank=g.node(v).rank,w=e.w,wRank=g.node(w).rank,name=e.name,edgeLabel=g.edge(e),labelRank=edgeLabel.labelRank;if(wRank===vRank+1)return;g.removeEdge(e);var dummy,attrs,i;for(i=0,++vRank;vRank0){if(index%2){weightSum+=tree[index+1]}index=index-1>>1;tree[index]+=entry.weight}cc+=entry.weight*weightSum}));return cc}},{"../lodash":36}],43:[function(require,module,exports){"use strict";var _=require("../lodash"),initOrder=require("./init-order"),crossCount=require("./cross-count"),sortSubgraph=require("./sort-subgraph"),buildLayerGraph=require("./build-layer-graph"),addSubgraphConstraints=require("./add-subgraph-constraints"),Graph=require("../graphlib").Graph,util=require("../util");module.exports=order;function order(g){var maxRank=util.maxRank(g),downLayerGraphs=buildLayerGraphs(g,_.range(1,maxRank+1),"inEdges"),upLayerGraphs=buildLayerGraphs(g,_.range(maxRank-1,-1,-1),"outEdges");var layering=initOrder(g);assignOrder(g,layering);var bestCC=Number.POSITIVE_INFINITY,best;for(var i=0,lastBest=0;lastBest<4;++i,++lastBest){sweepLayerGraphs(i%2?downLayerGraphs:upLayerGraphs,i%4>=2);layering=util.buildLayerMatrix(g);var cc=crossCount(g,layering);if(cc=vEntry.barycenter){mergeEntries(vEntry,uEntry)}}}function handleOut(vEntry){return function(wEntry){wEntry.in.push(vEntry);if(--wEntry.indegree===0){sourceSet.push(wEntry)}}}while(sourceSet.length){var entry=sourceSet.pop();entries.push(entry);_.each(entry.in.reverse(),handleIn(entry));_.each(entry.out,handleOut(entry))}return _.chain(entries).filter(function(entry){return!entry.merged}).map(function(entry){return _.pick(entry,["vs","i","barycenter","weight"])}).value()}function mergeEntries(target,source){var sum=0,weight=0;if(target.weight){sum+=target.barycenter*target.weight;weight+=target.weight}if(source.weight){sum+=source.barycenter*source.weight;weight+=source.weight}target.vs=source.vs.concat(target.vs);target.barycenter=sum/weight;target.weight=weight;target.i=Math.min(source.i,target.i);source.merged=true}},{"../lodash":36}],46:[function(require,module,exports){var _=require("../lodash"),barycenter=require("./barycenter"),resolveConflicts=require("./resolve-conflicts"),sort=require("./sort");module.exports=sortSubgraph;function sortSubgraph(g,v,cg,biasRight){var movable=g.children(v),node=g.node(v),bl=node?node.borderLeft:undefined,br=node?node.borderRight:undefined,subgraphs={};if(bl){movable=_.filter(movable,function(w){return w!==bl&&w!==br})}var barycenters=barycenter(g,movable);_.each(barycenters,function(entry){if(g.children(entry.v).length){var subgraphResult=sortSubgraph(g,entry.v,cg,biasRight);subgraphs[entry.v]=subgraphResult;if(_.has(subgraphResult,"barycenter")){mergeBarycenters(entry,subgraphResult)}}});var entries=resolveConflicts(barycenters,cg);expandSubgraphs(entries,subgraphs);var result=sort(entries,biasRight);if(bl){result.vs=_.flatten([bl,result.vs,br],true);if(g.predecessors(bl).length){var blPred=g.node(g.predecessors(bl)[0]),brPred=g.node(g.predecessors(br)[0]);if(!_.has(result,"barycenter")){result.barycenter=0;result.weight=0}result.barycenter=(result.barycenter*result.weight+blPred.order+brPred.order)/(result.weight+2);result.weight+=2}}return result}function expandSubgraphs(entries,subgraphs){_.each(entries,function(entry){entry.vs=_.flatten(entry.vs.map(function(v){if(subgraphs[v]){return subgraphs[v].vs}return v}),true)})}function mergeBarycenters(target,other){if(!_.isUndefined(target.barycenter)){target.barycenter=(target.barycenter*target.weight+other.barycenter*other.weight)/(target.weight+other.weight);target.weight+=other.weight}else{target.barycenter=other.barycenter;target.weight=other.weight}}},{"../lodash":36,"./barycenter":40,"./resolve-conflicts":45,"./sort":47}],47:[function(require,module,exports){var _=require("../lodash"),util=require("../util");module.exports=sort;function sort(entries,biasRight){var parts=util.partition(entries,function(entry){return _.has(entry,"barycenter")});var sortable=parts.lhs,unsortable=_.sortBy(parts.rhs,function(entry){return-entry.i}),vs=[],sum=0,weight=0,vsIndex=0;sortable.sort(compareWithBias(!!biasRight));vsIndex=consumeUnsortable(vs,unsortable,vsIndex);_.each(sortable,function(entry){vsIndex+=entry.vs.length;vs.push(entry.vs);sum+=entry.barycenter*entry.weight;weight+=entry.weight;vsIndex=consumeUnsortable(vs,unsortable,vsIndex)});var result={vs:_.flatten(vs,true)};if(weight){result.barycenter=sum/weight;result.weight=weight}return result}function consumeUnsortable(vs,unsortable,index){var last;while(unsortable.length&&(last=_.last(unsortable)).i<=index){unsortable.pop();vs.push(last.vs);index++}return index}function compareWithBias(bias){return function(entryV,entryW){if(entryV.barycenterentryW.barycenter){return 1}return!bias?entryV.i-entryW.i:entryW.i-entryV.i}}},{"../lodash":36,"../util":55}],48:[function(require,module,exports){var _=require("./lodash");module.exports=parentDummyChains;function parentDummyChains(g){var postorderNums=postorder(g);_.each(g.graph().dummyChains,function(v){var node=g.node(v),edgeObj=node.edgeObj,pathData=findPath(g,postorderNums,edgeObj.v,edgeObj.w),path=pathData.path,lca=pathData.lca,pathIdx=0,pathV=path[pathIdx],ascending=true;while(v!==edgeObj.w){node=g.node(v);if(ascending){while((pathV=path[pathIdx])!==lca&&g.node(pathV).maxRanklow||lim>postorderNums[parent].lim));lca=parent;parent=w;while((parent=g.parent(parent))!==lca){wPath.push(parent)}return{path:vPath.concat(wPath.reverse()),lca:lca}}function postorder(g){var result={},lim=0;function dfs(v){var low=lim;_.each(g.children(v),dfs);result[v]={low:low,lim:lim++}}_.each(g.children(),dfs);return result}},{"./lodash":36}],49:[function(require,module,exports){"use strict";var _=require("../lodash"),util=require("../util");module.exports={positionX:positionX,findType1Conflicts:findType1Conflicts,findType2Conflicts:findType2Conflicts,addConflict:addConflict,hasConflict:hasConflict,verticalAlignment:verticalAlignment,horizontalCompaction:horizontalCompaction,alignCoordinates:alignCoordinates,findSmallestWidthAlignment:findSmallestWidthAlignment,balance:balance};function findType1Conflicts(g,layering){var conflicts={};function visitLayer(prevLayer,layer){var k0=0,scanPos=0,prevLayerLength=prevLayer.length,lastNode=_.last(layer);_.each(layer,function(v,i){var w=findOtherInnerSegmentNode(g,v),k1=w?g.node(w).order:prevLayerLength;if(w||v===lastNode){_.each(layer.slice(scanPos,i+1),function(scanNode){_.each(g.predecessors(scanNode),function(u){var uLabel=g.node(u),uPos=uLabel.order;if((uPosnextNorthBorder)){addConflict(conflicts,u,v)}})}})}function visitLayer(north,south){var prevNorthPos=-1,nextNorthPos,southPos=0;_.each(south,function(v,southLookahead){if(g.node(v).dummy==="border"){var predecessors=g.predecessors(v);if(predecessors.length){nextNorthPos=g.node(predecessors[0]).order;scan(south,southPos,southLookahead,prevNorthPos,nextNorthPos);southPos=southLookahead;prevNorthPos=nextNorthPos}}scan(south,southPos,south.length,nextNorthPos,north.length)});return south}_.reduce(layering,visitLayer);return conflicts}function findOtherInnerSegmentNode(g,v){if(g.node(v).dummy){return _.find(g.predecessors(v),function(u){return g.node(u).dummy})}}function addConflict(conflicts,v,w){if(v>w){var tmp=v;v=w;w=tmp}var conflictsV=conflicts[v];if(!conflictsV){conflicts[v]=conflictsV={}}conflictsV[w]=true}function hasConflict(conflicts,v,w){if(v>w){var tmp=v;v=w;w=tmp}return _.has(conflicts[v],w)}function verticalAlignment(g,layering,conflicts,neighborFn){var root={},align={},pos={};_.each(layering,function(layer){_.each(layer,function(v,order){root[v]=v;align[v]=v;pos[v]=order})});_.each(layering,function(layer){var prevIdx=-1;_.each(layer,function(v){var ws=neighborFn(v);if(ws.length){ws=_.sortBy(ws,function(w){return pos[w]});var mp=(ws.length-1)/2;for(var i=Math.floor(mp),il=Math.ceil(mp);i<=il;++i){var w=ws[i];if(align[v]===v&&prevIdxwLabel.lim){tailLabel=wLabel;flip=true}var candidates=_.filter(g.edges(),function(edge){return flip===isDescendant(t,t.node(edge.v),tailLabel)&&flip!==isDescendant(t,t.node(edge.w),tailLabel)});return _.min(candidates,function(edge){return slack(g,edge)})}function exchangeEdges(t,g,e,f){var v=e.v,w=e.w;t.removeEdge(v,w);t.setEdge(f.v,f.w,{});initLowLimValues(t);initCutValues(t,g);updateRanks(t,g)}function updateRanks(t,g){var root=_.find(t.nodes(),function(v){return!g.node(v).parent}),vs=preorder(t,root);vs=vs.slice(1);_.each(vs,function(v){var parent=t.node(v).parent,edge=g.edge(v,parent),flipped=false;if(!edge){edge=g.edge(parent,v);flipped=true}g.node(v).rank=g.node(parent).rank+(flipped?edge.minlen:-edge.minlen)})}function isTreeEdge(tree,u,v){return tree.hasEdge(u,v)}function isDescendant(tree,vLabel,rootLabel){return rootLabel.low<=vLabel.lim&&vLabel.lim<=rootLabel.lim}},{"../graphlib":33,"../lodash":36,"../util":55,"./feasible-tree":51,"./util":54}],54:[function(require,module,exports){"use strict";var _=require("../lodash");module.exports={longestPath:longestPath,slack:slack};function longestPath(g){var visited={};function dfs(v){var label=g.node(v);if(_.has(visited,v)){return label.rank}visited[v]=true;var rank=_.min(_.map(g.outEdges(v),function(e){return dfs(e.w)-g.edge(e).minlen}));if(rank===Number.POSITIVE_INFINITY){rank=0}return label.rank=rank}_.each(g.sources(),dfs)}function slack(g,e){return g.node(e.w).rank-g.node(e.v).rank-g.edge(e).minlen}},{"../lodash":36}],55:[function(require,module,exports){"use strict";var _=require("./lodash"),Graph=require("./graphlib").Graph;module.exports={addDummyNode:addDummyNode,simplify:simplify,asNonCompoundGraph:asNonCompoundGraph,successorWeights:successorWeights,predecessorWeights:predecessorWeights,intersectRect:intersectRect,buildLayerMatrix:buildLayerMatrix,normalizeRanks:normalizeRanks,removeEmptyRanks:removeEmptyRanks,addBorderNode:addBorderNode,maxRank:maxRank,partition:partition,time:time,notime:notime};function addDummyNode(g,type,attrs,name){var v;do{v=_.uniqueId(name)}while(g.hasNode(v));attrs.dummy=type;g.setNode(v,attrs);return v}function simplify(g){var simplified=(new Graph).setGraph(g.graph());_.each(g.nodes(),function(v){simplified.setNode(v,g.node(v))});_.each(g.edges(),function(e){var simpleLabel=simplified.edge(e.v,e.w)||{weight:0,minlen:1},label=g.edge(e);simplified.setEdge(e.v,e.w,{weight:simpleLabel.weight+label.weight,minlen:Math.max(simpleLabel.minlen,label.minlen)})});return simplified}function asNonCompoundGraph(g){var simplified=new Graph({multigraph:g.isMultigraph()}).setGraph(g.graph());_.each(g.nodes(),function(v){if(!g.children(v).length){simplified.setNode(v,g.node(v))}});_.each(g.edges(),function(e){simplified.setEdge(e,g.edge(e))});return simplified}function successorWeights(g){var weightMap=_.map(g.nodes(),function(v){var sucs={};_.each(g.outEdges(v),function(e){sucs[e.w]=(sucs[e.w]||0)+g.edge(e).weight});return sucs});return _.zipObject(g.nodes(),weightMap)}function predecessorWeights(g){var weightMap=_.map(g.nodes(),function(v){var preds={};_.each(g.inEdges(v),function(e){preds[e.v]=(preds[e.v]||0)+g.edge(e).weight});return preds});return _.zipObject(g.nodes(),weightMap)}function intersectRect(rect,point){var x=rect.x;var y=rect.y;var dx=point.x-x;var dy=point.y-y;var w=rect.width/2;var h=rect.height/2;if(!dx&&!dy){throw new Error("Not possible to find intersection inside of the rectangle")}var sx,sy;if(Math.abs(dy)*w>Math.abs(dx)*h){if(dy<0){h=-h}sx=h*dx/dy;sy=h}else{if(dx<0){w=-w}sx=w;sy=w*dy/dx}return{x:x+sx,y:y+sy}}function buildLayerMatrix(g){var layering=_.map(_.range(maxRank(g)+1),function(){return[]});_.each(g.nodes(),function(v){var node=g.node(v),rank=node.rank;if(!_.isUndefined(rank)){layering[rank][node.order]=v}});return layering}function normalizeRanks(g){var min=_.min(_.map(g.nodes(),function(v){return g.node(v).rank -}));_.each(g.nodes(),function(v){var node=g.node(v);if(_.has(node,"rank")){node.rank-=min}})}function removeEmptyRanks(g){var offset=_.min(_.map(g.nodes(),function(v){return g.node(v).rank}));var layers=[];_.each(g.nodes(),function(v){var rank=g.node(v).rank-offset;if(!_.has(layers,rank)){layers[rank]=[]}layers[rank].push(v)});var delta=0,nodeRankFactor=g.graph().nodeRankFactor;_.each(layers,function(vs,i){if(_.isUndefined(vs)&&i%nodeRankFactor!==0){--delta}else if(delta){_.each(vs,function(v){g.node(v).rank+=delta})}})}function addBorderNode(g,prefix,rank,order){var node={width:0,height:0};if(arguments.length>=4){node.rank=rank;node.order=order}return addDummyNode(g,"border",node,prefix)}function maxRank(g){return _.max(_.map(g.nodes(),function(v){var rank=g.node(v).rank;if(!_.isUndefined(rank)){return rank}}))}function partition(collection,fn){var result={lhs:[],rhs:[]};_.each(collection,function(value){if(fn(value)){result.lhs.push(value)}else{result.rhs.push(value)}});return result}function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+" time: "+(_.now()-start)+"ms")}}function notime(name,fn){return fn()}},{"./graphlib":33,"./lodash":36}],56:[function(require,module,exports){module.exports="0.6.1"},{}],57:[function(require,module,exports){var lib=require("./lib");module.exports={Graph:lib.Graph,json:require("./lib/json"),alg:require("./lib/alg"),version:lib.version}},{"./lib":73,"./lib/alg":64,"./lib/json":74}],58:[function(require,module,exports){var _=require("../lodash");module.exports=components;function components(g){var visited={},cmpts=[],cmpt;function dfs(v){if(_.has(visited,v))return;visited[v]=true;cmpt.push(v);_.each(g.successors(v),dfs);_.each(g.predecessors(v),dfs)}_.each(g.nodes(),function(v){cmpt=[];dfs(v);if(cmpt.length){cmpts.push(cmpt)}});return cmpts}},{"../lodash":75}],59:[function(require,module,exports){var _=require("../lodash");module.exports=dfs;function dfs(g,vs,order){if(!_.isArray(vs)){vs=[vs]}var acc=[],visited={};_.each(vs,function(v){if(!g.hasNode(v)){throw new Error("Graph does not have node: "+v)}doDfs(g,v,order==="post",visited,acc)});return acc}function doDfs(g,v,postorder,visited,acc){if(!_.has(visited,v)){visited[v]=true;if(!postorder){acc.push(v)}_.each(g.neighbors(v),function(w){doDfs(g,w,postorder,visited,acc)});if(postorder){acc.push(v)}}}},{"../lodash":75}],60:[function(require,module,exports){var dijkstra=require("./dijkstra"),_=require("../lodash");module.exports=dijkstraAll;function dijkstraAll(g,weightFunc,edgeFunc){return _.transform(g.nodes(),function(acc,v){acc[v]=dijkstra(g,v,weightFunc,edgeFunc)},{})}},{"../lodash":75,"./dijkstra":61}],61:[function(require,module,exports){var _=require("../lodash"),PriorityQueue=require("../data/priority-queue");module.exports=dijkstra;var DEFAULT_WEIGHT_FUNC=_.constant(1);function dijkstra(g,source,weightFn,edgeFn){return runDijkstra(g,String(source),weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runDijkstra(g,source,weightFn,edgeFn){var results={},pq=new PriorityQueue,v,vEntry;var updateNeighbors=function(edge){var w=edge.v!==v?edge.v:edge.w,wEntry=results[w],weight=weightFn(edge),distance=vEntry.distance+weight;if(weight<0){throw new Error("dijkstra does not allow negative edge weights. "+"Bad edge: "+edge+" Weight: "+weight)}if(distance0){v=pq.removeMin();vEntry=results[v];if(vEntry.distance===Number.POSITIVE_INFINITY){break}edgeFn(v).forEach(updateNeighbors)}return results}},{"../data/priority-queue":71,"../lodash":75}],62:[function(require,module,exports){var _=require("../lodash"),tarjan=require("./tarjan");module.exports=findCycles;function findCycles(g){return _.filter(tarjan(g),function(cmpt){return cmpt.length>1})}},{"../lodash":75,"./tarjan":69}],63:[function(require,module,exports){var _=require("../lodash");module.exports=floydWarshall;var DEFAULT_WEIGHT_FUNC=_.constant(1);function floydWarshall(g,weightFn,edgeFn){return runFloydWarshall(g,weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runFloydWarshall(g,weightFn,edgeFn){var results={},nodes=g.nodes();nodes.forEach(function(v){results[v]={};results[v][v]={distance:0};nodes.forEach(function(w){if(v!==w){results[v][w]={distance:Number.POSITIVE_INFINITY}}});edgeFn(v).forEach(function(edge){var w=edge.v===v?edge.w:edge.v,d=weightFn(edge);results[v][w]={distance:d,predecessor:v}})});nodes.forEach(function(k){var rowK=results[k];nodes.forEach(function(i){var rowI=results[i];nodes.forEach(function(j){var ik=rowI[k];var kj=rowK[j];var ij=rowI[j];var altDistance=ik.distance+kj.distance;if(altDistance0){v=pq.removeMin();if(_.has(parents,v)){result.setEdge(v,parents[v])}else if(init){throw new Error("Input graph is not connected: "+g)}else{init=true}g.nodeEdges(v).forEach(updateNeighbors)}return result}},{"../data/priority-queue":71,"../graph":72,"../lodash":75}],69:[function(require,module,exports){var _=require("../lodash");module.exports=tarjan;function tarjan(g){var index=0,stack=[],visited={},results=[];function dfs(v){var entry=visited[v]={onStack:true,lowlink:index,index:index++};stack.push(v);g.successors(v).forEach(function(w){if(!_.has(visited,w)){dfs(w);entry.lowlink=Math.min(entry.lowlink,visited[w].lowlink)}else if(visited[w].onStack){entry.lowlink=Math.min(entry.lowlink,visited[w].index)}});if(entry.lowlink===entry.index){var cmpt=[],w;do{w=stack.pop();visited[w].onStack=false;cmpt.push(w)}while(v!==w);results.push(cmpt)}}g.nodes().forEach(function(v){if(!_.has(visited,v)){dfs(v)}});return results}},{"../lodash":75}],70:[function(require,module,exports){var _=require("../lodash");module.exports=topsort;topsort.CycleException=CycleException;function topsort(g){var visited={},stack={},results=[];function visit(node){if(_.has(stack,node)){throw new CycleException}if(!_.has(visited,node)){stack[node]=true;visited[node]=true;_.each(g.predecessors(node),visit);delete stack[node];results.push(node)}}_.each(g.sinks(),visit);if(_.size(visited)!==g.nodeCount()){throw new CycleException}return results}function CycleException(){}},{"../lodash":75}],71:[function(require,module,exports){var _=require("../lodash");module.exports=PriorityQueue;function PriorityQueue(){this._arr=[];this._keyIndices={}}PriorityQueue.prototype.size=function(){return this._arr.length};PriorityQueue.prototype.keys=function(){return this._arr.map(function(x){return x.key})};PriorityQueue.prototype.has=function(key){return _.has(this._keyIndices,key)};PriorityQueue.prototype.priority=function(key){var index=this._keyIndices[key];if(index!==undefined){return this._arr[index].priority}};PriorityQueue.prototype.min=function(){if(this.size()===0){throw new Error("Queue underflow")}return this._arr[0].key};PriorityQueue.prototype.add=function(key,priority){var keyIndices=this._keyIndices;key=String(key);if(!_.has(keyIndices,key)){var arr=this._arr;var index=arr.length;keyIndices[key]=index;arr.push({key:key,priority:priority});this._decrease(index);return true}return false};PriorityQueue.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var min=this._arr.pop();delete this._keyIndices[min.key];this._heapify(0);return min.key};PriorityQueue.prototype.decrease=function(key,priority){var index=this._keyIndices[key];if(priority>this._arr[index].priority){throw new Error("New priority is greater than current priority. "+"Key: "+key+" Old: "+this._arr[index].priority+" New: "+priority)}this._arr[index].priority=priority;this._decrease(index)};PriorityQueue.prototype._heapify=function(i){var arr=this._arr;var l=2*i,r=l+1,largest=i;if(l>1;if(arr[parent].priority1){this.setNode(v,value)}else{this.setNode(v)}},this);return this};Graph.prototype.setNode=function(v,value){if(_.has(this._nodes,v)){if(arguments.length>1){this._nodes[v]=value}return this}this._nodes[v]=arguments.length>1?value:this._defaultNodeLabelFn(v);if(this._isCompound){this._parent[v]=GRAPH_NODE;this._children[v]={};this._children[GRAPH_NODE][v]=true}this._in[v]={};this._preds[v]={};this._out[v]={};this._sucs[v]={};++this._nodeCount;return this};Graph.prototype.node=function(v){return this._nodes[v]};Graph.prototype.hasNode=function(v){return _.has(this._nodes,v)};Graph.prototype.removeNode=function(v){var self=this;if(_.has(this._nodes,v)){var removeEdge=function(e){self.removeEdge(self._edgeObjs[e])};delete this._nodes[v];if(this._isCompound){this._removeFromParentsChildList(v);delete this._parent[v];_.each(this.children(v),function(child){this.setParent(child)},this);delete this._children[v]}_.each(_.keys(this._in[v]),removeEdge);delete this._in[v];delete this._preds[v];_.each(_.keys(this._out[v]),removeEdge);delete this._out[v];delete this._sucs[v];--this._nodeCount}return this};Graph.prototype.setParent=function(v,parent){if(!this._isCompound){throw new Error("Cannot set parent in a non-compound graph")}if(_.isUndefined(parent)){parent=GRAPH_NODE}else{for(var ancestor=parent;!_.isUndefined(ancestor);ancestor=this.parent(ancestor)){if(ancestor===v){throw new Error("Setting "+parent+" as parent of "+v+" would create create a cycle")}}this.setNode(parent)}this.setNode(v);this._removeFromParentsChildList(v);this._parent[v]=parent;this._children[parent][v]=true;return this};Graph.prototype._removeFromParentsChildList=function(v){delete this._children[this._parent[v]][v]};Graph.prototype.parent=function(v){if(this._isCompound){var parent=this._parent[v];if(parent!==GRAPH_NODE){return parent}}};Graph.prototype.children=function(v){if(_.isUndefined(v)){v=GRAPH_NODE}if(this._isCompound){var children=this._children[v];if(children){return _.keys(children)}}else if(v===GRAPH_NODE){return this.nodes()}else if(this.hasNode(v)){return[]}};Graph.prototype.predecessors=function(v){var predsV=this._preds[v];if(predsV){return _.keys(predsV)}};Graph.prototype.successors=function(v){var sucsV=this._sucs[v];if(sucsV){return _.keys(sucsV)}};Graph.prototype.neighbors=function(v){var preds=this.predecessors(v);if(preds){return _.union(preds,this.successors(v))}};Graph.prototype.setDefaultEdgeLabel=function(newDefault){if(!_.isFunction(newDefault)){newDefault=_.constant(newDefault)}this._defaultEdgeLabelFn=newDefault;return this};Graph.prototype.edgeCount=function(){return this._edgeCount};Graph.prototype.edges=function(){return _.values(this._edgeObjs)};Graph.prototype.setPath=function(vs,value){var self=this,args=arguments;_.reduce(vs,function(v,w){if(args.length>1){self.setEdge(v,w,value)}else{self.setEdge(v,w)}return w});return this};Graph.prototype.setEdge=function(v,w,value,name){var valueSpecified=arguments.length>2;v=String(v);w=String(w);if(!_.isUndefined(name)){name=String(name)}if(_.isPlainObject(arguments[0])){v=arguments[0].v;w=arguments[0].w;name=arguments[0].name;if(arguments.length===2){value=arguments[1];valueSpecified=true}}var e=edgeArgsToId(this._isDirected,v,w,name);if(_.has(this._edgeLabels,e)){if(valueSpecified){this._edgeLabels[e]=value}return this}if(!_.isUndefined(name)&&!this._isMultigraph){throw new Error("Cannot set a named edge when isMultigraph = false")}this.setNode(v);this.setNode(w);this._edgeLabels[e]=valueSpecified?value:this._defaultEdgeLabelFn(v,w,name);var edgeObj=edgeArgsToObj(this._isDirected,v,w,name);v=edgeObj.v;w=edgeObj.w;Object.freeze(edgeObj);this._edgeObjs[e]=edgeObj;incrementOrInitEntry(this._preds[w],v);incrementOrInitEntry(this._sucs[v],w);this._in[w][e]=edgeObj;this._out[v][e]=edgeObj;this._edgeCount++;return this};Graph.prototype.edge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return this._edgeLabels[e]};Graph.prototype.hasEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return _.has(this._edgeLabels,e)};Graph.prototype.removeEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name),edge=this._edgeObjs[e];if(edge){v=edge.v;w=edge.w;delete this._edgeLabels[e];delete this._edgeObjs[e];decrementOrRemoveEntry(this._preds[w],v);decrementOrRemoveEntry(this._sucs[v],w);delete this._in[w][e];delete this._out[v][e];this._edgeCount--}return this};Graph.prototype.inEdges=function(v,u){var inV=this._in[v];if(inV){var edges=_.values(inV);if(!u){return edges}return _.filter(edges,function(edge){return edge.v===u})}};Graph.prototype.outEdges=function(v,w){var outV=this._out[v];if(outV){var edges=_.values(outV);if(!w){return edges}return _.filter(edges,function(edge){return edge.w===w})}};Graph.prototype.nodeEdges=function(v,w){var inEdges=this.inEdges(v,w);if(inEdges){return inEdges.concat(this.outEdges(v,w))}};function incrementOrInitEntry(map,k){if(_.has(map,k)){map[k]++}else{map[k]=1}}function decrementOrRemoveEntry(map,k){if(!--map[k]){delete map[k]}}function edgeArgsToId(isDirected,v,w,name){if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}return v+EDGE_KEY_DELIM+w+EDGE_KEY_DELIM+(_.isUndefined(name)?DEFAULT_EDGE_NAME:name)}function edgeArgsToObj(isDirected,v,w,name){if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}var edgeObj={v:v,w:w};if(name){edgeObj.name=name}return edgeObj}function edgeObjToId(isDirected,edgeObj){return edgeArgsToId(isDirected,edgeObj.v,edgeObj.w,edgeObj.name)}},{"./lodash":75}],73:[function(require,module,exports){module.exports={Graph:require("./graph"),version:require("./version")}},{"./graph":72,"./version":76}],74:[function(require,module,exports){var _=require("./lodash"),Graph=require("./graph");module.exports={write:write,read:read};function write(g){var json={options:{directed:g.isDirected(),multigraph:g.isMultigraph(),compound:g.isCompound()},nodes:writeNodes(g),edges:writeEdges(g)};if(!_.isUndefined(g.graph())){json.value=_.clone(g.graph())}return json}function writeNodes(g){return _.map(g.nodes(),function(v){var nodeValue=g.node(v),parent=g.parent(v),node={v:v};if(!_.isUndefined(nodeValue)){node.value=nodeValue}if(!_.isUndefined(parent)){node.parent=parent}return node})}function writeEdges(g){return _.map(g.edges(),function(e){var edgeValue=g.edge(e),edge={v:e.v,w:e.w};if(!_.isUndefined(e.name)){edge.name=e.name}if(!_.isUndefined(edgeValue)){edge.value=edgeValue}return edge})}function read(json){var g=new Graph(json.options).setGraph(json.value);_.each(json.nodes,function(entry){g.setNode(entry.v,entry.value);if(entry.parent){g.setParent(entry.v,entry.parent)}});_.each(json.edges,function(entry){g.setEdge({v:entry.v,w:entry.w,name:entry.name},entry.value)});return g}},{"./graph":72,"./lodash":75}],75:[function(require,module,exports){module.exports=require(20)},{"/Users/cpettitt/projects/dagre-d3/lib/lodash.js":20,lodash:77}],76:[function(require,module,exports){module.exports="0.9.1"},{}],77:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ᠎              ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++indexother||typeof value=="undefined"){return 1}if(value/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++indexresult){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index>>1;callback(array[mid])1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments); -func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++indexm?(m-y)/g:(m+y)/g,m=s*c-a*l,b=0>m?(m-y)/g:(m+y)/g,{x:v,y:b})}function n(e,t){return e*t>0}t.exports=r},{}],14:[function(e,t){function r(e,t){return e.intersect(t)}t.exports=r},{}],15:[function(e,t){function r(e,t,r){var i=e.x,a=e.y,s=[],o=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY;t.forEach(function(e){o=Math.min(o,e.x),u=Math.min(u,e.y)});for(var c=i-e.width/2-o,l=a-e.height/2-u,h=0;h1&&s.sort(function(e,t){var n=e.x-r.x,i=e.y-r.y,a=Math.sqrt(n*n+i*i),s=t.x-r.x,o=t.y-r.y,u=Math.sqrt(s*s+o*o);return u>a?-1:a===u?0:1}),s[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",e),e)}var n=e("./intersect-line");t.exports=r},{"./intersect-line":13}],16:[function(e,t){function r(e,t){var r,n,i=e.x,a=e.y,s=t.x-i,o=t.y-a,u=e.width/2,c=e.height/2;return Math.abs(o)*u>Math.abs(s)*c?(0>o&&(c=-c),r=0===o?0:c*s/o,n=c):(0>s&&(u=-u),r=u,n=0===s?0:u*o/s),{x:i+r,y:a+n}}t.exports=r},{}],17:[function(e,t){function r(e,t){var r=e.append("foreignObject").attr("width","100000"),i=r.append("xhtml:div"),a=t.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert(function(){return a});break;default:i.html(a)}n.applyStyle(i,t.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var s,o;return i.each(function(){s=this.clientWidth,o=this.clientHeight}),r.attr("width",s).attr("height",o),r}var n=e("../util");t.exports=r},{"../util":25}],18:[function(e,t){function r(e,t){var r=t.label,a=e.append("g");"string"!=typeof r||"html"===t.labelType?i(a,t):n(a,t);var s=a.node().getBBox();return a.attr("transform","translate("+-s.width/2+","+-s.height/2+")"),a}var n=e("./add-text-label"),i=e("./add-html-label");t.exports=r},{"./add-html-label":17,"./add-text-label":19}],19:[function(e,t){function r(e,t){for(var r=e.append("text"),a=n(t.label).split("\n"),s=0;so;++o)n(e,"borderLeft","_bl",r,s,o),n(e,"borderRight","_br",r,s,o)}}i.each(e.children(),t)}function n(e,t,r,n,i,s){var o={width:0,height:0,rank:s},u=i[t][s-1],c=a.addDummyNode(e,"border",o,r);i[t][s]=c,e.setParent(c,n),u&&e.setEdge(u,c,{weight:1})}var i=e("./lodash"),a=e("./util");t.exports=r},{"./lodash":36,"./util":55}],30:[function(e,t){"use strict";function r(e){var t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&i(e)}function n(e){var t=e.graph().rankdir.toLowerCase();("bt"===t||"rl"===t)&&s(e),("lr"===t||"rl"===t)&&(u(e),i(e))}function i(e){l.each(e.nodes(),function(t){a(e.node(t))}),l.each(e.edges(),function(t){a(e.edge(t))})}function a(e){var t=e.width;e.width=e.height,e.height=t}function s(e){l.each(e.nodes(),function(t){o(e.node(t))}),l.each(e.edges(),function(t){var r=e.edge(t);l.each(r.points,o),l.has(r,"y")&&o(r)})}function o(e){e.y=-e.y}function u(e){l.each(e.nodes(),function(t){c(e.node(t))}),l.each(e.edges(),function(t){var r=e.edge(t);l.each(r.points,c),l.has(r,"x")&&c(r)})}function c(e){var t=e.x;e.x=e.y,e.y=t}var l=e("./lodash");t.exports={adjust:r,undo:n}},{"./lodash":36}],31:[function(e,t){function r(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function i(e,t){return"_next"!==e&&"_prev"!==e?t:void 0}t.exports=r,r.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;return t!==e?(n(t),t):void 0},r.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},r.prototype.toString=function(){for(var e=[],t=this._sentinel,r=t._prev;r!==t;)e.push(JSON.stringify(r,i)),r=r._prev;return"["+e.join(", ")+"]"}},{}],32:[function(e,t){function r(e){var t=i.buildLayerMatrix(e),r=new a({compound:!0,multigraph:!0}).setGraph({});return n.each(e.nodes(),function(t){r.setNode(t,{label:t}),r.setParent(t,"layer"+e.node(t).rank)}),n.each(e.edges(),function(e){r.setEdge(e.v,e.w,{},e.name)}),n.each(t,function(e,t){var i="layer"+t;r.setNode(i,{rank:"same"}),n.reduce(e,function(e,t){return r.setEdge(e,t,{style:"invis"}),t})}),r}var n=e("./lodash"),i=e("./util"),a=e("./graphlib").Graph;t.exports={debugOrdering:r}},{"./graphlib":33,"./lodash":36,"./util":55}],33:[function(e,t){t.exports=e(9)},{graphlib:57}],34:[function(e,t){function r(e,t){if(e.nodeCount()<=1)return[];var r=a(e,t||l),i=n(r.graph,r.buckets,r.zeroIdx);return o.flatten(o.map(i,function(t){return e.outEdges(t.v,t.w)}),!0)}function n(e,t,r){for(var n,a=[],s=t[t.length-1],o=t[0];e.nodeCount();){for(;n=o.dequeue();)i(e,t,r,n);for(;n=s.dequeue();)i(e,t,r,n);if(e.nodeCount())for(var u=t.length-2;u>0;--u)if(n=t[u].dequeue()){a=a.concat(i(e,t,r,n,!0));break}}return a}function i(e,t,r,n,i){var a=i?[]:void 0;return o.each(e.inEdges(n.v),function(n){var o=e.edge(n),u=e.node(n.v);i&&a.push({v:n.v,w:n.w}),u.out-=o,s(t,r,u)}),o.each(e.outEdges(n.v),function(n){var i=e.edge(n),a=n.w,o=e.node(a);o.in-=i,s(t,r,o)}),e.removeNode(n.v),a}function a(e,t){var r=new u,n=0,i=0;o.each(e.nodes(),function(e){r.setNode(e,{v:e,"in":0,out:0})}),o.each(e.edges(),function(e){var a=r.edge(e.v,e.w)||0,s=t(e),o=a+s;r.setEdge(e.v,e.w,o),i=Math.max(i,r.node(e.v).out+=s),n=Math.max(n,r.node(e.w).in+=s)});var a=o.range(i+n+3).map(function(){return new c}),l=n+1;return o.each(r.nodes(),function(e){s(a,l,r.node(e))}),{graph:r,buckets:a,zeroIdx:l}}function s(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var o=e("./lodash"),u=e("./graphlib").Graph,c=e("./data/list");t.exports=r;var l=o.constant(1)},{"./data/list":31,"./graphlib":33,"./lodash":36}],35:[function(e,t){"use strict";function r(e,t){var r=t&&t.debugTiming?L.time:L.notime;r("layout",function(){var t=r(" buildLayoutGraph",function(){return a(e)});r(" runLayout",function(){n(t,r)}),r(" updateInputGraph",function(){i(e,t)})})}function n(e,t){t(" makeSpaceForEdgeLabels",function(){s(e)}),t(" removeSelfEdges",function(){g(e)}),t(" acyclic",function(){x.run(e)}),t(" nestingGraph.run",function(){C.run(e)}),t(" rank",function(){_(L.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){o(e)}),t(" removeEmptyRanks",function(){k(e)}),t(" nestingGraph.cleanup",function(){C.cleanup(e)}),t(" normalizeRanks",function(){w(e)}),t(" assignRankMinMax",function(){u(e)}),t(" removeEdgeLabelProxies",function(){c(e)}),t(" normalize.run",function(){E.run(e)}),t(" parentDummyChains",function(){D(e)}),t(" addBorderSegments",function(){F(e)}),t(" order",function(){T(e)}),t(" insertSelfEdges",function(){y(e)}),t(" adjustCoordinateSystem",function(){B.adjust(e)}),t(" position",function(){S(e)}),t(" positionSelfEdges",function(){m(e)}),t(" removeBorderNodes",function(){f(e)}),t(" normalize.undo",function(){E.undo(e)}),t(" fixupEdgeLabelCoords",function(){d(e)}),t(" undoCoordinateSystem",function(){B.undo(e)}),t(" translateGraph",function(){l(e)}),t(" assignNodeIntersects",function(){h(e)}),t(" reversePoints",function(){p(e)}),t(" acyclic.undo",function(){x.undo(e)})}function i(e,t){A.each(e.nodes(),function(r){var n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,t.children(r).length&&(n.width=i.width,n.height=i.height))}),A.each(e.edges(),function(r){var n=e.edge(r),i=t.edge(r);n.points=i.points,A.has(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}function a(e){var t=new N({multigraph:!0,compound:!0}),r=b(e.graph());return t.setGraph(A.merge({},O,v(r,I),A.pick(r,R))),A.each(e.nodes(),function(r){var n=b(e.node(r));t.setNode(r,A.defaults(v(n,q),P)),t.setParent(r,e.parent(r))}),A.each(e.edges(),function(r){var n=b(e.edge(r));t.setEdge(r,A.merge({},M,v(n,j),A.pick(n,V)))}),t}function s(e){var t=e.graph();t.ranksep/=2,A.each(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function o(e){A.each(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),i=e.node(t.w),a={rank:(i.rank-n.rank)/2+n.rank,e:t};L.addDummyNode(e,"edge-proxy",a,"_ep")}})}function u(e){var t=0;A.each(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=A.max(t,n.maxRank))}),e.graph().maxRank=t}function c(e){A.each(e.nodes(),function(t){var r=e.node(t);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function l(e){function t(e){var t=e.x,s=e.y,o=e.width,u=e.height;r=Math.min(r,t-o/2),n=Math.max(n,t+o/2),i=Math.min(i,s-u/2),a=Math.max(a,s+u/2)}var r=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,a=0,s=e.graph(),o=s.marginx||0,u=s.marginy||0;A.each(e.nodes(),function(r){t(e.node(r))}),A.each(e.edges(),function(r){var n=e.edge(r);A.has(n,"x")&&t(n)}),r-=o,i-=u,A.each(e.nodes(),function(t){var n=e.node(t);n.x-=r,n.y-=i}),A.each(e.edges(),function(t){var n=e.edge(t);A.each(n.points,function(e){e.x-=r,e.y-=i}),A.has(n,"x")&&(n.x-=r),A.has(n,"y")&&(n.y-=i)}),s.width=n-r+o,s.height=a-i+u}function h(e){A.each(e.edges(),function(t){var r,n,i=e.edge(t),a=e.node(t.v),s=e.node(t.w);i.points?(r=i.points[0],n=i.points[i.points.length-1]):(i.points=[],r=s,n=a),i.points.unshift(L.intersectRect(a,r)),i.points.push(L.intersectRect(s,n))})}function d(e){A.each(e.edges(),function(t){var r=e.edge(t);if(A.has(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}function p(e){A.each(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function f(e){A.each(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(A.last(r.borderLeft)),s=e.node(A.last(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),A.each(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}function g(e){A.each(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function y(e){var t=L.buildLayerMatrix(e);A.each(t,function(t){var r=0;A.each(t,function(t,n){var i=e.node(t);i.order=n+r,A.each(i.selfEdges,function(t){L.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:i.rank,order:n+ ++r,e:t.e,label:t.label},"_se")}),delete i.selfEdges})})}function m(e){A.each(e.nodes(),function(t){var r=e.node(t);if("selfedge"===r.dummy){var n=e.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function v(e,t){return A.mapValues(A.pick(e,t),Number)}function b(e){var t={};return A.each(e,function(e,r){t[r.toLowerCase()]=e}),t}var A=e("./lodash"),x=e("./acyclic"),E=e("./normalize"),_=e("./rank"),w=e("./util").normalizeRanks,D=e("./parent-dummy-chains"),k=e("./util").removeEmptyRanks,C=e("./nesting-graph"),F=e("./add-border-segments"),B=e("./coordinate-system"),T=e("./order"),S=e("./position"),L=e("./util"),N=e("./graphlib").Graph;t.exports=r;var I=["nodesep","edgesep","ranksep","marginx","marginy"],O={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},R=["acyclicer","ranker","rankdir","align"],q=["width","height"],P={width:0,height:0},j=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},V=["labelpos"]},{"./acyclic":28,"./add-border-segments":29,"./coordinate-system":30,"./graphlib":33,"./lodash":36,"./nesting-graph":37,"./normalize":38,"./order":43,"./parent-dummy-chains":48,"./position":50,"./rank":52,"./util":55}],36:[function(e,t){t.exports=e(20)},{lodash:101}],37:[function(e,t){function r(e){var t=u.addDummyNode(e,"root",{},"_root"),r=i(e),s=o.max(r)-1,c=2*s+1;e.graph().nestingRoot=t,o.each(e.edges(),function(t){e.edge(t).minlen*=c});var l=a(e)+1;o.each(e.children(),function(i){n(e,t,c,l,s,r,i)}),e.graph().nodeRankFactor=c}function n(e,t,r,i,a,s,c){var l=e.children(c);if(!l.length)return void(c!==t&&e.setEdge(t,c,{weight:0,minlen:r}));var h=u.addBorderNode(e,"_bt"),d=u.addBorderNode(e,"_bb"),p=e.node(c);e.setParent(h,c),p.borderTop=h,e.setParent(d,c),p.borderBottom=d,o.each(l,function(o){n(e,t,r,i,a,s,o);var u=e.node(o),l=u.borderTop?u.borderTop:o,p=u.borderBottom?u.borderBottom:o,f=u.borderTop?i:2*i,g=l!==p?1:a-s[c]+1;e.setEdge(h,l,{weight:f,minlen:g,nestingEdge:!0}),e.setEdge(p,d,{weight:f,minlen:g,nestingEdge:!0})}),e.parent(c)||e.setEdge(t,h,{weight:0,minlen:a+s[c]})}function i(e){function t(n,i){var a=e.children(n);a&&a.length&&o.each(a,function(e){t(e,i+1)}),r[n]=i}var r={};return o.each(e.children(),function(e){t(e,1)}),r}function a(e){return o.reduce(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function s(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,o.each(e.edges(),function(t){var r=e.edge(t);r.nestingEdge&&e.removeEdge(t)})}var o=e("./lodash"),u=e("./util");t.exports={run:r,cleanup:s}},{"./lodash":36,"./util":55}],38:[function(e,t){"use strict";function r(e){e.graph().dummyChains=[],a.each(e.edges(),function(t){n(e,t)})}function n(e,t){var r=t.v,n=e.node(r).rank,i=t.w,a=e.node(i).rank,o=t.name,u=e.edge(t),c=u.labelRank;if(a!==n+1){e.removeEdge(t);var l,h,d;for(d=0,++n;a>n;++d,++n)u.points=[],h={width:0,height:0,edgeLabel:u,edgeObj:t,rank:n},l=s.addDummyNode(e,"edge",h,"_d"),n===c&&(h.width=u.width,h.height=u.height,h.dummy="edge-label",h.labelpos=u.labelpos),e.setEdge(r,l,{weight:u.weight},o),0===d&&e.graph().dummyChains.push(l),r=l;e.setEdge(r,i,{weight:u.weight},o)}}function i(e){a.each(e.graph().dummyChains,function(t){var r,n=e.node(t),i=n.edgeLabel;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}var a=e("./lodash"),s=e("./util");t.exports={run:r,undo:i}},{"./lodash":36,"./util":55}],39:[function(e,t){function r(e,t,r){var i,a={};n.each(r,function(r){for(var n,s,o=e.parent(r);o;){if(n=e.parent(o),n?(s=a[n],a[n]=o):(s=i,i=o),s&&s!==o)return void t.setEdge(s,o);o=n}})}var n=e("../lodash");t.exports=r},{"../lodash":36}],40:[function(e,t){function r(e,t){return n.map(t,function(t){var r=e.inEdges(t);if(r.length){var i=n.reduce(r,function(t,r){var n=e.edge(r),i=e.node(r.v);return{sum:t.sum+n.weight*i.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}})}var n=e("../lodash");t.exports=r},{"../lodash":36}],41:[function(e,t){function r(e,t,r){var s=n(e),o=new a({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(t){return e.node(t)});return i.each(e.nodes(),function(n){var a=e.node(n),u=e.parent(n);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(o.setNode(n),o.setParent(n,u||s),i.each(e[r](n),function(t){var r=t.v===n?t.w:t.v,a=o.edge(r,n),s=i.isUndefined(a)?0:a.weight;o.setEdge(r,n,{weight:e.edge(t).weight+s})}),i.has(a,"minRank")&&o.setNode(n,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}))}),o}function n(e){for(var t;e.hasNode(t=i.uniqueId("_root")););return t}var i=e("../lodash"),a=e("../graphlib").Graph;t.exports=r},{"../graphlib":33,"../lodash":36}],42:[function(e,t){"use strict";function r(e,t){for(var r=0,i=1;i0;)t%2&&(r+=u[t+1]),t=t-1>>1,u[t]+=e.weight;c+=e.weight*r})),c}var i=e("../lodash");t.exports=r},{"../lodash":36}],43:[function(e,t){"use strict";function r(e){var t=p.maxRank(e),r=n(e,s.range(1,t+1),"inEdges"),c=n(e,s.range(t-1,-1,-1),"outEdges"),l=o(e);a(e,l);for(var h,d=Number.POSITIVE_INFINITY,f=0,g=0;4>g;++f,++g){i(f%2?r:c,f%4>=2),l=p.buildLayerMatrix(e);var y=u(e,l);d>y&&(g=0,h=s.cloneDeep(l),d=y)}a(e,h)}function n(e,t,r){return s.map(t,function(t){return l(e,t,r)})}function i(e,t){var r=new d;s.each(e,function(e){var n=e.graph().root,i=c(e,n,r,t);s.each(i.vs,function(t,r){e.node(t).order=r}),h(e,r,i.vs)})}function a(e,t){s.each(t,function(t){s.each(t,function(t,r){e.node(t).order=r})})}var s=e("../lodash"),o=e("./init-order"),u=e("./cross-count"),c=e("./sort-subgraph"),l=e("./build-layer-graph"),h=e("./add-subgraph-constraints"),d=e("../graphlib").Graph,p=e("../util");t.exports=r},{"../graphlib":33,"../lodash":36,"../util":55,"./add-subgraph-constraints":39,"./build-layer-graph":41,"./cross-count":42,"./init-order":44,"./sort-subgraph":46}],44:[function(e,t){"use strict";function r(e){function t(i){if(!n.has(r,i)){r[i]=!0;var a=e.node(i);s[a.rank].push(i),n.each(e.successors(i),t)}}var r={},i=n.filter(e.nodes(),function(t){return!e.children(t).length}),a=n.max(n.map(i,function(t){return e.node(t).rank})),s=n.map(n.range(a+1),function(){return[]}),o=n.sortBy(i,function(t){return e.node(t).rank});return n.each(o,t),s}var n=e("../lodash");t.exports=r},{"../lodash":36}],45:[function(e,t){"use strict";function r(e,t){var r={};a.each(e,function(e,t){var n=r[e.v]={indegree:0,"in":[],out:[],vs:[e.v],i:t};a.isUndefined(e.barycenter)||(n.barycenter=e.barycenter,n.weight=e.weight)}),a.each(t.edges(),function(e){var t=r[e.v],n=r[e.w];a.isUndefined(t)||a.isUndefined(n)||(n.indegree++,t.out.push(r[e.w]))});var i=a.filter(r,function(e){return!e.indegree});return n(i)}function n(e){function t(e){return function(t){t.merged||(a.isUndefined(t.barycenter)||a.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&i(e,t)}}function r(t){return function(r){r.in.push(t),0===--r.indegree&&e.push(r)}}for(var n=[];e.length;){var s=e.pop();n.push(s),a.each(s.in.reverse(),t(s)),a.each(s.out,r(s))}return a.chain(n).filter(function(e){return!e.merged}).map(function(e){return a.pick(e,["vs","i","barycenter","weight"])}).value()}function i(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}var a=e("../lodash");t.exports=r},{"../lodash":36}],46:[function(e,t){function r(e,t,c,l){var h=e.children(t),d=e.node(t),p=d?d.borderLeft:void 0,f=d?d.borderRight:void 0,g={};p&&(h=a.filter(h,function(e){return e!==p&&e!==f}));var y=s(e,h);a.each(y,function(t){if(e.children(t.v).length){var n=r(e,t.v,c,l);g[t.v]=n,a.has(n,"barycenter")&&i(t,n)}});var m=o(y,c);n(m,g);var v=u(m,l);if(p&&(v.vs=a.flatten([p,v.vs,f],!0),e.predecessors(p).length)){var b=e.node(e.predecessors(p)[0]),A=e.node(e.predecessors(f)[0]);a.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+b.order+A.order)/(v.weight+2),v.weight+=2 -}return v}function n(e,t){a.each(e,function(e){e.vs=a.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})}function i(e,t){a.isUndefined(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var a=e("../lodash"),s=e("./barycenter"),o=e("./resolve-conflicts"),u=e("./sort");t.exports=r},{"../lodash":36,"./barycenter":40,"./resolve-conflicts":45,"./sort":47}],47:[function(e,t){function r(e,t){var r=s.partition(e,function(e){return a.has(e,"barycenter")}),o=r.lhs,u=a.sortBy(r.rhs,function(e){return-e.i}),c=[],l=0,h=0,d=0;o.sort(i(!!t)),d=n(c,u,d),a.each(o,function(e){d+=e.vs.length,c.push(e.vs),l+=e.barycenter*e.weight,h+=e.weight,d=n(c,u,d)});var p={vs:a.flatten(c,!0)};return h&&(p.barycenter=l/h,p.weight=h),p}function n(e,t,r){for(var n;t.length&&(n=a.last(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function i(e){return function(t,r){return t.barycenterr.barycenter?1:e?r.i-t.i:t.i-r.i}}var a=e("../lodash"),s=e("../util");t.exports=r},{"../lodash":36,"../util":55}],48:[function(e,t){function r(e){var t=i(e);a.each(e.graph().dummyChains,function(r){for(var i=e.node(r),a=i.edgeObj,s=n(e,t,a.v,a.w),o=s.path,u=s.lca,c=0,l=o[c],h=!0;r!==a.w;){if(i=e.node(r),h){for(;(l=o[c])!==u&&e.node(l).maxRanku||c>t[i].lim));for(a=i,i=n;(i=e.parent(i))!==a;)o.push(i);return{path:s.concat(o.reverse()),lca:a}}function i(e){function t(i){var s=n;a.each(e.children(i),t),r[i]={low:s,lim:n++}}var r={},n=0;return a.each(e.children(),t),r}var a=e("./lodash");t.exports=r},{"./lodash":36}],49:[function(e,t){"use strict";function r(e,t){function r(t,r){var s=0,o=0,u=t.length,c=y.last(r);return y.each(r,function(t,l){var h=i(e,t),d=h?e.node(h).order:u;(h||t===c)&&(y.each(r.slice(o,l+1),function(t){y.each(e.predecessors(t),function(r){var i=e.node(r),o=i.order;!(s>o||o>d)||i.dummy&&e.node(t).dummy||a(n,r,t)})}),o=l+1,s=d)}),r}var n={};return y.reduce(t,r),n}function n(e,t){function r(t,r,n,s,o){var u;y.each(y.range(r,n),function(r){u=t[r],e.node(u).dummy&&y.each(e.predecessors(u),function(t){var r=e.node(t);r.dummy&&(r.ordero)&&a(i,t,u)})})}function n(t,n){var i,a=-1,s=0;return y.each(n,function(o,u){if("border"===e.node(o).dummy){var c=e.predecessors(o);c.length&&(i=e.node(c[0]).order,r(n,s,u,a,i),s=u,a=i)}r(n,s,n.length,i,t.length)}),n}var i={};return y.reduce(t,n),i}function i(e,t){return e.node(t).dummy?y.find(e.predecessors(t),function(t){return e.node(t).dummy}):void 0}function a(e,t,r){if(t>r){var n=t;t=r,r=n}var i=e[t];i||(e[t]=i={}),i[r]=!0}function s(e,t,r){if(t>r){var n=t;t=r,r=n}return y.has(e[t],r)}function o(e,t,r,n){var i={},a={},o={};return y.each(t,function(e){y.each(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),y.each(t,function(e){var t=-1;y.each(e,function(e){var u=n(e);if(u.length){u=y.sortBy(u,function(e){return o[e]});for(var c=(u.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var d=u[l];a[e]===e&&ts.lim&&(o=s,u=!0);var c=f.filter(t.edges(),function(t){return u===p(e,e.node(t.v),o)&&u!==p(e,e.node(t.w),o)});return f.min(c,function(e){return y(t,e)})}function l(e,t,r,i){var a=r.v,o=r.w;e.removeEdge(a,o),e.setEdge(i.v,i.w,{}),s(e),n(e,t),h(e,t)}function h(e,t){var r=f.find(e.nodes(),function(e){return!t.node(e).parent}),n=v(e,r);n=n.slice(1),f.each(n,function(r){var n=e.node(r).parent,i=t.edge(r,n),a=!1;i||(i=t.edge(n,r),a=!0),t.node(r).rank=t.node(n).rank+(a?i.minlen:-i.minlen)})}function d(e,t,r){return e.hasEdge(t,r)}function p(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var f=e("../lodash"),g=e("./feasible-tree"),y=e("./util").slack,m=e("./util").longestPath,v=e("../graphlib").alg.preorder,b=e("../graphlib").alg.postorder,A=e("../util").simplify;t.exports=r,r.initLowLimValues=s,r.initCutValues=n,r.calcCutValue=a,r.leaveEdge=u,r.enterEdge=c,r.exchangeEdges=l},{"../graphlib":33,"../lodash":36,"../util":55,"./feasible-tree":51,"./util":54}],54:[function(e,t){"use strict";function r(e){function t(n){var a=e.node(n);if(i.has(r,n))return a.rank;r[n]=!0;var s=i.min(i.map(e.outEdges(n),function(r){return t(r.w)-e.edge(r).minlen}));return s===Number.POSITIVE_INFINITY&&(s=0),a.rank=s}var r={};i.each(e.sources(),t)}function n(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var i=e("../lodash");t.exports={longestPath:r,slack:n}},{"../lodash":36}],55:[function(e,t){"use strict";function r(e,t,r,n){var i;do i=y.uniqueId(n);while(e.hasNode(i));return r.dummy=t,e.setNode(i,r),i}function n(e){var t=(new m).setGraph(e.graph());return y.each(e.nodes(),function(r){t.setNode(r,e.node(r))}),y.each(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function i(e){var t=new m({multigraph:e.isMultigraph()}).setGraph(e.graph());return y.each(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),y.each(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function a(e){var t=y.map(e.nodes(),function(t){var r={};return y.each(e.outEdges(t),function(t){r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return y.zipObject(e.nodes(),t)}function s(e){var t=y.map(e.nodes(),function(t){var r={};return y.each(e.inEdges(t),function(t){r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return y.zipObject(e.nodes(),t)}function o(e,t){var r=e.x,n=e.y,i=t.x-r,a=t.y-n,s=e.width/2,o=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,c;return Math.abs(a)*s>Math.abs(i)*o?(0>a&&(o=-o),u=o*i/a,c=o):(0>i&&(s=-s),u=s,c=s*a/i),{x:r+u,y:n+c}}function u(e){var t=y.map(y.range(d(e)+1),function(){return[]});return y.each(e.nodes(),function(r){var n=e.node(r),i=n.rank;y.isUndefined(i)||(t[i][n.order]=r)}),t}function c(e){var t=y.min(y.map(e.nodes(),function(t){return e.node(t).rank}));y.each(e.nodes(),function(r){var n=e.node(r);y.has(n,"rank")&&(n.rank-=t)})}function l(e){var t=y.min(y.map(e.nodes(),function(t){return e.node(t).rank})),r=[];y.each(e.nodes(),function(n){var i=e.node(n).rank-t;y.has(r,i)||(r[i]=[]),r[i].push(n)});var n=0,i=e.graph().nodeRankFactor;y.each(r,function(t,r){y.isUndefined(t)&&r%i!==0?--n:n&&y.each(t,function(t){e.node(t).rank+=n})})}function h(e,t,n,i){var a={width:0,height:0};return arguments.length>=4&&(a.rank=n,a.order=i),r(e,"border",a,t)}function d(e){return y.max(y.map(e.nodes(),function(t){var r=e.node(t).rank;return y.isUndefined(r)?void 0:r}))}function p(e,t){var r={lhs:[],rhs:[]};return y.each(e,function(e){t(e)?r.lhs.push(e):r.rhs.push(e)}),r}function f(e,t){var r=y.now();try{return t()}finally{console.log(e+" time: "+(y.now()-r)+"ms")}}function g(e,t){return t()}var y=e("./lodash"),m=e("./graphlib").Graph;t.exports={addDummyNode:r,simplify:n,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:s,intersectRect:o,buildLayerMatrix:u,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:d,partition:p,time:f,notime:g}},{"./graphlib":33,"./lodash":36}],56:[function(e,t){t.exports="0.6.4"},{}],57:[function(e,t){var r=e("./lib");t.exports={Graph:r.Graph,json:e("./lib/json"),alg:e("./lib/alg"),version:r.version}},{"./lib":73,"./lib/alg":64,"./lib/json":74}],58:[function(e,t){function r(e){function t(a){n.has(i,a)||(i[a]=!0,r.push(a),n.each(e.successors(a),t),n.each(e.predecessors(a),t))}var r,i={},a=[];return n.each(e.nodes(),function(e){r=[],t(e),r.length&&a.push(r)}),a}var n=e("../lodash");t.exports=r},{"../lodash":75}],59:[function(e,t){function r(e,t,r){i.isArray(t)||(t=[t]);var a=[],s={};return i.each(t,function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);n(e,t,"post"===r,s,a)}),a}function n(e,t,r,a,s){i.has(a,t)||(a[t]=!0,r||s.push(t),i.each(e.neighbors(t),function(t){n(e,t,r,a,s)}),r&&s.push(t))}var i=e("../lodash");t.exports=r},{"../lodash":75}],60:[function(e,t){function r(e,t,r){return i.transform(e.nodes(),function(i,a){i[a]=n(e,a,t,r)},{})}var n=e("./dijkstra"),i=e("../lodash");t.exports=r},{"../lodash":75,"./dijkstra":61}],61:[function(e,t){function r(e,t,r,i){return n(e,String(t),r||s,i||function(t){return e.outEdges(t)})}function n(e,t,r,n){var i,s,o={},u=new a,c=function(e){var t=e.v!==i?e.v:e.w,n=o[t],a=r(e),c=s.distance+a;if(0>a)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+a);c0&&(i=u.removeMin(),s=o[i],s.distance!==Number.POSITIVE_INFINITY);)n(i).forEach(c);return o}var i=e("../lodash"),a=e("../data/priority-queue");t.exports=r;var s=i.constant(1)},{"../data/priority-queue":71,"../lodash":75}],62:[function(e,t){function r(e){return n.filter(i(e),function(e){return e.length>1})}var n=e("../lodash"),i=e("./tarjan");t.exports=r},{"../lodash":75,"./tarjan":69}],63:[function(e,t){function r(e,t,r){return n(e,t||a,r||function(t){return e.outEdges(t)})}function n(e,t,r){var n={},i=e.nodes();return i.forEach(function(e){n[e]={},n[e][e]={distance:0},i.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var i=r.v===e?r.w:r.v,a=t(r);n[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){var t=n[e];i.forEach(function(r){var a=n[r];i.forEach(function(r){var n=a[e],i=t[r],s=a[r],o=n.distance+i.distance;oi&&(u[r]=s,c.decrease(r,i))}}var s,o=new i,u={},c=new a;if(0===e.nodeCount())return o;n.each(e.nodes(),function(e){c.add(e,Number.POSITIVE_INFINITY),o.setNode(e)}),c.decrease(e.nodes()[0],0);for(var l=!1;c.size()>0;){if(s=c.removeMin(),n.has(u,s))o.setEdge(s,u[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(r)}return o}var n=e("../lodash"),i=e("../graph"),a=e("../data/priority-queue");t.exports=r},{"../data/priority-queue":71,"../graph":72,"../lodash":75}],69:[function(e,t){function r(e){function t(o){var u=a[o]={onStack:!0,lowlink:r,index:r++};if(i.push(o),e.successors(o).forEach(function(e){n.has(a,e)?a[e].onStack&&(u.lowlink=Math.min(u.lowlink,a[e].index)):(t(e),u.lowlink=Math.min(u.lowlink,a[e].lowlink))}),u.lowlink===u.index){var c,l=[];do c=i.pop(),a[c].onStack=!1,l.push(c);while(o!==c);s.push(l)}}var r=0,i=[],a={},s=[];return e.nodes().forEach(function(e){n.has(a,e)||t(e)}),s}var n=e("../lodash");t.exports=r},{"../lodash":75}],70:[function(e,t){function r(e){function t(o){if(i.has(a,o))throw new n;i.has(r,o)||(a[o]=!0,r[o]=!0,i.each(e.predecessors(o),t),delete a[o],s.push(o))}var r={},a={},s=[];if(i.each(e.sinks(),t),i.size(r)!==e.nodeCount())throw new n;return s}function n(){}var i=e("../lodash");t.exports=r,r.CycleException=n},{"../lodash":75}],71:[function(e,t){function r(){this._arr=[],this._keyIndices={}}var n=e("../lodash");t.exports=r,r.prototype.size=function(){return this._arr.length},r.prototype.keys=function(){return this._arr.map(function(e){return e.key})},r.prototype.has=function(e){return n.has(this._keyIndices,e)},r.prototype.priority=function(e){var t=this._keyIndices[e];return void 0!==t?this._arr[t].priority:void 0},r.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},r.prototype.add=function(e,t){var r=this._keyIndices;if(e=String(e),!n.has(r,e)){var i=this._arr,a=i.length;return r[e]=a,i.push({key:e,priority:t}),this._decrease(a),!0}return!1},r.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},r.prototype.decrease=function(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)},r.prototype._heapify=function(e){var t=this._arr,r=2*e,n=r+1,i=e;r>1,!(r[t].priorityr){var i=t;t=r,r=i}return t+h+r+h+(u.isUndefined(n)?c:n)}function s(e,t,r,n){if(!e&&t>r){var i=t;t=r,r=i}var a={v:t,w:r};return n&&(a.name=n),a}function o(e,t){return a(e,t.v,t.w,t.name)}var u=e("./lodash");t.exports=r;var c="\x00",l="\x00",h="";r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(e){return this._label=e,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(e){return u.isFunction(e)||(e=u.constant(e)),this._defaultNodeLabelFn=e,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return u.keys(this._nodes)},r.prototype.sources=function(){return u.filter(this.nodes(),function(e){return u.isEmpty(this._in[e])},this)},r.prototype.sinks=function(){return u.filter(this.nodes(),function(e){return u.isEmpty(this._out[e])},this)},r.prototype.setNodes=function(e,t){var r=arguments;return u.each(e,function(e){r.length>1?this.setNode(e,t):this.setNode(e)},this),this},r.prototype.setNode=function(e,t){return u.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=l,this._children[e]={},this._children[l][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},r.prototype.node=function(e){return this._nodes[e]},r.prototype.hasNode=function(e){return u.has(this._nodes,e)},r.prototype.removeNode=function(e){var t=this;if(u.has(this._nodes,e)){var r=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],u.each(this.children(e),function(e){this.setParent(e)},this),delete this._children[e]),u.each(u.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],u.each(u.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},r.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(u.isUndefined(t))t=l;else{for(var r=t;!u.isUndefined(r);r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},r.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},r.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==l)return t}},r.prototype.children=function(e){if(u.isUndefined(e)&&(e=l),this._isCompound){var t=this._children[e];if(t)return u.keys(t)}else{if(e===l)return this.nodes();if(this.hasNode(e))return[]}},r.prototype.predecessors=function(e){var t=this._preds[e];return t?u.keys(t):void 0},r.prototype.successors=function(e){var t=this._sucs[e];return t?u.keys(t):void 0},r.prototype.neighbors=function(e){var t=this.predecessors(e);return t?u.union(t,this.successors(e)):void 0},r.prototype.setDefaultEdgeLabel=function(e){return u.isFunction(e)||(e=u.constant(e)),this._defaultEdgeLabelFn=e,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return u.values(this._edgeObjs)},r.prototype.setPath=function(e,t){var r=this,n=arguments;return u.reduce(e,function(e,i){return n.length>1?r.setEdge(e,i,t):r.setEdge(e,i),i}),this},r.prototype.setEdge=function(){var e,t,r,i,o=!1;u.isPlainObject(arguments[0])?(e=arguments[0].v,t=arguments[0].w,r=arguments[0].name,2===arguments.length&&(i=arguments[1],o=!0)):(e=arguments[0],t=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,u.isUndefined(r)||(r=""+r);var c=a(this._isDirected,e,t,r);if(u.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=i),this;if(!u.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=o?i:this._defaultEdgeLabelFn(e,t,r);var l=s(this._isDirected,e,t,r);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[c]=l,n(this._preds[t],e),n(this._sucs[e],t),this._in[t][c]=l,this._out[e][c]=l,this._edgeCount++,this},r.prototype.edge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return this._edgeLabels[n]},r.prototype.hasEdge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return u.has(this._edgeLabels,n)},r.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r),s=this._edgeObjs[n];return s&&(e=s.v,t=s.w,delete this._edgeLabels[n],delete this._edgeObjs[n],i(this._preds[t],e),i(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},r.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var n=u.values(r);return t?u.filter(n,function(e){return e.v===t}):n}},r.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var n=u.values(r);return t?u.filter(n,function(e){return e.w===t}):n}},r.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);return r?r.concat(this.outEdges(e,t)):void 0}},{"./lodash":75}],73:[function(e,t){t.exports={Graph:e("./graph"),version:e("./version")}},{"./graph":72,"./version":76}],74:[function(e,t){function r(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:n(e),edges:i(e)};return s.isUndefined(e.graph())||(t.value=s.clone(e.graph())),t}function n(e){return s.map(e.nodes(),function(t){var r=e.node(t),n=e.parent(t),i={v:t};return s.isUndefined(r)||(i.value=r),s.isUndefined(n)||(i.parent=n),i})}function i(e){return s.map(e.edges(),function(t){var r=e.edge(t),n={v:t.v,w:t.w};return s.isUndefined(t.name)||(n.name=t.name),s.isUndefined(r)||(n.value=r),n})}function a(e){var t=new o(e.options).setGraph(e.value);return s.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),s.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var s=e("./lodash"),o=e("./graph");t.exports={write:r,read:a}},{"./graph":72,"./lodash":75}],75:[function(e,t){t.exports=e(20)},{lodash:101}],76:[function(e,t){t.exports="1.0.1"},{}],77:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{"./lib":93,"./lib/alg":84,"./lib/json":94}],78:[function(e,t){t.exports=e(58)},{"../lodash":95}],79:[function(e,t){t.exports=e(59)},{"../lodash":95}],80:[function(e,t){t.exports=e(60)},{"../lodash":95,"./dijkstra":81}],81:[function(e,t){t.exports=e(61)},{"../data/priority-queue":91,"../lodash":95}],82:[function(e,t){t.exports=e(62)},{"../lodash":95,"./tarjan":89}],83:[function(e,t){t.exports=e(63)},{"../lodash":95}],84:[function(e,t,r){arguments[4][64][0].apply(r,arguments)},{"./components":78,"./dijkstra":81,"./dijkstra-all":80,"./find-cycles":82,"./floyd-warshall":83,"./is-acyclic":85,"./postorder":86,"./preorder":87,"./prim":88,"./tarjan":89,"./topsort":90}],85:[function(e,t){t.exports=e(65)},{"./topsort":90}],86:[function(e,t){t.exports=e(66)},{"./dfs":79}],87:[function(e,t){t.exports=e(67)},{"./dfs":79}],88:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{"../data/priority-queue":91,"../graph":92,"../lodash":95}],89:[function(e,t){t.exports=e(69)},{"../lodash":95}],90:[function(e,t){t.exports=e(70)},{"../lodash":95}],91:[function(e,t){t.exports=e(71)},{"../lodash":95}],92:[function(e,t){"use strict";function r(e){this._isDirected=u.has(e,"directed")?e.directed:!0,this._isMultigraph=u.has(e,"multigraph")?e.multigraph:!1,this._isCompound=u.has(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=u.constant(void 0),this._defaultEdgeLabelFn=u.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[l]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function n(e,t){u.has(e,t)?e[t]++:e[t]=1}function i(e,t){--e[t]||delete e[t]}function a(e,t,r,n){if(!e&&t>r){var i=t;t=r,r=i}return t+h+r+h+(u.isUndefined(n)?c:n)}function s(e,t,r,n){if(!e&&t>r){var i=t;t=r,r=i}var a={v:t,w:r};return n&&(a.name=n),a}function o(e,t){return a(e,t.v,t.w,t.name)}var u=e("./lodash");t.exports=r;var c="\x00",l="\x00",h="";r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(e){return this._label=e,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(e){return u.isFunction(e)||(e=u.constant(e)),this._defaultNodeLabelFn=e,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return u.keys(this._nodes)},r.prototype.sources=function(){return u.filter(this.nodes(),function(e){return u.isEmpty(this._in[e])},this)},r.prototype.sinks=function(){return u.filter(this.nodes(),function(e){return u.isEmpty(this._out[e])},this)},r.prototype.setNodes=function(e,t){var r=arguments;return u.each(e,function(e){r.length>1?this.setNode(e,t):this.setNode(e)},this),this},r.prototype.setNode=function(e,t){return u.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=l,this._children[e]={},this._children[l][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},r.prototype.node=function(e){return this._nodes[e]},r.prototype.hasNode=function(e){return u.has(this._nodes,e)},r.prototype.removeNode=function(e){var t=this;if(u.has(this._nodes,e)){var r=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],u.each(this.children(e),function(e){this.setParent(e)},this),delete this._children[e]),u.each(u.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],u.each(u.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},r.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(u.isUndefined(t))t=l;else{for(var r=t;!u.isUndefined(r);r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},r.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},r.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==l)return t}},r.prototype.children=function(e){if(u.isUndefined(e)&&(e=l),this._isCompound){var t=this._children[e];if(t)return u.keys(t)}else{if(e===l)return this.nodes();if(this.hasNode(e))return[]}},r.prototype.predecessors=function(e){var t=this._preds[e];return t?u.keys(t):void 0},r.prototype.successors=function(e){var t=this._sucs[e];return t?u.keys(t):void 0},r.prototype.neighbors=function(e){var t=this.predecessors(e);return t?u.union(t,this.successors(e)):void 0},r.prototype.setDefaultEdgeLabel=function(e){return u.isFunction(e)||(e=u.constant(e)),this._defaultEdgeLabelFn=e,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return u.values(this._edgeObjs)},r.prototype.setPath=function(e,t){var r=this,n=arguments;return u.reduce(e,function(e,i){return n.length>1?r.setEdge(e,i,t):r.setEdge(e,i),i}),this},r.prototype.setEdge=function(e,t,r,i){var o=arguments.length>2;e=String(e),t=String(t),u.isUndefined(i)||(i=String(i)),u.isPlainObject(arguments[0])&&(e=arguments[0].v,t=arguments[0].w,i=arguments[0].name,2===arguments.length&&(r=arguments[1],o=!0));var c=a(this._isDirected,e,t,i);if(u.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=r),this;if(!u.isUndefined(i)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=o?r:this._defaultEdgeLabelFn(e,t,i);var l=s(this._isDirected,e,t,i);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[c]=l,n(this._preds[t],e),n(this._sucs[e],t),this._in[t][c]=l,this._out[e][c]=l,this._edgeCount++,this},r.prototype.edge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return this._edgeLabels[n]},r.prototype.hasEdge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return u.has(this._edgeLabels,n)},r.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r),s=this._edgeObjs[n]; -return s&&(e=s.v,t=s.w,delete this._edgeLabels[n],delete this._edgeObjs[n],i(this._preds[t],e),i(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},r.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var n=u.values(r);return t?u.filter(n,function(e){return e.v===t}):n}},r.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var n=u.values(r);return t?u.filter(n,function(e){return e.w===t}):n}},r.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);return r?r.concat(this.outEdges(e,t)):void 0}},{"./lodash":95}],93:[function(e,t,r){arguments[4][73][0].apply(r,arguments)},{"./graph":92,"./version":96}],94:[function(e,t,r){arguments[4][74][0].apply(r,arguments)},{"./graph":92,"./lodash":95}],95:[function(e,t){t.exports=e(20)},{lodash:101}],96:[function(e,t){t.exports="0.9.1"},{}],97:[function(){},{}],98:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!i;a--){var s=a>=0?arguments[a]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(e){var i=r.isAbsolute(e),a="/"===s(e,-1);return e=t(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),a=n(t.split("/")),s=Math.min(i.length,a.length),o=s,u=0;s>u;u++)if(i[u]!==a[u]){o=u;break}for(var c=[],u=o;ut&&(t=e.length+t),e.substr(t,r)}}).call(this,e("1YiZ5S"))},{"1YiZ5S":99}],99:[function(e,t){function r(){}var n=t.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=r,n.addListener=r,n.once=r,n.off=r,n.removeListener=r,n.removeAllListeners=r,n.emit=r,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],100:[function(e,t,r){(function(e){!function(n){var i="object"==typeof r&&r,a="object"==typeof t&&t&&t.exports==i&&t,s="object"==typeof e&&e;(s.global===s||s.window===s)&&(n=s);var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,h={"Á":"Aacute","á":"aacute","Ă":"Abreve","ă":"abreve","∾":"ac","∿":"acd","∾̳":"acE","Â":"Acirc","â":"acirc","´":"acute","А":"Acy","а":"acy","Æ":"AElig","æ":"aelig","⁡":"af","𝔄":"Afr","𝔞":"afr","À":"Agrave","à":"agrave","ℵ":"aleph","Α":"Alpha","α":"alpha","Ā":"Amacr","ā":"amacr","⨿":"amalg","&":"amp","⩕":"andand","⩓":"And","∧":"and","⩜":"andd","⩘":"andslope","⩚":"andv","∠":"ang","⦤":"ange","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","∡":"angmsd","∟":"angrt","⊾":"angrtvb","⦝":"angrtvbd","∢":"angsph","Å":"angst","⍼":"angzarr","Ą":"Aogon","ą":"aogon","𝔸":"Aopf","𝕒":"aopf","⩯":"apacir","≈":"ap","⩰":"apE","≊":"ape","≋":"apid","'":"apos","å":"aring","𝒜":"Ascr","𝒶":"ascr","≔":"colone","*":"ast","≍":"CupCap","Ã":"Atilde","ã":"atilde","Ä":"Auml","ä":"auml","∳":"awconint","⨑":"awint","≌":"bcong","϶":"bepsi","‵":"bprime","∽":"bsim","⋍":"bsime","∖":"setmn","⫧":"Barv","⊽":"barvee","⌅":"barwed","⌆":"Barwed","⎵":"bbrk","⎶":"bbrktbrk","Б":"Bcy","б":"bcy","„":"bdquo","∵":"becaus","⦰":"bemptyv","ℬ":"Bscr","Β":"Beta","β":"beta","ℶ":"beth","≬":"twixt","𝔅":"Bfr","𝔟":"bfr","⋂":"xcap","◯":"xcirc","⋃":"xcup","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨆":"xsqcup","★":"starf","▽":"xdtri","△":"xutri","⨄":"xuplus","⋁":"Vee","⋀":"Wedge","⤍":"rbarr","⧫":"lozf","▪":"squf","▴":"utrif","▾":"dtrif","◂":"ltrif","▸":"rtrif","␣":"blank","▒":"blk12","░":"blk14","▓":"blk34","█":"block","=⃥":"bne","≡⃥":"bnequiv","⫭":"bNot","⌐":"bnot","𝔹":"Bopf","𝕓":"bopf","⊥":"bot","⋈":"bowtie","⧉":"boxbox","┐":"boxdl","╕":"boxdL","╖":"boxDl","╗":"boxDL","┌":"boxdr","╒":"boxdR","╓":"boxDr","╔":"boxDR","─":"boxh","═":"boxH","┬":"boxhd","╤":"boxHd","╥":"boxhD","╦":"boxHD","┴":"boxhu","╧":"boxHu","╨":"boxhU","╩":"boxHU","⊟":"minusb","⊞":"plusb","⊠":"timesb","┘":"boxul","╛":"boxuL","╜":"boxUl","╝":"boxUL","└":"boxur","╘":"boxuR","╙":"boxUr","╚":"boxUR","│":"boxv","║":"boxV","┼":"boxvh","╪":"boxvH","╫":"boxVh","╬":"boxVH","┤":"boxvl","╡":"boxvL","╢":"boxVl","╣":"boxVL","├":"boxvr","╞":"boxvR","╟":"boxVr","╠":"boxVR","˘":"breve","¦":"brvbar","𝒷":"bscr","⁏":"bsemi","⧅":"bsolb","\\":"bsol","⟈":"bsolhsub","•":"bull","≎":"bump","⪮":"bumpE","≏":"bumpe","Ć":"Cacute","ć":"cacute","⩄":"capand","⩉":"capbrcup","⩋":"capcap","∩":"cap","⋒":"Cap","⩇":"capcup","⩀":"capdot","ⅅ":"DD","∩︀":"caps","⁁":"caret","ˇ":"caron","ℭ":"Cfr","⩍":"ccaps","Č":"Ccaron","č":"ccaron","Ç":"Ccedil","ç":"ccedil","Ĉ":"Ccirc","ĉ":"ccirc","∰":"Cconint","⩌":"ccups","⩐":"ccupssm","Ċ":"Cdot","ċ":"cdot","¸":"cedil","⦲":"cemptyv","¢":"cent","·":"middot","𝔠":"cfr","Ч":"CHcy","ч":"chcy","✓":"check","Χ":"Chi","χ":"chi","ˆ":"circ","≗":"cire","↺":"olarr","↻":"orarr","⊛":"oast","⊚":"ocir","⊝":"odash","⊙":"odot","®":"reg","Ⓢ":"oS","⊖":"ominus","⊕":"oplus","⊗":"otimes","○":"cir","⧃":"cirE","⨐":"cirfnint","⫯":"cirmid","⧂":"cirscir","∲":"cwconint","”":"rdquo","’":"rsquo","♣":"clubs",":":"colon","∷":"Colon","⩴":"Colone",",":"comma","@":"commat","∁":"comp","∘":"compfn","ℂ":"Copf","≅":"cong","⩭":"congdot","≡":"equiv","∮":"oint","∯":"Conint","𝕔":"copf","∐":"coprod","©":"copy","℗":"copysr","↵":"crarr","✗":"cross","⨯":"Cross","𝒞":"Cscr","𝒸":"cscr","⫏":"csub","⫑":"csube","⫐":"csup","⫒":"csupe","⋯":"ctdot","⤸":"cudarrl","⤵":"cudarrr","⋞":"cuepr","⋟":"cuesc","↶":"cularr","⤽":"cularrp","⩈":"cupbrcap","⩆":"cupcap","∪":"cup","⋓":"Cup","⩊":"cupcup","⊍":"cupdot","⩅":"cupor","∪︀":"cups","↷":"curarr","⤼":"curarrm","⋎":"cuvee","⋏":"cuwed","¤":"curren","∱":"cwint","⌭":"cylcty","†":"dagger","‡":"Dagger","ℸ":"daleth","↓":"darr","↡":"Darr","⇓":"dArr","‐":"dash","⫤":"Dashv","⊣":"dashv","⤏":"rBarr","˝":"dblac","Ď":"Dcaron","ď":"dcaron","Д":"Dcy","д":"dcy","⇊":"ddarr","ⅆ":"dd","⤑":"DDotrahd","⩷":"eDDot","°":"deg","∇":"Del","Δ":"Delta","δ":"delta","⦱":"demptyv","⥿":"dfisht","𝔇":"Dfr","𝔡":"dfr","⥥":"dHar","⇃":"dharl","⇂":"dharr","˙":"dot","`":"grave","˜":"tilde","⋄":"diam","♦":"diams","¨":"die","ϝ":"gammad","⋲":"disin","÷":"div","⋇":"divonx","Ђ":"DJcy","ђ":"djcy","⌞":"dlcorn","⌍":"dlcrop",$:"dollar","𝔻":"Dopf","𝕕":"dopf","⃜":"DotDot","≐":"doteq","≑":"eDot","∸":"minusd","∔":"plusdo","⊡":"sdotb","⇐":"lArr","⇔":"iff","⟸":"xlArr","⟺":"xhArr","⟹":"xrArr","⇒":"rArr","⊨":"vDash","⇑":"uArr","⇕":"vArr","∥":"par","⤓":"DownArrowBar","⇵":"duarr","̑":"DownBreve","⥐":"DownLeftRightVector","⥞":"DownLeftTeeVector","⥖":"DownLeftVectorBar","↽":"lhard","⥟":"DownRightTeeVector","⥗":"DownRightVectorBar","⇁":"rhard","↧":"mapstodown","⊤":"top","⤐":"RBarr","⌟":"drcorn","⌌":"drcrop","𝒟":"Dscr","𝒹":"dscr","Ѕ":"DScy","ѕ":"dscy","⧶":"dsol","Đ":"Dstrok","đ":"dstrok","⋱":"dtdot","▿":"dtri","⥯":"duhar","⦦":"dwangle","Џ":"DZcy","џ":"dzcy","⟿":"dzigrarr","É":"Eacute","é":"eacute","⩮":"easter","Ě":"Ecaron","ě":"ecaron","Ê":"Ecirc","ê":"ecirc","≖":"ecir","≕":"ecolon","Э":"Ecy","э":"ecy","Ė":"Edot","ė":"edot","ⅇ":"ee","≒":"efDot","𝔈":"Efr","𝔢":"efr","⪚":"eg","È":"Egrave","è":"egrave","⪖":"egs","⪘":"egsdot","⪙":"el","∈":"in","⏧":"elinters","ℓ":"ell","⪕":"els","⪗":"elsdot","Ē":"Emacr","ē":"emacr","∅":"empty","◻":"EmptySmallSquare","▫":"EmptyVerySmallSquare"," ":"emsp13"," ":"emsp14"," ":"emsp","Ŋ":"ENG","ŋ":"eng"," ":"ensp","Ę":"Eogon","ę":"eogon","𝔼":"Eopf","𝕖":"eopf","⋕":"epar","⧣":"eparsl","⩱":"eplus","ε":"epsi","Ε":"Epsilon","ϵ":"epsiv","≂":"esim","⩵":"Equal","=":"equals","≟":"equest","⇌":"rlhar","⩸":"equivDD","⧥":"eqvparsl","⥱":"erarr","≓":"erDot","ℯ":"escr","ℰ":"Escr","⩳":"Esim","Η":"Eta","η":"eta","Ð":"ETH","ð":"eth","Ë":"Euml","ë":"euml","€":"euro","!":"excl","∃":"exist","Ф":"Fcy","ф":"fcy","♀":"female","ffi":"ffilig","ff":"fflig","ffl":"ffllig","𝔉":"Ffr","𝔣":"ffr","fi":"filig","◼":"FilledSmallSquare",fj:"fjlig","♭":"flat","fl":"fllig","▱":"fltns","ƒ":"fnof","𝔽":"Fopf","𝕗":"fopf","∀":"forall","⋔":"fork","⫙":"forkv","ℱ":"Fscr","⨍":"fpartint","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","⅔":"frac23","⅖":"frac25","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","⁄":"frasl","⌢":"frown","𝒻":"fscr","ǵ":"gacute","Γ":"Gamma","γ":"gamma","Ϝ":"Gammad","⪆":"gap","Ğ":"Gbreve","ğ":"gbreve","Ģ":"Gcedil","Ĝ":"Gcirc","ĝ":"gcirc","Г":"Gcy","г":"gcy","Ġ":"Gdot","ġ":"gdot","≥":"ge","≧":"gE","⪌":"gEl","⋛":"gel","⩾":"ges","⪩":"gescc","⪀":"gesdot","⪂":"gesdoto","⪄":"gesdotol","⋛︀":"gesl","⪔":"gesles","𝔊":"Gfr","𝔤":"gfr","≫":"gg","⋙":"Gg","ℷ":"gimel","Ѓ":"GJcy","ѓ":"gjcy","⪥":"gla","≷":"gl","⪒":"glE","⪤":"glj","⪊":"gnap","⪈":"gne","≩":"gnE","⋧":"gnsim","𝔾":"Gopf","𝕘":"gopf","⪢":"GreaterGreater","≳":"gsim","𝒢":"Gscr","ℊ":"gscr","⪎":"gsime","⪐":"gsiml","⪧":"gtcc","⩺":"gtcir",">":"gt","⋗":"gtdot","⦕":"gtlPar","⩼":"gtquest","⥸":"gtrarr","≩︀":"gvnE"," ":"hairsp","ℋ":"Hscr","Ъ":"HARDcy","ъ":"hardcy","⥈":"harrcir","↔":"harr","↭":"harrw","^":"Hat","ℏ":"hbar","Ĥ":"Hcirc","ĥ":"hcirc","♥":"hearts","…":"mldr","⊹":"hercon","𝔥":"hfr","ℌ":"Hfr","⤥":"searhk","⤦":"swarhk","⇿":"hoarr","∻":"homtht","↩":"larrhk","↪":"rarrhk","𝕙":"hopf","ℍ":"Hopf","―":"horbar","𝒽":"hscr","Ħ":"Hstrok","ħ":"hstrok","⁃":"hybull","Í":"Iacute","í":"iacute","⁣":"ic","Î":"Icirc","î":"icirc","И":"Icy","и":"icy","İ":"Idot","Е":"IEcy","е":"iecy","¡":"iexcl","𝔦":"ifr","ℑ":"Im","Ì":"Igrave","ì":"igrave","ⅈ":"ii","⨌":"qint","∭":"tint","⧜":"iinfin","℩":"iiota","IJ":"IJlig","ij":"ijlig","Ī":"Imacr","ī":"imacr","ℐ":"Iscr","ı":"imath","⊷":"imof","Ƶ":"imped","℅":"incare","∞":"infin","⧝":"infintie","⊺":"intcal","∫":"int","∬":"Int","ℤ":"Zopf","⨗":"intlarhk","⨼":"iprod","⁢":"it","Ё":"IOcy","ё":"iocy","Į":"Iogon","į":"iogon","𝕀":"Iopf","𝕚":"iopf","Ι":"Iota","ι":"iota","¿":"iquest","𝒾":"iscr","⋵":"isindot","⋹":"isinE","⋴":"isins","⋳":"isinsv","Ĩ":"Itilde","ĩ":"itilde","І":"Iukcy","і":"iukcy","Ï":"Iuml","ï":"iuml","Ĵ":"Jcirc","ĵ":"jcirc","Й":"Jcy","й":"jcy","𝔍":"Jfr","𝔧":"jfr","ȷ":"jmath","𝕁":"Jopf","𝕛":"jopf","𝒥":"Jscr","𝒿":"jscr","Ј":"Jsercy","ј":"jsercy","Є":"Jukcy","є":"jukcy","Κ":"Kappa","κ":"kappa","ϰ":"kappav","Ķ":"Kcedil","ķ":"kcedil","К":"Kcy","к":"kcy","𝔎":"Kfr","𝔨":"kfr","ĸ":"kgreen","Х":"KHcy","х":"khcy","Ќ":"KJcy","ќ":"kjcy","𝕂":"Kopf","𝕜":"kopf","𝒦":"Kscr","𝓀":"kscr","⇚":"lAarr","Ĺ":"Lacute","ĺ":"lacute","⦴":"laemptyv","ℒ":"Lscr","Λ":"Lambda","λ":"lambda","⟨":"lang","⟪":"Lang","⦑":"langd","⪅":"lap","«":"laquo","⇤":"larrb","⤟":"larrbfs","←":"larr","↞":"Larr","⤝":"larrfs","↫":"larrlp","⤹":"larrpl","⥳":"larrsim","↢":"larrtl","⤙":"latail","⤛":"lAtail","⪫":"lat","⪭":"late","⪭︀":"lates","⤌":"lbarr","⤎":"lBarr","❲":"lbbrk","{":"lcub","[":"lsqb","⦋":"lbrke","⦏":"lbrksld","⦍":"lbrkslu","Ľ":"Lcaron","ľ":"lcaron","Ļ":"Lcedil","ļ":"lcedil","⌈":"lceil","Л":"Lcy","л":"lcy","⤶":"ldca","“":"ldquo","⥧":"ldrdhar","⥋":"ldrushar","↲":"ldsh","≤":"le","≦":"lE","⇆":"lrarr","⟦":"lobrk","⥡":"LeftDownTeeVector","⥙":"LeftDownVectorBar","⌊":"lfloor","↼":"lharu","⇇":"llarr","⇋":"lrhar","⥎":"LeftRightVector","↤":"mapstoleft","⥚":"LeftTeeVector","⋋":"lthree","⧏":"LeftTriangleBar","⊲":"vltri","⊴":"ltrie","⥑":"LeftUpDownVector","⥠":"LeftUpTeeVector","⥘":"LeftUpVectorBar","↿":"uharl","⥒":"LeftVectorBar","⪋":"lEg","⋚":"leg","⩽":"les","⪨":"lescc","⩿":"lesdot","⪁":"lesdoto","⪃":"lesdotor","⋚︀":"lesg","⪓":"lesges","⋖":"ltdot","≶":"lg","⪡":"LessLess","≲":"lsim","⥼":"lfisht","𝔏":"Lfr","𝔩":"lfr","⪑":"lgE","⥢":"lHar","⥪":"lharul","▄":"lhblk","Љ":"LJcy","љ":"ljcy","≪":"ll","⋘":"Ll","⥫":"llhard","◺":"lltri","Ŀ":"Lmidot","ŀ":"lmidot","⎰":"lmoust","⪉":"lnap","⪇":"lne","≨":"lnE","⋦":"lnsim","⟬":"loang","⇽":"loarr","⟵":"xlarr","⟷":"xharr","⟼":"xmap","⟶":"xrarr","↬":"rarrlp","⦅":"lopar","𝕃":"Lopf","𝕝":"lopf","⨭":"loplus","⨴":"lotimes","∗":"lowast",_:"lowbar","↙":"swarr","↘":"searr","◊":"loz","(":"lpar","⦓":"lparlt","⥭":"lrhard","‎":"lrm","⊿":"lrtri","‹":"lsaquo","𝓁":"lscr","↰":"lsh","⪍":"lsime","⪏":"lsimg","‘":"lsquo","‚":"sbquo","Ł":"Lstrok","ł":"lstrok","⪦":"ltcc","⩹":"ltcir","<":"lt","⋉":"ltimes","⥶":"ltlarr","⩻":"ltquest","◃":"ltri","⦖":"ltrPar","⥊":"lurdshar","⥦":"luruhar","≨︀":"lvnE","¯":"macr","♂":"male","✠":"malt","⤅":"Map","↦":"map","↥":"mapstoup","▮":"marker","⨩":"mcomma","М":"Mcy","м":"mcy","—":"mdash","∺":"mDDot"," ":"MediumSpace","ℳ":"Mscr","𝔐":"Mfr","𝔪":"mfr","℧":"mho","µ":"micro","⫰":"midcir","∣":"mid","−":"minus","⨪":"minusdu","∓":"mp","⫛":"mlcp","⊧":"models","𝕄":"Mopf","𝕞":"mopf","𝓂":"mscr","Μ":"Mu","μ":"mu","⊸":"mumap","Ń":"Nacute","ń":"nacute","∠⃒":"nang","≉":"nap","⩰̸":"napE","≋̸":"napid","ʼn":"napos","♮":"natur","ℕ":"Nopf"," ":"nbsp","≎̸":"nbump","≏̸":"nbumpe","⩃":"ncap","Ň":"Ncaron","ň":"ncaron","Ņ":"Ncedil","ņ":"ncedil","≇":"ncong","⩭̸":"ncongdot","⩂":"ncup","Н":"Ncy","н":"ncy","–":"ndash","⤤":"nearhk","↗":"nearr","⇗":"neArr","≠":"ne","≐̸":"nedot","​":"ZeroWidthSpace","≢":"nequiv","⤨":"toea","≂̸":"nesim","\n":"NewLine","∄":"nexist","𝔑":"Nfr","𝔫":"nfr","≧̸":"ngE","≱":"nge","⩾̸":"nges","⋙̸":"nGg","≵":"ngsim","≫⃒":"nGt","≯":"ngt","≫̸":"nGtv","↮":"nharr","⇎":"nhArr","⫲":"nhpar","∋":"ni","⋼":"nis","⋺":"nisd","Њ":"NJcy","њ":"njcy","↚":"nlarr","⇍":"nlArr","‥":"nldr","≦̸":"nlE","≰":"nle","⩽̸":"nles","≮":"nlt","⋘̸":"nLl","≴":"nlsim","≪⃒":"nLt","⋪":"nltri","⋬":"nltrie","≪̸":"nLtv","∤":"nmid","⁠":"NoBreak","𝕟":"nopf","⫬":"Not","¬":"not","≭":"NotCupCap","∦":"npar","∉":"notin","≹":"ntgl","⋵̸":"notindot","⋹̸":"notinE","⋷":"notinvb","⋶":"notinvc","⧏̸":"NotLeftTriangleBar","≸":"ntlg","⪢̸":"NotNestedGreaterGreater","⪡̸":"NotNestedLessLess","∌":"notni","⋾":"notnivb","⋽":"notnivc","⊀":"npr","⪯̸":"npre","⋠":"nprcue","⧐̸":"NotRightTriangleBar","⋫":"nrtri","⋭":"nrtrie","⊏̸":"NotSquareSubset","⋢":"nsqsube","⊐̸":"NotSquareSuperset","⋣":"nsqsupe","⊂⃒":"vnsub","⊈":"nsube","⊁":"nsc","⪰̸":"nsce","⋡":"nsccue","≿̸":"NotSucceedsTilde","⊃⃒":"vnsup","⊉":"nsupe","≁":"nsim","≄":"nsime","⫽⃥":"nparsl","∂̸":"npart","⨔":"npolint","⤳̸":"nrarrc","↛":"nrarr","⇏":"nrArr","↝̸":"nrarrw","𝒩":"Nscr","𝓃":"nscr","⊄":"nsub","⫅̸":"nsubE","⊅":"nsup","⫆̸":"nsupE","Ñ":"Ntilde","ñ":"ntilde","Ν":"Nu","ν":"nu","#":"num","№":"numero"," ":"numsp","≍⃒":"nvap","⊬":"nvdash","⊭":"nvDash","⊮":"nVdash","⊯":"nVDash","≥⃒":"nvge",">⃒":"nvgt","⤄":"nvHarr","⧞":"nvinfin","⤂":"nvlArr","≤⃒":"nvle","<⃒":"nvlt","⊴⃒":"nvltrie","⤃":"nvrArr","⊵⃒":"nvrtrie","∼⃒":"nvsim","⤣":"nwarhk","↖":"nwarr","⇖":"nwArr","⤧":"nwnear","Ó":"Oacute","ó":"oacute","Ô":"Ocirc","ô":"ocirc","О":"Ocy","о":"ocy","Ő":"Odblac","ő":"odblac","⨸":"odiv","⦼":"odsold","Œ":"OElig","œ":"oelig","⦿":"ofcir","𝔒":"Ofr","𝔬":"ofr","˛":"ogon","Ò":"Ograve","ò":"ograve","⧁":"ogt","⦵":"ohbar","Ω":"ohm","⦾":"olcir","⦻":"olcross","‾":"oline","⧀":"olt","Ō":"Omacr","ō":"omacr","ω":"omega","Ο":"Omicron","ο":"omicron","⦶":"omid","𝕆":"Oopf","𝕠":"oopf","⦷":"opar","⦹":"operp","⩔":"Or","∨":"or","⩝":"ord","ℴ":"oscr","ª":"ordf","º":"ordm","⊶":"origof","⩖":"oror","⩗":"orslope","⩛":"orv","𝒪":"Oscr","Ø":"Oslash","ø":"oslash","⊘":"osol","Õ":"Otilde","õ":"otilde","⨶":"otimesas","⨷":"Otimes","Ö":"Ouml","ö":"ouml","⌽":"ovbar","⏞":"OverBrace","⎴":"tbrk","⏜":"OverParenthesis","¶":"para","⫳":"parsim","⫽":"parsl","∂":"part","П":"Pcy","п":"pcy","%":"percnt",".":"period","‰":"permil","‱":"pertenk","𝔓":"Pfr","𝔭":"pfr","Φ":"Phi","φ":"phi","ϕ":"phiv","☎":"phone","Π":"Pi","π":"pi","ϖ":"piv","ℎ":"planckh","⨣":"plusacir","⨢":"pluscir","+":"plus","⨥":"plusdu","⩲":"pluse","±":"pm","⨦":"plussim","⨧":"plustwo","⨕":"pointint","𝕡":"popf","ℙ":"Popf","£":"pound","⪷":"prap","⪻":"Pr","≺":"pr","≼":"prcue","⪯":"pre","≾":"prsim","⪹":"prnap","⪵":"prnE","⋨":"prnsim","⪳":"prE","′":"prime","″":"Prime","∏":"prod","⌮":"profalar","⌒":"profline","⌓":"profsurf","∝":"prop","⊰":"prurel","𝒫":"Pscr","𝓅":"pscr","Ψ":"Psi","ψ":"psi"," ":"puncsp","𝔔":"Qfr","𝔮":"qfr","𝕢":"qopf","ℚ":"Qopf","⁗":"qprime","𝒬":"Qscr","𝓆":"qscr","⨖":"quatint","?":"quest",'"':"quot","⇛":"rAarr","∽̱":"race","Ŕ":"Racute","ŕ":"racute","√":"Sqrt","⦳":"raemptyv","⟩":"rang","⟫":"Rang","⦒":"rangd","⦥":"range","»":"raquo","⥵":"rarrap","⇥":"rarrb","⤠":"rarrbfs","⤳":"rarrc","→":"rarr","↠":"Rarr","⤞":"rarrfs","⥅":"rarrpl","⥴":"rarrsim","⤖":"Rarrtl","↣":"rarrtl","↝":"rarrw","⤚":"ratail","⤜":"rAtail","∶":"ratio","❳":"rbbrk","}":"rcub","]":"rsqb","⦌":"rbrke","⦎":"rbrksld","⦐":"rbrkslu","Ř":"Rcaron","ř":"rcaron","Ŗ":"Rcedil","ŗ":"rcedil","⌉":"rceil","Р":"Rcy","р":"rcy","⤷":"rdca","⥩":"rdldhar","↳":"rdsh","ℜ":"Re","ℛ":"Rscr","ℝ":"Ropf","▭":"rect","⥽":"rfisht","⌋":"rfloor","𝔯":"rfr","⥤":"rHar","⇀":"rharu","⥬":"rharul","Ρ":"Rho","ρ":"rho","ϱ":"rhov","⇄":"rlarr","⟧":"robrk","⥝":"RightDownTeeVector","⥕":"RightDownVectorBar","⇉":"rrarr","⊢":"vdash","⥛":"RightTeeVector","⋌":"rthree","⧐":"RightTriangleBar","⊳":"vrtri","⊵":"rtrie","⥏":"RightUpDownVector","⥜":"RightUpTeeVector","⥔":"RightUpVectorBar","↾":"uharr","⥓":"RightVectorBar","˚":"ring","‏":"rlm","⎱":"rmoust","⫮":"rnmid","⟭":"roang","⇾":"roarr","⦆":"ropar","𝕣":"ropf","⨮":"roplus","⨵":"rotimes","⥰":"RoundImplies",")":"rpar","⦔":"rpargt","⨒":"rppolint","›":"rsaquo","𝓇":"rscr","↱":"rsh","⋊":"rtimes","▹":"rtri","⧎":"rtriltri","⧴":"RuleDelayed","⥨":"ruluhar","℞":"rx","Ś":"Sacute","ś":"sacute","⪸":"scap","Š":"Scaron","š":"scaron","⪼":"Sc","≻":"sc","≽":"sccue","⪰":"sce","⪴":"scE","Ş":"Scedil","ş":"scedil","Ŝ":"Scirc","ŝ":"scirc","⪺":"scnap","⪶":"scnE","⋩":"scnsim","⨓":"scpolint","≿":"scsim","С":"Scy","с":"scy","⋅":"sdot","⩦":"sdote","⇘":"seArr","§":"sect",";":"semi","⤩":"tosa","✶":"sext","𝔖":"Sfr","𝔰":"sfr","♯":"sharp","Щ":"SHCHcy","щ":"shchcy","Ш":"SHcy","ш":"shcy","↑":"uarr","­":"shy","Σ":"Sigma","σ":"sigma","ς":"sigmaf","∼":"sim","⩪":"simdot","≃":"sime","⪞":"simg","⪠":"simgE","⪝":"siml","⪟":"simlE","≆":"simne","⨤":"simplus","⥲":"simrarr","⨳":"smashp","⧤":"smeparsl","⌣":"smile","⪪":"smt","⪬":"smte","⪬︀":"smtes","Ь":"SOFTcy","ь":"softcy","⌿":"solbar","⧄":"solb","/":"sol","𝕊":"Sopf","𝕤":"sopf","♠":"spades","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊏":"sqsub","⊑":"sqsube","⊐":"sqsup","⊒":"sqsupe","□":"squ","𝒮":"Sscr","𝓈":"sscr","⋆":"Star","☆":"star","⊂":"sub","⋐":"Sub","⪽":"subdot","⫅":"subE","⊆":"sube","⫃":"subedot","⫁":"submult","⫋":"subnE","⊊":"subne","⪿":"subplus","⥹":"subrarr","⫇":"subsim","⫕":"subsub","⫓":"subsup","∑":"sum","♪":"sung","¹":"sup1","²":"sup2","³":"sup3","⊃":"sup","⋑":"Sup","⪾":"supdot","⫘":"supdsub","⫆":"supE","⊇":"supe","⫄":"supedot","⟉":"suphsol","⫗":"suphsub","⥻":"suplarr","⫂":"supmult","⫌":"supnE","⊋":"supne","⫀":"supplus","⫈":"supsim","⫔":"supsub","⫖":"supsup","⇙":"swArr","⤪":"swnwar","ß":"szlig"," ":"Tab","⌖":"target","Τ":"Tau","τ":"tau","Ť":"Tcaron","ť":"tcaron","Ţ":"Tcedil","ţ":"tcedil","Т":"Tcy","т":"tcy","⃛":"tdot","⌕":"telrec","𝔗":"Tfr","𝔱":"tfr","∴":"there4","Θ":"Theta","θ":"theta","ϑ":"thetav","  ":"ThickSpace"," ":"thinsp","Þ":"THORN","þ":"thorn","⨱":"timesbar","×":"times","⨰":"timesd","⌶":"topbot","⫱":"topcir","𝕋":"Topf","𝕥":"topf","⫚":"topfork","‴":"tprime","™":"trade","▵":"utri","≜":"trie","◬":"tridot","⨺":"triminus","⨹":"triplus","⧍":"trisb","⨻":"tritime","⏢":"trpezium","𝒯":"Tscr","𝓉":"tscr","Ц":"TScy","ц":"tscy","Ћ":"TSHcy","ћ":"tshcy","Ŧ":"Tstrok","ŧ":"tstrok","Ú":"Uacute","ú":"uacute","↟":"Uarr","⥉":"Uarrocir","Ў":"Ubrcy","ў":"ubrcy","Ŭ":"Ubreve","ŭ":"ubreve","Û":"Ucirc","û":"ucirc","У":"Ucy","у":"ucy","⇅":"udarr","Ű":"Udblac","ű":"udblac","⥮":"udhar","⥾":"ufisht","𝔘":"Ufr","𝔲":"ufr","Ù":"Ugrave","ù":"ugrave","⥣":"uHar","▀":"uhblk","⌜":"ulcorn","⌏":"ulcrop","◸":"ultri","Ū":"Umacr","ū":"umacr","⏟":"UnderBrace","⏝":"UnderParenthesis","⊎":"uplus","Ų":"Uogon","ų":"uogon","𝕌":"Uopf","𝕦":"uopf","⤒":"UpArrowBar","↕":"varr","υ":"upsi","ϒ":"Upsi","Υ":"Upsilon","⇈":"uuarr","⌝":"urcorn","⌎":"urcrop","Ů":"Uring","ů":"uring","◹":"urtri","𝒰":"Uscr","𝓊":"uscr","⋰":"utdot","Ũ":"Utilde","ũ":"utilde","Ü":"Uuml","ü":"uuml","⦧":"uwangle","⦜":"vangrt","⊊︀":"vsubne","⫋︀":"vsubnE","⊋︀":"vsupne","⫌︀":"vsupnE","⫨":"vBar","⫫":"Vbar","⫩":"vBarv","В":"Vcy","в":"vcy","⊩":"Vdash","⊫":"VDash","⫦":"Vdashl","⊻":"veebar","≚":"veeeq","⋮":"vellip","|":"vert","‖":"Vert","❘":"VerticalSeparator","≀":"wr","𝔙":"Vfr","𝔳":"vfr","𝕍":"Vopf","𝕧":"vopf","𝒱":"Vscr","𝓋":"vscr","⊪":"Vvdash","⦚":"vzigzag","Ŵ":"Wcirc","ŵ":"wcirc","⩟":"wedbar","≙":"wedgeq","℘":"wp","𝔚":"Wfr","𝔴":"wfr","𝕎":"Wopf","𝕨":"wopf","𝒲":"Wscr","𝓌":"wscr","𝔛":"Xfr","𝔵":"xfr","Ξ":"Xi","ξ":"xi","⋻":"xnis","𝕏":"Xopf","𝕩":"xopf","𝒳":"Xscr","𝓍":"xscr","Ý":"Yacute","ý":"yacute","Я":"YAcy","я":"yacy","Ŷ":"Ycirc","ŷ":"ycirc","Ы":"Ycy","ы":"ycy","¥":"yen","𝔜":"Yfr","𝔶":"yfr","Ї":"YIcy","ї":"yicy","𝕐":"Yopf","𝕪":"yopf","𝒴":"Yscr","𝓎":"yscr","Ю":"YUcy","ю":"yucy","ÿ":"yuml","Ÿ":"Yuml","Ź":"Zacute","ź":"zacute","Ž":"Zcaron","ž":"zcaron","З":"Zcy","з":"zcy","Ż":"Zdot","ż":"zdot","ℨ":"Zfr","Ζ":"Zeta","ζ":"zeta","𝔷":"zfr","Ж":"ZHcy","ж":"zhcy","⇝":"zigrarr","𝕫":"zopf","𝒵":"Zscr","𝓏":"zscr","‍":"zwj","‌":"zwnj"},d=/["&'<>`]/g,p={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g,m={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅","in":"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺","int":"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},v={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},A=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],x=String.fromCharCode,E={},_=E.hasOwnProperty,w=function(e,t){return _.call(e,t) -},D=function(e,t){for(var r=-1,n=e.length;++r=55296&&57343>=e||e>1114111?(t&&B("character reference outside the permissible Unicode range"),"�"):w(b,e)?(t&&B("disallowed character reference"),b[e]):(t&&D(A,e)&&B("disallowed character reference"),e>65535&&(e-=65536,r+=x(e>>>10&1023|55296),e=56320|1023&e),r+=x(e))},F=function(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"},B=function(e){throw Error("Parse error: "+e)},T=function(e,t){t=k(t,T.options);var r=t.strict;r&&g.test(e)&&B("forbidden code point");var n=t.encodeEverything,i=t.useNamedReferences,a=t.allowUnsafeSymbols;return n?(e=e.replace(u,function(e){return i&&w(h,e)?"&"+h[e]+";":F(e)}),i&&(e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),i&&(e=e.replace(l,function(e){return"&"+h[e]+";"}))):i?(a||(e=e.replace(d,function(e){return"&"+h[e]+";"})),e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),e=e.replace(l,function(e){return"&"+h[e]+";"})):a||(e=e.replace(d,F)),e.replace(o,function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=1024*(t-55296)+r-56320+65536;return"&#x"+n.toString(16).toUpperCase()+";"}).replace(c,F)};T.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var S=function(e,t){t=k(t,S.options);var r=t.strict;return r&&f.test(e)&&B("malformed character reference"),e.replace(y,function(e,n,i,a,s,o,u,c){var l,h,d,p,f;return n?(l=n,h=i,r&&!h&&B("character reference was not terminated by a semicolon"),C(l,r)):a?(d=a,h=s,r&&!h&&B("character reference was not terminated by a semicolon"),l=parseInt(d,16),C(l,r)):o?(p=o,w(m,p)?m[p]:(r&&B("named character reference was not terminated by a semicolon"),e)):(p=u,f=c,f&&t.isAttributeValue?(r&&"="==f&&B("`&` did not start a character reference"),e):(r&&B("named character reference was not terminated by a semicolon"),v[p]+(f||"")))})};S.options={isAttributeValue:!1,strict:!1};var L=function(e){return e.replace(d,function(e){return p[e]})},N={version:"0.5.0",encode:T,decode:S,escape:L,unescape:S};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return N});else if(i&&!i.nodeType)if(a)a.exports=N;else for(var I in N)w(N,I)&&(i[I]=N[I]);else n.he=N}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],101:[function(e,t,r){(function(e){(function(){function n(e,t,r){for(var n=(r||0)-1,i=e?e.length:0;++n-1?0:-1:e?0:-1}function a(e){var t=this.cache,r=typeof e;if("boolean"==r||null==e)t[e]=!0;else{"number"!=r&&"string"!=r&&(r="object");var n="number"==r?e:A+e,i=t[r]||(t[r]={});"object"==r?(i[n]||(i[n]=[])).push(e):i[n]=!0}}function s(e){return e.charCodeAt(0)}function o(e,t){for(var r=e.criteria,n=t.criteria,i=-1,a=r.length;++io||"undefined"==typeof s)return 1;if(o>s||"undefined"==typeof o)return-1}}return e.index-t.index}function u(e){var t=-1,r=e.length,n=e[0],i=e[r/2|0],s=e[r-1];if(n&&"object"==typeof n&&i&&"object"==typeof i&&s&&"object"==typeof s)return!1;var o=h();o["false"]=o["null"]=o["true"]=o.undefined=!1;var u=h();for(u.array=e,u.cache=o,u.push=a;++ti?0:i);++n=x&&a===n,c=[];if(o){var l=u(t);l?(a=i,t=l):o=!1}for(;++r-1:void 0});return i.pop(),a.pop(),v&&(d(i),d(a)),s}function tt(e,t,r,n,i){(Jn(t)?Zt:ui)(t,function(t,a){var s,o,u=t,c=e[a];if(t&&((o=Jn(t))||ci(t))){for(var l=n.length;l--;)if(s=n[l]==t){c=i[l];break}if(!s){var h;r&&(u=r(c,t),(h="undefined"!=typeof u)&&(c=u)),h||(c=o?Jn(c)?c:[]:ci(c)?c:{}),n.push(t),i.push(c),h||tt(c,t,r,n,i)}}else r&&(u=r(c,t),"undefined"==typeof u&&(u=t)),"undefined"!=typeof u&&(c=u);e[a]=c})}function nt(e,t){return e+Sn(Wn()*(t-e+1))}function it(e,t,r){var a=-1,s=ut(),o=e?e.length:0,c=[],h=!t&&o>=x&&s===n,f=r||h?l():c;if(h){var g=u(f);s=i,f=g}for(;++a3&&"function"==typeof t[r-2])var n=E(t[--r-1],t[r--],2);else r>2&&"function"==typeof t[r-1]&&(n=t[--r]);for(var i=f(arguments,1,r),a=-1,s=l(),o=l();++ar?Hn(0,a+r):r)||0,Jn(e)?s=i(e,t,r)>-1:"number"==typeof a?s=(Ot(e)?e.indexOf(t,r):i(e,t,r))>-1:ui(e,function(e){return++n>=r?!(s=e===t):void 0}),s}function Yt(e,r,n){var i=!0;r=t.createCallback(r,n,3);var a=-1,s=e?e.length:0;if("number"==typeof s)for(;++aa&&(a=c)}else r=null==r&&Ot(e)?s:t.createCallback(r,n,3),Zt(e,function(e,t,n){var s=r(e,t,n);s>i&&(i=s,a=e)});return a}function tr(e,r,n){var i=1/0,a=i;if("function"!=typeof r&&n&&n[r]===e&&(r=null),null==r&&Jn(e))for(var o=-1,u=e.length;++oc&&(a=c)}else r=null==r&&Ot(e)?s:t.createCallback(r,n,3),Zt(e,function(e,t,n){var s=r(e,t,n);i>s&&(i=s,a=e)});return a}function rr(e,r,n,i){if(!e)return n;var a=arguments.length<3;r=t.createCallback(r,i,4);var s=-1,o=e.length;if("number"==typeof o)for(a&&(n=e[++s]);++sr?Hn(0,i+r):r||0}else if(r){var a=kr(e,t);return e[a]===t?a:-1}return n(e,t,r)}function vr(e,r,n){var i=0,a=e?e.length:0;if("number"!=typeof r&&null!=r){var s=a;for(r=t.createCallback(r,n,3);s--&&r(e[s],s,e);)i++}else i=null==r||n?1:r||i;return f(e,0,Yn(Hn(0,a-i),a))}function br(){for(var e=[],t=-1,r=arguments.length,a=l(),s=ut(),o=s===n,c=l();++t=x&&u(t?e[t]:c)))}var f=e[0],g=-1,y=f?f.length:0,m=[];e:for(;++gr?Hn(0,n+r):Yn(r,n-1))+1);n--;)if(e[n]===t)return n;return-1}function Er(e){for(var t=arguments,r=0,n=t.length,i=e?e.length:0;++ra;){var o=a+s>>>1;n(e[o])1?arguments:arguments[0],t=-1,r=e?er(pi(e,"length")):0,n=fn(0>r?0:r);++t2?st(e,17,f(arguments,2),null,t):st(e,1,null,null,t)}function Or(e){for(var t=arguments.length>1?Q(arguments,!0,!1,1):At(e),r=-1,n=t.length;++r2?st(t,19,f(arguments,2),null,e):st(t,3,null,null,e)}function qr(){for(var e=arguments,t=e.length;t--;)if(!Bt(e[t]))throw new _n;return function(){for(var t=arguments,r=e.length;r--;)t=[e[r].apply(this,t)];return t[0]}}function Pr(e,t){return t="number"==typeof t?t:+t||e.length,st(e,4,null,null,null,t)}function jr(e,t,r){var n,i,a,s,o,u,c,l=0,h=!1,d=!0;if(!Bt(e))throw new _n;if(t=Hn(0,t)||0,r===!0){var p=!0;d=!1}else Tt(r)&&(p=r.leading,h="maxWait"in r&&(Hn(t,r.maxWait)||0),d="trailing"in r?r.trailing:d);var f=function(){var r=t-(gi()-s);if(0>=r){i&&Tn(i);var h=c;i=u=c=y,h&&(l=gi(),a=e.apply(o,n),u||i||(n=o=null))}else u=Rn(f,r)},g=function(){u&&Tn(u),i=u=c=y,(d||h!==t)&&(l=gi(),a=e.apply(o,n),u||i||(n=o=null))};return function(){if(n=arguments,s=gi(),o=this,c=d&&(u||!p),h===!1)var r=p&&!u;else{i||p||(l=s);var y=h-(s-l),m=0>=y;m?(i&&(i=Tn(i)),l=s,a=e.apply(o,n)):i||(i=Rn(g,y))}return m&&u?u=Tn(u):u||t===h||(u=Rn(f,t)),r&&(m=!0,a=e.apply(o,n)),!m||u||i||(n=o=null),a}}function Mr(e){if(!Bt(e))throw new _n;var t=f(arguments,1);return Rn(function(){e.apply(y,t)},1)}function Vr(e,t){if(!Bt(e))throw new _n;var r=f(arguments,2);return Rn(function(){e.apply(y,r)},t)}function Ur(e,t){if(!Bt(e))throw new _n;var r=function(){var n=r.cache,i=t?t.apply(this,arguments):A+arguments[0];return In.call(n,i)?n[i]:n[i]=e.apply(this,arguments)};return r.cache={},r}function $r(e){var t,r;if(!Bt(e))throw new _n;return function(){return t?r:(t=!0,r=e.apply(this,arguments),e=null,r)}}function Gr(e){return st(e,16,f(arguments,1))}function Hr(e){return st(e,32,null,f(arguments,1))}function Yr(e,t,r){var n=!0,i=!0;if(!Bt(e))throw new _n;return r===!1?n=!1:Tt(r)&&(n="leading"in r?r.leading:n,i="trailing"in r?r.trailing:i),z.leading=n,z.maxWait=t,z.trailing=i,jr(e,t,z)}function zr(e,t){return st(t,16,[e])}function Wr(e){return function(){return e}}function Kr(e,t,r){var n=typeof e;if(null==e||"function"==n)return E(e,t,r);if("object"!=n)return tn(e);var i=ei(e),a=i[0],s=e[a];return 1!=i.length||s!==s||Tt(s)?function(t){for(var r=i.length,n=!1;r--&&(n=et(t[i[r]],e[i[r]],null,!0)););return n}:function(e){var t=e[a];return s===t&&(0!==s||1/s==1/t)}}function Zr(e){return null==e?"":En(e).replace(ii,ot)}function Xr(e){return e}function Jr(e,n,i){var a=!0,s=n&&At(n);n&&(i||s.length)||(null==i&&(i=n),o=r,n=e,e=t,s=At(n)),i===!1?a=!1:Tt(i)&&"chain"in i&&(a=i.chain);var o=e,u=Bt(o);Zt(s,function(t){var r=e[t]=n[t];u&&(o.prototype[t]=function(){var t=this.__chain__,n=this.__wrapped__,i=[n];On.apply(i,arguments);var s=r.apply(e,i);if(a||t){if(n===s&&Tt(s))return this;s=new o(s),s.__chain__=t}return s})})}function Qr(){return e._=kn,this}function en(){}function tn(e){return function(t){return t[e]}}function rn(e,t,r){var n=null==e,i=null==t;if(null==r&&("boolean"==typeof e&&i?(r=e,e=1):i||"boolean"!=typeof t||(r=t,i=!0)),n&&i&&(t=1),e=+e||0,i?(t=e,e=0):t=+t||0,r||e%1||t%1){var a=Wn();return Yn(e+a*(t-e+parseFloat("1e-"+((a+"").length-1))),t)}return nt(e,t)}function nn(e,t){if(e){var r=e[t];return Bt(r)?e[t]():r}}function an(e,r,n){var i=t.templateSettings;e=En(e||""),n=si({},n,i);var a,s=si({},n.imports,i.imports),o=ei(s),u=$t(s),l=0,h=n.interpolate||L,d="__p += '",p=xn((n.escape||L).source+"|"+h.source+"|"+(h===T?C:L).source+"|"+(n.evaluate||L).source+"|$","g");e.replace(p,function(t,r,n,i,s,o){return n||(n=i),d+=e.slice(l,o).replace(I,c),r&&(d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=o+t.length,t}),d+="';\n";var f=n.variable,g=f;g||(f="obj",d="with ("+f+") {\n"+d+"\n}\n"),d=(a?d.replace(w,""):d).replace(D,"$1").replace(k,"$1;"),d="function("+f+") {\n"+(g?"":f+" || ("+f+" = {});\n")+"var __t, __p = '', __e = _.escape"+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m="\n/*\n//# sourceURL="+(n.sourceURL||"/lodash/template/source["+R++ +"]")+"\n*/";try{var v=mn(o,"return "+d+m).apply(y,u)}catch(b){throw b.source=d,b}return r?v(r):(v.source=d,v)}function sn(e,t,r){e=(e=+e)>-1?e:0;var n=-1,i=fn(e);for(t=E(t,r,1);++n/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:T,variable:"",imports:{_:t}},Mn||(v=function(){function t(){}return function(r){if(Tt(r)){t.prototype=r;var n=new t;t.prototype=null}return n||e.Object()}}());var Xn=jn?function(e,t){W.value=t,jn(e,"__bindData__",W)}:en,Jn=Vn||function(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Cn.call(e)==P||!1},Qn=function(e){var t,r=e,n=[];if(!r)return n;if(!K[typeof e])return n;for(t in r)In.call(r,t)&&n.push(t);return n},ei=Gn?function(e){return Tt(e)?Gn(e):[]}:Qn,ti={"&":"&","<":"<",">":">",'"':""","'":"'"},ri=Et(ti),ni=xn("("+ei(ri).join("|")+")","g"),ii=xn("["+ei(ti).join("")+"]","g"),ai=function(e,t,r){var n,i=e,a=i;if(!i)return a;var s=arguments,o=0,u="number"==typeof r?2:s.length;if(u>3&&"function"==typeof s[u-2])var c=E(s[--u-1],s[u--],2);else u>2&&"function"==typeof s[u-1]&&(c=s[--u]);for(;++o/g,S=RegExp("^["+_+"]*0+(?=.$)"),L=/($^)/,N=/\bthis\b/,I=/['\n\r\t\u2028\u2029\\]/g,O=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],R=0,q="[object Arguments]",P="[object Array]",j="[object Boolean]",M="[object Date]",V="[object Function]",U="[object Number]",$="[object Object]",G="[object RegExp]",H="[object String]",Y={};Y[V]=!1,Y[q]=Y[P]=Y[j]=Y[M]=Y[U]=Y[$]=Y[G]=Y[H]=!0;var z={leading:!1,maxWait:0,trailing:!1},W={configurable:!1,enumerable:!1,value:null,writable:!1},K={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},X=K[typeof window]&&window||this,J=K[typeof r]&&r&&!r.nodeType&&r,Q=K[typeof t]&&t&&!t.nodeType&&t,et=Q&&Q.exports===J&&J,tt=K[typeof e]&&e;!tt||tt.global!==tt&&tt.window!==tt||(X=tt);var rt=g();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(X._=rt,define(function(){return rt})):J&&Q?et?(Q.exports=rt)._=rt:J._=rt:X._=rt}).call(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],102:[function(e,t){t.exports={name:"mermaid",version:"0.3.2",description:"Markdownish syntax for generating flowcharts",main:"src/main.js",bin:{mermaid:"./bin/mermaid.js"},scripts:{test:"gulp test"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"",license:"MIT",dependencies:{chalk:"^0.5.1","dagre-d3":"~0.3.2",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",d3:"~3.4.13","dagre-d3":"~0.3.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.8.9","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-ext-replace":"~0.1.0","gulp-hogan":"^1.1.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~1.0.1","gulp-jison":"~1.0.0","gulp-jshint":"^1.9.0","gulp-less":"^1.3.6","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1",he:"^0.5.0","hogan.js":"^3.0.2",jasmine:"~2.0.1",jison:"~0.4.15","jshint-stylish":"^1.0.0",karma:"~0.12.20","karma-chrome-launcher":"~0.1.5","karma-jasmine":"~0.2.1","karma-requirejs":"~0.2.2",lodash:"^2.4.1","lodash._escapestringchar":"^2.4.1","lodash._objecttypes":"^2.4.1","lodash._reinterpolate":"^2.4.1","lodash._reunescapedhtml":"^2.4.1","lodash.defaults":"^2.4.1","lodash.templatesettings":"^2.4.1","lodash.values":"^2.4.1",marked:"^0.3.2","mock-browser":"^0.90.27",path:"^0.4.9",phantomjs:"^1.9.12",rewire:"^2.1.3",rimraf:"^2.2.8","semantic-ui":"^1.4.1",tape:"^3.0.3"}} -},{}],103:[function(e,t,r){var n="",i=!1;r.setMessage=function(e){n=e},r.getMessage=function(){return n},r.setInfo=function(e){i=e},r.getInfo=function(){return i}},{}],104:[function(e,t,r){var n=e("./exampleDb"),i=e("./parser/example.js");r.draw=function(e,t,r){var a;a=i.parser,a.yy=n,a.parse(e);var s=d3.select("#"+t),o=s.append("g");o.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+r),s.attr("height",100),s.attr("width",400)}},{"./exampleDb":103,"./parser/example.js":105}],105:[function(e,t,r){(function(n){var i=function(){function e(){this.yy={}}var t=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},r=[6,9,10,12],n={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(e,t,r,n,i,a){var s=a.length-1;switch(i){case 1:return n;case 4:break;case 6:n.setInfo(!0);break;case 7:n.setMessage(a[s]);break;case 8:this.$=a[s-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},t(r,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},t(r,[2,3]),t(r,[2,4]),t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),{13:[1,11]},t(r,[2,8])],defaultActions:{4:[2,1]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){function t(){var e;return e=f.lex()||d,"number"!=typeof e&&(e=r.symbols_[e]||e),e}var r=this,n=[0],i=[null],a=[],s=this.table,o="",u=0,c=0,l=0,h=2,d=1,p=a.slice.call(arguments,1),f=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);f.setInput(e,g.yy),g.yy.lexer=f,g.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var m=f.yylloc;a.push(m);var v=f.options&&f.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,A,x,E,_,w,D,k,C,F={};;){if(x=n[n.length-1],this.defaultActions[x]?E=this.defaultActions[x]:((null===b||"undefined"==typeof b)&&(b=t()),E=s[x]&&s[x][b]),"undefined"==typeof E||!E.length||!E[0]){var B="";C=[];for(w in s[x])this.terminals_[w]&&w>h&&C.push("'"+this.terminals_[w]+"'");B=f.showPosition?"Parse error on line "+(u+1)+":\n"+f.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(u+1)+": Unexpected "+(b==d?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(B,{text:f.match,token:this.terminals_[b]||b,line:f.yylineno,loc:m,expected:C})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+b);switch(E[0]){case 1:n.push(b),i.push(f.yytext),a.push(f.yylloc),n.push(E[1]),b=null,A?(b=A,A=null):(c=f.yyleng,o=f.yytext,u=f.yylineno,m=f.yylloc,l>0&&l--);break;case 2:if(D=this.productions_[E[1]][1],F.$=i[i.length-D],F._$={first_line:a[a.length-(D||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(D||1)].first_column,last_column:a[a.length-1].last_column},v&&(F._$.range=[a[a.length-(D||1)].range[0],a[a.length-1].range[1]]),_=this.performAction.apply(F,[o,c,u,g.yy,E[1],i,a].concat(p)),"undefined"!=typeof _)return _;D&&(n=n.slice(0,-1*D*2),i=i.slice(0,-1*D),a=a.slice(0,-1*D)),n.push(this.productions_[E[1]][0]),i.push(F.$),a.push(F._$),k=s[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},i=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=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),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,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))),n=e[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(e=this.test_match(r,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[n]),e!==!1?e:!1):""===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(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>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(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,t,r,n){switch(r){case 0:return 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return e}();return n.lexer=i,e.prototype=n,n.Parser=e,new e}();"undefined"!=typeof e&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("1YiZ5S"))},{"1YiZ5S":99,fs:97,path:98}],106:[function(e,t){var r;if(e)try{r=e("dagre-d3")}catch(n){}r||(r=window.dagreD3),t.exports=r},{"dagre-d3":1}],107:[function(e,t,r){(function(t){var n=e("./graphDb"),i=e("./parser/flow"),a=e("./parser/dot"),s=e("./dagre-d3");r.addVertices=function(e,r){var n=Object.keys(e),i=function(e,t){var r;for(r=0;r0&&(o=s.classes.join(" "));var u="";u=i(u,s.styles),a="undefined"==typeof s.text?s.id:s.text;var c="";t.mermaid.htmlLabels?c="html":(a=a.replace(/
/g,"\n"),c="text");var l=0,h="";switch(s.type){case"round":l=5,h="rect";break;case"square":h="rect";break;case"diamond":h="question";break;case"odd":h="rect_left_inv_arrow";break;case"odd_right":h="rect_left_inv_arrow";break;case"circle":h="circle";break;default:h="rect"}r.setNode(s.id,{labelType:c,shape:h,label:a,rx:l,ry:l,"class":o,style:u,id:s.id})})},r.addEdges=function(e,r){var n,i=0;e.forEach(function(e){i++,n="arrow_open"===e.type?"none":"normal";var a="";if("undefined"!=typeof e.style)e.style.forEach(function(e){a=a+e+";"});else switch(e.stroke){case"normal":a="stroke: #333; stroke-width: 1.5px;fill:none";break;case"dotted":a="stroke: #333; fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":a="stroke: #333; stroke-width: 3.5px;fill:none"}if("undefined"==typeof e.text)"undefined"==typeof e.style?r.setEdge(e.start,e.end,{style:a,arrowhead:n},i):r.setEdge(e.start,e.end,{style:a,arrowheadStyle:"fill: #333",arrowhead:n},i);else{var s=e.text.replace(/
/g,"\n");"undefined"==typeof e.style?t.mermaid.htmlLabels?r.setEdge(e.start,e.end,{labelType:"html",style:a,labelpos:"c",label:''+e.text+"",arrowheadStyle:"fill: #333",arrowhead:n},i):r.setEdge(e.start,e.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:s,arrowheadStyle:"fill: #333",arrowhead:n},i):r.setEdge(e.start,e.end,{labelType:"text",style:a,arrowheadStyle:"fill: #333",label:s,arrowhead:n},i)}})},r.getClasses=function(e,t){var r;n.clear(),r=t?a.parser:i.parser,r.yy=n,r.parse(e);var s=n.getClasses();return"undefined"==typeof s.default&&(s.default={id:"default"},s.default.styles=["fill:#ffa","stroke:#666","stroke-width:3px"],s.default.nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],s.default.edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),s},r.draw=function(e,t,o){var u;n.clear(),u=o?a.parser:i.parser,u.yy=n,u.parse(e);var c;c=n.getDirection(),"undefined"==typeof c&&(c="TD");var l=new s.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:c,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),h=n.getSubGraphs(),d=0;h.forEach(function(){d+=1;var e="subG"+d;n.addVertex(e,void 0,void 0,void 0)});var p=n.getVertices(),f=n.getEdges();d=0,h.forEach(function(e){d+=1;var t="subG"+d;d3.selectAll("cluster").append("text"),e.nodes.forEach(function(e){l.setParent(e,t)})}),r.addVertices(p,l),r.addEdges(f,l);var g=new s.render;g.shapes().question=function(e,t,r){var n=t.width,i=t.height,a=.8*(n+i),o=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}],u=e.insert("polygon",":first-child").attr("points",o.map(function(e){return e.x+","+e.y}).join(" ")).attr("rx",5).attr("ry",5).attr("transform","translate("+-a/2+","+2*a/4+")");return r.intersect=function(e){return s.intersect.polygon(r,o,e)},u},g.shapes().rect_left_inv_arrow=function(e,t,r){var n=t.width,i=t.height,a=[{x:-i/2,y:0},{x:n,y:0},{x:n,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}],o=e.insert("polygon",":first-child").attr("points",a.map(function(e){return e.x+","+e.y}).join(" ")).attr("transform","translate("+-n/2+","+2*i/4+")");return r.intersect=function(e){return s.intersect.polygon(r,a,e)},o},g.shapes().rect_right_inv_arrow=function(e,t,r){var n=t.width,i=t.height,a=[{x:0,y:0},{x:n+i/2,y:0},{x:n,y:-i/2},{x:n+i/2,y:-i},{x:0,y:-i}],o=e.insert("polygon",":first-child").attr("points",a.map(function(e){return e.x+","+e.y}).join(" ")).attr("transform","translate("+-n/2+","+2*i/4+")");return r.intersect=function(e){return s.intersect.polygon(r,a,e)},o},g.arrows().none=function(e,t,r,n){var i=e.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),a=i.append("path").attr("d","M 0 0 L 0 0 L 0 0 z");s.util.applyStyle(a,r[n+"Style"])};var y=d3.select("#"+t);svgGroup=d3.select("#"+t+" g"),g(d3.select("#"+t+" g"),l);var m=document.querySelector("#mermaidChart0");y.attr("height",l.graph().height),y.attr("width",l.graph().width),y.attr("viewBox",m.getBBox().x+" 0 "+l.graph().width+" "+l.graph().height),setTimeout(function(){var e=0;h.forEach(function(r){var n=document.querySelectorAll("#"+t+" .clusters rect"),i=document.querySelectorAll("#"+t+" .cluster");if("undefined"!==r.title){var a=n[e].x.baseVal.value,s=n[e].y.baseVal.value,o=n[e].width.baseVal.value,u=d3.select(i[e]),c=u.append("text");c.attr("x",a+o/2),c.attr("y",s+14),c.attr("fill","black"),c.attr("stroke","none"),c.attr("id",t+"Text"),c.style("text-anchor","middle"),c.text(r.title)}e+=1})},200)}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./dagre-d3":106,"./graphDb":108,"./parser/dot":109,"./parser/flow":110}],108:[function(require,module,exports){var vertices={},edges=[],classes=[],subGraphs=[],direction,funs=[];exports.addVertex=function(e,t,r,n){"undefined"!=typeof e&&0!==e.trim().length&&("undefined"==typeof vertices[e]&&(vertices[e]={id:e,styles:[],classes:[]}),"undefined"!=typeof t&&(vertices[e].text=t),"undefined"!=typeof r&&(vertices[e].type=r),"undefined"!=typeof r&&(vertices[e].type=r),"undefined"!=typeof n&&null!==n&&n.forEach(function(t){vertices[e].styles.push(t)}))},exports.addLink=function(e,t,r,n){var i={start:e,end:t,type:void 0,text:""};n=r.text,"undefined"!=typeof n&&(i.text=n),"undefined"!=typeof r&&(i.type=r.type,i.stroke=r.stroke),edges.push(i)},exports.updateLink=function(e,t){e.substr(1);edges[e].style=t},exports.addClass=function(e,t){"undefined"==typeof classes[e]&&(classes[e]={id:e,styles:[]}),"undefined"!=typeof t&&null!==t&&t.forEach(function(t){classes[e].styles.push(t)})},exports.setDirection=function(e){direction=e},exports.setClass=function(e,t){e.indexOf(",")>0?e.split(",").forEach(function(e){"undefined"!=typeof vertices[e]&&vertices[e].classes.push(t)}):"undefined"!=typeof vertices[e]&&vertices[e].classes.push(t)},exports.setClickEvent=function(id,functionName){id.indexOf(",")>0?id.split(",").forEach(function(id2){"undefined"!=typeof vertices[id2]&&funs.push(function(){var elem=document.getElementById(id2);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id2+"')")})})}):"undefined"!=typeof vertices[id]&&funs.push(function(){var elem=document.getElementById(id);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id+"')")})})},exports.bindFunctions=function(){funs.forEach(function(e){e()})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes},exports.clear=function(){vertices={},classes={},edges=[],funs=[],subGraphs=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(e,t){function r(e){var t={"boolean":{},number:{},string:{}},r=[];return e.filter(function(e){var n=typeof e;return n in t?t[n].hasOwnProperty(e)?!1:t[n][e]=!0:r.indexOf(e)>=0?!1:r.push(e)})}var n=[];n=r(n.concat.apply(n,e)),subGraphs.push({nodes:n,title:t})},exports.getSubGraphs=function(){return subGraphs}},{}],109:[function(e,t,r){(function(n){var i=function(){function e(){this.yy={}}var t=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},r=[1,5],n=[1,6],i=[1,12],a=[1,13],s=[1,14],o=[1,15],u=[1,16],c=[1,17],l=[1,18],h=[1,19],d=[1,20],p=[1,21],f=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],y=[1,37],m=[1,33],v=[1,34],b=[1,35],A=[1,36],x=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],E=[10,28],_=[10,28,37,57,58],w=[2,49],D=[1,45],k=[1,48],C=[1,49],F=[1,52],B=[2,65],T=[1,65],S=[1,66],L=[1,67],N=[1,68],I=[1,69],O=[1,70],R=[1,71],q=[1,72],P=[1,73],j=[8,16,17,18,19,20,21,22,23,24,25,26,47],M=[10,28,37],V={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(e,t,r,n,i,a){var s=a.length-1;switch(i){case 1:this.$=a[s-1];break;case 2:this.$=a[s-4];break;case 3:this.$=a[s-5];break;case 4:this.$=a[s-3];break;case 8:case 10:case 11:this.$=a[s];break;case 9:this.$=a[s-1]+""+a[s];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=a[s];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:n.addLink(a[s-1],a[s].id,a[s].op),this.$="oy";break;case 42:n.addLink(a[s-1],a[s].id,a[s].op),this.$={op:a[s-2],id:a[s-1]};break;case 44:this.$={op:a[s-1],id:a[s]};break;case 48:n.addVertex(a[s-1]),this.$=a[s-1];break;case 49:n.addVertex(a[s]),this.$=a[s];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:r,13:n},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f},{6:23,12:r,13:n},t(g,[2,5]),t(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:y,9:25,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},t([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f}),t(x,[2,8]),t(x,[2,10]),t(x,[2,11]),t(x,[2,12]),t(x,[2,13]),t(x,[2,14]),t(x,[2,15]),t(x,[2,16]),t(x,[2,17]),t(x,[2,18]),t(x,[2,19]),t(x,[2,20]),{7:39,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f},{7:30,8:y,9:40,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},{10:[1,41]},{10:[2,21],28:[1,42]},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(_,w,{44:44,32:[1,43],45:D}),t(E,[2,27],{41:46,43:47,57:k,58:C}),t(E,[2,47],{43:47,34:50,41:51,37:F,57:k,58:C}),{34:53,37:F},{34:54,37:F},{34:55,37:F},{7:56,8:[1,57],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f},{7:30,8:y,9:58,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},t(x,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:y,9:61,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},{7:62,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f},t(_,[2,48]),t(_,B,{14:10,15:11,7:63,46:64,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,48:T,49:S,50:L,51:N,52:I,53:O,54:R,55:q,56:P}),t(E,[2,41],{34:74,37:F}),{7:77,8:y,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,33:76,42:75,47:A},t(j,[2,66]),t(j,[2,67]),t(E,[2,46]),t(E,[2,40],{34:78,37:F}),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,38:79,39:[1,80]},t(E,[2,28]),t(E,[2,29]),t(E,[2,30]),{8:[1,82]},{7:30,8:y,9:83,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},{10:[1,84]},{7:30,8:y,9:85,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},{5:[2,2]},{10:[2,22]},t(E,[2,26]),t(_,[2,51],{45:[1,86]}),t(_,[2,52]),t(_,[2,56]),t(_,[2,57]),t(_,[2,58]),t(_,[2,59]),t(_,[2,60]),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),t(_,[2,64]),t(E,[2,38]),t(M,[2,44],{43:47,41:87,57:k,58:C}),t(M,[2,45],{43:47,41:88,57:k,58:C}),t(_,w,{44:44,45:D}),t(E,[2,39]),{39:[1,89]},t(E,[2,34],{34:90,37:F}),{32:[1,91]},{7:30,8:y,9:92,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},{10:[1,93]},t(_,[2,55]),{10:[1,94]},t(_,B,{46:95,48:T,49:S,50:L,51:N,52:I,53:O,54:R,55:q,56:P}),t(M,[2,42]),t(M,[2,43]),t(E,[2,33],{34:96,37:F}),t(E,[2,32]),{7:97,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f},{10:[1,98]},t(_,[2,54]),{5:[2,3]},t(_,[2,50]),t(E,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},t(_,[2,53]),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,38:101},{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){function t(){var e;return e=f.lex()||d,"number"!=typeof e&&(e=r.symbols_[e]||e),e}var r=this,n=[0],i=[null],a=[],s=this.table,o="",u=0,c=0,l=0,h=2,d=1,p=a.slice.call(arguments,1),f=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);f.setInput(e,g.yy),g.yy.lexer=f,g.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var m=f.yylloc;a.push(m);var v=f.options&&f.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,A,x,E,_,w,D,k,C,F={};;){if(x=n[n.length-1],this.defaultActions[x]?E=this.defaultActions[x]:((null===b||"undefined"==typeof b)&&(b=t()),E=s[x]&&s[x][b]),"undefined"==typeof E||!E.length||!E[0]){var B="";C=[];for(w in s[x])this.terminals_[w]&&w>h&&C.push("'"+this.terminals_[w]+"'");B=f.showPosition?"Parse error on line "+(u+1)+":\n"+f.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(u+1)+": Unexpected "+(b==d?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(B,{text:f.match,token:this.terminals_[b]||b,line:f.yylineno,loc:m,expected:C})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+b);switch(E[0]){case 1:n.push(b),i.push(f.yytext),a.push(f.yylloc),n.push(E[1]),b=null,A?(b=A,A=null):(c=f.yyleng,o=f.yytext,u=f.yylineno,m=f.yylloc,l>0&&l--);break;case 2:if(D=this.productions_[E[1]][1],F.$=i[i.length-D],F._$={first_line:a[a.length-(D||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(D||1)].first_column,last_column:a[a.length-1].last_column},v&&(F._$.range=[a[a.length-(D||1)].range[0],a[a.length-1].range[1]]),_=this.performAction.apply(F,[o,c,u,g.yy,E[1],i,a].concat(p)),"undefined"!=typeof _)return _;D&&(n=n.slice(0,-1*D*2),i=i.slice(0,-1*D),a=a.slice(0,-1*D)),n.push(this.productions_[E[1]][0]),i.push(F.$),a.push(F._$),k=s[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},U=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=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),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,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))),n=e[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(e=this.test_match(r,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[n]),e!==!1?e:!1):""===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(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>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(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,r,n){switch(r){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}}; -return e}();return V.lexer=U,e.prototype=V,V.Parser=e,new e}();"undefined"!=typeof e&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("1YiZ5S"))},{"1YiZ5S":99,fs:97,path:98}],110:[function(e,t,r){(function(n){var i=function(){function e(){this.yy={}}var t=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},r=[1,9,10,12,19,29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],n=[2,2],i=[1,9],a=[1,10],s=[1,11],o=[1,12],u=[1,20],c=[1,23],l=[1,24],h=[1,25],d=[1,26],p=[1,27],f=[1,32],g=[1,21],y=[1,34],m=[1,31],v=[1,33],b=[1,39],A=[1,38],x=[1,35],E=[1,36],_=[1,37],w=[1,9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],D=[29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],k=[2,19],C=[1,51],F=[1,52],B=[1,50],T=[1,75],S=[1,67],L=[1,76],N=[1,63],I=[1,62],O=[1,77],R=[1,78],q=[1,68],P=[1,65],j=[1,64],M=[1,70],V=[1,71],U=[1,72],$=[1,73],G=[1,74],H=[9,10,19],Y=[1,85],z=[1,86],W=[1,87],K=[1,88],Z=[1,89],X=[1,90],J=[1,91],Q=[1,92],et=[1,93],tt=[1,94],rt=[1,95],nt=[1,96],it=[9,10,19,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61],at=[9,10,12,15,19,36,38,40,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,76,79,81,82,84,85,87,88,89],st=[9,10,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],ot=[1,110],ut=[1,113],ct=[1,111],lt=[9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],ht=[9,10,11,12,13,15,16,19,29,32,37,39,41,44,47,49,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89],dt=[9,10,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],pt=[2,122],ft=[1,139],gt=[1,128],yt=[1,129],mt=[1,126],vt=[1,127],bt=[1,130],At=[1,131],xt=[1,135],Et=[1,136],_t=[1,134],wt=[1,137],Dt=[1,125],kt=[1,132],Ct=[1,133],Ft=[1,138],Bt=[76,79,81,82,84,85,87,88,89],Tt=[12,62,76,79,81,82,84,85,87,88,89],St=[1,164],Lt=[1,163],Nt=[9,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],It=[1,197],Ot=[1,194],Rt=[1,201],qt=[1,198],Pt=[1,195],jt=[1,202],Mt=[1,192],Vt=[1,193],Ut=[1,196],$t=[1,199],Gt=[1,200],Ht=[11,12,13,15,16,29,32,44,47,49,67,68,69,70,71,76,79,81,82,84,85,87,88,89],Yt=[1,217],zt=[9,10,19,79],Wt=[9,10,12,19,44,67,75,76,77,79,81,82,83,84,85],Kt={trace:function(){},yy:{},symbols_:{error:2,mermaidDoc:3,graphConfig:4,document:5,line:6,spaceListNewline:7,statement:8,SEMI:9,EOF:10,GRAPH:11,SPACE:12,DIR:13,FirstStmtSeperator:14,TAGEND:15,TAGSTART:16,UP:17,DOWN:18,NEWLINE:19,spaceList:20,commentStatement:21,verticeStatement:22,separator:23,styleStatement:24,linkStyleStatement:25,classDefStatement:26,classStatement:27,clickStatement:28,subgraph:29,text:30,endStatement:31,end:32,vertex:33,link:34,alphaNum:35,SQS:36,SQE:37,PS:38,PE:39,DIAMOND_START:40,DIAMOND_STOP:41,alphaNumStatement:42,alphaNumToken:43,MINUS:44,linkStatement:45,arrowText:46,"--":47,"-.":48,"==":49,ARROW_POINT:50,ARROW_CIRCLE:51,ARROW_CROSS:52,ARROW_OPEN:53,DOTTED_ARROW_POINT:54,DOTTED_ARROW_CIRCLE:55,DOTTED_ARROW_CROSS:56,DOTTED_ARROW_OPEN:57,THICK_ARROW_POINT:58,THICK_ARROW_CIRCLE:59,THICK_ARROW_CROSS:60,THICK_ARROW_OPEN:61,PIPE:62,textToken:63,commentText:64,commentToken:65,keywords:66,STYLE:67,LINKSTYLE:68,CLASSDEF:69,CLASS:70,CLICK:71,textNoTags:72,textNoTagsToken:73,stylesOpt:74,HEX:75,NUM:76,PCT:77,style:78,COMMA:79,styleComponent:80,ALPHA:81,COLON:82,UNIT:83,BRKT:84,DOT:85,graphCodeTokens:86,PLUS:87,EQUALS:88,MULT:89,TAG_START:90,TAG_END:91,QUOTE:92,$accept:0,$end:1},terminals_:{2:"error",9:"SEMI",10:"EOF",11:"GRAPH",12:"SPACE",13:"DIR",15:"TAGEND",16:"TAGSTART",17:"UP",18:"DOWN",19:"NEWLINE",29:"subgraph",32:"end",36:"SQS",37:"SQE",38:"PS",39:"PE",40:"DIAMOND_START",41:"DIAMOND_STOP",44:"MINUS",47:"--",48:"-.",49:"==",50:"ARROW_POINT",51:"ARROW_CIRCLE",52:"ARROW_CROSS",53:"ARROW_OPEN",54:"DOTTED_ARROW_POINT",55:"DOTTED_ARROW_CIRCLE",56:"DOTTED_ARROW_CROSS",57:"DOTTED_ARROW_OPEN",58:"THICK_ARROW_POINT",59:"THICK_ARROW_CIRCLE",60:"THICK_ARROW_CROSS",61:"THICK_ARROW_OPEN",62:"PIPE",67:"STYLE",68:"LINKSTYLE",69:"CLASSDEF",70:"CLASS",71:"CLICK",75:"HEX",76:"NUM",77:"PCT",79:"COMMA",81:"ALPHA",82:"COLON",83:"UNIT",84:"BRKT",85:"DOT",87:"PLUS",88:"EQUALS",89:"MULT",90:"TAG_START",91:"TAG_END",92:"QUOTE"},productions_:[0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[6,1],[4,4],[4,4],[4,4],[4,4],[4,4],[14,1],[14,1],[14,2],[7,2],[7,2],[7,1],[7,1],[20,2],[20,1],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,6],[8,5],[31,1],[31,2],[23,1],[23,1],[23,1],[22,3],[22,1],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,1],[33,2],[35,1],[35,2],[42,1],[42,3],[34,2],[34,3],[34,1],[34,2],[34,5],[34,6],[34,5],[34,6],[34,5],[34,6],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[46,3],[30,1],[30,2],[64,1],[64,2],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[72,1],[72,2],[26,5],[27,5],[28,5],[24,5],[24,5],[25,5],[21,3],[74,1],[74,3],[78,1],[78,2],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[65,1],[65,1],[63,1],[63,1],[63,1],[63,1],[63,1],[73,1],[73,1],[73,1],[73,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1]],performAction:function(e,t,r,n,i,a){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:a[s]!==[]&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:case 50:case 52:case 77:case 79:case 90:this.$=a[s];break;case 8:n.setDirection(a[s-1]),this.$=a[s-1];break;case 9:n.setDirection("LR"),this.$=a[s-1];break;case 10:n.setDirection("RL"),this.$=a[s-1];break;case 11:n.setDirection("BT"),this.$=a[s-1];break;case 12:n.setDirection("TB"),this.$=a[s-1];break;case 22:case 24:case 25:case 26:case 27:case 28:this.$=[];break;case 23:this.$=a[s-1];break;case 29:n.addSubGraph(a[s-2],a[s-4]);break;case 30:n.addSubGraph(a[s-2],void 0);break;case 36:n.addLink(a[s-2],a[s],a[s-1]),this.$=[a[s-2],a[s]];break;case 37:this.$=[a[s]];break;case 38:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"square");break;case 39:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"square");break;case 40:this.$=a[s-5],n.addVertex(a[s-5],a[s-2],"circle");break;case 41:this.$=a[s-6],n.addVertex(a[s-6],a[s-3],"circle");break;case 42:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"round");break;case 43:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"round");break;case 44:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"diamond");break;case 45:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"diamond");break;case 46:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"odd");break;case 47:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"odd");break;case 48:this.$=a[s],n.addVertex(a[s]);break;case 49:this.$=a[s-1],n.addVertex(a[s-1]);break;case 51:case 78:case 80:case 91:this.$=a[s-1]+""+a[s];break;case 53:this.$=a[s-2]+"-"+a[s];break;case 54:a[s-1].text=a[s],this.$=a[s-1];break;case 55:a[s-2].text=a[s-1],this.$=a[s-2];break;case 56:this.$=a[s];break;case 57:case 76:this.$=a[s-1];break;case 58:case 60:case 62:a[s].text=a[s-2],this.$=a[s];break;case 59:case 61:case 63:a[s-1].text=a[s-3],this.$=a[s-1];break;case 64:this.$={type:"arrow",stroke:"normal"};break;case 65:this.$={type:"arrow_circle",stroke:"normal"};break;case 66:this.$={type:"arrow_cross",stroke:"normal"};break;case 67:this.$={type:"arrow_open",stroke:"normal"};break;case 68:this.$={type:"arrow",stroke:"dotted"};break;case 69:this.$={type:"arrow_circle",stroke:"dotted"};break;case 70:this.$={type:"arrow_cross",stroke:"dotted"};break;case 71:this.$={type:"arrow_open",stroke:"dotted"};break;case 72:this.$={type:"arrow",stroke:"thick"};break;case 73:this.$={type:"arrow_circle",stroke:"thick"};break;case 74:this.$={type:"arrow_cross",stroke:"thick"};break;case 75:this.$={type:"arrow_open",stroke:"thick"};break;case 92:this.$=a[s-4],n.addClass(a[s-2],a[s]);break;case 93:this.$=a[s-4],n.setClass(a[s-2],a[s]);break;case 94:this.$=a[s-4],n.setClickEvent(a[s-2],a[s]);break;case 95:this.$=a[s-4],n.addVertex(a[s-2],void 0,void 0,a[s]);break;case 96:case 97:this.$=a[s-4],n.updateLink(a[s-2],a[s]);break;case 99:this.$=[a[s]];break;case 100:a[s-2].push(a[s]),this.$=a[s-2];break;case 102:this.$=a[s-1]+a[s]}},table:[{3:1,4:2,11:[1,3]},{1:[3]},t(r,n,{5:4}),{12:[1,5]},{1:[2,1],6:6,7:7,8:8,9:i,10:a,12:s,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:u,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:d,71:p,76:f,77:g,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{13:[1,40],15:[1,41],16:[1,42],17:[1,43],18:[1,44]},t(w,[2,3]),{8:45,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:u,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:d,71:p,76:f,77:g,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(D,k,{7:46,12:s,19:o}),t(D,[2,18],{7:47,12:s,19:o}),{19:[1,48]},{9:C,10:F,19:B,23:49},{9:C,10:F,19:B,23:53},{9:C,10:F,19:B,23:54},{9:C,10:F,19:B,23:55},{9:C,10:F,19:B,23:56},{9:C,10:F,19:B,23:57},{9:C,10:F,11:T,12:S,13:L,15:N,16:I,19:B,23:59,29:O,30:58,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{77:[1,79]},t(H,[2,37],{34:80,45:81,47:[1,82],48:[1,83],49:[1,84],50:Y,51:z,52:W,53:K,54:Z,55:X,56:J,57:Q,58:et,59:tt,60:rt,61:nt}),{12:[1,97]},{12:[1,98]},{12:[1,99]},{12:[1,100]},{12:[1,101]},t(it,[2,48],{43:30,42:107,12:[1,106],15:[1,105],36:[1,102],38:[1,103],40:[1,104],76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_}),t(at,[2,50]),t(at,[2,52],{44:[1,108]}),t(st,[2,125]),t(st,[2,126]),t(st,[2,127]),t(st,[2,128]),t(st,[2,129]),t(st,[2,130]),t(st,[2,131]),t(st,[2,132]),t(st,[2,133]),{9:ot,12:ut,14:109,19:ct,20:112},{9:ot,12:ut,14:114,19:ct,20:112},{9:ot,12:ut,14:115,19:ct,20:112},{9:ot,12:ut,14:116,19:ct,20:112},{9:ot,12:ut,14:117,19:ct,20:112},t(w,[2,4]),t(D,[2,16]),t(D,[2,17]),t(w,[2,22]),t(w,[2,23]),t(w,[2,33]),t(w,[2,34]),t(w,[2,35]),t(w,[2,24]),t(w,[2,25]),t(w,[2,26]),t(w,[2,27]),t(w,[2,28]),{9:C,10:F,11:T,12:S,13:L,15:N,16:I,19:B,23:118,29:O,32:R,43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(lt,n,{5:120}),t(ht,[2,77]),t(dt,[2,116]),t(dt,[2,117]),t(dt,[2,118]),t(dt,[2,119]),t(dt,[2,120]),t(dt,[2,121]),t(dt,pt),t(dt,[2,123]),t(dt,[2,124]),t(dt,[2,81]),t(dt,[2,82]),t(dt,[2,83]),t(dt,[2,84]),t(dt,[2,85]),t(dt,[2,86]),t(dt,[2,87]),t(dt,[2,88]),t(dt,[2,89]),{9:ft,11:T,12:S,13:L,15:N,16:I,29:O,32:R,36:gt,37:yt,38:mt,39:vt,40:bt,41:At,43:66,44:q,47:P,49:j,50:xt,51:Et,52:_t,53:wt,62:Dt,63:123,64:121,65:122,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,86:124,87:x,88:E,89:_,90:kt,91:Ct,92:Ft},{33:140,35:28,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(Bt,[2,56],{46:141,12:[1,142],62:[1,143]}),{12:[1,144]},{12:[1,145]},{12:[1,146]},t(Tt,[2,64]),t(Tt,[2,65]),t(Tt,[2,66]),t(Tt,[2,67]),t(Tt,[2,68]),t(Tt,[2,69]),t(Tt,[2,70]),t(Tt,[2,71]),t(Tt,[2,72]),t(Tt,[2,73]),t(Tt,[2,74]),t(Tt,[2,75]),{35:147,42:29,43:30,75:[1,148],76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{76:[1,149]},{35:150,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{35:151,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{35:152,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:153,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:155,32:R,38:[1,154],43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:156,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:157,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(it,[2,49]),t(at,[2,51]),{43:158,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(r,[2,8]),t(r,[2,13]),t(r,[2,14]),{19:[1,159]},{12:ut,19:[2,21],20:160},t(r,[2,9]),t(r,[2,10]),t(r,[2,11]),t(r,[2,12]),t(lt,n,{5:161}),t(ht,[2,78]),{6:6,7:7,8:8,9:i,10:a,12:St,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:u,31:162,32:Lt,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:d,71:p,76:f,77:g,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{9:ft,11:T,12:S,13:L,15:N,16:I,19:[2,98],29:O,32:R,36:gt,37:yt,38:mt,39:vt,40:bt,41:At,43:66,44:q,47:P,49:j,50:xt,51:Et,52:_t,53:wt,62:Dt,63:123,65:165,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,86:124,87:x,88:E,89:_,90:kt,91:Ct,92:Ft},t(Nt,[2,79]),t(Nt,[2,114]),t(Nt,[2,115]),t(Nt,[2,134]),t(Nt,[2,135]),t(Nt,[2,136]),t(Nt,[2,137]),t(Nt,[2,138]),t(Nt,[2,139]),t(Nt,[2,140]),t(Nt,[2,141]),t(Nt,[2,142]),t(Nt,[2,143]),t(Nt,[2,144]),t(Nt,[2,145]),t(Nt,[2,146]),t(Nt,[2,147]),t(Nt,[2,148]),t(H,[2,36]),t(Bt,[2,54],{12:[1,166]}),t(Bt,[2,57]),{11:T,12:S,13:L,15:N,16:I,29:O,30:167,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:168,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:169,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:170,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{12:[1,171],42:107,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{12:[1,172]},{12:[1,173]},{12:[1,174],42:107,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{12:[1,175],42:107,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{12:[1,176],42:107,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,32:R,37:[1,177],43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:178,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,32:R,39:[1,179],43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,32:R,41:[1,180],43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,32:R,37:[1,181],43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(at,[2,53]),t(r,[2,15]),{19:[2,20]},{6:6,7:7,8:8,9:i,10:a,12:St,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:u,31:182,32:Lt,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:d,71:p,76:f,77:g,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{9:C,10:F,19:B,23:183},t(H,[2,31]),t(D,k,{7:46,31:184,12:St,19:o,32:Lt}),t(Nt,[2,80]),t(Bt,[2,55]),{11:T,12:S,13:L,15:N,16:I,29:O,32:R,43:66,44:q,47:P,49:j,62:[1,185],63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:[1,186],13:L,15:N,16:I,29:O,32:R,43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:[1,187],13:L,15:N,16:I,29:O,32:R,43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:[1,188],13:L,15:N,16:I,29:O,32:R,43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{12:It,44:Ot,67:Rt,74:189,75:qt,76:Pt,77:jt,78:190,80:191,81:Mt,82:Vt,83:Ut,84:$t,85:Gt},{12:It,44:Ot,67:Rt,74:203,75:qt,76:Pt,77:jt,78:190,80:191,81:Mt,82:Vt,83:Ut,84:$t,85:Gt},{12:It,44:Ot,67:Rt,74:204,75:qt,76:Pt,77:jt,78:190,80:191,81:Mt,82:Vt,83:Ut,84:$t,85:Gt},{12:It,44:Ot,67:Rt,74:205,75:qt,76:Pt,77:jt,78:190,80:191,81:Mt,82:Vt,83:Ut,84:$t,85:Gt},{35:206,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{35:207,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(it,[2,38],{12:[1,208]}),{11:T,12:S,13:L,15:N,16:I,29:O,32:R,39:[1,209],43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(it,[2,42],{12:[1,210]}),t(it,[2,44],{12:[1,211]}),t(it,[2,46],{12:[1,212]}),{9:C,10:F,19:B,23:213},t(w,[2,30]),t(H,[2,32]),t([12,76,79,81,82,84,85,87,88,89],[2,76]),t(Ht,pt,{45:214,50:Y,51:z,52:W,53:K,54:Z,55:X,56:J,57:Q,58:et,59:tt,60:rt,61:nt}),t(Ht,pt,{45:215,50:Y,51:z,52:W,53:K,54:Z,55:X,56:J,57:Q,58:et,59:tt,60:rt,61:nt}),t(Ht,pt,{45:216,50:Y,51:z,52:W,53:K,54:Z,55:X,56:J,57:Q,58:et,59:tt,60:rt,61:nt}),t(H,[2,95],{79:Yt}),t(zt,[2,99],{80:218,12:It,44:Ot,67:Rt,75:qt,76:Pt,77:jt,81:Mt,82:Vt,83:Ut,84:$t,85:Gt}),t(Wt,[2,101]),t(Wt,[2,103]),t(Wt,[2,104]),t(Wt,[2,105]),t(Wt,[2,106]),t(Wt,[2,107]),t(Wt,[2,108]),t(Wt,[2,109]),t(Wt,[2,110]),t(Wt,[2,111]),t(Wt,[2,112]),t(Wt,[2,113]),t(H,[2,96],{79:Yt}),t(H,[2,97],{79:Yt}),t(H,[2,92],{79:Yt}),t(H,[2,93],{43:30,42:107,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_}),t(H,[2,94],{43:30,42:107,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_}),t(it,[2,39]),{39:[1,219]},t(it,[2,43]),t(it,[2,45]),t(it,[2,47]),t(w,[2,29]),t(Bt,[2,58],{12:[1,220]}),t(Bt,[2,60],{12:[1,221]}),t(Bt,[2,62],{12:[1,222]}),{12:It,44:Ot,67:Rt,75:qt,76:Pt,77:jt,78:223,80:191,81:Mt,82:Vt,83:Ut,84:$t,85:Gt},t(Wt,[2,102]),t(it,[2,40],{12:[1,224]}),t(Bt,[2,59]),t(Bt,[2,61]),t(Bt,[2,63]),t(zt,[2,100],{80:218,12:It,44:Ot,67:Rt,75:qt,76:Pt,77:jt,81:Mt,82:Vt,83:Ut,84:$t,85:Gt}),t(it,[2,41])],defaultActions:{160:[2,20]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){function t(){var e;return e=f.lex()||d,"number"!=typeof e&&(e=r.symbols_[e]||e),e}var r=this,n=[0],i=[null],a=[],s=this.table,o="",u=0,c=0,l=0,h=2,d=1,p=a.slice.call(arguments,1),f=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);f.setInput(e,g.yy),g.yy.lexer=f,g.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var m=f.yylloc;a.push(m);var v=f.options&&f.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,A,x,E,_,w,D,k,C,F={};;){if(x=n[n.length-1],this.defaultActions[x]?E=this.defaultActions[x]:((null===b||"undefined"==typeof b)&&(b=t()),E=s[x]&&s[x][b]),"undefined"==typeof E||!E.length||!E[0]){var B="";C=[];for(w in s[x])this.terminals_[w]&&w>h&&C.push("'"+this.terminals_[w]+"'");B=f.showPosition?"Parse error on line "+(u+1)+":\n"+f.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(u+1)+": Unexpected "+(b==d?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(B,{text:f.match,token:this.terminals_[b]||b,line:f.yylineno,loc:m,expected:C})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+b);switch(E[0]){case 1:n.push(b),i.push(f.yytext),a.push(f.yylloc),n.push(E[1]),b=null,A?(b=A,A=null):(c=f.yyleng,o=f.yytext,u=f.yylineno,m=f.yylloc,l>0&&l--);break;case 2:if(D=this.productions_[E[1]][1],F.$=i[i.length-D],F._$={first_line:a[a.length-(D||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(D||1)].first_column,last_column:a[a.length-1].last_column},v&&(F._$.range=[a[a.length-(D||1)].range[0],a[a.length-1].range[1]]),_=this.performAction.apply(F,[o,c,u,g.yy,E[1],i,a].concat(p)),"undefined"!=typeof _)return _;D&&(n=n.slice(0,-1*D*2),i=i.slice(0,-1*D),a=a.slice(0,-1*D)),n.push(this.productions_[E[1]][0]),i.push(F.$),a.push(F._$),k=s[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},Zt=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=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),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,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))),n=e[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(e=this.test_match(r,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[n]),e!==!1?e:!1):""===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(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>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(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,r,n){switch(r){case 0:return 67;case 1:return 68;case 2:return 69;case 3:return 70;case 4:return 71;case 5:return 11;case 6:return 29;case 7:return 32;case 8:return 13;case 9:return 13;case 10:return 13;case 11:return 13;case 12:return 13;case 13:return 13;case 14:return 76;case 15:return 84;case 16:return 82;case 17:return 9;case 18:return 79;case 19:return 89;case 20:return 16;case 21:return 15;case 22:return 17;case 23:return 18;case 24:return 52;case 25:return 50;case 26:return 51;case 27:return 53;case 28:return 56;case 29:return 54;case 30:return 55;case 31:return 57;case 32:return 56;case 33:return 54;case 34:return 55;case 35:return 57;case 36:return 60;case 37:return 58;case 38:return 59;case 39:return 61;case 40:return 47;case 41:return 48;case 42:return 49;case 43:return 44;case 44:return 85;case 45:return 87;case 46:return 77;case 47:return 88;case 48:return 88;case 49:return 81;case 50:return 62;case 51:return 38;case 52:return 39;case 53:return 36;case 54:return 37;case 55:return 40;case 56:return 41;case 57:return 92;case 58:return 19;case 59:return 12;case 60:return 10}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:subgraph\b)/,/^(?:end\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:v\b)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-\.-[x])/,/^(?:-\.->)/,/^(?:-\.-[o])/,/^(?:-\.-)/,/^(?:.-[x])/,/^(?:\.->)/,/^(?:\.-[o])/,/^(?:\.-)/,/^(?:==[x])/,/^(?:==>)/,/^(?:==[o])/,/^(?:==[\=])/,/^(?:--)/,/^(?:-\.)/,/^(?:==)/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u005C\u005F-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_\/])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\n)/,/^(?:\s)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60],inclusive:!0}}};return e}();return Kt.lexer=Zt,e.prototype=Kt,Kt.Parser=e,new e}();"undefined"!=typeof e&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("1YiZ5S"))},{"1YiZ5S":99,fs:97,path:98}],111:[function(e,t,r){(function(n){var i=function(){function e(){this.yy={}}var t=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},r=[6,8,10,11,15,17,19,20,22,33],n=[2,2],i=[1,6],a=[1,8],s=[1,9],o=[1,12],u=[1,13],c=[1,14],l=[1,15],h=[1,17],d=[1,18],p=[2,7],f=[6,8,10,11,15,17,18,19,20,21,22,33],g=[6,8,10,11,15,17,18,19,20,22,33],y=[1,46],m=[1,49],v=[1,53],b={trace:function(){},yy:{},symbols_:{error:2,start:3,SD:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,participant:11,actor:12,signal:13,note_statement:14,title:15,text:16,loop:17,end:18,opt:19,alt:20,"else":21,note:22,placement:23,text2:24,over:25,spaceList:26,actor_pair:27,",":28,left_of:29,right_of:30,signaltype:31,actors:32,ACTOR:33,SOLID_OPEN_ARROW:34,DOTTED_OPEN_ARROW:35,SOLID_ARROW:36,DOTTED_ARROW:37,SOLID_CROSS:38,DOTTED_CROSS:39,TXT:40,$accept:0,$end:1},terminals_:{2:"error",4:"SD",6:"EOF",8:"SPACE",10:"NL",11:"participant",15:"title",16:"text",17:"loop",18:"end",19:"opt",20:"alt",21:"else",22:"note",25:"over",28:",",29:"left_of",30:"right_of",33:"ACTOR",34:"SOLID_OPEN_ARROW",35:"DOTTED_OPEN_ARROW",36:"SOLID_ARROW",37:"DOTTED_ARROW",38:"SOLID_CROSS",39:"DOTTED_CROSS",40:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,3],[9,2],[9,2],[9,4],[9,4],[9,4],[9,7],[14,4],[14,5],[26,2],[26,1],[27,1],[27,3],[23,1],[23,1],[13,4],[32,2],[32,1],[12,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,1],[24,1]],performAction:function(e,t,r,n,i,a){var s=a.length-1; -switch(i){case 1:return n.apply(a[s-1]),a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:this.$=a[s-1];break;case 12:a[s-1].unshift({type:"loopStart",loopText:a[s-2].actor,signalType:n.LINETYPE.LOOP_START}),a[s-1].push({type:"loopEnd",loopText:a[s-2],signalType:n.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 13:a[s-1].unshift({type:"optStart",optText:a[s-2].actor,signalType:n.LINETYPE.OPT_START}),a[s-1].push({type:"optEnd",optText:a[s-2].actor,signalType:n.LINETYPE.OPT_END}),this.$=a[s-1];break;case 14:a[s-4].unshift({type:"altStart",altText:a[s-5].actor,signalType:n.LINETYPE.ALT_START}),a[s-4].push({type:"else",altText:a[s-2].actor,signalType:n.LINETYPE.ALT_ELSE}),a[s-4]=a[s-4].concat(a[s-1]),a[s-4].push({type:"altEnd",signalType:n.LINETYPE.ALT_END}),this.$=a[s-4];break;case 15:this.$=[a[s-1],{type:"addNote",placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 19:this.$=a[s];break;case 20:this.$=[a[s-2],a[s]];break;case 21:this.$=n.PLACEMENT.LEFTOF;break;case 22:this.$=n.PLACEMENT.RIGHTOF;break;case 23:this.$=[a[s-3],a[s-1],{type:"addMessage",from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 26:this.$={type:"addActor",actor:a[s]};break;case 27:this.$=n.LINETYPE.SOLID_OPEN;break;case 28:this.$=n.LINETYPE.DOTTED_OPEN;break;case 29:this.$=n.LINETYPE.SOLID;break;case 30:this.$=n.LINETYPE.DOTTED;break;case 31:this.$=n.LINETYPE.SOLID_CROSS;break;case 32:this.$=n.LINETYPE.DOTTED_CROSS;break;case 33:this.$=a[s].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},t(r,n,{5:3}),{6:[1,4],7:5,8:i,9:7,10:a,11:s,12:16,13:10,14:11,15:o,17:u,19:c,20:l,22:h,33:d},t(r,p,{1:[2,1]}),t(f,[2,3]),{9:19,11:s,12:16,13:10,14:11,15:o,17:u,19:c,20:l,22:h,33:d},t(f,[2,5]),t(f,[2,6]),{12:20,33:d},{10:[1,21]},{10:[1,22]},{8:[1,23]},{12:24,33:d},{12:25,33:d},{12:26,33:d},{31:27,34:[1,28],35:[1,29],36:[1,30],37:[1,31],38:[1,32],39:[1,33]},{23:34,25:[1,35],29:[1,36],30:[1,37]},t([6,8,10,11,15,17,18,19,20,21,22,28,33,34,35,36,37,38,39,40],[2,26]),t(f,[2,4]),{10:[1,38]},t(f,[2,9]),t(f,[2,10]),{16:[1,39]},t(g,n,{5:40}),t(g,n,{5:41}),t([6,8,10,11,15,17,19,20,21,22,33],n,{5:42}),{12:43,33:d},{33:[2,27]},{33:[2,28]},{33:[2,29]},{33:[2,30]},{33:[2,31]},{33:[2,32]},{12:44,33:d},{8:y,26:45},{33:[2,21]},{33:[2,22]},t(f,[2,8]),{10:[1,47]},{6:m,7:5,8:i,9:7,10:a,11:s,12:16,13:10,14:11,15:o,17:u,18:[1,48],19:c,20:l,22:h,33:d},{6:m,7:5,8:i,9:7,10:a,11:s,12:16,13:10,14:11,15:o,17:u,18:[1,50],19:c,20:l,22:h,33:d},{6:m,7:5,8:i,9:7,10:a,11:s,12:16,13:10,14:11,15:o,17:u,19:c,20:l,21:[1,51],22:h,33:d},{24:52,40:v},{24:54,40:v},{12:56,27:55,33:d},{8:y,26:57,33:[2,18]},t(f,[2,11]),t(f,[2,12]),t(f,p),t(f,[2,13]),{12:58,33:d},{10:[2,23]},{10:[2,33]},{10:[2,15]},{12:59,33:d},{28:[1,60],33:[2,19]},{33:[2,17]},t(g,n,{5:61}),{10:[2,16]},{12:62,33:d},{6:m,7:5,8:i,9:7,10:a,11:s,12:16,13:10,14:11,15:o,17:u,18:[1,63],19:c,20:l,22:h,33:d},{33:[2,20]},t(f,[2,14])],defaultActions:{28:[2,27],29:[2,28],30:[2,29],31:[2,30],32:[2,31],33:[2,32],36:[2,21],37:[2,22],52:[2,23],53:[2,33],54:[2,15],57:[2,17],59:[2,16],62:[2,20]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){function t(){var e;return e=f.lex()||d,"number"!=typeof e&&(e=r.symbols_[e]||e),e}var r=this,n=[0],i=[null],a=[],s=this.table,o="",u=0,c=0,l=0,h=2,d=1,p=a.slice.call(arguments,1),f=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);f.setInput(e,g.yy),g.yy.lexer=f,g.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var m=f.yylloc;a.push(m);var v=f.options&&f.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,A,x,E,_,w,D,k,C,F={};;){if(x=n[n.length-1],this.defaultActions[x]?E=this.defaultActions[x]:((null===b||"undefined"==typeof b)&&(b=t()),E=s[x]&&s[x][b]),"undefined"==typeof E||!E.length||!E[0]){var B="";C=[];for(w in s[x])this.terminals_[w]&&w>h&&C.push("'"+this.terminals_[w]+"'");B=f.showPosition?"Parse error on line "+(u+1)+":\n"+f.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(u+1)+": Unexpected "+(b==d?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(B,{text:f.match,token:this.terminals_[b]||b,line:f.yylineno,loc:m,expected:C})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+b);switch(E[0]){case 1:n.push(b),i.push(f.yytext),a.push(f.yylloc),n.push(E[1]),b=null,A?(b=A,A=null):(c=f.yyleng,o=f.yytext,u=f.yylineno,m=f.yylloc,l>0&&l--);break;case 2:if(D=this.productions_[E[1]][1],F.$=i[i.length-D],F._$={first_line:a[a.length-(D||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(D||1)].first_column,last_column:a[a.length-1].last_column},v&&(F._$.range=[a[a.length-(D||1)].range[0],a[a.length-1].range[1]]),_=this.performAction.apply(F,[o,c,u,g.yy,E[1],i,a].concat(p)),"undefined"!=typeof _)return _;D&&(n=n.slice(0,-1*D*2),i=i.slice(0,-1*D),a=a.slice(0,-1*D)),n.push(this.productions_[E[1]][0]),i.push(F.$),a.push(F._$),k=s[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},A=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=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),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,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))),n=e[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(e=this.test_match(r,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[n]),e!==!1?e:!1):""===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(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>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(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,t,r,n){switch(r){case 0:return 10;case 1:return 38;case 2:return 39;case 3:return 36;case 4:return 37;case 5:break;case 6:break;case 7:break;case 8:return 11;case 9:return 19;case 10:return 17;case 11:return 20;case 12:return 21;case 13:return 18;case 14:return 29;case 15:return 30;case 16:return 25;case 17:return 22;case 18:return 15;case 19:return 4;case 20:return 28;case 21:return 10;case 22:return 33;case 23:return 34;case 24:return 35;case 25:return 36;case 26:return 37;case 27:return 40;case 28:return 6;case 29:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:[\-][x])/i,/^(?:[\-][\-][x])/i,/^(?:[\-][>][>])/i,/^(?:[\-][\-][>][>])/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:participant\b)/i,/^(?:opt\b)/i,/^(?:loop\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\->:\n,;]+)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],inclusive:!0}}};return e}();return b.lexer=A,e.prototype=b,b.Parser=e,new e}();"undefined"!=typeof e&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("1YiZ5S"))},{"1YiZ5S":99,fs:97,path:98}],112:[function(e,t,r){var n={},i=[],a=[],s=[];r.addActor=function(e,t,r){n[e]={name:t,description:r},i.push(e)},r.addMessage=function(e,t,r,n){a.push({from:e,to:t,message:r,answer:n})},r.addSignal=function(e,t,r,n){a.push({from:e,to:t,message:r,type:n})},r.getMessages=function(){return a},r.getActors=function(){return n},r.getActor=function(e){return n[e]},r.getActorKeys=function(){return Object.keys(n)},r.clear=function(){n={},a=[]},r.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16},r.ARROWTYPE={FILLED:0,OPEN:1},r.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},r.addNote=function(e,t,n){var i={actor:e,placement:t,message:n};s.push(i),a.push({from:e,to:e,message:n,type:r.LINETYPE.NOTE,placement:t})},r.parseError=function(e){console.log("Syntax error:"+e)},r.apply=function(e){if(e instanceof Array)e.forEach(function(e){r.apply(e)});else switch(e.type){case"addActor":r.addActor(e.actor,e.actor,e.actor);break;case"addNote":r.addNote(e.actor,e.placement,e.text);break;case"addMessage":r.addSignal(e.from,e.to,e.msg,e.signalType);break;case"loopStart":r.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":r.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":r.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":r.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":r.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":r.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":r.addSignal(void 0,void 0,void 0,e.signalType)}}},{}],113:[function(e,t,r){var n=e("./parser/sequenceDiagram").parser;n.yy=e("./sequenceDb");var i=e("./svgDraw"),a={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35};r.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,list:[],init:function(){this.list=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(e,t,r,n){e[t]="undefined"==typeof e[t]?r:n(r,e[t])},updateLoops:function(e,t,n,i){var s=this,o=0;this.list.forEach(function(u){o++;var c=s.list.length-o+1;s.updateVal(u,"startx",e-c*a.boxMargin,Math.min),s.updateVal(u,"starty",t-c*a.boxMargin,Math.min),s.updateVal(u,"stopx",n+c*a.boxMargin,Math.max),s.updateVal(u,"stopy",i+c*a.boxMargin,Math.max),s.updateVal(r.bounds.data,"startx",e-c*a.boxMargin,Math.min),s.updateVal(r.bounds.data,"starty",t-c*a.boxMargin,Math.min),s.updateVal(r.bounds.data,"stopx",n+c*a.boxMargin,Math.max),s.updateVal(r.bounds.data,"stopy",i+c*a.boxMargin,Math.max)})},insert:function(e,t,n,i){var a,s,o,u;a=Math.min(e,n),o=Math.max(e,n),s=Math.min(t,i),u=Math.max(t,i),this.updateVal(r.bounds.data,"startx",a,Math.min),this.updateVal(r.bounds.data,"starty",s,Math.min),this.updateVal(r.bounds.data,"stopx",o,Math.max),this.updateVal(r.bounds.data,"stopy",u,Math.max),this.updateLoops(a,s,o,u)},newLoop:function(e){this.list.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e})},endLoop:function(){var e=this.list.pop();return e},addElseToLoop:function(e){var t=this.list.pop();t.elsey=r.bounds.getVerticalPos(),t.elseText=e,this.list.push(t)},bumpVerticalPos:function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var s=function(e,t,n,s){var o=i.getNoteRect();o.x=t,o.y=n,o.width=a.width,o.class="note";var u=e.append("g"),c=i.drawRect(u,o),l=i.getTextObj();l.x=t,l.y=n+a.noteMargin,l.textMargin=a.noteMargin,l.dy="1em",l.text=s.message,l.class="noteText";var h=i.drawText(u,l),d=h[0][0].getBBox().height;r.bounds.insert(t,n,t+a.width,n+2*a.noteMargin+d),c.attr("height",d+2*a.noteMargin),r.bounds.bumpVerticalPos(d+2*a.noteMargin)},o=function(e,t,i,a,s){var o,u=e.append("g"),c=t+(i-t)/2,l=u.append("text").attr("x",c).attr("y",a-7).style("text-anchor","middle").attr("class","messageText").text(s.message),h=l[0][0].getBBox().width;if(t===i){o=u.append("path").attr("d","M "+t+","+a+" C "+(t+60)+","+(a-10)+" "+(t+60)+","+(a+30)+" "+t+","+(a+20)),r.bounds.bumpVerticalPos(30);var d=Math.max(h/2,100);r.bounds.insert(t-d,r.bounds.getVerticalPos()-10,i+d,r.bounds.getVerticalPos())}else o=u.append("line"),o.attr("x1",t),o.attr("y1",a),o.attr("x2",i),o.attr("y2",a),r.bounds.insert(t,r.bounds.getVerticalPos()-10,i,r.bounds.getVerticalPos());s.type===n.yy.LINETYPE.DOTTED||s.type===n.yy.LINETYPE.DOTTED_CROSS||s.type===n.yy.LINETYPE.DOTTED_OPEN?(o.style("stroke-dasharray","3, 3"),o.attr("class","messageLine1")):o.attr("class","messageLine0"),o.attr("stroke-width",2),o.attr("stroke","black"),o.style("fill","none"),(s.type===n.yy.LINETYPE.SOLID||s.type===n.yy.LINETYPE.DOTTED)&&o.attr("marker-end","url(#arrowhead)"),(s.type===n.yy.LINETYPE.SOLID_CROSS||s.type===n.yy.LINETYPE.DOTTED_CROSS)&&o.attr("marker-end","url(#crosshead)")};t.exports.drawActors=function(e,t,n){var s;for(s=0;s/gi).forEach(function(e){var n=r.append("tspan");n.attr("x",t.x+t.textMargin),n.attr("dy",t.dy),n.text(e)}),"undefined"!=typeof t.class&&r.attr("class",t.class),r},r.drawLabel=function(e,t){var n=r.getNoteRect();n.x=t.x,n.y=t.y,n.width=50,n.height=20,n.fill="#526e52",n.stroke="none",n.class="labelBox",r.drawRect(e,n),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,t.fill="white",r.drawText(e,t)},r.drawActor=function(e,t,n,i){var a=t+i.width/2,s=e.append("g");s.append("line").attr("x1",a).attr("y1",5).attr("x2",a).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999");var o=r.getNoteRect();o.x=t,o.fill="#eaeaea",o.width=i.width,o.height=i.height,o.class="actor",o.rx=3,o.ry=3,r.drawRect(s,o),s.append("text").attr("x",a).attr("y",i.height/2+5).attr("class","actor").style("text-anchor","middle").text(n)},r.drawLoop=function(e,t,n,i){var a=e.append("g"),s=function(e,t,r,n){a.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",n).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};s(t.startx,t.starty,t.stopx,t.starty),s(t.stopx,t.starty,t.stopx,t.stopy),s(t.startx,t.stopy,t.stopx,t.stopy),s(t.startx,t.starty,t.startx,t.stopy),"undefined"!=typeof t.elsey&&s(t.startx,t.elsey,t.stopx,t.elsey);var o=r.getTextObj();o.text=n,o.x=t.startx,o.y=t.starty,o.labelMargin=1.5*i.boxMargin,o.class="labelText",o.fill="white",r.drawLabel(a,o),o=r.getTextObj(),o.text="[ "+t.title+" ]",o.x=t.startx+(t.stopx-t.startx)/2,o.y=t.starty+1.5*i.boxMargin,o.anchor="middle",o.class="loopText",r.drawText(a,o),"undefined"!=typeof t.elseText&&(o.text="[ "+t.elseText+" ]",o.y=t.elsey+1.5*i.boxMargin,r.drawText(a,o))},r.insertArrowHead=function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},r.insertArrowCrossHead=function(e){var t=e.append("defs"),r=t.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);r.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),r.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},r.getTextObj=function(){var e={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return e},r.getNoteRect=function(){var e={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return e}},{}],115:[function(e,t,r){(function(t){var n=e("./diagrams/flowchart/graphDb"),i=e("./diagrams/flowchart/parser/flow"),a=e("./utils"),s=e("./diagrams/flowchart/flowRenderer"),o=e("./diagrams/sequenceDiagram/sequenceRenderer"),u=e("./diagrams/example/exampleRenderer"),c=e("he"),l=function(e){var t,i=document.querySelectorAll(".mermaid");"undefined"!==e&&"undefined"!=typeof e&&o.setConf(JSON.parse(e));var l=0;for(t=0;t/g,">"),p=p.replace(/';var f=a.detectType(p),g={};switch(f){case"graph":g=s.getClasses(p,!1),s.draw(p,d,!1),a.cloneCssStyles(h.firstChild,g),n.bindFunctions();break;case"dotGraph":g=s.getClasses(p,!0),s.draw(p,d,!0),a.cloneCssStyles(h.firstChild,g);break;case"sequenceDiagram":o.draw(p,d),a.cloneCssStyles(h.firstChild,[]);break;case"info":u.draw(p,d,r.version()),a.cloneCssStyles(h.firstChild,[])}}}};r.tester=function(){},r.version=function(){return e("../package.json").version};var h=function(e,t){return"undefined"==typeof t?!1:e===t};t.mermaid={startOnLoad:!0,htmlLabels:!0,init:function(e){l(e)},version:function(){return r.version()},getParser:function(){return i.parser}},r.contentLoaded=function(){"undefined"!=typeof mermaid_config&&h(!1,mermaid_config.htmlLabels)&&(t.mermaid.htmlLabels=!1),t.mermaid.startOnLoad&&("undefined"!=typeof mermaid_config?h(!0,mermaid_config.startOnLoad)&&t.mermaid.init():t.mermaid.init())},"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",function(){r.contentLoaded()},!1)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../package.json":102,"./diagrams/example/exampleRenderer":104,"./diagrams/flowchart/flowRenderer":107,"./diagrams/flowchart/graphDb":108,"./diagrams/flowchart/parser/flow":110,"./diagrams/sequenceDiagram/sequenceRenderer":113,"./utils":116,he:100}],116:[function(e,t){t.exports.detectType=function(e){return e.match(/^\s*sequenceDiagram/)?"sequenceDiagram":e.match(/^\s*sequence/)?"sequence":e.match(/^\s*digraph/)?(console.log("Detected dot syntax"),"dotGraph"):e.match(/^\s*info/)?"info":"graph"},t.exports.cloneCssStyles=function(e,t){for(var r="",n=document.styleSheets,i=0;i0&&(r+=o.selectorText+" { "+o.style.cssText+" }\n")}}}var c="",l="";for(var h in t)t.hasOwnProperty(h)&&"undefined"!=typeof h&&("default"===h?(t.default.styles instanceof Array&&(c+="#"+e.id.trim()+" .node { "+t[h].styles.join("; ")+"; }\n"),t.default.nodeLabelStyles instanceof Array&&(c+="#"+e.id.trim()+" .node text { "+t[h].nodeLabelStyles.join("; ")+"; }\n"),t.default.edgeLabelStyles instanceof Array&&(c+="#"+e.id.trim()+" .edgeLabel text { "+t[h].edgeLabelStyles.join("; ")+"; }\n")):t[h].styles instanceof Array&&(l+="#"+e.id.trim()+" ."+h+" { "+t[h].styles.join("; ")+"; }\n"));if(""!==r||""!==c||""!==l){var d=document.createElement("style");d.setAttribute("type","text/css"),d.setAttribute("title","mermaid-svg-internal-css"),d.innerHTML="/* */\n",e.insertBefore(d,e.firstChild)}}},{}]},{},[115]); \ No newline at end of file +module.exports={graphlib:require("./lib/graphlib"),dagre:require("./lib/dagre"),intersect:require("./lib/intersect"),render:require("./lib/render"),util:require("./lib/util"),version:require("./lib/version")}},{"./lib/dagre":8,"./lib/graphlib":9,"./lib/intersect":10,"./lib/render":23,"./lib/util":25,"./lib/version":26}],2:[function(require,module,exports){var util=require("./util");module.exports={"default":normal,normal:normal,vee:vee};function normal(parent,id,edge,type){var marker=parent.append("marker").attr("id",id).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto");var path=marker.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");util.applyStyle(path,edge[type+"Style"])}function vee(parent,id,edge,type){var marker=parent.append("marker").attr("id",id).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto");var path=marker.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");util.applyStyle(path,edge[type+"Style"])}},{"./util":25}],3:[function(require,module,exports){var util=require("./util");module.exports=createClusters;function createClusters(selection,g){var clusters=g.nodes().filter(function(v){return util.isSubgraph(g,v)}),svgClusters=selection.selectAll("g.cluster").data(clusters,function(v){return v});svgClusters.enter().append("g").attr("class","cluster").style("opacity",0).append("rect");util.applyTransition(svgClusters.exit(),g).style("opacity",0).remove();util.applyTransition(svgClusters,g).style("opacity",1);util.applyTransition(svgClusters.selectAll("rect"),g).attr("width",function(v){return g.node(v).width}).attr("height",function(v){return g.node(v).height}).attr("x",function(v){var node=g.node(v);return node.x-node.width/2}).attr("y",function(v){var node=g.node(v);return node.y-node.height/2})}},{"./util":25}],4:[function(require,module,exports){"use strict";var _=require("./lodash"),addLabel=require("./label/add-label"),util=require("./util"),d3=require("./d3");module.exports=createEdgeLabels;function createEdgeLabels(selection,g){var svgEdgeLabels=selection.selectAll("g.edgeLabel").data(g.edges(),function(e){return util.edgeToId(e)}).classed("update",true);svgEdgeLabels.selectAll("*").remove();svgEdgeLabels.enter().append("g").classed("edgeLabel",true).style("opacity",0);svgEdgeLabels.each(function(e){var edge=g.edge(e),label=addLabel(d3.select(this),g.edge(e),0,0).classed("label",true),bbox=label.node().getBBox();if(edge.labelId){label.attr("id",edge.labelId)}if(!_.has(edge,"width")){edge.width=bbox.width}if(!_.has(edge,"height")){edge.height=bbox.height}});util.applyTransition(svgEdgeLabels.exit(),g).style("opacity",0).remove();return svgEdgeLabels}},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],5:[function(require,module,exports){"use strict";var _=require("./lodash"),intersectNode=require("./intersect/intersect-node"),util=require("./util"),d3=require("./d3");module.exports=createEdgePaths;function createEdgePaths(selection,g,arrows){var svgPaths=selection.selectAll("g.edgePath").data(g.edges(),function(e){return util.edgeToId(e)}).classed("update",true);enter(svgPaths,g);exit(svgPaths,g);util.applyTransition(svgPaths,g).style("opacity",1);svgPaths.selectAll("path.path").each(function(e){var edge=g.edge(e);edge.arrowheadId=_.uniqueId("arrowhead");var domEdge=d3.select(this).attr("marker-end",function(){return"url(#"+edge.arrowheadId+")"}).style("fill","none");util.applyTransition(domEdge,g).attr("d",function(e){return calcPoints(g,e)});if(edge.id){domEdge.attr("id",edge.id)}util.applyStyle(domEdge,edge.style)});svgPaths.selectAll("defs *").remove();svgPaths.selectAll("defs").each(function(e){var edge=g.edge(e),arrowhead=arrows[edge.arrowhead];arrowhead(d3.select(this),edge.arrowheadId,edge,"arrowhead")});return svgPaths}function calcPoints(g,e){var edge=g.edge(e),tail=g.node(e.v),head=g.node(e.w),points=edge.points.slice(1,edge.points.length-1);points.unshift(intersectNode(tail,points[0]));points.push(intersectNode(head,points[points.length-1]));return createLine(edge,points)}function createLine(edge,points){var line=d3.svg.line().x(function(d){return d.x}).y(function(d){return d.y});if(_.has(edge,"lineInterpolate")){line.interpolate(edge.lineInterpolate)}if(_.has(edge,"lineTension")){line.tension(Number(edge.lineTension))}return line(points)}function getCoords(elem){var bbox=elem.getBBox(),matrix=elem.getTransformToElement(elem.ownerSVGElement).translate(bbox.width/2,bbox.height/2);return{x:matrix.e,y:matrix.f}}function enter(svgPaths,g){var svgPathsEnter=svgPaths.enter().append("g").attr("class","edgePath").style("opacity",0);svgPathsEnter.append("path").attr("class","path").attr("d",function(e){var edge=g.edge(e),sourceElem=g.node(e.v).elem,points=_.range(edge.points.length).map(function(){return getCoords(sourceElem)});return createLine(edge,points)});svgPathsEnter.append("defs")}function exit(svgPaths,g){var svgPathExit=svgPaths.exit();util.applyTransition(svgPathExit,g).style("opacity",0).remove();util.applyTransition(svgPathExit.select("path.path"),g).attr("d",function(e){var source=g.node(e.v);if(source){var points=_.range(this.pathSegList.length).map(function(){return source});return createLine({},points)}else{return d3.select(this).attr("d")}})}},{"./d3":7,"./intersect/intersect-node":14,"./lodash":20,"./util":25}],6:[function(require,module,exports){"use strict";var _=require("./lodash"),addLabel=require("./label/add-label"),util=require("./util"),d3=require("./d3");module.exports=createNodes;function createNodes(selection,g,shapes){var simpleNodes=g.nodes().filter(function(v){return!util.isSubgraph(g,v)});var svgNodes=selection.selectAll("g.node").data(simpleNodes,function(v){return v}).classed("update",true);svgNodes.selectAll("*").remove();svgNodes.enter().append("g").attr("class","node").style("opacity",0);svgNodes.each(function(v){var node=g.node(v),thisGroup=d3.select(this),labelGroup=thisGroup.append("g").attr("class","label"),labelDom=addLabel(labelGroup,node),shape=shapes[node.shape],bbox=_.pick(labelDom.node().getBBox(),"width","height");node.elem=this;if(node.id){thisGroup.attr("id",node.id)}if(node.labelId){labelGroup.attr("id",node.labelId)}util.applyClass(thisGroup,node.class,(thisGroup.classed("update")?"update ":"")+"node");if(_.has(node,"width")){bbox.width=node.width}if(_.has(node,"height")){bbox.height=node.height}bbox.width+=node.paddingLeft+node.paddingRight;bbox.height+=node.paddingTop+node.paddingBottom;labelGroup.attr("transform","translate("+(node.paddingLeft-node.paddingRight)/2+","+(node.paddingTop-node.paddingBottom)/2+")");var shapeSvg=shape(d3.select(this),bbox,node);util.applyStyle(shapeSvg,node.style);var shapeBBox=shapeSvg.node().getBBox();node.width=shapeBBox.width;node.height=shapeBBox.height});util.applyTransition(svgNodes.exit(),g).style("opacity",0).remove();return svgNodes}},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],7:[function(require,module,exports){module.exports=window.d3},{}],8:[function(require,module,exports){var dagre;if(require){try{dagre=require("dagre")}catch(e){}}if(!dagre){dagre=window.dagre}module.exports=dagre},{dagre:27}],9:[function(require,module,exports){var graphlib;if(require){try{graphlib=require("graphlib")}catch(e){}}if(!graphlib){graphlib=window.graphlib}module.exports=graphlib},{graphlib:57}],10:[function(require,module,exports){module.exports={node:require("./intersect-node"),circle:require("./intersect-circle"),ellipse:require("./intersect-ellipse"),polygon:require("./intersect-polygon"),rect:require("./intersect-rect")}},{"./intersect-circle":11,"./intersect-ellipse":12,"./intersect-node":14,"./intersect-polygon":15,"./intersect-rect":16}],11:[function(require,module,exports){var intersectEllipse=require("./intersect-ellipse");module.exports=intersectCircle;function intersectCircle(node,rx,point){return intersectEllipse(node,rx,rx,point)}},{"./intersect-ellipse":12}],12:[function(require,module,exports){module.exports=intersectEllipse;function intersectEllipse(node,rx,ry,point){var cx=node.x;var cy=node.y;var px=cx-point.x;var py=cy-point.y;var det=Math.sqrt(rx*rx*py*py+ry*ry*px*px);var dx=Math.abs(rx*ry*px/det);if(point.x0}},{}],14:[function(require,module,exports){module.exports=intersectNode;function intersectNode(node,point){return node.intersect(point)}},{}],15:[function(require,module,exports){var intersectLine=require("./intersect-line");module.exports=intersectPolygon;function intersectPolygon(node,polyPoints,point){var x1=node.x;var y1=node.y;var intersections=[];var minX=Number.POSITIVE_INFINITY,minY=Number.POSITIVE_INFINITY;polyPoints.forEach(function(entry){minX=Math.min(minX,entry.x);minY=Math.min(minY,entry.y)});var left=x1-node.width/2-minX;var top=y1-node.height/2-minY;for(var i=0;i1){intersections.sort(function(p,q){var pdx=p.x-point.x,pdy=p.y-point.y,distp=Math.sqrt(pdx*pdx+pdy*pdy),qdx=q.x-point.x,qdy=q.y-point.y,distq=Math.sqrt(qdx*qdx+qdy*qdy);return distpMath.abs(dx)*h){if(dy<0){h=-h}sx=dy===0?0:h*dx/dy;sy=h}else{if(dx<0){w=-w}sx=w;sy=dx===0?0:w*dy/dx}return{x:x+sx,y:y+sy}}},{}],17:[function(require,module,exports){var util=require("../util");module.exports=addHtmlLabel;function addHtmlLabel(root,node){var fo=root.append("foreignObject").attr("width","100000");var div=fo.append("xhtml:div");var label=node.label;switch(typeof label){case"function":div.insert(label);break;case"object":div.insert(function(){return label});break;default:div.html(label)}util.applyStyle(div,node.labelStyle);div.style("display","inline-block");div.style("white-space","nowrap");var w,h;div.each(function(){w=this.clientWidth;h=this.clientHeight});fo.attr("width",w).attr("height",h);return fo}},{"../util":25}],18:[function(require,module,exports){var addTextLabel=require("./add-text-label"),addHtmlLabel=require("./add-html-label");module.exports=addLabel;function addLabel(root,node){var label=node.label;var labelSvg=root.append("g");if(typeof label!=="string"||node.labelType==="html"){addHtmlLabel(labelSvg,node)}else{addTextLabel(labelSvg,node)}var labelBBox=labelSvg.node().getBBox();labelSvg.attr("transform","translate("+-labelBBox.width/2+","+-labelBBox.height/2+")");return labelSvg}},{"./add-html-label":17,"./add-text-label":19}],19:[function(require,module,exports){var util=require("../util");module.exports=addTextLabel;function addTextLabel(root,node){var domNode=root.append("text");var lines=processEscapeSequences(node.label).split("\n");for(var i=0;i0;--i){entry=buckets[i].dequeue();if(entry){results=results.concat(removeNode(g,buckets,zeroIdx,entry,true));break}}}}return results}function removeNode(g,buckets,zeroIdx,entry,collectPredecessors){var results=collectPredecessors?[]:undefined;_.each(g.inEdges(entry.v),function(edge){var weight=g.edge(edge),uEntry=g.node(edge.v);if(collectPredecessors){results.push({v:edge.v,w:edge.w})}uEntry.out-=weight;assignBucket(buckets,zeroIdx,uEntry)});_.each(g.outEdges(entry.v),function(edge){var weight=g.edge(edge),w=edge.w,wEntry=g.node(w);wEntry.in-=weight;assignBucket(buckets,zeroIdx,wEntry)});g.removeNode(entry.v);return results}function buildState(g,weightFn){var fasGraph=new Graph,maxIn=0,maxOut=0;_.each(g.nodes(),function(v){fasGraph.setNode(v,{v:v,"in":0,out:0})});_.each(g.edges(),function(e){var prevWeight=fasGraph.edge(e.v,e.w)||0,weight=weightFn(e),edgeWeight=prevWeight+weight;fasGraph.setEdge(e.v,e.w,edgeWeight);maxOut=Math.max(maxOut,fasGraph.node(e.v).out+=weight);maxIn=Math.max(maxIn,fasGraph.node(e.w).in+=weight)});var buckets=_.range(maxOut+maxIn+3).map(function(){return new List});var zeroIdx=maxIn+1;_.each(fasGraph.nodes(),function(v){assignBucket(buckets,zeroIdx,fasGraph.node(v))});return{graph:fasGraph,buckets:buckets,zeroIdx:zeroIdx}}function assignBucket(buckets,zeroIdx,entry){if(!entry.out){buckets[0].enqueue(entry)}else if(!entry.in){buckets[buckets.length-1].enqueue(entry)}else{buckets[entry.out-entry.in+zeroIdx].enqueue(entry)}}},{"./data/list":31,"./graphlib":33,"./lodash":36}],35:[function(require,module,exports){"use strict";var _=require("./lodash"),acyclic=require("./acyclic"),normalize=require("./normalize"),rank=require("./rank"),normalizeRanks=require("./util").normalizeRanks,parentDummyChains=require("./parent-dummy-chains"),removeEmptyRanks=require("./util").removeEmptyRanks,nestingGraph=require("./nesting-graph"),addBorderSegments=require("./add-border-segments"),coordinateSystem=require("./coordinate-system"),order=require("./order"),position=require("./position"),util=require("./util"),Graph=require("./graphlib").Graph;module.exports=layout;function layout(g,opts){var time=opts&&opts.debugTiming?util.time:util.notime;time("layout",function(){var layoutGraph=time(" buildLayoutGraph",function(){return buildLayoutGraph(g)});time(" runLayout",function(){runLayout(layoutGraph,time)});time(" updateInputGraph",function(){updateInputGraph(g,layoutGraph)})})}function runLayout(g,time){time(" makeSpaceForEdgeLabels",function(){makeSpaceForEdgeLabels(g)});time(" removeSelfEdges",function(){removeSelfEdges(g)});time(" acyclic",function(){acyclic.run(g)});time(" nestingGraph.run",function(){nestingGraph.run(g)});time(" rank",function(){rank(util.asNonCompoundGraph(g))});time(" injectEdgeLabelProxies",function(){injectEdgeLabelProxies(g)});time(" removeEmptyRanks",function(){removeEmptyRanks(g)});time(" nestingGraph.cleanup",function(){nestingGraph.cleanup(g)});time(" normalizeRanks",function(){normalizeRanks(g)});time(" assignRankMinMax",function(){assignRankMinMax(g)});time(" removeEdgeLabelProxies",function(){removeEdgeLabelProxies(g)});time(" normalize.run",function(){normalize.run(g)});time(" parentDummyChains",function(){parentDummyChains(g)});time(" addBorderSegments",function(){addBorderSegments(g)});time(" order",function(){order(g)});time(" insertSelfEdges",function(){insertSelfEdges(g)});time(" adjustCoordinateSystem",function(){coordinateSystem.adjust(g)});time(" position",function(){position(g)});time(" positionSelfEdges",function(){positionSelfEdges(g)});time(" removeBorderNodes",function(){removeBorderNodes(g)});time(" normalize.undo",function(){normalize.undo(g)});time(" fixupEdgeLabelCoords",function(){fixupEdgeLabelCoords(g)});time(" undoCoordinateSystem",function(){coordinateSystem.undo(g)});time(" translateGraph",function(){translateGraph(g)});time(" assignNodeIntersects",function(){assignNodeIntersects(g)});time(" reversePoints",function(){reversePointsForReversedEdges(g)});time(" acyclic.undo",function(){acyclic.undo(g)})}function updateInputGraph(inputGraph,layoutGraph){_.each(inputGraph.nodes(),function(v){var inputLabel=inputGraph.node(v),layoutLabel=layoutGraph.node(v);if(inputLabel){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y;if(layoutGraph.children(v).length){inputLabel.width=layoutLabel.width;inputLabel.height=layoutLabel.height}}});_.each(inputGraph.edges(),function(e){var inputLabel=inputGraph.edge(e),layoutLabel=layoutGraph.edge(e);inputLabel.points=layoutLabel.points;if(_.has(layoutLabel,"x")){inputLabel.x=layoutLabel.x;inputLabel.y=layoutLabel.y}});inputGraph.graph().width=layoutGraph.graph().width;inputGraph.graph().height=layoutGraph.graph().height}var graphNumAttrs=["nodesep","edgesep","ranksep","marginx","marginy"],graphDefaults={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},graphAttrs=["acyclicer","ranker","rankdir","align"],nodeNumAttrs=["width","height"],nodeDefaults={width:0,height:0},edgeNumAttrs=["minlen","weight","width","height","labeloffset"],edgeDefaults={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},edgeAttrs=["labelpos"];function buildLayoutGraph(inputGraph){var g=new Graph({multigraph:true,compound:true}),graph=canonicalize(inputGraph.graph());g.setGraph(_.merge({},graphDefaults,selectNumberAttrs(graph,graphNumAttrs),_.pick(graph,graphAttrs)));_.each(inputGraph.nodes(),function(v){var node=canonicalize(inputGraph.node(v));g.setNode(v,_.defaults(selectNumberAttrs(node,nodeNumAttrs),nodeDefaults));g.setParent(v,inputGraph.parent(v))});_.each(inputGraph.edges(),function(e){var edge=canonicalize(inputGraph.edge(e));g.setEdge(e,_.merge({},edgeDefaults,selectNumberAttrs(edge,edgeNumAttrs),_.pick(edge,edgeAttrs)))});return g}function makeSpaceForEdgeLabels(g){var graph=g.graph();graph.ranksep/=2;_.each(g.edges(),function(e){var edge=g.edge(e);edge.minlen*=2;if(edge.labelpos.toLowerCase()!=="c"){if(graph.rankdir==="TB"||graph.rankdir==="BT"){edge.width+=edge.labeloffset}else{edge.height+=edge.labeloffset}}})}function injectEdgeLabelProxies(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.width&&edge.height){var v=g.node(e.v),w=g.node(e.w),label={rank:(w.rank-v.rank)/2+v.rank,e:e};util.addDummyNode(g,"edge-proxy",label,"_ep")}})}function assignRankMinMax(g){var maxRank=0;_.each(g.nodes(),function(v){var node=g.node(v);if(node.borderTop){node.minRank=g.node(node.borderTop).rank;node.maxRank=g.node(node.borderBottom).rank;maxRank=_.max(maxRank,node.maxRank)}});g.graph().maxRank=maxRank}function removeEdgeLabelProxies(g){_.each(g.nodes(),function(v){var node=g.node(v);if(node.dummy==="edge-proxy"){g.edge(node.e).labelRank=node.rank;g.removeNode(v)}})}function translateGraph(g){var minX=Number.POSITIVE_INFINITY,maxX=0,minY=Number.POSITIVE_INFINITY,maxY=0,graphLabel=g.graph(),marginX=graphLabel.marginx||0,marginY=graphLabel.marginy||0;function getExtremes(attrs){var x=attrs.x,y=attrs.y,w=attrs.width,h=attrs.height;minX=Math.min(minX,x-w/2);maxX=Math.max(maxX,x+w/2);minY=Math.min(minY,y-h/2); +maxY=Math.max(maxY,y+h/2)}_.each(g.nodes(),function(v){getExtremes(g.node(v))});_.each(g.edges(),function(e){var edge=g.edge(e);if(_.has(edge,"x")){getExtremes(edge)}});minX-=marginX;minY-=marginY;_.each(g.nodes(),function(v){var node=g.node(v);node.x-=minX;node.y-=minY});_.each(g.edges(),function(e){var edge=g.edge(e);_.each(edge.points,function(p){p.x-=minX;p.y-=minY});if(_.has(edge,"x")){edge.x-=minX}if(_.has(edge,"y")){edge.y-=minY}});graphLabel.width=maxX-minX+marginX;graphLabel.height=maxY-minY+marginY}function assignNodeIntersects(g){_.each(g.edges(),function(e){var edge=g.edge(e),nodeV=g.node(e.v),nodeW=g.node(e.w),p1,p2;if(!edge.points){edge.points=[];p1=nodeW;p2=nodeV}else{p1=edge.points[0];p2=edge.points[edge.points.length-1]}edge.points.unshift(util.intersectRect(nodeV,p1));edge.points.push(util.intersectRect(nodeW,p2))})}function fixupEdgeLabelCoords(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(_.has(edge,"x")){if(edge.labelpos==="l"||edge.labelpos==="r"){edge.width-=edge.labeloffset}switch(edge.labelpos){case"l":edge.x-=edge.width/2+edge.labeloffset;break;case"r":edge.x+=edge.width/2+edge.labeloffset;break}}})}function reversePointsForReversedEdges(g){_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.reversed){edge.points.reverse()}})}function removeBorderNodes(g){_.each(g.nodes(),function(v){if(g.children(v).length){var node=g.node(v),t=g.node(node.borderTop),b=g.node(node.borderBottom),l=g.node(_.last(node.borderLeft)),r=g.node(_.last(node.borderRight));node.width=Math.abs(r.x-l.x);node.height=Math.abs(b.y-t.y);node.x=l.x+node.width/2;node.y=t.y+node.height/2}});_.each(g.nodes(),function(v){if(g.node(v).dummy==="border"){g.removeNode(v)}})}function removeSelfEdges(g){_.each(g.edges(),function(e){if(e.v===e.w){var node=g.node(e.v);if(!node.selfEdges){node.selfEdges=[]}node.selfEdges.push({e:e,label:g.edge(e)});g.removeEdge(e)}})}function insertSelfEdges(g){var layers=util.buildLayerMatrix(g);_.each(layers,function(layer){var orderShift=0;_.each(layer,function(v,i){var node=g.node(v);node.order=i+orderShift;_.each(node.selfEdges,function(selfEdge){util.addDummyNode(g,"selfedge",{width:selfEdge.label.width,height:selfEdge.label.height,rank:node.rank,order:i+ ++orderShift,e:selfEdge.e,label:selfEdge.label},"_se")});delete node.selfEdges})})}function positionSelfEdges(g){_.each(g.nodes(),function(v){var node=g.node(v);if(node.dummy==="selfedge"){var selfNode=g.node(node.e.v),x=selfNode.x+selfNode.width/2,y=selfNode.y,dx=node.x-x,dy=selfNode.height/2;g.setEdge(node.e,node.label);g.removeNode(v);node.label.points=[{x:x+2*dx/3,y:y-dy},{x:x+5*dx/6,y:y-dy},{x:x+dx,y:y},{x:x+5*dx/6,y:y+dy},{x:x+2*dx/3,y:y+dy}];node.label.x=node.x;node.label.y=node.y}})}function selectNumberAttrs(obj,attrs){return _.mapValues(_.pick(obj,attrs),Number)}function canonicalize(attrs){var newAttrs={};_.each(attrs,function(v,k){newAttrs[k.toLowerCase()]=v});return newAttrs}},{"./acyclic":28,"./add-border-segments":29,"./coordinate-system":30,"./graphlib":33,"./lodash":36,"./nesting-graph":37,"./normalize":38,"./order":43,"./parent-dummy-chains":48,"./position":50,"./rank":52,"./util":55}],36:[function(require,module,exports){module.exports=require(20)},{"/Users/cpettitt/projects/dagre-d3/lib/lodash.js":20,lodash:77}],37:[function(require,module,exports){var _=require("./lodash"),util=require("./util");module.exports={run:run,cleanup:cleanup};function run(g){var root=util.addDummyNode(g,"root",{},"_root"),depths=treeDepths(g),height=_.max(depths)-1,nodeSep=2*height+1;g.graph().nestingRoot=root;_.each(g.edges(),function(e){g.edge(e).minlen*=nodeSep});var weight=sumWeights(g)+1;_.each(g.children(),function(child){dfs(g,root,nodeSep,weight,height,depths,child)});g.graph().nodeRankFactor=nodeSep}function dfs(g,root,nodeSep,weight,height,depths,v){var children=g.children(v);if(!children.length){if(v!==root){g.setEdge(root,v,{weight:0,minlen:nodeSep})}return}var top=util.addBorderNode(g,"_bt"),bottom=util.addBorderNode(g,"_bb"),label=g.node(v);g.setParent(top,v);label.borderTop=top;g.setParent(bottom,v);label.borderBottom=bottom;_.each(children,function(child){dfs(g,root,nodeSep,weight,height,depths,child);var childNode=g.node(child),childTop=childNode.borderTop?childNode.borderTop:child,childBottom=childNode.borderBottom?childNode.borderBottom:child,thisWeight=childNode.borderTop?weight:2*weight,minlen=childTop!==childBottom?1:height-depths[v]+1;g.setEdge(top,childTop,{weight:thisWeight,minlen:minlen,nestingEdge:true});g.setEdge(childBottom,bottom,{weight:thisWeight,minlen:minlen,nestingEdge:true})});if(!g.parent(v)){g.setEdge(root,top,{weight:0,minlen:height+depths[v]})}}function treeDepths(g){var depths={};function dfs(v,depth){var children=g.children(v);if(children&&children.length){_.each(children,function(child){dfs(child,depth+1)})}depths[v]=depth}_.each(g.children(),function(v){dfs(v,1)});return depths}function sumWeights(g){return _.reduce(g.edges(),function(acc,e){return acc+g.edge(e).weight},0)}function cleanup(g){var graphLabel=g.graph();g.removeNode(graphLabel.nestingRoot);delete graphLabel.nestingRoot;_.each(g.edges(),function(e){var edge=g.edge(e);if(edge.nestingEdge){g.removeEdge(e)}})}},{"./lodash":36,"./util":55}],38:[function(require,module,exports){"use strict";var _=require("./lodash"),util=require("./util");module.exports={run:run,undo:undo};function run(g){g.graph().dummyChains=[];_.each(g.edges(),function(edge){normalizeEdge(g,edge)})}function normalizeEdge(g,e){var v=e.v,vRank=g.node(v).rank,w=e.w,wRank=g.node(w).rank,name=e.name,edgeLabel=g.edge(e),labelRank=edgeLabel.labelRank;if(wRank===vRank+1)return;g.removeEdge(e);var dummy,attrs,i;for(i=0,++vRank;vRank0){if(index%2){weightSum+=tree[index+1]}index=index-1>>1;tree[index]+=entry.weight}cc+=entry.weight*weightSum}));return cc}},{"../lodash":36}],43:[function(require,module,exports){"use strict";var _=require("../lodash"),initOrder=require("./init-order"),crossCount=require("./cross-count"),sortSubgraph=require("./sort-subgraph"),buildLayerGraph=require("./build-layer-graph"),addSubgraphConstraints=require("./add-subgraph-constraints"),Graph=require("../graphlib").Graph,util=require("../util");module.exports=order;function order(g){var maxRank=util.maxRank(g),downLayerGraphs=buildLayerGraphs(g,_.range(1,maxRank+1),"inEdges"),upLayerGraphs=buildLayerGraphs(g,_.range(maxRank-1,-1,-1),"outEdges");var layering=initOrder(g);assignOrder(g,layering);var bestCC=Number.POSITIVE_INFINITY,best;for(var i=0,lastBest=0;lastBest<4;++i,++lastBest){sweepLayerGraphs(i%2?downLayerGraphs:upLayerGraphs,i%4>=2);layering=util.buildLayerMatrix(g);var cc=crossCount(g,layering);if(cc=vEntry.barycenter){mergeEntries(vEntry,uEntry)}}}function handleOut(vEntry){return function(wEntry){wEntry.in.push(vEntry);if(--wEntry.indegree===0){sourceSet.push(wEntry)}}}while(sourceSet.length){var entry=sourceSet.pop();entries.push(entry);_.each(entry.in.reverse(),handleIn(entry));_.each(entry.out,handleOut(entry))}return _.chain(entries).filter(function(entry){return!entry.merged}).map(function(entry){return _.pick(entry,["vs","i","barycenter","weight"])}).value()}function mergeEntries(target,source){var sum=0,weight=0;if(target.weight){sum+=target.barycenter*target.weight;weight+=target.weight}if(source.weight){sum+=source.barycenter*source.weight;weight+=source.weight}target.vs=source.vs.concat(target.vs);target.barycenter=sum/weight;target.weight=weight;target.i=Math.min(source.i,target.i);source.merged=true}},{"../lodash":36}],46:[function(require,module,exports){var _=require("../lodash"),barycenter=require("./barycenter"),resolveConflicts=require("./resolve-conflicts"),sort=require("./sort");module.exports=sortSubgraph;function sortSubgraph(g,v,cg,biasRight){var movable=g.children(v),node=g.node(v),bl=node?node.borderLeft:undefined,br=node?node.borderRight:undefined,subgraphs={};if(bl){movable=_.filter(movable,function(w){return w!==bl&&w!==br})}var barycenters=barycenter(g,movable);_.each(barycenters,function(entry){if(g.children(entry.v).length){var subgraphResult=sortSubgraph(g,entry.v,cg,biasRight);subgraphs[entry.v]=subgraphResult;if(_.has(subgraphResult,"barycenter")){mergeBarycenters(entry,subgraphResult)}}});var entries=resolveConflicts(barycenters,cg);expandSubgraphs(entries,subgraphs);var result=sort(entries,biasRight);if(bl){result.vs=_.flatten([bl,result.vs,br],true);if(g.predecessors(bl).length){var blPred=g.node(g.predecessors(bl)[0]),brPred=g.node(g.predecessors(br)[0]);if(!_.has(result,"barycenter")){result.barycenter=0;result.weight=0}result.barycenter=(result.barycenter*result.weight+blPred.order+brPred.order)/(result.weight+2);result.weight+=2}}return result}function expandSubgraphs(entries,subgraphs){_.each(entries,function(entry){entry.vs=_.flatten(entry.vs.map(function(v){if(subgraphs[v]){return subgraphs[v].vs}return v}),true)})}function mergeBarycenters(target,other){if(!_.isUndefined(target.barycenter)){target.barycenter=(target.barycenter*target.weight+other.barycenter*other.weight)/(target.weight+other.weight);target.weight+=other.weight}else{target.barycenter=other.barycenter;target.weight=other.weight}}},{"../lodash":36,"./barycenter":40,"./resolve-conflicts":45,"./sort":47}],47:[function(require,module,exports){var _=require("../lodash"),util=require("../util");module.exports=sort;function sort(entries,biasRight){var parts=util.partition(entries,function(entry){return _.has(entry,"barycenter")});var sortable=parts.lhs,unsortable=_.sortBy(parts.rhs,function(entry){return-entry.i}),vs=[],sum=0,weight=0,vsIndex=0;sortable.sort(compareWithBias(!!biasRight));vsIndex=consumeUnsortable(vs,unsortable,vsIndex);_.each(sortable,function(entry){vsIndex+=entry.vs.length;vs.push(entry.vs);sum+=entry.barycenter*entry.weight;weight+=entry.weight;vsIndex=consumeUnsortable(vs,unsortable,vsIndex)});var result={vs:_.flatten(vs,true)};if(weight){result.barycenter=sum/weight;result.weight=weight}return result}function consumeUnsortable(vs,unsortable,index){var last;while(unsortable.length&&(last=_.last(unsortable)).i<=index){unsortable.pop();vs.push(last.vs);index++}return index}function compareWithBias(bias){return function(entryV,entryW){if(entryV.barycenterentryW.barycenter){return 1}return!bias?entryV.i-entryW.i:entryW.i-entryV.i}}},{"../lodash":36,"../util":55}],48:[function(require,module,exports){var _=require("./lodash");module.exports=parentDummyChains;function parentDummyChains(g){var postorderNums=postorder(g);_.each(g.graph().dummyChains,function(v){var node=g.node(v),edgeObj=node.edgeObj,pathData=findPath(g,postorderNums,edgeObj.v,edgeObj.w),path=pathData.path,lca=pathData.lca,pathIdx=0,pathV=path[pathIdx],ascending=true;while(v!==edgeObj.w){node=g.node(v);if(ascending){while((pathV=path[pathIdx])!==lca&&g.node(pathV).maxRanklow||lim>postorderNums[parent].lim));lca=parent;parent=w;while((parent=g.parent(parent))!==lca){wPath.push(parent)}return{path:vPath.concat(wPath.reverse()),lca:lca}}function postorder(g){var result={},lim=0;function dfs(v){var low=lim;_.each(g.children(v),dfs);result[v]={low:low,lim:lim++}}_.each(g.children(),dfs);return result}},{"./lodash":36}],49:[function(require,module,exports){"use strict";var _=require("../lodash"),util=require("../util");module.exports={positionX:positionX,findType1Conflicts:findType1Conflicts,findType2Conflicts:findType2Conflicts,addConflict:addConflict,hasConflict:hasConflict,verticalAlignment:verticalAlignment,horizontalCompaction:horizontalCompaction,alignCoordinates:alignCoordinates,findSmallestWidthAlignment:findSmallestWidthAlignment,balance:balance};function findType1Conflicts(g,layering){var conflicts={};function visitLayer(prevLayer,layer){var k0=0,scanPos=0,prevLayerLength=prevLayer.length,lastNode=_.last(layer);_.each(layer,function(v,i){var w=findOtherInnerSegmentNode(g,v),k1=w?g.node(w).order:prevLayerLength;if(w||v===lastNode){_.each(layer.slice(scanPos,i+1),function(scanNode){_.each(g.predecessors(scanNode),function(u){var uLabel=g.node(u),uPos=uLabel.order;if((uPosnextNorthBorder)){addConflict(conflicts,u,v)}})}})}function visitLayer(north,south){var prevNorthPos=-1,nextNorthPos,southPos=0;_.each(south,function(v,southLookahead){if(g.node(v).dummy==="border"){var predecessors=g.predecessors(v);if(predecessors.length){nextNorthPos=g.node(predecessors[0]).order;scan(south,southPos,southLookahead,prevNorthPos,nextNorthPos);southPos=southLookahead;prevNorthPos=nextNorthPos}}scan(south,southPos,south.length,nextNorthPos,north.length)});return south}_.reduce(layering,visitLayer);return conflicts}function findOtherInnerSegmentNode(g,v){if(g.node(v).dummy){return _.find(g.predecessors(v),function(u){return g.node(u).dummy})}}function addConflict(conflicts,v,w){if(v>w){var tmp=v;v=w;w=tmp}var conflictsV=conflicts[v];if(!conflictsV){conflicts[v]=conflictsV={}}conflictsV[w]=true}function hasConflict(conflicts,v,w){if(v>w){var tmp=v;v=w;w=tmp}return _.has(conflicts[v],w)}function verticalAlignment(g,layering,conflicts,neighborFn){var root={},align={},pos={};_.each(layering,function(layer){_.each(layer,function(v,order){root[v]=v;align[v]=v;pos[v]=order})});_.each(layering,function(layer){var prevIdx=-1;_.each(layer,function(v){var ws=neighborFn(v);if(ws.length){ws=_.sortBy(ws,function(w){return pos[w]});var mp=(ws.length-1)/2;for(var i=Math.floor(mp),il=Math.ceil(mp);i<=il;++i){var w=ws[i];if(align[v]===v&&prevIdxwLabel.lim){tailLabel=wLabel;flip=true}var candidates=_.filter(g.edges(),function(edge){return flip===isDescendant(t,t.node(edge.v),tailLabel)&&flip!==isDescendant(t,t.node(edge.w),tailLabel)});return _.min(candidates,function(edge){return slack(g,edge)})}function exchangeEdges(t,g,e,f){var v=e.v,w=e.w;t.removeEdge(v,w);t.setEdge(f.v,f.w,{});initLowLimValues(t);initCutValues(t,g);updateRanks(t,g)}function updateRanks(t,g){var root=_.find(t.nodes(),function(v){return!g.node(v).parent}),vs=preorder(t,root);vs=vs.slice(1);_.each(vs,function(v){var parent=t.node(v).parent,edge=g.edge(v,parent),flipped=false;if(!edge){edge=g.edge(parent,v);flipped=true}g.node(v).rank=g.node(parent).rank+(flipped?edge.minlen:-edge.minlen)})}function isTreeEdge(tree,u,v){return tree.hasEdge(u,v)}function isDescendant(tree,vLabel,rootLabel){return rootLabel.low<=vLabel.lim&&vLabel.lim<=rootLabel.lim}},{"../graphlib":33,"../lodash":36,"../util":55,"./feasible-tree":51,"./util":54}],54:[function(require,module,exports){"use strict";var _=require("../lodash");module.exports={longestPath:longestPath,slack:slack};function longestPath(g){var visited={};function dfs(v){var label=g.node(v);if(_.has(visited,v)){return label.rank}visited[v]=true;var rank=_.min(_.map(g.outEdges(v),function(e){return dfs(e.w)-g.edge(e).minlen}));if(rank===Number.POSITIVE_INFINITY){rank=0}return label.rank=rank}_.each(g.sources(),dfs)}function slack(g,e){return g.node(e.w).rank-g.node(e.v).rank-g.edge(e).minlen}},{"../lodash":36}],55:[function(require,module,exports){"use strict";var _=require("./lodash"),Graph=require("./graphlib").Graph;module.exports={addDummyNode:addDummyNode,simplify:simplify,asNonCompoundGraph:asNonCompoundGraph,successorWeights:successorWeights,predecessorWeights:predecessorWeights,intersectRect:intersectRect,buildLayerMatrix:buildLayerMatrix,normalizeRanks:normalizeRanks,removeEmptyRanks:removeEmptyRanks,addBorderNode:addBorderNode,maxRank:maxRank,partition:partition,time:time,notime:notime};function addDummyNode(g,type,attrs,name){var v;do{v=_.uniqueId(name)}while(g.hasNode(v));attrs.dummy=type;g.setNode(v,attrs);return v}function simplify(g){var simplified=(new Graph).setGraph(g.graph());_.each(g.nodes(),function(v){simplified.setNode(v,g.node(v))});_.each(g.edges(),function(e){var simpleLabel=simplified.edge(e.v,e.w)||{weight:0,minlen:1},label=g.edge(e);simplified.setEdge(e.v,e.w,{weight:simpleLabel.weight+label.weight,minlen:Math.max(simpleLabel.minlen,label.minlen)})});return simplified}function asNonCompoundGraph(g){var simplified=new Graph({multigraph:g.isMultigraph()}).setGraph(g.graph());_.each(g.nodes(),function(v){if(!g.children(v).length){simplified.setNode(v,g.node(v))}});_.each(g.edges(),function(e){simplified.setEdge(e,g.edge(e))});return simplified}function successorWeights(g){var weightMap=_.map(g.nodes(),function(v){var sucs={};_.each(g.outEdges(v),function(e){sucs[e.w]=(sucs[e.w]||0)+g.edge(e).weight});return sucs});return _.zipObject(g.nodes(),weightMap)}function predecessorWeights(g){var weightMap=_.map(g.nodes(),function(v){var preds={};_.each(g.inEdges(v),function(e){preds[e.v]=(preds[e.v]||0)+g.edge(e).weight});return preds});return _.zipObject(g.nodes(),weightMap)}function intersectRect(rect,point){var x=rect.x;var y=rect.y;var dx=point.x-x;var dy=point.y-y;var w=rect.width/2;var h=rect.height/2;if(!dx&&!dy){throw new Error("Not possible to find intersection inside of the rectangle")}var sx,sy;if(Math.abs(dy)*w>Math.abs(dx)*h){if(dy<0){h=-h}sx=h*dx/dy;sy=h}else{if(dx<0){w=-w}sx=w;sy=w*dy/dx}return{x:x+sx,y:y+sy}}function buildLayerMatrix(g){var layering=_.map(_.range(maxRank(g)+1),function(){return[]});_.each(g.nodes(),function(v){var node=g.node(v),rank=node.rank;if(!_.isUndefined(rank)){layering[rank][node.order]=v}});return layering}function normalizeRanks(g){var min=_.min(_.map(g.nodes(),function(v){return g.node(v).rank +}));_.each(g.nodes(),function(v){var node=g.node(v);if(_.has(node,"rank")){node.rank-=min}})}function removeEmptyRanks(g){var offset=_.min(_.map(g.nodes(),function(v){return g.node(v).rank}));var layers=[];_.each(g.nodes(),function(v){var rank=g.node(v).rank-offset;if(!_.has(layers,rank)){layers[rank]=[]}layers[rank].push(v)});var delta=0,nodeRankFactor=g.graph().nodeRankFactor;_.each(layers,function(vs,i){if(_.isUndefined(vs)&&i%nodeRankFactor!==0){--delta}else if(delta){_.each(vs,function(v){g.node(v).rank+=delta})}})}function addBorderNode(g,prefix,rank,order){var node={width:0,height:0};if(arguments.length>=4){node.rank=rank;node.order=order}return addDummyNode(g,"border",node,prefix)}function maxRank(g){return _.max(_.map(g.nodes(),function(v){var rank=g.node(v).rank;if(!_.isUndefined(rank)){return rank}}))}function partition(collection,fn){var result={lhs:[],rhs:[]};_.each(collection,function(value){if(fn(value)){result.lhs.push(value)}else{result.rhs.push(value)}});return result}function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+" time: "+(_.now()-start)+"ms")}}function notime(name,fn){return fn()}},{"./graphlib":33,"./lodash":36}],56:[function(require,module,exports){module.exports="0.6.3"},{}],57:[function(require,module,exports){var lib=require("./lib");module.exports={Graph:lib.Graph,json:require("./lib/json"),alg:require("./lib/alg"),version:lib.version}},{"./lib":73,"./lib/alg":64,"./lib/json":74}],58:[function(require,module,exports){var _=require("../lodash");module.exports=components;function components(g){var visited={},cmpts=[],cmpt;function dfs(v){if(_.has(visited,v))return;visited[v]=true;cmpt.push(v);_.each(g.successors(v),dfs);_.each(g.predecessors(v),dfs)}_.each(g.nodes(),function(v){cmpt=[];dfs(v);if(cmpt.length){cmpts.push(cmpt)}});return cmpts}},{"../lodash":75}],59:[function(require,module,exports){var _=require("../lodash");module.exports=dfs;function dfs(g,vs,order){if(!_.isArray(vs)){vs=[vs]}var acc=[],visited={};_.each(vs,function(v){if(!g.hasNode(v)){throw new Error("Graph does not have node: "+v)}doDfs(g,v,order==="post",visited,acc)});return acc}function doDfs(g,v,postorder,visited,acc){if(!_.has(visited,v)){visited[v]=true;if(!postorder){acc.push(v)}_.each(g.neighbors(v),function(w){doDfs(g,w,postorder,visited,acc)});if(postorder){acc.push(v)}}}},{"../lodash":75}],60:[function(require,module,exports){var dijkstra=require("./dijkstra"),_=require("../lodash");module.exports=dijkstraAll;function dijkstraAll(g,weightFunc,edgeFunc){return _.transform(g.nodes(),function(acc,v){acc[v]=dijkstra(g,v,weightFunc,edgeFunc)},{})}},{"../lodash":75,"./dijkstra":61}],61:[function(require,module,exports){var _=require("../lodash"),PriorityQueue=require("../data/priority-queue");module.exports=dijkstra;var DEFAULT_WEIGHT_FUNC=_.constant(1);function dijkstra(g,source,weightFn,edgeFn){return runDijkstra(g,String(source),weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runDijkstra(g,source,weightFn,edgeFn){var results={},pq=new PriorityQueue,v,vEntry;var updateNeighbors=function(edge){var w=edge.v!==v?edge.v:edge.w,wEntry=results[w],weight=weightFn(edge),distance=vEntry.distance+weight;if(weight<0){throw new Error("dijkstra does not allow negative edge weights. "+"Bad edge: "+edge+" Weight: "+weight)}if(distance0){v=pq.removeMin();vEntry=results[v];if(vEntry.distance===Number.POSITIVE_INFINITY){break}edgeFn(v).forEach(updateNeighbors)}return results}},{"../data/priority-queue":71,"../lodash":75}],62:[function(require,module,exports){var _=require("../lodash"),tarjan=require("./tarjan");module.exports=findCycles;function findCycles(g){return _.filter(tarjan(g),function(cmpt){return cmpt.length>1})}},{"../lodash":75,"./tarjan":69}],63:[function(require,module,exports){var _=require("../lodash");module.exports=floydWarshall;var DEFAULT_WEIGHT_FUNC=_.constant(1);function floydWarshall(g,weightFn,edgeFn){return runFloydWarshall(g,weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runFloydWarshall(g,weightFn,edgeFn){var results={},nodes=g.nodes();nodes.forEach(function(v){results[v]={};results[v][v]={distance:0};nodes.forEach(function(w){if(v!==w){results[v][w]={distance:Number.POSITIVE_INFINITY}}});edgeFn(v).forEach(function(edge){var w=edge.v===v?edge.w:edge.v,d=weightFn(edge);results[v][w]={distance:d,predecessor:v}})});nodes.forEach(function(k){var rowK=results[k];nodes.forEach(function(i){var rowI=results[i];nodes.forEach(function(j){var ik=rowI[k];var kj=rowK[j];var ij=rowI[j];var altDistance=ik.distance+kj.distance;if(altDistance0){v=pq.removeMin();if(_.has(parents,v)){result.setEdge(v,parents[v])}else if(init){throw new Error("Input graph is not connected: "+g)}else{init=true}g.nodeEdges(v).forEach(updateNeighbors)}return result}},{"../data/priority-queue":71,"../graph":72,"../lodash":75}],69:[function(require,module,exports){var _=require("../lodash");module.exports=tarjan;function tarjan(g){var index=0,stack=[],visited={},results=[];function dfs(v){var entry=visited[v]={onStack:true,lowlink:index,index:index++};stack.push(v);g.successors(v).forEach(function(w){if(!_.has(visited,w)){dfs(w);entry.lowlink=Math.min(entry.lowlink,visited[w].lowlink)}else if(visited[w].onStack){entry.lowlink=Math.min(entry.lowlink,visited[w].index)}});if(entry.lowlink===entry.index){var cmpt=[],w;do{w=stack.pop();visited[w].onStack=false;cmpt.push(w)}while(v!==w);results.push(cmpt)}}g.nodes().forEach(function(v){if(!_.has(visited,v)){dfs(v)}});return results}},{"../lodash":75}],70:[function(require,module,exports){var _=require("../lodash");module.exports=topsort;topsort.CycleException=CycleException;function topsort(g){var visited={},stack={},results=[];function visit(node){if(_.has(stack,node)){throw new CycleException}if(!_.has(visited,node)){stack[node]=true;visited[node]=true;_.each(g.predecessors(node),visit);delete stack[node];results.push(node)}}_.each(g.sinks(),visit);if(_.size(visited)!==g.nodeCount()){throw new CycleException}return results}function CycleException(){}},{"../lodash":75}],71:[function(require,module,exports){var _=require("../lodash");module.exports=PriorityQueue;function PriorityQueue(){this._arr=[];this._keyIndices={}}PriorityQueue.prototype.size=function(){return this._arr.length};PriorityQueue.prototype.keys=function(){return this._arr.map(function(x){return x.key})};PriorityQueue.prototype.has=function(key){return _.has(this._keyIndices,key)};PriorityQueue.prototype.priority=function(key){var index=this._keyIndices[key];if(index!==undefined){return this._arr[index].priority}};PriorityQueue.prototype.min=function(){if(this.size()===0){throw new Error("Queue underflow")}return this._arr[0].key};PriorityQueue.prototype.add=function(key,priority){var keyIndices=this._keyIndices;key=String(key);if(!_.has(keyIndices,key)){var arr=this._arr;var index=arr.length;keyIndices[key]=index;arr.push({key:key,priority:priority});this._decrease(index);return true}return false};PriorityQueue.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var min=this._arr.pop();delete this._keyIndices[min.key];this._heapify(0);return min.key};PriorityQueue.prototype.decrease=function(key,priority){var index=this._keyIndices[key];if(priority>this._arr[index].priority){throw new Error("New priority is greater than current priority. "+"Key: "+key+" Old: "+this._arr[index].priority+" New: "+priority)}this._arr[index].priority=priority;this._decrease(index)};PriorityQueue.prototype._heapify=function(i){var arr=this._arr;var l=2*i,r=l+1,largest=i;if(l>1;if(arr[parent].priority1){this.setNode(v,value)}else{this.setNode(v)}},this);return this};Graph.prototype.setNode=function(v,value){if(_.has(this._nodes,v)){if(arguments.length>1){this._nodes[v]=value}return this}this._nodes[v]=arguments.length>1?value:this._defaultNodeLabelFn(v);if(this._isCompound){this._parent[v]=GRAPH_NODE;this._children[v]={};this._children[GRAPH_NODE][v]=true}this._in[v]={};this._preds[v]={};this._out[v]={};this._sucs[v]={};++this._nodeCount;return this};Graph.prototype.node=function(v){return this._nodes[v]};Graph.prototype.hasNode=function(v){return _.has(this._nodes,v)};Graph.prototype.removeNode=function(v){var self=this;if(_.has(this._nodes,v)){var removeEdge=function(e){self.removeEdge(self._edgeObjs[e])};delete this._nodes[v];if(this._isCompound){this._removeFromParentsChildList(v);delete this._parent[v];_.each(this.children(v),function(child){this.setParent(child)},this);delete this._children[v]}_.each(_.keys(this._in[v]),removeEdge);delete this._in[v];delete this._preds[v];_.each(_.keys(this._out[v]),removeEdge);delete this._out[v];delete this._sucs[v];--this._nodeCount}return this};Graph.prototype.setParent=function(v,parent){if(!this._isCompound){throw new Error("Cannot set parent in a non-compound graph")}if(_.isUndefined(parent)){parent=GRAPH_NODE}else{for(var ancestor=parent;!_.isUndefined(ancestor);ancestor=this.parent(ancestor)){if(ancestor===v){throw new Error("Setting "+parent+" as parent of "+v+" would create create a cycle")}}this.setNode(parent)}this.setNode(v);this._removeFromParentsChildList(v);this._parent[v]=parent;this._children[parent][v]=true;return this};Graph.prototype._removeFromParentsChildList=function(v){delete this._children[this._parent[v]][v]};Graph.prototype.parent=function(v){if(this._isCompound){var parent=this._parent[v];if(parent!==GRAPH_NODE){return parent}}};Graph.prototype.children=function(v){if(_.isUndefined(v)){v=GRAPH_NODE}if(this._isCompound){var children=this._children[v];if(children){return _.keys(children)}}else if(v===GRAPH_NODE){return this.nodes()}else if(this.hasNode(v)){return[]}};Graph.prototype.predecessors=function(v){var predsV=this._preds[v];if(predsV){return _.keys(predsV)}};Graph.prototype.successors=function(v){var sucsV=this._sucs[v];if(sucsV){return _.keys(sucsV)}};Graph.prototype.neighbors=function(v){var preds=this.predecessors(v);if(preds){return _.union(preds,this.successors(v))}};Graph.prototype.setDefaultEdgeLabel=function(newDefault){if(!_.isFunction(newDefault)){newDefault=_.constant(newDefault)}this._defaultEdgeLabelFn=newDefault;return this};Graph.prototype.edgeCount=function(){return this._edgeCount};Graph.prototype.edges=function(){return _.values(this._edgeObjs)};Graph.prototype.setPath=function(vs,value){var self=this,args=arguments;_.reduce(vs,function(v,w){if(args.length>1){self.setEdge(v,w,value)}else{self.setEdge(v,w)}return w});return this};Graph.prototype.setEdge=function(){var v,w,name,value,valueSpecified=false;if(_.isPlainObject(arguments[0])){v=arguments[0].v;w=arguments[0].w;name=arguments[0].name;if(arguments.length===2){value=arguments[1];valueSpecified=true}}else{v=arguments[0];w=arguments[1];name=arguments[3];if(arguments.length>2){value=arguments[2];valueSpecified=true}}v=""+v;w=""+w;if(!_.isUndefined(name)){name=""+name}var e=edgeArgsToId(this._isDirected,v,w,name);if(_.has(this._edgeLabels,e)){if(valueSpecified){this._edgeLabels[e]=value}return this}if(!_.isUndefined(name)&&!this._isMultigraph){throw new Error("Cannot set a named edge when isMultigraph = false")}this.setNode(v);this.setNode(w);this._edgeLabels[e]=valueSpecified?value:this._defaultEdgeLabelFn(v,w,name);var edgeObj=edgeArgsToObj(this._isDirected,v,w,name);v=edgeObj.v;w=edgeObj.w;Object.freeze(edgeObj);this._edgeObjs[e]=edgeObj;incrementOrInitEntry(this._preds[w],v);incrementOrInitEntry(this._sucs[v],w);this._in[w][e]=edgeObj;this._out[v][e]=edgeObj;this._edgeCount++;return this};Graph.prototype.edge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return this._edgeLabels[e]};Graph.prototype.hasEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return _.has(this._edgeLabels,e)};Graph.prototype.removeEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name),edge=this._edgeObjs[e];if(edge){v=edge.v;w=edge.w;delete this._edgeLabels[e];delete this._edgeObjs[e];decrementOrRemoveEntry(this._preds[w],v);decrementOrRemoveEntry(this._sucs[v],w);delete this._in[w][e];delete this._out[v][e];this._edgeCount--}return this};Graph.prototype.inEdges=function(v,u){var inV=this._in[v];if(inV){var edges=_.values(inV);if(!u){return edges}return _.filter(edges,function(edge){return edge.v===u})}};Graph.prototype.outEdges=function(v,w){var outV=this._out[v];if(outV){var edges=_.values(outV);if(!w){return edges}return _.filter(edges,function(edge){return edge.w===w})}};Graph.prototype.nodeEdges=function(v,w){var inEdges=this.inEdges(v,w);if(inEdges){return inEdges.concat(this.outEdges(v,w))}};function incrementOrInitEntry(map,k){if(_.has(map,k)){map[k]++}else{map[k]=1}}function decrementOrRemoveEntry(map,k){if(!--map[k]){delete map[k]}}function edgeArgsToId(isDirected,v,w,name){if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}return v+EDGE_KEY_DELIM+w+EDGE_KEY_DELIM+(_.isUndefined(name)?DEFAULT_EDGE_NAME:name)}function edgeArgsToObj(isDirected,v,w,name){if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}var edgeObj={v:v,w:w};if(name){edgeObj.name=name}return edgeObj}function edgeObjToId(isDirected,edgeObj){return edgeArgsToId(isDirected,edgeObj.v,edgeObj.w,edgeObj.name)}},{"./lodash":75}],73:[function(require,module,exports){module.exports={Graph:require("./graph"),version:require("./version")}},{"./graph":72,"./version":76}],74:[function(require,module,exports){var _=require("./lodash"),Graph=require("./graph");module.exports={write:write,read:read};function write(g){var json={options:{directed:g.isDirected(),multigraph:g.isMultigraph(),compound:g.isCompound()},nodes:writeNodes(g),edges:writeEdges(g)};if(!_.isUndefined(g.graph())){json.value=_.clone(g.graph())}return json}function writeNodes(g){return _.map(g.nodes(),function(v){var nodeValue=g.node(v),parent=g.parent(v),node={v:v};if(!_.isUndefined(nodeValue)){node.value=nodeValue}if(!_.isUndefined(parent)){node.parent=parent}return node})}function writeEdges(g){return _.map(g.edges(),function(e){var edgeValue=g.edge(e),edge={v:e.v,w:e.w};if(!_.isUndefined(e.name)){edge.name=e.name}if(!_.isUndefined(edgeValue)){edge.value=edgeValue}return edge})}function read(json){var g=new Graph(json.options).setGraph(json.value);_.each(json.nodes,function(entry){g.setNode(entry.v,entry.value);if(entry.parent){g.setParent(entry.v,entry.parent)}});_.each(json.edges,function(entry){g.setEdge({v:entry.v,w:entry.w,name:entry.name},entry.value)});return g}},{"./graph":72,"./lodash":75}],75:[function(require,module,exports){module.exports=require(20)},{"/Users/cpettitt/projects/dagre-d3/lib/lodash.js":20,lodash:77}],76:[function(require,module,exports){module.exports="1.0.1"},{}],77:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ᠎              ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++indexother||typeof value=="undefined"){return 1}if(value/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++indexresult){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index>>1;callback(array[mid])1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments) +};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++indext?-1:t>e?1:t>=e?0:0/0}function n(t){return null===t?0/0:+t}function r(t){return!isNaN(t)}function i(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var u=r+i>>>1;t(e[u],n)<0?r=u+1:i=u}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var u=r+i>>>1;t(e[u],n)>0?i=u:r=u+1}return r}}}function u(t){return t.length}function a(t){for(var e=1;t*e%1;)e*=10;return e}function o(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function s(){this._=Object.create(null)}function c(t){return(t+="")===lo||t[0]===fo?fo+t:t}function l(t){return(t+="")[0]===fo?t.slice(1):t}function f(t){return c(t)in this._}function h(t){return(t=c(t))in this._&&delete this._[t]}function p(){var t=[];for(var e in this._)t.push(l(e));return t}function d(){var t=0;for(var e in this._)++t;return t}function g(){for(var t in this._)return!1;return!0}function y(){this._=Object.create(null)}function m(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function v(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=ho.length;r>n;++n){var i=ho[n]+e;if(i in t)return i}}function b(){}function x(){}function w(t){function e(){for(var e,r=n,i=-1,u=r.length;++in;n++)for(var i,u=t[n],a=0,o=u.length;o>a;a++)(i=u[a])&&e(i,a,n);return t}function U(t){return go(t,Ao),t}function V(t){var e,n;return function(r,i,u){var a,o=t[u].update,s=o.length;for(u!=n&&(n=u,e=0),i>=e&&(e=i+1);!(a=o[e])&&++e0&&(t=t.slice(0,o));var c=Eo.get(t);return c&&(t=c,s=G),o?e?i:r:e?b:u}function $(t,e){return function(n){var r=Za.event;Za.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{Za.event=r}}}function G(t,e){var n=$(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function Y(){var t=".dragsuppress-"+ ++Do,e="click"+t,n=Za.select(to).on("touchmove"+t,A).on("dragstart"+t,A).on("selectstart"+t,A);if(ko){var r=Qa.style,i=r[ko];r[ko]="none"}return function(u){function a(){n.on(e,null)}n.on(t,null),ko&&(r[ko]=i),u&&(n.on(e,function(){A(),a()},!0),setTimeout(a,0))}}function W(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();if(0>Co&&(to.scrollX||to.scrollY)){n=Za.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var i=n[0][0].getScreenCTM();Co=!(i.f||i.e),n.remove()}return Co?(r.x=e.pageX,r.y=e.pageY):(r.x=e.clientX,r.y=e.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var u=t.getBoundingClientRect();return[e.clientX-u.left-t.clientLeft,e.clientY-u.top-t.clientTop]}function Z(){return Za.event.changedTouches[0].identifier}function X(){return Za.event.target}function K(){return to}function J(t){return t>0?1:0>t?-1:0}function Q(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function te(t){return t>1?0:-1>t?Mo:Math.acos(t)}function ee(t){return t>1?Fo:-1>t?-Fo:Math.asin(t)}function ne(t){return((t=Math.exp(t))-1/t)/2}function re(t){return((t=Math.exp(t))+1/t)/2}function ie(t){return((t=Math.exp(2*t))-1)/(t+1)}function ue(t){return(t=Math.sin(t/2))*t}function ae(){}function oe(t,e,n){return this instanceof oe?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof oe?new oe(t.h,t.s,t.l):we(""+t,Ae,oe):new oe(t,e,n)}function se(t,e,n){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?u+(a-u)*t/60:180>t?a:240>t?u+(a-u)*(240-t)/60:u}function i(t){return Math.round(255*r(t))}var u,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,a=.5>=n?n*(1+e):n+e-n*e,u=2*n-a,new me(i(t+120),i(t),i(t-120))}function ce(t,e,n){return this instanceof ce?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof ce?new ce(t.h,t.c,t.l):t instanceof fe?pe(t.l,t.a,t.b):pe((t=_e((t=Za.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ce(t,e,n)}function le(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new fe(n,Math.cos(t*=Lo)*e,Math.sin(t)*e)}function fe(t,e,n){return this instanceof fe?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof fe?new fe(t.l,t.a,t.b):t instanceof ce?le(t.h,t.c,t.l):_e((t=me(t)).r,t.g,t.b):new fe(t,e,n)}function he(t,e,n){var r=(t+16)/116,i=r+e/500,u=r-n/200;return i=de(i)*Ho,r=de(r)*$o,u=de(u)*Go,new me(ye(3.2404542*i-1.5371385*r-.4985314*u),ye(-.969266*i+1.8760108*r+.041556*u),ye(.0556434*i-.2040259*r+1.0572252*u))}function pe(t,e,n){return t>0?new ce(Math.atan2(n,e)*No,Math.sqrt(e*e+n*n),t):new ce(0/0,0/0,t)}function de(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ge(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ye(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function me(t,e,n){return this instanceof me?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof me?new me(t.r,t.g,t.b):we(""+t,me,se):new me(t,e,n)}function ve(t){return new me(t>>16,t>>8&255,255&t)}function be(t){return ve(t)+""}function xe(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function we(t,e,n){var r,i,u,a=0,o=0,s=0;if(r=/([a-z]+)\((.*)\)/i.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(ke(i[0]),ke(i[1]),ke(i[2]))}return(u=Zo.get(t))?e(u.r,u.g,u.b):(null==t||"#"!==t.charAt(0)||isNaN(u=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&u)>>4,a=a>>4|a,o=240&u,o=o>>4|o,s=15&u,s=s<<4|s):7===t.length&&(a=(16711680&u)>>16,o=(65280&u)>>8,s=255&u)),e(a,o,s))}function Ae(t,e,n){var r,i,u=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),o=a-u,s=(a+u)/2;return o?(i=.5>s?o/(a+u):o/(2-a-u),r=t==a?(e-n)/o+(n>e?6:0):e==a?(n-t)/o+2:(t-e)/o+4,r*=60):(r=0/0,i=s>0&&1>s?0:r),new oe(r,i,s)}function _e(t,e,n){t=Ee(t),e=Ee(e),n=Ee(n);var r=ge((.4124564*t+.3575761*e+.1804375*n)/Ho),i=ge((.2126729*t+.7151522*e+.072175*n)/$o),u=ge((.0193339*t+.119192*e+.9503041*n)/Go);return fe(116*i-16,500*(r-i),200*(i-u))}function Ee(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ke(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function De(t){return"function"==typeof t?t:function(){return t}}function Ce(t){return t}function Me(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),Se(e,n,t,r)}}function Se(t,e,n,r){function i(){var t,e=s.status;if(!e&&Te(s)||e>=200&&300>e||304===e){try{t=n.call(u,s)}catch(r){return void a.error.call(u,r)}a.load.call(u,t)}else a.error.call(u,s)}var u={},a=Za.dispatch("beforesend","progress","load","error"),o={},s=new XMLHttpRequest,c=null;return!to.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=i:s.onreadystatechange=function(){s.readyState>3&&i()},s.onprogress=function(t){var e=Za.event;Za.event=t;try{a.progress.call(u,s)}finally{Za.event=e}},u.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?o[t]:(null==e?delete o[t]:o[t]=e+"",u)},u.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",u):e},u.responseType=function(t){return arguments.length?(c=t,u):c},u.response=function(t){return n=t,u},["get","post"].forEach(function(t){u[t]=function(){return u.send.apply(u,[t].concat(Ka(arguments)))}}),u.send=function(n,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),s.open(n,t,!0),null==e||"accept"in o||(o.accept=e+",*/*"),s.setRequestHeader)for(var l in o)s.setRequestHeader(l,o[l]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=i&&u.on("error",i).on("load",function(t){i(null,t)}),a.beforesend.call(u,s),s.send(null==r?null:r),u},u.abort=function(){return s.abort(),u},Za.rebind(u,a,"on"),null==r?u:u.get(Fe(r))}function Fe(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Te(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Be(){var t=Le(),e=Ne()-t;e>24?(isFinite(e)&&(clearTimeout(Qo),Qo=setTimeout(Be,e)),Jo=0):(Jo=1,es(Be))}function Le(){var t=Date.now();for(ts=Xo;ts;)t>=ts.t&&(ts.f=ts.c(t-ts.t)),ts=ts.n;return t}function Ne(){for(var t,e=Xo,n=1/0;e;)e.f?e=t?t.n=e.n:Xo=e.n:(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Oe(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,u=r&&n?function(t,e){for(var i=t.length,u=[],a=0,o=r[0],s=0;i>0&&o>0&&(s+o+1>e&&(o=Math.max(1,e-s)),u.push(t.substring(i-=o,i+o)),!((s+=o+1)>e));)o=r[a=(a+1)%r.length];return u.reverse().join(n)}:Ce;return function(t){var n=rs.exec(t),r=n[1]||" ",a=n[2]||">",o=n[3]||"-",s=n[4]||"",c=n[5],l=+n[6],f=n[7],h=n[8],p=n[9],d=1,g="",y="",m=!1,v=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===a)&&(c=r="0",a="="),p){case"n":f=!0,p="g";break;case"%":d=100,y="%",p="f";break;case"p":d=100,y="%",p="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+p.toLowerCase());case"c":v=!1;case"d":m=!0,h=0;break;case"s":d=-1,p="r"}"$"===s&&(g=i[0],y=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):("e"==p||"f"==p)&&(h=Math.max(0,Math.min(20,h)))),p=is.get(p)||Ie;var b=c&&f;return function(t){var n=y;if(m&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===o?"":o;if(0>d){var s=Za.formatPrefix(t,h);t=s.scale(t),n=s.symbol+y}else t*=d;t=p(t,h);var x,w,A=t.lastIndexOf(".");if(0>A){var _=v?t.lastIndexOf("e"):-1;0>_?(x=t,w=""):(x=t.substring(0,_),w=t.substring(_))}else x=t.substring(0,A),w=e+t.substring(A+1);!c&&f&&(x=u(x,1/0));var E=g.length+x.length+w.length+(b?0:i.length),k=l>E?new Array(E=l-E+1).join(r):"";return b&&(x=u(k+x,k.length?l-w.length:1/0)),i+=g,t=x+w,("<"===a?i+t+k:">"===a?k+i+t:"^"===a?k.substring(0,E>>=1)+i+t+k.substring(E):i+(b?t:k+t))+n}}}function Ie(t){return t+""}function Pe(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function je(t,e,n){function r(e){var n=t(e),r=u(n,1);return r-e>e-n?n:r}function i(n){return e(n=t(new as(n-1)),1),n}function u(t,n){return e(t=new as(+t),n),t}function a(t,r,u){var a=i(t),o=[];if(u>1)for(;r>a;)n(a)%u||o.push(new Date(+a)),e(a,1);else for(;r>a;)o.push(new Date(+a)),e(a,1);return o}function o(t,e,n){try{as=Pe;var r=new Pe;return r._=t,a(r,e,n)}finally{as=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=u,t.range=a;var s=t.utc=Ue(t);return s.floor=s,s.round=Ue(r),s.ceil=Ue(i),s.offset=Ue(u),s.range=o,t}function Ue(t){return function(e,n){try{as=Pe;var r=new Pe;return r._=e,t(r,n)._}finally{as=Date}}}function Ve(t){function e(t){function e(e){for(var n,i,u,a=[],o=-1,s=0;++oo;){if(r>=c)return-1;if(i=e.charCodeAt(o++),37===i){if(a=e.charAt(o++),u=S[a in ss?e.charAt(o++):a],!u||(r=u(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){A.lastIndex=0;var r=A.exec(e.slice(n));return r?(t.w=_.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){x.lastIndex=0;var r=x.exec(e.slice(n));return r?(t.w=w.get(r[0].toLowerCase()),n+r[0].length):-1}function u(t,e,n){D.lastIndex=0;var r=D.exec(e.slice(n));return r?(t.m=C.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){E.lastIndex=0;var r=E.exec(e.slice(n));return r?(t.m=k.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,r){return n(t,M.c.toString(),e,r)}function s(t,e,r){return n(t,M.x.toString(),e,r)}function c(t,e,r){return n(t,M.X.toString(),e,r)}function l(t,e,n){var r=b.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var f=t.dateTime,h=t.date,p=t.time,d=t.periods,g=t.days,y=t.shortDays,m=t.months,v=t.shortMonths;e.utc=function(t){function n(t){try{as=Pe;var e=new as;return e._=t,r(e)}finally{as=Date}}var r=e(t);return n.parse=function(t){try{as=Pe;var e=r.parse(t);return e&&e._}finally{as=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=cn;var b=Za.map(),x=He(g),w=$e(g),A=He(y),_=$e(y),E=He(m),k=$e(m),D=He(v),C=$e(v);d.forEach(function(t,e){b.set(t.toLowerCase(),e)});var M={a:function(t){return y[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return v[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(f),d:function(t,e){return ze(t.getDate(),e,2)},e:function(t,e){return ze(t.getDate(),e,2)},H:function(t,e){return ze(t.getHours(),e,2)},I:function(t,e){return ze(t.getHours()%12||12,e,2)},j:function(t,e){return ze(1+us.dayOfYear(t),e,3)},L:function(t,e){return ze(t.getMilliseconds(),e,3)},m:function(t,e){return ze(t.getMonth()+1,e,2)},M:function(t,e){return ze(t.getMinutes(),e,2)},p:function(t){return d[+(t.getHours()>=12)]},S:function(t,e){return ze(t.getSeconds(),e,2)},U:function(t,e){return ze(us.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return ze(us.mondayOfYear(t),e,2)},x:e(h),X:e(p),y:function(t,e){return ze(t.getFullYear()%100,e,2)},Y:function(t,e){return ze(t.getFullYear()%1e4,e,4)},Z:on,"%":function(){return"%"}},S={a:r,A:i,b:u,B:a,c:o,d:tn,e:tn,H:nn,I:nn,j:en,L:an,m:Qe,M:rn,p:l,S:un,U:Ye,w:Ge,W:We,x:s,X:c,y:Xe,Y:Ze,Z:Ke,"%":sn};return e}function ze(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",u=i.length;return r+(n>u?new Array(n-u+1).join(e)+i:i)}function He(t){return new RegExp("^(?:"+t.map(Za.requote).join("|")+")","i")}function $e(t){for(var e=new s,n=-1,r=t.length;++n68?1900:2e3)}function Qe(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function tn(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function en(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function nn(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function rn(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function un(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function an(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function on(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=co(e)/60|0,i=co(e)%60;return n+ze(r,"0",2)+ze(i,"0",2)}function sn(t,e,n){ls.lastIndex=0;var r=ls.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function cn(t){for(var e=t.length,n=-1;++n=0?1:-1,o=a*n,s=Math.cos(e),c=Math.sin(e),l=u*c,f=i*s+l*Math.cos(o),h=l*a*Math.sin(o);ys.add(Math.atan2(h,f)),r=t,i=s,u=c}var e,n,r,i,u;ms.point=function(a,o){ms.point=t,r=(e=a)*Lo,i=Math.cos(o=(n=o)*Lo/2+Mo/4),u=Math.sin(o)},ms.lineEnd=function(){t(e,n)}}function yn(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function mn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function vn(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 bn(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function wn(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function An(t){return[Math.atan2(t[1],t[0]),ee(t[2])]}function _n(t,e){return co(t[0]-e[0])o;++o)i.point((n=t[o])[0],n[1]);return void i.lineEnd()}var s=new Bn(n,t,null,!0),c=new Bn(n,null,s,!1);s.o=c,u.push(s),a.push(c),s=new Bn(r,t,null,!1),c=new Bn(r,null,s,!0),s.o=c,u.push(s),a.push(c)}}),a.sort(e),Tn(u),Tn(a),u.length){for(var o=0,s=n,c=a.length;c>o;++o)a[o].e=s=!s;for(var l,f,h=u[0];;){for(var p=h,d=!0;p.v;)if((p=p.n)===h)return;l=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(var o=0,c=l.length;c>o;++o)i.point((f=l[o])[0],f[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(d){l=p.p.z;for(var o=l.length-1;o>=0;--o)i.point((f=l[o])[0],f[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,l=p.z,d=!d}while(!p.v);i.lineEnd()}}}function Tn(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0){for(w||(u.polygonStart(),w=!0),u.lineStart();++a1&&2&e&&n.push(n.pop().concat(n.shift())),p.push(n.filter(Nn))}var p,d,g,y=e(u),m=i.invert(r[0],r[1]),v={point:a,lineStart:s,lineEnd:c,polygonStart:function(){v.point=l,v.lineStart=f,v.lineEnd=h,p=[],d=[]},polygonEnd:function(){v.point=a,v.lineStart=s,v.lineEnd=c,p=Za.merge(p);var t=jn(m,d);p.length?(w||(u.polygonStart(),w=!0),Fn(p,Rn,t,n,u)):t&&(w||(u.polygonStart(),w=!0),u.lineStart(),n(null,null,1,u),u.lineEnd()),w&&(u.polygonEnd(),w=!1),p=d=null},sphere:function(){u.polygonStart(),u.lineStart(),n(null,null,1,u),u.lineEnd(),u.polygonEnd()}},b=qn(),x=e(b),w=!1;return v}}function Nn(t){return t.length>1}function qn(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:b,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Rn(t,e){return((t=t.x)[0]<0?t[1]-Fo-To:Fo-t[1])-((e=e.x)[0]<0?e[1]-Fo-To:Fo-e[1])}function On(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(u,a){var o=u>0?Mo:-Mo,s=co(u-n);co(s-Mo)0?Fo:-Fo),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),t.point(u,r),e=0):i!==o&&s>=Mo&&(co(n-i)To?Math.atan((Math.sin(e)*(u=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*u*a)):(e+r)/2}function Pn(t,e,n,r){var i;if(null==t)i=n*Fo,r.point(-Mo,i),r.point(0,i),r.point(Mo,i),r.point(Mo,0),r.point(Mo,-i),r.point(0,-i),r.point(-Mo,-i),r.point(-Mo,0),r.point(-Mo,i);else if(co(t[0]-e[0])>To){var u=t[0]o;++o){var c=e[o],l=c.length;if(l)for(var f=c[0],h=f[0],p=f[1]/2+Mo/4,d=Math.sin(p),g=Math.cos(p),y=1;;){y===l&&(y=0),t=c[y];var m=t[0],v=t[1]/2+Mo/4,b=Math.sin(v),x=Math.cos(v),w=m-h,A=w>=0?1:-1,_=A*w,E=_>Mo,k=d*b;if(ys.add(Math.atan2(k*A*Math.sin(_),g*x+k*Math.cos(_))),u+=E?w+A*So:w,E^h>=n^m>=n){var D=vn(yn(f),yn(t));wn(D);var C=vn(i,D);wn(C);var M=(E^w>=0?-1:1)*ee(C[2]);(r>M||r===M&&(D[0]||D[1]))&&(a+=E^w>=0?1:-1)}if(!y++)break;h=m,d=b,g=x,f=t}}return(-To>u||To>u&&0>ys)^1&a}function Un(t){function e(t,e){return Math.cos(t)*Math.cos(e)>u}function n(t){var n,u,s,c,l;return{lineStart:function(){c=s=!1,l=1},point:function(f,h){var p,d=[f,h],g=e(f,h),y=a?g?0:i(f,h):g?i(f+(0>f?Mo:-Mo),h):0;if(!n&&(c=s=g)&&t.lineStart(),g!==s&&(p=r(n,d),(_n(n,p)||_n(d,p))&&(d[0]+=To,d[1]+=To,g=e(d[0],d[1]))),g!==s)l=0,g?(t.lineStart(),p=r(d,n),t.point(p[0],p[1])):(p=r(n,d),t.point(p[0],p[1]),t.lineEnd()),n=p;else if(o&&n&&a^g){var m;y&u||!(m=r(d,n,!0))||(l=0,a?(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])))}!g||n&&_n(n,d)||t.point(d[0],d[1]),n=d,s=g,u=y},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return l|(c&&s)<<1}}}function r(t,e,n){var r=yn(t),i=yn(e),a=[1,0,0],o=vn(r,i),s=mn(o,o),c=o[0],l=s-c*c;if(!l)return!n&&t;var f=u*s/l,h=-u*c/l,p=vn(a,o),d=xn(a,f),g=xn(o,h);bn(d,g);var y=p,m=mn(d,y),v=mn(y,y),b=m*m-v*(mn(d,d)-1);if(!(0>b)){var x=Math.sqrt(b),w=xn(y,(-m-x)/v);if(bn(w,d),w=An(w),!n)return w;var A,_=t[0],E=e[0],k=t[1],D=e[1];_>E&&(A=_,_=E,E=A);var C=E-_,M=co(C-Mo)C;if(!M&&k>D&&(A=k,k=D,D=A),S?M?k+D>0^w[1]<(co(w[0]-_)Mo^(_<=w[0]&&w[0]<=E)){var F=xn(y,(-m+x)/v);return bn(F,d),[w,An(F)]}}}function i(e,n){var r=a?t:Mo-t,i=0;return-r>e?i|=1:e>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var u=Math.cos(t),a=u>0,o=co(u)>To,s=gr(t,6*Lo);return Ln(e,n,s,a?[0,-t]:[-Mo,t-Mo])}function Vn(t,e,n,r){return function(i){var u,a=i.a,o=i.b,s=a.x,c=a.y,l=o.x,f=o.y,h=0,p=1,d=l-s,g=f-c;if(u=t-s,d||!(u>0)){if(u/=d,0>d){if(h>u)return;p>u&&(p=u)}else if(d>0){if(u>p)return;u>h&&(h=u)}if(u=n-s,d||!(0>u)){if(u/=d,0>d){if(u>p)return;u>h&&(h=u)}else if(d>0){if(h>u)return;p>u&&(p=u)}if(u=e-c,g||!(u>0)){if(u/=g,0>g){if(h>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>h&&(h=u)}if(u=r-c,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>h&&(h=u)}else if(g>0){if(h>u)return;p>u&&(p=u)}return h>0&&(i.a={x:s+h*d,y:c+h*g}),1>p&&(i.b={x:s+p*d,y:c+p*g}),i}}}}}}function zn(t,e,n,r){function i(r,i){return co(r[0]-t)0?0:3:co(r[0]-n)0?2:1:co(r[1]-e)0?1:0:i>0?3:2}function u(t,e){return a(t.x,e.x)}function a(t,e){var n=i(t,1),r=i(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){function s(t){for(var e=0,n=y.length,r=t[1],i=0;n>i;++i)for(var u,a=1,o=y[i],s=o.length,c=o[0];s>a;++a)u=o[a],c[1]<=r?u[1]>r&&Q(c,u,t)>0&&++e:u[1]<=r&&Q(c,u,t)<0&&--e,c=u;return 0!==e}function c(u,o,s,c){var l=0,f=0;if(null==u||(l=i(u,s))!==(f=i(o,s))||a(u,o)<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(o[0],o[1])}function l(i,u){return i>=t&&n>=i&&u>=e&&r>=u}function f(t,e){l(t,e)&&o.point(t,e)}function h(){S.point=d,y&&y.push(m=[]),E=!0,_=!1,w=A=0/0}function p(){g&&(d(v,b),x&&_&&C.rejoin(),g.push(C.buffer())),S.point=f,_&&o.lineEnd()}function d(t,e){t=Math.max(-Ts,Math.min(Ts,t)),e=Math.max(-Ts,Math.min(Ts,e));var n=l(t,e);if(y&&m.push([t,e]),E)v=t,b=e,x=n,E=!1,n&&(o.lineStart(),o.point(t,e));else if(n&&_)o.point(t,e);else{var r={a:{x:w,y:A},b:{x:t,y:e}};M(r)?(_||(o.lineStart(),o.point(r.a.x,r.a.y)),o.point(r.b.x,r.b.y),n||o.lineEnd(),k=!1):n&&(o.lineStart(),o.point(t,e),k=!1)}w=t,A=e,_=n}var g,y,m,v,b,x,w,A,_,E,k,D=o,C=qn(),M=Vn(t,e,n,r),S={point:f,lineStart:h,lineEnd:p,polygonStart:function(){o=C,g=[],y=[],k=!0},polygonEnd:function(){o=D,g=Za.merge(g);var e=s([t,r]),n=k&&e,i=g.length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),c(null,null,1,o),o.lineEnd()),i&&Fn(g,u,e,c,o),o.polygonEnd()),g=y=m=null}};return S}}function Hn(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),n&&t.invert(n[0],n[1])}),n}function $n(t){var e=0,n=Mo/3,r=or(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Mo/180,n=t[1]*Mo/180):[e/Mo*180,n/Mo*180]},i}function Gn(t,e){function n(t,e){var n=Math.sqrt(u-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),a-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,u=1+r*(2*i-r),a=Math.sqrt(u)/i;return n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/i,ee((u-(t*t+n*n)*i*i)/(2*i))]},n}function Yn(){function t(t,e){Ls+=i*t-r*e,r=t,i=e}var e,n,r,i;Is.point=function(u,a){Is.point=t,e=r=u,n=i=a},Is.lineEnd=function(){t(e,n)}}function Wn(t,e){Ns>t&&(Ns=t),t>Rs&&(Rs=t),qs>e&&(qs=e),e>Os&&(Os=e)}function Zn(){function t(t,e){a.push("M",t,",",e,u)}function e(t,e){a.push("M",t,",",e),o.point=n}function n(t,e){a.push("L",t,",",e)}function r(){o.point=t}function i(){a.push("Z")}var u=Xn(4.5),a=[],o={point:t,lineStart:function(){o.point=e},lineEnd:r,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=r,o.point=t},pointRadius:function(t){return u=Xn(t),o},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return o}function Xn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Kn(t,e){xs+=t,ws+=e,++As}function Jn(){function t(t,r){var i=t-e,u=r-n,a=Math.sqrt(i*i+u*u);_s+=a*(e+t)/2,Es+=a*(n+r)/2,ks+=a,Kn(e=t,n=r)}var e,n;js.point=function(r,i){js.point=t,Kn(e=r,n=i)}}function Qn(){js.point=Kn}function tr(){function t(t,e){var n=t-r,u=e-i,a=Math.sqrt(n*n+u*u);_s+=a*(r+t)/2,Es+=a*(i+e)/2,ks+=a,a=i*t-r*e,Ds+=a*(r+t),Cs+=a*(i+e),Ms+=3*a,Kn(r=t,i=e)}var e,n,r,i;js.point=function(u,a){js.point=t,Kn(e=r=u,n=i=a)},js.lineEnd=function(){t(e,n)}}function er(t){function e(e,n){t.moveTo(e,n),t.arc(e,n,a,0,So)}function n(e,n){t.moveTo(e,n),o.point=r}function r(e,n){t.lineTo(e,n)}function i(){o.point=e}function u(){t.closePath()}var a=4.5,o={point:e,lineStart:function(){o.point=n},lineEnd:i,polygonStart:function(){o.lineEnd=u},polygonEnd:function(){o.lineEnd=i,o.point=e},pointRadius:function(t){return a=t,o},result:b};return o}function nr(t){function e(t){return(o?r:n)(t)}function n(e){return ur(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){b=0/0,E.point=u,e.lineStart()}function u(n,r){var u=yn([n,r]),a=t(n,r);i(b,x,v,w,A,_,b=a[0],x=a[1],v=n,w=u[0],A=u[1],_=u[2],o,e),e.point(b,x)}function a(){E.point=n,e.lineEnd()}function s(){r(),E.point=c,E.lineEnd=l}function c(t,e){u(f=t,h=e),p=b,d=x,g=w,y=A,m=_,E.point=u +}function l(){i(b,x,v,w,A,_,p,d,f,g,y,m,o,e),E.lineEnd=a,a()}var f,h,p,d,g,y,m,v,b,x,w,A,_,E={point:n,lineStart:r,lineEnd:a,polygonStart:function(){e.polygonStart(),E.lineStart=s},polygonEnd:function(){e.polygonEnd(),E.lineStart=r}};return E}function i(e,n,r,o,s,c,l,f,h,p,d,g,y,m){var v=l-e,b=f-n,x=v*v+b*b;if(x>4*u&&y--){var w=o+p,A=s+d,_=c+g,E=Math.sqrt(w*w+A*A+_*_),k=Math.asin(_/=E),D=co(co(_)-1)u||co((v*F+b*T)/x-.5)>.3||a>o*p+s*d+c*g)&&(i(e,n,r,o,s,c,M,S,D,w/=E,A/=E,_,y,m),m.point(M,S),i(M,S,D,w,A,_,l,f,h,p,d,g,y,m))}}var u=.5,a=Math.cos(30*Lo),o=16;return e.precision=function(t){return arguments.length?(o=(u=t*t)>0&&16,e):Math.sqrt(u)},e}function rr(t){var e=nr(function(e,n){return t([e*No,n*No])});return function(t){return sr(e(t))}}function ir(t){this.stream=t}function ur(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function ar(t){return or(function(){return t})()}function or(t){function e(t){return t=o(t[0]*Lo,t[1]*Lo),[t[0]*h+s,c-t[1]*h]}function n(t){return t=o.invert((t[0]-s)/h,(c-t[1])/h),t&&[t[0]*No,t[1]*No]}function r(){o=Hn(a=fr(m,v,b),u);var t=u(g,y);return s=p-t[0]*h,c=d+t[1]*h,i()}function i(){return l&&(l.valid=!1,l=null),e}var u,a,o,s,c,l,f=nr(function(t,e){return t=u(t,e),[t[0]*h+s,c-t[1]*h]}),h=150,p=480,d=250,g=0,y=0,m=0,v=0,b=0,x=Fs,w=Ce,A=null,_=null;return e.stream=function(t){return l&&(l.valid=!1),l=sr(x(a,f(w(t)))),l.valid=!0,l},e.clipAngle=function(t){return arguments.length?(x=null==t?(A=t,Fs):Un((A=+t)*Lo),i()):A},e.clipExtent=function(t){return arguments.length?(_=t,w=t?zn(t[0][0],t[0][1],t[1][0],t[1][1]):Ce,i()):_},e.scale=function(t){return arguments.length?(h=+t,r()):h},e.translate=function(t){return arguments.length?(p=+t[0],d=+t[1],r()):[p,d]},e.center=function(t){return arguments.length?(g=t[0]%360*Lo,y=t[1]%360*Lo,r()):[g*No,y*No]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Lo,v=t[1]%360*Lo,b=t.length>2?t[2]%360*Lo:0,r()):[m*No,v*No,b*No]},Za.rebind(e,f,"precision"),function(){return u=t.apply(this,arguments),e.invert=u.invert&&n,r()}}function sr(t){return ur(t,function(e,n){t.point(e*Lo,n*Lo)})}function cr(t,e){return[t,e]}function lr(t,e){return[t>Mo?t-So:-Mo>t?t+So:t,e]}function fr(t,e,n){return t?e||n?Hn(pr(t),dr(e,n)):pr(t):e||n?dr(e,n):lr}function hr(t){return function(e,n){return e+=t,[e>Mo?e-So:-Mo>e?e+So:e,n]}}function pr(t){var e=hr(t);return e.invert=hr(-t),e}function dr(t,e){function n(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*r+o*i;return[Math.atan2(s*u-l*a,o*r-c*i),ee(l*u+s*a)]}var r=Math.cos(t),i=Math.sin(t),u=Math.cos(e),a=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*u-s*a;return[Math.atan2(s*u+c*a,o*r+l*i),ee(l*r-o*i)]},n}function gr(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,u,a,o){var s=a*e;null!=i?(i=yr(n,i),u=yr(n,u),(a>0?u>i:i>u)&&(i+=a*So)):(i=t+a*So,u=t-.5*s);for(var c,l=i;a>0?l>u:u>l;l-=s)o.point((c=An([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],c[1])}}function yr(t,e){var n=yn(e);n[0]-=t,wn(n);var r=te(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-To)%(2*Math.PI)}function mr(t,e,n){var r=Za.range(t,e-To,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function vr(t,e,n){var r=Za.range(t,e-To,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function br(t){return t.source}function xr(t){return t.target}function wr(t,e,n,r){var i=Math.cos(e),u=Math.sin(e),a=Math.cos(r),o=Math.sin(r),s=i*Math.cos(t),c=i*Math.sin(t),l=a*Math.cos(n),f=a*Math.sin(n),h=2*Math.asin(Math.sqrt(ue(r-e)+i*a*ue(n-t))),p=1/Math.sin(h),d=h?function(t){var e=Math.sin(t*=h)*p,n=Math.sin(h-t)*p,r=n*s+e*l,i=n*c+e*f,a=n*u+e*o;return[Math.atan2(i,r)*No,Math.atan2(a,Math.sqrt(r*r+i*i))*No]}:function(){return[t*No,e*No]};return d.distance=h,d}function Ar(){function t(t,i){var u=Math.sin(i*=Lo),a=Math.cos(i),o=co((t*=Lo)-e),s=Math.cos(o);Us+=Math.atan2(Math.sqrt((o=a*Math.sin(o))*o+(o=r*u-n*a*s)*o),n*u+r*a*s),e=t,n=u,r=a}var e,n,r;Vs.point=function(i,u){e=i*Lo,n=Math.sin(u*=Lo),r=Math.cos(u),Vs.point=t},Vs.lineEnd=function(){Vs.point=Vs.lineEnd=b}}function _r(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),u=t(r*i);return[u*i*Math.sin(e),u*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),u=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*u,r*a),Math.asin(r&&n*u/r)]},n}function Er(t,e){function n(t,e){a>0?-Fo+To>e&&(e=-Fo+To):e>Fo-To&&(e=Fo-To);var n=a/Math.pow(i(e),u);return[n*Math.sin(u*t),a-n*Math.cos(u*t)]}var r=Math.cos(t),i=function(t){return Math.tan(Mo/4+t/2)},u=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),a=r*Math.pow(i(t),u)/u;return u?(n.invert=function(t,e){var n=a-e,r=J(u)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/u,2*Math.atan(Math.pow(a/r,1/u))-Fo]},n):Dr}function kr(t,e){function n(t,e){var n=u-e;return[n*Math.sin(i*t),u-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),u=r/i+t;return co(i)i;i++){for(;r>1&&Q(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Br(t,e){return t[0]-e[0]||t[1]-e[1]}function Lr(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Nr(t,e,n,r){var i=t[0],u=n[0],a=e[0]-i,o=r[0]-u,s=t[1],c=n[1],l=e[1]-s,f=r[1]-c,h=(o*(s-c)-f*(i-u))/(f*a-o*l);return[i+h*a,s+h*l]}function qr(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function Rr(){ri(this),this.edge=this.site=this.circle=null}function Or(t){var e=tc.pop()||new Rr;return e.site=t,e}function Ir(t){Wr(t),Ks.remove(t),tc.push(t),ri(t)}function Pr(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},u=t.P,a=t.N,o=[t];Ir(t);for(var s=u;s.circle&&co(n-s.circle.x)l;++l)c=o[l],s=o[l-1],ti(c.edge,s.site,c.site,i);s=o[0],c=o[f-1],c.edge=Jr(s.site,c.site,null,i),Yr(s),Yr(c)}function jr(t){for(var e,n,r,i,u=t.x,a=t.y,o=Ks._;o;)if(r=Ur(o,a)-u,r>To)o=o.L;else{if(i=u-Vr(o,a),!(i>To)){r>-To?(e=o.P,n=o):i>-To?(e=o,n=o.N):e=n=o;break}if(!o.R){e=o;break}o=o.R}var s=Or(t);if(Ks.insert(e,s),e||n){if(e===n)return Wr(e),n=Or(e.site),Ks.insert(s,n),s.edge=n.edge=Jr(e.site,s.site),Yr(e),void Yr(n);if(!n)return void(s.edge=Jr(e.site,s.site));Wr(e),Wr(n);var c=e.site,l=c.x,f=c.y,h=t.x-l,p=t.y-f,d=n.site,g=d.x-l,y=d.y-f,m=2*(h*y-p*g),v=h*h+p*p,b=g*g+y*y,x={x:(y*v-p*b)/m+l,y:(h*b-g*v)/m+f};ti(n.edge,c,d,x),s.edge=Jr(c,t,null,x),n.edge=Jr(t,d,null,x),Yr(e),Yr(n)}}function Ur(t,e){var n=t.site,r=n.x,i=n.y,u=i-e;if(!u)return r;var a=t.P;if(!a)return-1/0;n=a.site;var o=n.x,s=n.y,c=s-e;if(!c)return o;var l=o-r,f=1/u-1/c,h=l/c;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*c)-s+c/2+i-u/2)))/f+r:(r+o)/2}function Vr(t,e){var n=t.N;if(n)return Ur(n,e);var r=t.site;return r.y===e?r.x:1/0}function zr(t){this.site=t,this.edges=[]}function Hr(t){for(var e,n,r,i,u,a,o,s,c,l,f=t[0][0],h=t[1][0],p=t[0][1],d=t[1][1],g=Xs,y=g.length;y--;)if(u=g[y],u&&u.prepare())for(o=u.edges,s=o.length,a=0;s>a;)l=o[a].end(),r=l.x,i=l.y,c=o[++a%s].start(),e=c.x,n=c.y,(co(r-e)>To||co(i-n)>To)&&(o.splice(a,0,new ei(Qr(u.site,l,co(r-f)To?{x:f,y:co(e-f)To?{x:co(n-d)To?{x:h,y:co(e-h)To?{x:co(n-p)=-Bo)){var p=s*s+c*c,d=l*l+f*f,g=(f*p-c*d)/h,y=(s*d-l*p)/h,f=y+o,m=ec.pop()||new Gr;m.arc=t,m.site=i,m.x=g+a,m.y=f+Math.sqrt(g*g+y*y),m.cy=f,t.circle=m;for(var v=null,b=Qs._;b;)if(m.yy||y>=o)return;if(h>d){if(u){if(u.y>=c)return}else u={x:y,y:s};n={x:y,y:c}}else{if(u){if(u.yr||r>1)if(h>d){if(u){if(u.y>=c)return}else u={x:(s-i)/r,y:s};n={x:(c-i)/r,y:c}}else{if(u){if(u.yp){if(u){if(u.x>=o)return}else u={x:a,y:r*a+i};n={x:o,y:r*o+i}}else{if(u){if(u.xu&&(i=e.slice(u,i),o[a]?o[a]+=i:o[++a]=i),(n=n[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,s.push({i:a,x:yi(n,r)})),u=ic.lastIndex;return ur;++r)o[(n=s[r]).i]=n.x(t);return o.join("")})}function vi(t,e){for(var n,r=Za.interpolators.length;--r>=0&&!(n=Za.interpolators[r](t,e)););return n}function bi(t,e){var n,r=[],i=[],u=t.length,a=e.length,o=Math.min(t.length,e.length);for(n=0;o>n;++n)r.push(vi(t[n],e[n]));for(;u>n;++n)i[n]=t[n];for(;a>n;++n)i[n]=e[n];return function(t){for(n=0;o>n;++n)i[n]=r[n](t);return i}}function xi(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function wi(t){return function(e){return 1-t(1-e)}}function Ai(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function _i(t){return t*t}function Ei(t){return t*t*t}function ki(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Di(t){return function(e){return Math.pow(e,t)}}function Ci(t){return 1-Math.cos(t*Fo)}function Mi(t){return Math.pow(2,10*(t-1))}function Si(t){return 1-Math.sqrt(1-t*t)}function Fi(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/So*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*So/e)}}function Ti(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Bi(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Li(t,e){t=Za.hcl(t),e=Za.hcl(e);var n=t.h,r=t.c,i=t.l,u=e.h-n,a=e.c-r,o=e.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?e.c:r),isNaN(u)?(u=0,n=isNaN(n)?e.h:n):u>180?u-=360:-180>u&&(u+=360),function(t){return le(n+u*t,r+a*t,i+o*t)+""}}function Ni(t,e){t=Za.hsl(t),e=Za.hsl(e);var n=t.h,r=t.s,i=t.l,u=e.h-n,a=e.s-r,o=e.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?e.s:r),isNaN(u)?(u=0,n=isNaN(n)?e.h:n):u>180?u-=360:-180>u&&(u+=360),function(t){return se(n+u*t,r+a*t,i+o*t)+""}}function qi(t,e){t=Za.lab(t),e=Za.lab(e);var n=t.l,r=t.a,i=t.b,u=e.l-n,a=e.a-r,o=e.b-i;return function(t){return he(n+u*t,r+a*t,i+o*t)+""}}function Ri(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Oi(t){var e=[t.a,t.b],n=[t.c,t.d],r=Pi(e),i=Ii(e,n),u=Pi(ji(n,e,-i))||0;e[0]*n[1]180?l+=360:l-c>180&&(c+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:yi(c,l)})):l&&r.push(r.pop()+"rotate("+l+")"),f!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:yi(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),p[0]!=d[0]||p[1]!=d[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:n-4,x:yi(p[0],d[0])},{i:n-2,x:yi(p[1],d[1])})):(1!=d[0]||1!=d[1])&&r.push(r.pop()+"scale("+d+")"),n=i.length,function(t){for(var e,u=-1;++u=0;)n.push(i[r])}function tu(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(u=t.children)&&(i=u.length))for(var i,u,a=-1;++an;++n)(e=t[n][1])>i&&(r=n,i=e);return r}function fu(t){return t.reduce(hu,0)}function hu(t,e){return t+e[1]}function pu(t,e){return du(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function du(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,u=[];++n<=e;)u[n]=i*n+r;return u}function gu(t){return[Za.min(t),Za.max(t)]}function yu(t,e){return t.value-e.value}function mu(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function vu(t,e){t._pack_next=e,e._pack_prev=t}function bu(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function xu(t){function e(t){l=Math.min(t.x-t.r,l),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),p=Math.max(t.y+t.r,p)}if((n=t.children)&&(c=n.length)){var n,r,i,u,a,o,s,c,l=1/0,f=-1/0,h=1/0,p=-1/0;if(n.forEach(wu),r=n[0],r.x=-r.r,r.y=0,e(r),c>1&&(i=n[1],i.x=i.r,i.y=0,e(i),c>2))for(u=n[2],Eu(r,i,u),e(u),mu(r,u),r._pack_prev=u,mu(u,i),i=r._pack_next,a=3;c>a;a++){Eu(r,i,u=n[a]);var d=0,g=1,y=1;for(o=i._pack_next;o!==i;o=o._pack_next,g++)if(bu(o,u)){d=1;break}if(1==d)for(s=r._pack_prev;s!==o._pack_prev&&!bu(s,u);s=s._pack_prev,y++);d?(y>g||g==y&&i.ra;a++)u=n[a],u.x-=m,u.y-=v,b=Math.max(b,u.r+Math.sqrt(u.x*u.x+u.y*u.y));t.r=b,n.forEach(Au)}}function wu(t){t._pack_next=t._pack_prev=t}function Au(t){delete t._pack_next,delete t._pack_prev}function _u(t,e,n,r){var i=t.children;if(t.x=e+=r*t.x,t.y=n+=r*t.y,t.r*=r,i)for(var u=-1,a=i.length;++u=0;)e=i[u],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Fu(t,e,n){return t.a.parent===e.parent?t.a:n}function Tu(t){return 1+Za.max(t,function(t){return t.y})}function Bu(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Lu(t){var e=t.children;return e&&e.length?Lu(e[0]):t}function Nu(t){var e,n=t.children;return n&&(e=n.length)?Nu(n[e-1]):t}function qu(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ru(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],u=t.dy-e[0]-e[2];return 0>i&&(n+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:n,y:r,dx:i,dy:u}}function Ou(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function Iu(t){return t.rangeExtent?t.rangeExtent():Ou(t.range())}function Pu(t,e,n,r){var i=n(t[0],t[1]),u=r(e[0],e[1]);return function(t){return u(i(t))}}function ju(t,e){var n,r=0,i=t.length-1,u=t[r],a=t[i];return u>a&&(n=r,r=i,i=n,n=u,u=a,a=n),t[r]=e.floor(u),t[i]=e.ceil(a),t}function Uu(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:gc}function Vu(t,e,n,r){var i=[],u=[],a=0,o=Math.min(t.length,e.length)-1;for(t[o]2?Vu:Pu,s=r?zi:Vi;return a=i(t,e,s,n),o=i(e,t,s,vi),u}function u(t){return a(t)}var a,o;return u.invert=function(t){return o(t)},u.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},u.range=function(t){return arguments.length?(e=t,i()):e},u.rangeRound=function(t){return u.range(t).interpolate(Ri)},u.clamp=function(t){return arguments.length?(r=t,i()):r},u.interpolate=function(t){return arguments.length?(n=t,i()):n},u.ticks=function(e){return Yu(t,e)},u.tickFormat=function(e,n){return Wu(t,e,n)},u.nice=function(e){return $u(t,e),i()},u.copy=function(){return zu(t,e,n,r)},i()}function Hu(t,e){return Za.rebind(t,e,"range","rangeRound","interpolate","clamp")}function $u(t,e){return ju(t,Uu(Gu(t,e)[2]))}function Gu(t,e){null==e&&(e=10);var n=Ou(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),u=e/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Yu(t,e){return Za.range.apply(Za,Gu(t,e))}function Wu(t,e,n){var r=Gu(t,e);if(n){var i=rs.exec(n);if(i.shift(),"s"===i[8]){var u=Za.formatPrefix(Math.max(co(r[0]),co(r[1])));return i[7]||(i[7]="."+Zu(u.scale(r[2]))),i[8]="f",n=Za.format(i.join("")),function(t){return n(u.scale(t))+u.symbol}}i[7]||(i[7]="."+Xu(i[8],r)),n=i.join("")}else n=",."+Zu(r[2])+"f";return Za.format(n)}function Zu(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Xu(t,e){var n=Zu(e[2]);return t in yc?Math.abs(n-Zu(Math.max(co(e[0]),co(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Ku(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function u(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}return a.invert=function(e){return u(t.invert(e))},a.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(i)),a):r},a.base=function(n){return arguments.length?(e=+n,t.domain(r.map(i)),a):e},a.nice=function(){var e=ju(r.map(i),n?Math:vc);return t.domain(e),r=e.map(u),a},a.ticks=function(){var t=Ou(r),a=[],o=t[0],s=t[1],c=Math.floor(i(o)),l=Math.ceil(i(s)),f=e%1?2:e;if(isFinite(l-c)){if(n){for(;l>c;c++)for(var h=1;f>h;h++)a.push(u(c)*h);a.push(u(c))}else for(a.push(u(c));c++0;h--)a.push(u(c)*h);for(c=0;a[c]s;l--);a=a.slice(c,l)}return a},a.tickFormat=function(t,e){if(!arguments.length)return mc;arguments.length<2?e=mc:"function"!=typeof e&&(e=Za.format(e));var r,o=Math.max(.1,t/a.ticks().length),s=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/u(s(i(t)+r))<=o?e(t):""}},a.copy=function(){return Ku(t.copy(),e,n,r)},Hu(a,t)}function Ju(t,e,n){function r(e){return t(i(e))}var i=Qu(e),u=Qu(1/e);return r.invert=function(e){return u(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(i)),r):n},r.ticks=function(t){return Yu(n,t)},r.tickFormat=function(t,e){return Wu(n,t,e)},r.nice=function(t){return r.domain($u(n,t))},r.exponent=function(a){return arguments.length?(i=Qu(e=a),u=Qu(1/e),t.domain(n.map(i)),r):e},r.copy=function(){return Ju(t.copy(),e,n)},Hu(r,t)}function Qu(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ta(t,e){function n(n){return u[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%u.length]}function r(e,n){return Za.range(t.length).map(function(t){return e+n*t})}var i,u,a;return n.domain=function(r){if(!arguments.length)return t;t=[],i=new s;for(var u,a=-1,o=r.length;++at?[0/0,0/0]:[t>0?o[t-1]:e[0],te?0/0:e/u+t,[e,e+1/u]},r.copy=function(){return na(t,e,n)},i()}function ra(t,e){function n(n){return n>=n?e[Za.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return ra(t,e)},n}function ia(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Yu(t,e)},e.tickFormat=function(e,n){return Wu(t,e,n)},e.copy=function(){return ia(t)},e}function ua(t){return t.innerRadius}function aa(t){return t.outerRadius}function oa(t){return t.startAngle}function sa(t){return t.endAngle}function ca(t){function e(e){function a(){c.push("M",u(t(l),o))}for(var s,c=[],l=[],f=-1,h=e.length,p=De(n),d=De(r);++f1&&i.push("H",r[0]),i.join("")}function pa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1){o=e[1],u=t[s],s++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(u[0]-o[0])+","+(u[1]-o[1])+","+u[0]+","+u[1];for(var c=2;c9&&(i=3*e/Math.sqrt(i),a[o]=i*n,a[o+1]=i*r));for(o=-1;++o<=s;)i=(t[Math.min(s,o+1)][0]-t[Math.max(0,o-1)][0])/(6*(1+a[o]*a[o])),u.push([i||0,a[o]*i||0]);return u}function Sa(t){return t.length<3?la(t):t[0]+va(t,Ma(t))}function Fa(t){for(var e,n,r,i=-1,u=t.length;++in?c():(i.active=n,u.event&&u.event.start.call(t,l,e),u.tween.forEach(function(n,r){(r=r.call(t,l,e))&&g.push(r)}),void Za.timer(function(){return d.c=s(r||1)?Sn:s,1},0,a))}function s(r){if(i.active!==n)return c();for(var a=r/p,o=f(a),s=g.length;s>0;)g[--s].call(t,o);return a>=1?(u.event&&u.event.end.call(t,l,e),c()):void 0}function c(){return--i.count?delete i[n]:delete t.__transition__,1}var l=t.__data__,f=u.ease,h=u.delay,p=u.duration,d=ts,g=[];return d.t=h+a,r>=h?o(r-h):void(d.c=o)},0,a)}}function Va(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function za(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Ha(t){return t.toISOString()}function $a(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,u=Za.bisect(zc,i);return u==zc.length?[e.year,Gu(t.map(function(t){return t/31536e6}),n)[2]]:u?e[i/zc[u-1]1?{floor:function(e){for(;n(e=t.floor(e));)e=Ga(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=Ga(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Ou(r.domain()),u=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return u&&(t=u[0],e=u[1]),t.range(n[0],Ga(+n[1]+1),1>e?1:e)},r.tickFormat=function(){return n},r.copy=function(){return $a(t.copy(),e,n)},Hu(r,t)}function Ga(t){return new Date(t)}function Ya(t){return JSON.parse(t.responseText)}function Wa(t){var e=Ja.createRange();return e.selectNode(Ja.body),e.createContextualFragment(t.responseText)}var Za={version:"3.4.13"};Date.now||(Date.now=function(){return+new Date});var Xa=[].slice,Ka=function(t){return Xa.call(t)},Ja=document,Qa=Ja.documentElement,to=window;try{Ka(Qa.childNodes)[0].nodeType}catch(eo){Ka=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}try{Ja.createElement("div").style.setProperty("opacity",0,"")}catch(no){var ro=to.Element.prototype,io=ro.setAttribute,uo=ro.setAttributeNS,ao=to.CSSStyleDeclaration.prototype,oo=ao.setProperty;ro.setAttribute=function(t,e){io.call(this,t,e+"")},ro.setAttributeNS=function(t,e,n){uo.call(this,t,e,n+"")},ao.setProperty=function(t,e,n){oo.call(this,t,e+"",n)}}Za.ascending=t,Za.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},Za.min=function(t,e){var n,r,i=-1,u=t.length;if(1===arguments.length){for(;++i=n);)n=void 0;for(;++ir&&(n=r)}else{for(;++i=n);)n=void 0;for(;++ir&&(n=r)}return n},Za.max=function(t,e){var n,r,i=-1,u=t.length;if(1===arguments.length){for(;++i=n);)n=void 0;for(;++in&&(n=r)}else{for(;++i=n);)n=void 0;for(;++in&&(n=r)}return n},Za.extent=function(t,e){var n,r,i,u=-1,a=t.length;if(1===arguments.length){for(;++u=n);)n=i=void 0;for(;++ur&&(n=r),r>i&&(i=r))}else{for(;++u=n);)n=void 0;for(;++ur&&(n=r),r>i&&(i=r))}return[n,i]},Za.sum=function(t,e){var n,i=0,u=t.length,a=-1;if(1===arguments.length)for(;++ar?0:r);r>n;)u[n]=[e=i,i=t[++n]];return u},Za.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=Za.min(arguments,u),n=new Array(e);++t=0;)for(r=t[i],e=r.length;--e>=0;)n[--a]=r[e];return n};var co=Math.abs;Za.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,i=[],u=a(co(n)),o=-1;if(t*=u,e*=u,n*=u,0>n)for(;(r=t+n*++o)>e;)i.push(r/u);else for(;(r=t+n*++o)=u.length)return r?r.call(i,a):n?a.sort(n):a;for(var c,l,f,h,p=-1,d=a.length,g=u[o++],y=new s;++p=u.length)return t;var r=[],i=a[n++];return t.forEach(function(t,i){r.push({key:t,values:e(i,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},u=[],a=[];return i.map=function(e,n){return t(n,e,0)},i.entries=function(n){return e(t(Za.map,n,0),0)},i.key=function(t){return u.push(t),i},i.sortKeys=function(t){return a[u.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},Za.set=function(t){var e=new y;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e},o(y,{has:f,add:function(t){return this._[c(t+="")]=!0,t},remove:h,values:p,size:d,empty:g,forEach:function(t){for(var e in this._)t.call(this,l(e))}}),Za.behavior={},Za.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},Za.event=null,Za.requote=function(t){return t.replace(po,"\\$&")};var po=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,go={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},yo=function(t,e){return e.querySelector(t)},mo=function(t,e){return e.querySelectorAll(t)},vo=Qa.matches||Qa[v(Qa,"matchesSelector")],bo=function(t,e){return vo.call(t,e)};"function"==typeof Sizzle&&(yo=function(t,e){return Sizzle(t,e)[0]||null},mo=Sizzle,bo=Sizzle.matchesSelector),Za.selection=function(){return _o};var xo=Za.selection.prototype=[];xo.select=function(t){var e,n,r,i,u=[];t=D(t);for(var a=-1,o=this.length;++a=0&&(n=t.slice(0,e),t=t.slice(e+1)),wo.hasOwnProperty(n)?{space:wo[n],local:t}:t}},xo.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=Za.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(M(e,t[e]));return this}return this.each(M(t,e))},xo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=T(t)).length,i=-1;if(e=n.classList){for(;++ir){if("string"!=typeof t){2>r&&(e="");for(n in t)this.each(N(n,t[n],e));return this}if(2>r)return to.getComputedStyle(this.node(),null).getPropertyValue(t);n=""}return this.each(N(t,e,n))},xo.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(q(e,t[e]));return this}return this.each(q(t,e))},xo.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},xo.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},xo.append=function(t){return t=R(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},xo.insert=function(t,e){return t=R(t),e=D(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},xo.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},xo.data=function(t,e){function n(t,n){var r,i,u,a=t.length,f=n.length,h=Math.min(a,f),p=new Array(f),d=new Array(f),g=new Array(a);if(e){var y,m=new s,v=new Array(a);for(r=-1;++rr;++r)d[r]=O(n[r]);for(;a>r;++r)g[r]=t[r]}d.update=p,d.parentNode=p.parentNode=g.parentNode=t.parentNode,o.push(d),c.push(p),l.push(g)}var r,i,u=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++uu;u++){i.push(e=[]),e.parentNode=(n=this[u]).parentNode;for(var o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,u)&&e.push(r)}return k(i)},xo.order=function(){for(var t=-1,e=this.length;++t=0;)(n=r[i])&&(u&&u!==n.nextSibling&&u.parentNode.insertBefore(n,u),u=n);return this},xo.sort=function(t){t=P.apply(this,arguments);for(var e=-1,n=this.length;++et;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var u=n[r];if(u)return u}return null},xo.size=function(){var t=0;return j(this,function(){++t}),t};var Ao=[];Za.selection.enter=U,Za.selection.enter.prototype=Ao,Ao.append=xo.append,Ao.empty=xo.empty,Ao.node=xo.node,Ao.call=xo.call,Ao.size=xo.size,Ao.select=function(t){for(var e,n,r,i,u,a=[],o=-1,s=this.length;++or){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(H(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(H(t,e,n))};var Eo=Za.map({mouseenter:"mouseover",mouseleave:"mouseout"});Eo.forEach(function(t){"on"+t in Ja&&Eo.remove(t)});var ko="onselectstart"in Ja?null:v(Qa.style,"userSelect"),Do=0;Za.mouse=function(t){return W(t,_())};var Co=/WebKit/.test(to.navigator.userAgent)?-1:0;Za.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=_().changedTouches),e)for(var r,i=0,u=e.length;u>i;++i)if((r=e[i]).identifier===n)return W(t,r)},Za.behavior.drag=function(){function t(){this.on("mousedown.drag",i).on("touchstart.drag",u)}function e(t,e,i,u,a){return function(){function o(){var t,n,r=e(h,g);r&&(t=r[0]-b[0],n=r[1]-b[1],d|=t|n,b=r,p({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:t,dy:n}))}function s(){e(h,g)&&(m.on(u+y,null).on(a+y,null),v(d&&Za.event.target===f),p({type:"dragend"}))}var c,l=this,f=Za.event.target,h=l.parentNode,p=n.of(l,arguments),d=0,g=t(),y=".drag"+(null==g?"":"-"+g),m=Za.select(i()).on(u+y,o).on(a+y,s),v=Y(),b=e(h,g);r?(c=r.apply(l,arguments),c=[c.x-b[0],c.y-b[1]]):c=[0,0],p({type:"dragstart"})}}var n=E(t,"drag","dragstart","dragend"),r=null,i=e(b,Za.mouse,K,"mousemove","mouseup"),u=e(Z,Za.touch,X,"touchmove","touchend");return t.origin=function(e){return arguments.length?(r=e,t):r},Za.rebind(t,n,"on")},Za.touches=function(t,e){return arguments.length<2&&(e=_().touches),e?Ka(e).map(function(e){var n=W(t,e);return n.identifier=e.identifier,n}):[]};var Mo=Math.PI,So=2*Mo,Fo=Mo/2,To=1e-6,Bo=To*To,Lo=Mo/180,No=180/Mo,qo=Math.SQRT2,Ro=2,Oo=4;Za.interpolateZoom=function(t,e){function n(t){var e=t*v;if(m){var n=re(g),a=u/(Ro*h)*(n*ie(qo*e+g)-ne(g));return[r+a*c,i+a*l,u*n/re(qo*e+g)]}return[r+t*c,i+t*l,u*Math.exp(qo*e)]}var r=t[0],i=t[1],u=t[2],a=e[0],o=e[1],s=e[2],c=a-r,l=o-i,f=c*c+l*l,h=Math.sqrt(f),p=(s*s-u*u+Oo*f)/(2*u*Ro*h),d=(s*s-u*u-Oo*f)/(2*s*Ro*h),g=Math.log(Math.sqrt(p*p+1)-p),y=Math.log(Math.sqrt(d*d+1)-d),m=y-g,v=(m||Math.log(s/u))/qo;return n.duration=1e3*v,n},Za.behavior.zoom=function(){function t(t){t.on(C,c).on(jo+".zoom",f).on("dblclick.zoom",h).on(F,l)}function e(t){return[(t[0]-_.x)/_.k,(t[1]-_.y)/_.k]}function n(t){return[t[0]*_.k+_.x,t[1]*_.k+_.y]}function r(t){_.k=Math.max(D[0],Math.min(D[1],t))}function i(t,e){e=n(e),_.x+=t[0]-e[0],_.y+=t[1]-e[1]}function u(){b&&b.domain(v.range().map(function(t){return(t-_.x)/_.k}).map(v.invert)),w&&w.domain(x.range().map(function(t){return(t-_.y)/_.k}).map(x.invert))}function a(t){t({type:"zoomstart"})}function o(t){u(),t({type:"zoom",scale:_.k,translate:[_.x,_.y]})}function s(t){t({type:"zoomend"})}function c(){function t(){l=1,i(Za.mouse(r),h),o(c)}function n(){f.on(M,null).on(S,null),p(l&&Za.event.target===u),s(c)}var r=this,u=Za.event.target,c=T.of(r,arguments),l=0,f=Za.select(to).on(M,t).on(S,n),h=e(Za.mouse(r)),p=Y();z.call(r),a(c)}function l(){function t(){var t=Za.touches(p);return h=_.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function n(){var e=Za.event.target;Za.select(e).on(b,u).on(x,f),w.push(e);for(var n=Za.event.changedTouches,a=0,s=n.length;s>a;++a)g[n[a].identifier]=null;var c=t(),l=Date.now();if(1===c.length){if(500>l-m){var h=c[0],p=g[h.identifier];r(2*_.k),i(h,p),A(),o(d)}m=l}else if(c.length>1){var h=c[0],v=c[1],E=h[0]-v[0],k=h[1]-v[1];y=E*E+k*k}}function u(){for(var t,e,n,u,a=Za.touches(p),s=0,c=a.length;c>s;++s,u=null)if(n=a[s],u=g[n.identifier]){if(e)break;t=n,e=u}if(u){var l=(l=n[0]-t[0])*l+(l=n[1]-t[1])*l,f=y&&Math.sqrt(l/y);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+u[0])/2,(e[1]+u[1])/2],r(f*h)}m=null,i(t,e),o(d)}function f(){if(Za.event.touches.length){for(var e=Za.event.changedTouches,n=0,r=e.length;r>n;++n)delete g[e[n].identifier];for(var i in g)return void t()}Za.selectAll(w).on(v,null),E.on(C,c).on(F,l),k(),s(d)}var h,p=this,d=T.of(p,arguments),g={},y=0,v=".zoom-"+Za.event.changedTouches[0].identifier,b="touchmove"+v,x="touchend"+v,w=[],E=Za.select(p),k=Y();z.call(p),n(),a(d),E.on(C,null).on(F,n)}function f(){var t=T.of(this,arguments);y?clearTimeout(y):(p=e(d=g||Za.mouse(this)),z.call(this),a(t)),y=setTimeout(function(){y=null,s(t)},50),A(),r(Math.pow(2,.002*Io())*_.k),i(d,p),o(t)}function h(){var t=T.of(this,arguments),n=Za.mouse(this),u=e(n),c=Math.log(_.k)/Math.LN2;a(t),r(Math.pow(2,Za.event.shiftKey?Math.ceil(c)-1:Math.floor(c)+1)),i(n,u),o(t),s(t)}var p,d,g,y,m,v,b,x,w,_={x:0,y:0,k:1},k=[960,500],D=Po,C="mousedown.zoom",M="mousemove.zoom",S="mouseup.zoom",F="touchstart.zoom",T=E(t,"zoomstart","zoom","zoomend");return t.event=function(t){t.each(function(){var t=T.of(this,arguments),e=_;Fc?Za.select(this).transition().each("start.zoom",function(){_=this.__chart__||{x:0,y:0,k:1},a(t)}).tween("zoom:zoom",function(){var n=k[0],r=k[1],i=n/2,u=r/2,a=Za.interpolateZoom([(i-_.x)/_.k,(u-_.y)/_.k,n/_.k],[(i-e.x)/e.k,(u-e.y)/e.k,n/e.k]);return function(e){var r=a(e),s=n/r[2];this.__chart__=_={x:i-r[0]*s,y:u-r[1]*s,k:s},o(t)}}).each("end.zoom",function(){s(t)}):(this.__chart__=_,a(t),o(t),s(t))})},t.translate=function(e){return arguments.length?(_={x:+e[0],y:+e[1],k:_.k},u(),t):[_.x,_.y]},t.scale=function(e){return arguments.length?(_={x:_.x,y:_.y,k:+e},u(),t):_.k},t.scaleExtent=function(e){return arguments.length?(D=null==e?Po:[+e[0],+e[1]],t):D},t.center=function(e){return arguments.length?(g=e&&[+e[0],+e[1]],t):g},t.size=function(e){return arguments.length?(k=e&&[+e[0],+e[1]],t):k},t.x=function(e){return arguments.length?(b=e,v=e.copy(),_={x:0,y:0,k:1},t):b},t.y=function(e){return arguments.length?(w=e,x=e.copy(),_={x:0,y:0,k:1},t):w},Za.rebind(t,T,"on")};var Io,Po=[0,1/0],jo="onwheel"in Ja?(Io=function(){return-Za.event.deltaY*(Za.event.deltaMode?120:1)},"wheel"):"onmousewheel"in Ja?(Io=function(){return Za.event.wheelDelta},"mousewheel"):(Io=function(){return-Za.event.detail},"MozMousePixelScroll");Za.color=ae,ae.prototype.toString=function(){return this.rgb()+""},Za.hsl=oe;var Uo=oe.prototype=new ae;Uo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new oe(this.h,this.s,this.l/t)},Uo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new oe(this.h,this.s,t*this.l)},Uo.rgb=function(){return se(this.h,this.s,this.l)},Za.hcl=ce;var Vo=ce.prototype=new ae;Vo.brighter=function(t){return new ce(this.h,this.c,Math.min(100,this.l+zo*(arguments.length?t:1)))},Vo.darker=function(t){return new ce(this.h,this.c,Math.max(0,this.l-zo*(arguments.length?t:1)))},Vo.rgb=function(){return le(this.h,this.c,this.l).rgb()},Za.lab=fe;var zo=18,Ho=.95047,$o=1,Go=1.08883,Yo=fe.prototype=new ae;Yo.brighter=function(t){return new fe(Math.min(100,this.l+zo*(arguments.length?t:1)),this.a,this.b)},Yo.darker=function(t){return new fe(Math.max(0,this.l-zo*(arguments.length?t:1)),this.a,this.b)},Yo.rgb=function(){return he(this.l,this.a,this.b)},Za.rgb=me;var Wo=me.prototype=new ae;Wo.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&i>e&&(e=i),n&&i>n&&(n=i),r&&i>r&&(r=i),new me(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))):new me(i,i,i)},Wo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new me(t*this.r,t*this.g,t*this.b)},Wo.hsl=function(){return Ae(this.r,this.g,this.b)},Wo.toString=function(){return"#"+xe(this.r)+xe(this.g)+xe(this.b)};var Zo=Za.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Zo.forEach(function(t,e){Zo.set(t,ve(e))}),Za.functor=De,Za.xhr=Me(Ce),Za.dsv=function(t,e){function n(t,n,u){arguments.length<3&&(u=n,n=null);var a=Se(t,e,null==n?r:i(n),u);return a.row=function(t){return arguments.length?a.response(null==(n=t)?r:i(t)):n},a}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function u(e){return e.map(a).join(t)}function a(t){return o.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var o=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})},n.parseRows=function(t,e){function n(){if(l>=c)return a;if(i)return i=!1,u;var e=l;if(34===t.charCodeAt(e)){for(var n=e;n++l;){var r=t.charCodeAt(l++),o=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(l)&&(++l,++o);else if(r!==s)continue;return t.slice(e,l-o)}return t.slice(e)}for(var r,i,u={},a={},o=[],c=t.length,l=0,f=0;(r=n())!==a;){for(var h=[];r!==u&&r!==a;)h.push(r),r=n();e&&null==(h=e(h,f++))||o.push(h)}return o},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new y,i=[];return e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))}),[i.map(a).join(t)].concat(e.map(function(e){return i.map(function(t){return a(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(u).join("\n")},n},Za.csv=Za.dsv(",","text/csv"),Za.tsv=Za.dsv(" ","text/tab-separated-values");var Xo,Ko,Jo,Qo,ts,es=to[v(to,"requestAnimationFrame")]||function(t){setTimeout(t,17)};Za.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0),3>r&&(n=Date.now());var i=n+e,u={c:t,t:i,f:!1,n:null};Ko?Ko.n=u:Xo=u,Ko=u,Jo||(Qo=clearTimeout(Qo),Jo=1,es(Be))},Za.timer.flush=function(){Le(),Ne()},Za.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ns=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Re);Za.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=Za.round(t,qe(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),ns[8+n/3]};var rs=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,is=Za.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=Za.round(t,qe(t,e))).toFixed(Math.max(0,Math.min(20,qe(t*(1+1e-15),e))))}}),us=Za.time={},as=Date;Pe.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){os.setUTCDate.apply(this._,arguments)},setDay:function(){os.setUTCDay.apply(this._,arguments)},setFullYear:function(){os.setUTCFullYear.apply(this._,arguments)},setHours:function(){os.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){os.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){os.setUTCMinutes.apply(this._,arguments)},setMonth:function(){os.setUTCMonth.apply(this._,arguments)},setSeconds:function(){os.setUTCSeconds.apply(this._,arguments)},setTime:function(){os.setTime.apply(this._,arguments)}};var os=Date.prototype;us.year=je(function(t){return t=us.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),us.years=us.year.range,us.years.utc=us.year.utc.range,us.day=je(function(t){var e=new as(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),us.days=us.day.range,us.days.utc=us.day.utc.range,us.dayOfYear=function(t){var e=us.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=us[t]=je(function(t){return(t=us.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=us.year(t).getDay();return Math.floor((us.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});us[t+"s"]=n.range,us[t+"s"].utc=n.utc.range,us[t+"OfYear"]=function(t){var n=us.year(t).getDay();return Math.floor((us.dayOfYear(t)+(n+e)%7)/7)}}),us.week=us.sunday,us.weeks=us.sunday.range,us.weeks.utc=us.sunday.utc.range,us.weekOfYear=us.sundayOfYear;var ss={"-":"",_:" ",0:"0"},cs=/^\s*\d+/,ls=/^%/;Za.locale=function(t){return{numberFormat:Oe(t),timeFormat:Ve(t)}};var fs=Za.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Za.format=fs.numberFormat,Za.geo={},ln.prototype={s:0,t:0,add:function(t){fn(t,this.t,hs),fn(hs.s,this.s,this),this.s?this.t+=hs.t:this.s=hs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var hs=new ln;Za.geo.stream=function(t,e){t&&ps.hasOwnProperty(t.type)?ps[t.type](t,e):hn(t,e)};var ps={Feature:function(t,e){hn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rt?4*Mo+t:t,ms.lineStart=ms.lineEnd=ms.point=b}};Za.geo.bounds=function(){function t(t,e){b.push(x=[l=t,h=t]),f>e&&(f=e),e>p&&(p=e)}function e(e,n){var r=yn([e*Lo,n*Lo]);if(m){var i=vn(m,r),u=[i[1],-i[0],0],a=vn(u,i);wn(a),a=An(a);var s=e-d,c=s>0?1:-1,g=a[0]*No*c,y=co(s)>180;if(y^(g>c*d&&c*e>g)){var v=a[1]*No;v>p&&(p=v)}else if(g=(g+360)%360-180,y^(g>c*d&&c*e>g)){var v=-a[1]*No;f>v&&(f=v)}else f>n&&(f=n),n>p&&(p=n);y?d>e?o(l,e)>o(l,h)&&(h=e):o(e,h)>o(l,h)&&(l=e):h>=l?(l>e&&(l=e),e>h&&(h=e)):e>d?o(l,e)>o(l,h)&&(h=e):o(e,h)>o(l,h)&&(l=e)}else t(e,n);m=r,d=e}function n(){w.point=e}function r(){x[0]=l,x[1]=h,w.point=t,m=null}function i(t,n){if(m){var r=t-d;v+=co(r)>180?r+(r>0?360:-360):r}else g=t,y=n;ms.point(t,n),e(t,n)}function u(){ms.lineStart()}function a(){i(g,y),ms.lineEnd(),co(v)>To&&(l=-(h=180)),x[0]=l,x[1]=h,m=null +}function o(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tys?(l=-(h=180),f=-(p=90)):v>To?p=90:-To>v&&(f=-90),x[0]=l,x[1]=h}};return function(t){p=h=-(l=f=1/0),b=[],Za.geo.stream(t,w);var e=b.length;if(e){b.sort(s);for(var n,r=1,i=b[0],u=[i];e>r;++r)n=b[r],c(n[0],i)||c(n[1],i)?(o(i[0],n[1])>o(i[0],i[1])&&(i[1]=n[1]),o(n[0],i[1])>o(i[0],i[1])&&(i[0]=n[0])):u.push(i=n);for(var a,n,d=-1/0,e=u.length-1,r=0,i=u[e];e>=r;i=n,++r)n=u[r],(a=o(i[1],n[0]))>d&&(d=a,l=n[0],h=i[1])}return b=x=null,1/0===l||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[l,f],[h,p]]}}(),Za.geo.centroid=function(t){vs=bs=xs=ws=As=_s=Es=ks=Ds=Cs=Ms=0,Za.geo.stream(t,Ss);var e=Ds,n=Cs,r=Ms,i=e*e+n*n+r*r;return Bo>i&&(e=_s,n=Es,r=ks,To>bs&&(e=xs,n=ws,r=As),i=e*e+n*n+r*r,Bo>i)?[0/0,0/0]:[Math.atan2(n,e)*No,ee(r/Math.sqrt(i))*No]};var vs,bs,xs,ws,As,_s,Es,ks,Ds,Cs,Ms,Ss={sphere:b,point:En,lineStart:Dn,lineEnd:Cn,polygonStart:function(){Ss.lineStart=Mn},polygonEnd:function(){Ss.lineStart=Dn}},Fs=Ln(Sn,On,Pn,[-Mo,-Mo/2]),Ts=1e9;Za.geo.clipExtent=function(){var t,e,n,r,i,u,a={stream:function(t){return i&&(i.valid=!1),i=u(t),i.valid=!0,i},extent:function(o){return arguments.length?(u=zn(t=+o[0][0],e=+o[0][1],n=+o[1][0],r=+o[1][1]),i&&(i.valid=!1,i=null),a):[[t,e],[n,r]]}};return a.extent([[0,0],[960,500]])},(Za.geo.conicEqualArea=function(){return $n(Gn)}).raw=Gn,Za.geo.albers=function(){return Za.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Za.geo.albersUsa=function(){function t(t){var u=t[0],a=t[1];return e=null,n(u,a),e||(r(u,a),e)||i(u,a),e}var e,n,r,i,u=Za.geo.albers(),a=Za.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=Za.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=u.scale(),n=u.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?a:i>=.166&&.234>i&&r>=-.214&&-.115>r?o:u).invert(t)},t.stream=function(t){var e=u.stream(t),n=a.stream(t),r=o.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(u.precision(e),a.precision(e),o.precision(e),t):u.precision()},t.scale=function(e){return arguments.length?(u.scale(e),a.scale(.35*e),o.scale(e),t.translate(u.translate())):u.scale()},t.translate=function(e){if(!arguments.length)return u.translate();var c=u.scale(),l=+e[0],f=+e[1];return n=u.translate(e).clipExtent([[l-.455*c,f-.238*c],[l+.455*c,f+.238*c]]).stream(s).point,r=a.translate([l-.307*c,f+.201*c]).clipExtent([[l-.425*c+To,f+.12*c+To],[l-.214*c-To,f+.234*c-To]]).stream(s).point,i=o.translate([l-.205*c,f+.212*c]).clipExtent([[l-.214*c+To,f+.166*c+To],[l-.115*c-To,f+.234*c-To]]).stream(s).point,t},t.scale(1070)};var Bs,Ls,Ns,qs,Rs,Os,Is={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Ls=0,Is.lineStart=Yn},polygonEnd:function(){Is.lineStart=Is.lineEnd=Is.point=b,Bs+=co(Ls/2)}},Ps={point:Wn,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},js={point:Kn,lineStart:Jn,lineEnd:Qn,polygonStart:function(){js.lineStart=tr},polygonEnd:function(){js.point=Kn,js.lineStart=Jn,js.lineEnd=Qn}};Za.geo.path=function(){function t(t){return t&&("function"==typeof o&&u.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=i(u)),Za.geo.stream(t,a)),u.result()}function e(){return a=null,t}var n,r,i,u,a,o=4.5;return t.area=function(t){return Bs=0,Za.geo.stream(t,i(Is)),Bs},t.centroid=function(t){return xs=ws=As=_s=Es=ks=Ds=Cs=Ms=0,Za.geo.stream(t,i(js)),Ms?[Ds/Ms,Cs/Ms]:ks?[_s/ks,Es/ks]:As?[xs/As,ws/As]:[0/0,0/0]},t.bounds=function(t){return Rs=Os=-(Ns=qs=1/0),Za.geo.stream(t,i(Ps)),[[Ns,qs],[Rs,Os]]},t.projection=function(t){return arguments.length?(i=(n=t)?t.stream||rr(t):Ce,e()):n},t.context=function(t){return arguments.length?(u=null==(r=t)?new Zn:new er(t),"function"!=typeof o&&u.pointRadius(o),e()):r},t.pointRadius=function(e){return arguments.length?(o="function"==typeof e?e:(u.pointRadius(+e),+e),t):o},t.projection(Za.geo.albersUsa()).context(null)},Za.geo.transform=function(t){return{stream:function(e){var n=new ir(e);for(var r in t)n[r]=t[r];return n}}},ir.prototype={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()}},Za.geo.projection=ar,Za.geo.projectionMutator=or,(Za.geo.equirectangular=function(){return ar(cr)}).raw=cr.invert=cr,Za.geo.rotation=function(t){function e(e){return e=t(e[0]*Lo,e[1]*Lo),e[0]*=No,e[1]*=No,e}return t=fr(t[0]%360*Lo,t[1]*Lo,t.length>2?t[2]*Lo:0),e.invert=function(e){return e=t.invert(e[0]*Lo,e[1]*Lo),e[0]*=No,e[1]*=No,e},e},lr.invert=cr,Za.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=fr(-t[0]*Lo,-t[1]*Lo,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=No,t[1]*=No}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=gr((e=+r)*Lo,i*Lo),t):e},t.precision=function(r){return arguments.length?(n=gr(e*Lo,(i=+r)*Lo),t):i},t.angle(90)},Za.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Lo,i=t[1]*Lo,u=e[1]*Lo,a=Math.sin(r),o=Math.cos(r),s=Math.sin(i),c=Math.cos(i),l=Math.sin(u),f=Math.cos(u);return Math.atan2(Math.sqrt((n=f*a)*n+(n=c*l-s*f*o)*n),s*l+c*f*o)},Za.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return Za.range(Math.ceil(u/y)*y,i,y).map(h).concat(Za.range(Math.ceil(c/m)*m,s,m).map(p)).concat(Za.range(Math.ceil(r/d)*d,n,d).filter(function(t){return co(t%y)>To}).map(l)).concat(Za.range(Math.ceil(o/g)*g,a,g).filter(function(t){return co(t%m)>To}).map(f))}var n,r,i,u,a,o,s,c,l,f,h,p,d=10,g=d,y=90,m=360,v=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(p(s).slice(1),h(i).reverse().slice(1),p(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(u=+e[0][0],i=+e[1][0],c=+e[0][1],s=+e[1][1],u>i&&(e=u,u=i,i=e),c>s&&(e=c,c=s,s=e),t.precision(v)):[[u,c],[i,s]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],o=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),o>a&&(e=o,o=a,a=e),t.precision(v)):[[r,o],[n,a]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(y=+e[0],m=+e[1],t):[y,m]},t.minorStep=function(e){return arguments.length?(d=+e[0],g=+e[1],t):[d,g]},t.precision=function(e){return arguments.length?(v=+e,l=mr(o,a,90),f=vr(r,n,v),h=mr(c,s,90),p=vr(u,i,v),t):v},t.majorExtent([[-180,-90+To],[180,90-To]]).minorExtent([[-180,-80-To],[180,80+To]])},Za.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=br,i=xr;return t.distance=function(){return Za.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(i=e,n="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},Za.geo.interpolate=function(t,e){return wr(t[0]*Lo,t[1]*Lo,e[0]*Lo,e[1]*Lo)},Za.geo.length=function(t){return Us=0,Za.geo.stream(t,Vs),Us};var Us,Vs={sphere:b,point:b,lineStart:Ar,lineEnd:b,polygonStart:b,polygonEnd:b},zs=_r(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(Za.geo.azimuthalEqualArea=function(){return ar(zs)}).raw=zs;var Hs=_r(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},Ce);(Za.geo.azimuthalEquidistant=function(){return ar(Hs)}).raw=Hs,(Za.geo.conicConformal=function(){return $n(Er)}).raw=Er,(Za.geo.conicEquidistant=function(){return $n(kr)}).raw=kr;var $s=_r(function(t){return 1/t},Math.atan);(Za.geo.gnomonic=function(){return ar($s)}).raw=$s,Dr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Fo]},(Za.geo.mercator=function(){return Cr(Dr)}).raw=Dr;var Gs=_r(function(){return 1},Math.asin);(Za.geo.orthographic=function(){return ar(Gs)}).raw=Gs;var Ys=_r(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(Za.geo.stereographic=function(){return ar(Ys)}).raw=Ys,Mr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Fo]},(Za.geo.transverseMercator=function(){var t=Cr(Mr),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=Mr,Za.geom={},Za.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=De(n),u=De(r),a=t.length,o=[],s=[];for(e=0;a>e;e++)o.push([+i.call(this,t[e],e),+u.call(this,t[e],e),e]);for(o.sort(Br),e=0;a>e;e++)s.push([o[e][0],-o[e][1]]);var c=Tr(o),l=Tr(s),f=l[0]===c[0],h=l[l.length-1]===c[c.length-1],p=[];for(e=c.length-1;e>=0;--e)p.push(t[o[c[e]][2]]);for(e=+f;e=r&&c.x<=u&&c.y>=i&&c.y<=a?[[r,a],[u,a],[u,i],[r,i]]:[];l.point=t[o]}),e}function n(t){return t.map(function(t,e){return{x:Math.round(u(t,e)/To)*To,y:Math.round(a(t,e)/To)*To,i:e}})}var r=Sr,i=Fr,u=r,a=i,o=nc;return t?e(t):(e.links=function(t){return oi(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return oi(n(t)).cells.forEach(function(n,r){for(var i,u,a=n.site,o=n.edges.sort($r),s=-1,c=o.length,l=o[c-1].edge,f=l.l===a?l.r:l.l;++s=c,h=r>=l,p=(h<<1)+f;t.leaf=!1,t=t.nodes[p]||(t.nodes[p]=hi()),f?i=c:o=c,h?a=l:s=l,u(t,e,n,r,i,a,o,s)}var l,f,h,p,d,g,y,m,v,b=De(o),x=De(s);if(null!=e)g=e,y=n,m=r,v=i;else if(m=v=-(g=y=1/0),f=[],h=[],d=t.length,a)for(p=0;d>p;++p)l=t[p],l.xm&&(m=l.x),l.y>v&&(v=l.y),f.push(l.x),h.push(l.y);else for(p=0;d>p;++p){var w=+b(l=t[p],p),A=+x(l,p);g>w&&(g=w),y>A&&(y=A),w>m&&(m=w),A>v&&(v=A),f.push(w),h.push(A)}var _=m-g,E=v-y;_>E?v=y+_:m=g+E;var k=hi();if(k.add=function(t){u(k,t,+b(t,++p),+x(t,p),g,y,m,v)},k.visit=function(t){pi(t,k,g,y,m,v)},p=-1,null==e){for(;++p=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=ac.get(n)||uc,r=oc.get(r)||Ce,xi(r(n.apply(null,Xa.call(arguments,1))))},Za.interpolateHcl=Li,Za.interpolateHsl=Ni,Za.interpolateLab=qi,Za.interpolateRound=Ri,Za.transform=function(t){var e=Ja.createElementNS(Za.ns.prefix.svg,"g");return(Za.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Oi(n?n.matrix:sc)})(t)},Oi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var sc={a:1,b:0,c:0,d:1,e:0,f:0};Za.interpolateTransform=Ui,Za.layout={},Za.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++no*o/y){if(d>s){var c=e.charge/s;t.px-=u*c,t.py-=a*c}return!0}if(e.point&&s&&d>s){var c=e.pointCharge/s;t.px-=u*c,t.py-=a*c}}return!e.charge}}function e(t){t.px=Za.event.x,t.py=Za.event.y,o.resume()}var n,r,i,u,a,o={},s=Za.dispatch("start","tick","end"),c=[1,1],l=.9,f=cc,h=lc,p=-30,d=fc,g=.1,y=.64,m=[],v=[];return o.tick=function(){if((r*=.99)<.005)return s.end({type:"end",alpha:r=0}),!0;var e,n,o,f,h,d,y,b,x,w=m.length,A=v.length;for(n=0;A>n;++n)o=v[n],f=o.source,h=o.target,b=h.x-f.x,x=h.y-f.y,(d=b*b+x*x)&&(d=r*u[n]*((d=Math.sqrt(d))-i[n])/d,b*=d,x*=d,h.x-=b*(y=f.weight/(h.weight+f.weight)),h.y-=x*y,f.x+=b*(y=1-y),f.y+=x*y);if((y=r*g)&&(b=c[0]/2,x=c[1]/2,n=-1,y))for(;++n0?t:0:t>0&&(s.start({type:"start",alpha:r=t}),Za.timer(o.tick)),o):r},o.start=function(){function t(t,r){if(!n){for(n=new Array(s),o=0;s>o;++o)n[o]=[];for(o=0;c>o;++o){var i=v[o];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var u,a=n[e],o=-1,c=a.length;++oe;++e)(r=m[e]).index=e,r.weight=0;for(e=0;l>e;++e)r=v[e],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(e=0;s>e;++e)r=m[e],isNaN(r.x)&&(r.x=t("x",d)),isNaN(r.y)&&(r.y=t("y",g)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof f)for(e=0;l>e;++e)i[e]=+f.call(this,v[e],e);else for(e=0;l>e;++e)i[e]=f;if(u=[],"function"==typeof h)for(e=0;l>e;++e)u[e]=+h.call(this,v[e],e);else for(e=0;l>e;++e)u[e]=h;if(a=[],"function"==typeof p)for(e=0;s>e;++e)a[e]=+p.call(this,m[e],e);else for(e=0;s>e;++e)a[e]=p;return o.resume()},o.resume=function(){return o.alpha(.1)},o.stop=function(){return o.alpha(0)},o.drag=function(){return n||(n=Za.behavior.drag().origin(Ce).on("dragstart.force",Yi).on("drag.force",e).on("dragend.force",Wi)),arguments.length?void this.on("mouseover.force",Zi).on("mouseout.force",Xi).call(n):n},Za.rebind(o,s,"on")};var cc=20,lc=1,fc=1/0;Za.layout.hierarchy=function(){function t(i){var u,a=[i],o=[];for(i.depth=0;null!=(u=a.pop());)if(o.push(u),(c=n.call(t,u,u.depth))&&(s=c.length)){for(var s,c,l;--s>=0;)a.push(l=c[s]),l.parent=u,l.depth=u.depth+1;r&&(u.value=0),u.children=c}else r&&(u.value=+r.call(t,u,u.depth)||0),delete u.children;return tu(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)}),o}var e=ru,n=eu,r=nu;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(Qi(e,function(t){t.children&&(t.value=0)}),tu(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},Za.layout.partition=function(){function t(e,n,r,i){var u=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,u&&(a=u.length)){var a,o,s,c=-1;for(r=e.value?r/e.value:0;++cd;++d)for(i.call(t,c[0][d],g=y[d],l[0][d][1]),p=1;h>p;++p)i.call(t,c[p][d],g+=l[p-1][d][1],l[p][d][1]);return o}var e=Ce,n=su,r=cu,i=ou,u=uu,a=au;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:pc.get(e)||su,t):n},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:dc.get(e)||cu,t):r},t.x=function(e){return arguments.length?(u=e,t):u},t.y=function(e){return arguments.length?(a=e,t):a},t.out=function(e){return arguments.length?(i=e,t):i},t};var pc=Za.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(lu),u=t.map(fu),a=Za.range(r).sort(function(t,e){return i[t]-i[e]}),o=0,s=0,c=[],l=[];for(e=0;r>e;++e)n=a[e],s>o?(o+=u[n],c.push(n)):(s+=u[n],l.push(n));return l.reverse().concat(c)},reverse:function(t){return Za.range(t.length).reverse()},"default":su}),dc=Za.map({silhouette:function(t){var e,n,r,i=t.length,u=t[0].length,a=[],o=0,s=[];for(n=0;u>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>o&&(o=r),a.push(r)}for(n=0;u>n;++n)s[n]=(o-a[n])/2;return s},wiggle:function(t){var e,n,r,i,u,a,o,s,c,l=t.length,f=t[0],h=f.length,p=[];for(p[0]=s=c=0,n=1;h>n;++n){for(e=0,i=0;l>e;++e)i+=t[e][n][1];for(e=0,u=0,o=f[n][0]-f[n-1][0];l>e;++e){for(r=0,a=(t[e][n][1]-t[e][n-1][1])/(2*o);e>r;++r)a+=(t[r][n][1]-t[r][n-1][1])/o;u+=a*t[e][n][1]}p[n]=s-=i?u/i*o:0,c>s&&(c=s)}for(n=0;h>n;++n)p[n]-=c;return p},expand:function(t){var e,n,r,i=t.length,u=t[0].length,a=1/i,o=[];for(n=0;u>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=a}for(n=0;u>n;++n)o[n]=0;return o},zero:cu});Za.layout.histogram=function(){function t(t,u){for(var a,o,s=[],c=t.map(n,this),l=r.call(this,c,u),f=i.call(this,l,c,u),u=-1,h=c.length,p=f.length-1,d=e?1:1/h;++u0)for(u=-1;++u=l[0]&&o<=l[1]&&(a=s[Za.bisect(f,o,1,p)-1],a.y+=d,a.push(t[u]));return s}var e=!0,n=Number,r=gu,i=pu;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=De(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return du(t,e)}:De(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},Za.layout.pack=function(){function t(t,u){var a=n.call(this,t,u),o=a[0],s=i[0],c=i[1],l=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(o.x=o.y=0,tu(o,function(t){t.r=+l(t.value)}),tu(o,xu),r){var f=r*(e?1:Math.max(2*o.r/s,2*o.r/c))/2;tu(o,function(t){t.r+=f}),tu(o,xu),tu(o,function(t){t.r-=f})}return _u(o,s/2,c/2,e?1:1/Math.max(2*o.r/s,2*o.r/c)),a}var e,n=Za.layout.hierarchy().sort(yu),r=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},Ji(t,n)},Za.layout.tree=function(){function t(t,i){var l=a.call(this,t,i),f=l[0],h=e(f);if(tu(h,n),h.parent.m=-h.z,Qi(h,r),c)Qi(f,u);else{var p=f,d=f,g=f;Qi(f,function(t){t.xd.x&&(d=t),t.depth>g.depth&&(g=t)});var y=o(p,d)/2-p.x,m=s[0]/(d.x+o(d,p)/2+y),v=s[1]/(g.depth||1);Qi(f,function(t){t.x=(t.x+y)*m,t.y=t.depth*v})}return l}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,u=e.children,a=0,o=u.length;o>a;++a)r.push((u[a]=i={_:u[a],parent:e,children:(i=u[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){Su(t);var u=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+o(t._,r._),t.m=t.z-u):t.z=u}else r&&(t.z=r.z+o(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,u=t,a=e,s=i.parent.children[0],c=i.m,l=u.m,f=a.m,h=s.m;a=Cu(a),i=Du(i),a&&i;)s=Du(s),u=Cu(u),u.a=t,r=a.z+f-i.z-c+o(a._,i._),r>0&&(Mu(Fu(a,t,n),t,r),c+=r,l+=r),f+=a.m,c+=i.m,h+=s.m,l+=u.m;a&&!Cu(u)&&(u.t=a,u.m+=f-l),i&&!Du(s)&&(s.t=i,s.m+=c-h,n=t)}return n}function u(t){t.x*=s[0],t.y=t.depth*s[1]}var a=Za.layout.hierarchy().sort(null).value(null),o=ku,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(o=e,t):o},t.size=function(e){return arguments.length?(c=null==(s=e)?u:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:u,t):c?s:null},Ji(t,a)},Za.layout.cluster=function(){function t(t,u){var a,o=e.call(this,t,u),s=o[0],c=0;tu(s,function(t){var e=t.children;e&&e.length?(t.x=Bu(e),t.y=Tu(e)):(t.x=a?c+=n(t,a):0,t.y=0,a=t)});var l=Lu(s),f=Nu(s),h=l.x-n(l,f)/2,p=f.x+n(f,l)/2;return tu(s,i?function(t){t.x=(t.x-s.x)*r[0],t.y=(s.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(p-h)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),o}var e=Za.layout.hierarchy().sort(null).value(null),n=ku,r=[1,1],i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=null==(r=e),t):i?null:r},t.nodeSize=function(e){return arguments.length?(i=null!=(r=e),t):i?r:null},Ji(t,e)},Za.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,u=t.length;++ie?0:e),n.area=isNaN(r)||0>=r?0:r}function e(n){var u=n.children;if(u&&u.length){var a,o,s,c=f(n),l=[],h=u.slice(),d=1/0,g="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&n.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(h,c.dx*c.dy/n.value),l.area=0;(s=h.length)>0;)l.push(a=h[s-1]),l.area+=a.area,"squarify"!==p||(o=r(l,g))<=d?(h.pop(),d=o):(l.area-=l.pop().area,i(l,g,c,!1),g=Math.min(c.dx,c.dy),l.length=l.area=0,d=1/0);l.length&&(i(l,g,c,!0),l.length=l.area=0),u.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var u,a=f(e),o=r.slice(),s=[];for(t(o,a.dx*a.dy/e.value),s.area=0;u=o.pop();)s.push(u),s.area+=u.area,null!=u.z&&(i(s,u.z?a.dx:a.dy,a,!o.length),s.length=s.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,u=1/0,a=-1,o=t.length;++an&&(u=n),n>i&&(i=n));return r*=r,e*=e,r?Math.max(e*i*d/r,r/(e*u*d)):1/0}function i(t,e,n,r){var i,u=-1,a=t.length,o=n.x,c=n.y,l=e?s(t.area/e):0;if(e==n.dx){for((r||l>n.dy)&&(l=n.dy);++un.dx)&&(l=n.dx);++un&&(e=1),1>n&&(t=0),function(){var n,r,i;do n=2*Math.random()-1,r=2*Math.random()-1,i=n*n+r*r;while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=Za.random.normal.apply(Za,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=Za.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}},Za.scale={};var gc={floor:Ce,ceil:Ce};Za.scale.linear=function(){return zu([0,1],[0,1],vi,!1)};var yc={s:1,g:1,p:1,r:1,e:1};Za.scale.log=function(){return Ku(Za.scale.linear().domain([0,1]),10,!0,[1,10])};var mc=Za.format(".0e"),vc={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};Za.scale.pow=function(){return Ju(Za.scale.linear(),1,[0,1])},Za.scale.sqrt=function(){return Za.scale.pow().exponent(.5)},Za.scale.ordinal=function(){return ta([],{t:"range",a:[[]]})},Za.scale.category10=function(){return Za.scale.ordinal().range(bc)},Za.scale.category20=function(){return Za.scale.ordinal().range(xc)},Za.scale.category20b=function(){return Za.scale.ordinal().range(wc)},Za.scale.category20c=function(){return Za.scale.ordinal().range(Ac)};var bc=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(be),xc=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(be),wc=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(be),Ac=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(be); +Za.scale.quantile=function(){return ea([],[])},Za.scale.quantize=function(){return na(0,1,[0,1])},Za.scale.threshold=function(){return ra([.5],[0,1])},Za.scale.identity=function(){return ia([0,1])},Za.svg={},Za.svg.arc=function(){function t(){var t=e.apply(this,arguments),u=n.apply(this,arguments),a=r.apply(this,arguments)+_c,o=i.apply(this,arguments)+_c,s=(a>o&&(s=a,a=o,o=s),o-a),c=Mo>s?"0":"1",l=Math.cos(a),f=Math.sin(a),h=Math.cos(o),p=Math.sin(o);return s>=Ec?t?"M0,"+u+"A"+u+","+u+" 0 1,1 0,"+-u+"A"+u+","+u+" 0 1,1 0,"+u+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+u+"A"+u+","+u+" 0 1,1 0,"+-u+"A"+u+","+u+" 0 1,1 0,"+u+"Z":t?"M"+u*l+","+u*f+"A"+u+","+u+" 0 "+c+",1 "+u*h+","+u*p+"L"+t*h+","+t*p+"A"+t+","+t+" 0 "+c+",0 "+t*l+","+t*f+"Z":"M"+u*l+","+u*f+"A"+u+","+u+" 0 "+c+",1 "+u*h+","+u*p+"L0,0Z"}var e=ua,n=aa,r=oa,i=sa;return t.innerRadius=function(n){return arguments.length?(e=De(n),t):e},t.outerRadius=function(e){return arguments.length?(n=De(e),t):n},t.startAngle=function(e){return arguments.length?(r=De(e),t):r},t.endAngle=function(e){return arguments.length?(i=De(e),t):i},t.centroid=function(){var t=(e.apply(this,arguments)+n.apply(this,arguments))/2,u=(r.apply(this,arguments)+i.apply(this,arguments))/2+_c;return[Math.cos(u)*t,Math.sin(u)*t]},t};var _c=-Fo,Ec=So-To;Za.svg.line=function(){return ca(Ce)};var kc=Za.map({linear:la,"linear-closed":fa,step:ha,"step-before":pa,"step-after":da,basis:xa,"basis-open":wa,"basis-closed":Aa,bundle:_a,cardinal:ma,"cardinal-open":ga,"cardinal-closed":ya,monotone:Sa});kc.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Dc=[0,2/3,1/3,0],Cc=[0,1/3,2/3,0],Mc=[0,1/6,2/3,1/6];Za.svg.line.radial=function(){var t=ca(Fa);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},pa.reverse=da,da.reverse=pa,Za.svg.area=function(){return Ta(Ce)},Za.svg.area.radial=function(){var t=Ta(Fa);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},Za.svg.chord=function(){function t(t,o){var s=e(this,u,t,o),c=e(this,a,t,o);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(n(s,c)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,s.r,s.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),u=o.call(t,i,r),a=s.call(t,i,r)+_c,l=c.call(t,i,r)+_c;return{r:u,a0:a,a1:l,p0:[u*Math.cos(a),u*Math.sin(a)],p1:[u*Math.cos(l),u*Math.sin(l)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Mo)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var u=br,a=xr,o=Ba,s=oa,c=sa;return t.radius=function(e){return arguments.length?(o=De(e),t):o},t.source=function(e){return arguments.length?(u=De(e),t):u},t.target=function(e){return arguments.length?(a=De(e),t):a},t.startAngle=function(e){return arguments.length?(s=De(e),t):s},t.endAngle=function(e){return arguments.length?(c=De(e),t):c},t},Za.svg.diagonal=function(){function t(t,i){var u=e.call(this,t,i),a=n.call(this,t,i),o=(u.y+a.y)/2,s=[u,{x:u.x,y:o},{x:a.x,y:o},a];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=br,n=xr,r=La;return t.source=function(n){return arguments.length?(e=De(n),t):e},t.target=function(e){return arguments.length?(n=De(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},Za.svg.diagonal.radial=function(){var t=Za.svg.diagonal(),e=La,n=t.projection;return t.projection=function(t){return arguments.length?n(Na(e=t)):e},t},Za.svg.symbol=function(){function t(t,r){return(Sc.get(e.call(this,t,r))||Oa)(n.call(this,t,r))}var e=Ra,n=qa;return t.type=function(n){return arguments.length?(e=De(n),t):e},t.size=function(e){return arguments.length?(n=De(e),t):n},t};var Sc=Za.map({circle:Oa,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Lc)),n=e*Lc;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Bc),n=e*Bc/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Bc),n=e*Bc/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});Za.svg.symbolTypes=Sc.keys();var Fc,Tc,Bc=Math.sqrt(3),Lc=Math.tan(30*Lo),Nc=[],qc=0;Nc.call=xo.call,Nc.empty=xo.empty,Nc.node=xo.node,Nc.size=xo.size,Za.transition=function(t){return arguments.length?Fc?t.transition():t:_o.transition()},Za.transition.prototype=Nc,Nc.select=function(t){var e,n,r,i=this.id,u=[];t=D(t);for(var a=-1,o=this.length;++au;u++){i.push(e=[]);for(var n=this[u],o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,u)&&e.push(r)}return Ia(i,this.id)},Nc.tween=function(t,e){var n=this.id;return arguments.length<2?this.node().__transition__[n].tween.get(t):j(this,null==e?function(e){e.__transition__[n].tween.remove(t)}:function(r){r.__transition__[n].tween.set(t,e)})},Nc.attr=function(t,e){function n(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(o);return n!==t&&(e=a(n,t),function(t){this.setAttribute(o,e(t))})})}function u(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(o.space,o.local);return n!==t&&(e=a(n,t),function(t){this.setAttributeNS(o.space,o.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var a="transform"==t?Ui:vi,o=Za.ns.qualify(t);return Pa(this,"attr."+t,e,o.local?u:i)},Nc.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=Za.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)},Nc.style=function(t,e,n){function r(){this.style.removeProperty(t)}function i(e){return null==e?r:(e+="",function(){var r,i=to.getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(r=vi(i,e),function(e){this.style.setProperty(t,r(e),n)})})}var u=arguments.length;if(3>u){if("string"!=typeof t){2>u&&(e="");for(n in t)this.style(n,t[n],e);return this}n=""}return Pa(this,"style."+t,e,i)},Nc.styleTween=function(t,e,n){function r(r,i){var u=e.call(this,r,i,to.getComputedStyle(this,null).getPropertyValue(t));return u&&function(e){this.style.setProperty(t,u(e),n)}}return arguments.length<3&&(n=""),this.tween("style."+t,r)},Nc.text=function(t){return Pa(this,"text",t,ja)},Nc.remove=function(){return this.each("end.transition",function(){var t;this.__transition__.count<2&&(t=this.parentNode)&&t.removeChild(this)})},Nc.ease=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].ease:("function"!=typeof t&&(t=Za.ease.apply(Za,arguments)),j(this,function(n){n.__transition__[e].ease=t}))},Nc.delay=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].delay:j(this,"function"==typeof t?function(n,r,i){n.__transition__[e].delay=+t.call(n,n.__data__,r,i)}:(t=+t,function(n){n.__transition__[e].delay=t}))},Nc.duration=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].duration:j(this,"function"==typeof t?function(n,r,i){n.__transition__[e].duration=Math.max(1,t.call(n,n.__data__,r,i))}:(t=Math.max(1,t),function(n){n.__transition__[e].duration=t}))},Nc.each=function(t,e){var n=this.id;if(arguments.length<2){var r=Tc,i=Fc;Fc=n,j(this,function(e,r,i){Tc=e.__transition__[n],t.call(e,e.__data__,r,i)}),Tc=r,Fc=i}else j(this,function(r){var i=r.__transition__[n];(i.event||(i.event=Za.dispatch("start","end"))).on(t,e)});return this},Nc.transition=function(){for(var t,e,n,r,i=this.id,u=++qc,a=[],o=0,s=this.length;s>o;o++){a.push(t=[]);for(var e=this[o],c=0,l=e.length;l>c;c++)(n=e[c])&&(r=Object.create(n.__transition__[i]),r.delay+=r.duration,Ua(n,c,u,r)),t.push(n)}return Ia(a,u)},Za.svg.axis=function(){function t(t){t.each(function(){var t,c=Za.select(this),l=this.__chart__||n,f=this.__chart__=n.copy(),h=null==s?f.ticks?f.ticks.apply(f,o):f.domain():s,p=null==e?f.tickFormat?f.tickFormat.apply(f,o):Ce:e,d=c.selectAll(".tick").data(h,f),g=d.enter().insert("g",".domain").attr("class","tick").style("opacity",To),y=Za.transition(d.exit()).style("opacity",To).remove(),m=Za.transition(d.order()).style("opacity",1),v=Math.max(i,0)+a,b=Iu(f),x=c.selectAll(".domain").data([0]),w=(x.enter().append("path").attr("class","domain"),Za.transition(x));g.append("line"),g.append("text");var A,_,E,k,D=g.select("line"),C=m.select("line"),M=d.select("text").text(p),S=g.select("text"),F=m.select("text"),T="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=Va,A="x",E="y",_="x2",k="y2",M.attr("dy",0>T?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+T*u+"V0H"+b[1]+"V"+T*u)):(t=za,A="y",E="x",_="y2",k="x2",M.attr("dy",".32em").style("text-anchor",0>T?"end":"start"),w.attr("d","M"+T*u+","+b[0]+"H0V"+b[1]+"H"+T*u)),D.attr(k,T*i),S.attr(E,T*v),C.attr(_,0).attr(k,T*i),F.attr(A,0).attr(E,T*v),f.rangeBand){var B=f,L=B.rangeBand()/2;l=f=function(t){return B(t)+L}}else l.rangeBand?l=f:y.call(t,f,l);g.call(t,l,f),m.call(t,f,f)})}var e,n=Za.scale.linear(),r=Rc,i=6,u=6,a=3,o=[10],s=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(r=e in Oc?e+"":Rc,t):r},t.ticks=function(){return arguments.length?(o=arguments,t):o},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(i=+e,u=+arguments[n-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(u=+e,t):u},t.tickPadding=function(e){return arguments.length?(a=+e,t):a},t.tickSubdivide=function(){return arguments.length&&t},t};var Rc="bottom",Oc={top:1,right:1,bottom:1,left:1};Za.svg.brush=function(){function t(u){u.each(function(){var u=Za.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),a=u.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),u.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=u.selectAll(".resize").data(d,Ce);o.exit().remove(),o.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ic[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",t.empty()?"none":null);var l,f=Za.transition(u),h=Za.transition(a);s&&(l=Iu(s),h.attr("x",l[0]).attr("width",l[1]-l[0]),n(f)),c&&(l=Iu(c),h.attr("y",l[0]).attr("height",l[1]-l[0]),r(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+l[+/e$/.test(t)]+","+f[+/^s/.test(t)]+")"})}function n(t){t.select(".extent").attr("x",l[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function r(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function i(){function i(){32==Za.event.keyCode&&(M||(v=null,F[0]-=l[1],F[1]-=f[1],M=2),A())}function d(){32==Za.event.keyCode&&2==M&&(F[0]+=l[1],F[1]+=f[1],M=0,A())}function g(){var t=Za.mouse(x),i=!1;b&&(t[0]+=b[0],t[1]+=b[1]),M||(Za.event.altKey?(v||(v=[(l[0]+l[1])/2,(f[0]+f[1])/2]),F[0]=l[+(t[0]d?(i=r,r=d):i=d),g[0]!=r||g[1]!=i?(n?a=null:u=null,g[0]=r,g[1]=i,!0):void 0}function m(){g(),E.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),Za.select("body").style("cursor",null),T.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),S(),_({type:"brushend"})}var v,b,x=this,w=Za.select(Za.event.target),_=o.of(x,arguments),E=Za.select(x),k=w.datum(),D=!/^(n|s)$/.test(k)&&s,C=!/^(e|w)$/.test(k)&&c,M=w.classed("extent"),S=Y(),F=Za.mouse(x),T=Za.select(to).on("keydown.brush",i).on("keyup.brush",d);if(Za.event.changedTouches?T.on("touchmove.brush",g).on("touchend.brush",m):T.on("mousemove.brush",g).on("mouseup.brush",m),E.interrupt().selectAll("*").interrupt(),M)F[0]=l[0]-F[0],F[1]=f[0]-F[1];else if(k){var B=+/w$/.test(k),L=+/^n/.test(k);b=[l[1-B]-F[0],f[1-L]-F[1]],F[0]=l[B],F[1]=f[L]}else Za.event.altKey&&(v=F.slice());E.style("pointer-events","none").selectAll(".resize").style("display",null),Za.select("body").style("cursor",w.style("cursor")),_({type:"brushstart"}),g()}var u,a,o=E(t,"brushstart","brush","brushend"),s=null,c=null,l=[0,0],f=[0,0],h=!0,p=!0,d=Pc[0];return t.event=function(t){t.each(function(){var t=o.of(this,arguments),e={x:l,y:f,i:u,j:a},n=this.__chart__||e;this.__chart__=e,Fc?Za.select(this).transition().each("start.brush",function(){u=n.i,a=n.j,l=n.x,f=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=bi(l,e.x),r=bi(f,e.y);return u=a=null,function(i){l=e.x=n(i),f=e.y=r(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){u=e.i,a=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(s=e,d=Pc[!s<<1|!c],t):s},t.y=function(e){return arguments.length?(c=e,d=Pc[!s<<1|!c],t):c},t.clamp=function(e){return arguments.length?(s&&c?(h=!!e[0],p=!!e[1]):s?h=!!e:c&&(p=!!e),t):s&&c?[h,p]:s?h:c?p:null},t.extent=function(e){var n,r,i,o,h;return arguments.length?(s&&(n=e[0],r=e[1],c&&(n=n[0],r=r[0]),u=[n,r],s.invert&&(n=s(n),r=s(r)),n>r&&(h=n,n=r,r=h),(n!=l[0]||r!=l[1])&&(l=[n,r])),c&&(i=e[0],o=e[1],s&&(i=i[1],o=o[1]),a=[i,o],c.invert&&(i=c(i),o=c(o)),i>o&&(h=i,i=o,o=h),(i!=f[0]||o!=f[1])&&(f=[i,o])),t):(s&&(u?(n=u[0],r=u[1]):(n=l[0],r=l[1],s.invert&&(n=s.invert(n),r=s.invert(r)),n>r&&(h=n,n=r,r=h))),c&&(a?(i=a[0],o=a[1]):(i=f[0],o=f[1],c.invert&&(i=c.invert(i),o=c.invert(o)),i>o&&(h=i,i=o,o=h))),s&&c?[[n,i],[r,o]]:s?[n,r]:c&&[i,o])},t.clear=function(){return t.empty()||(l=[0,0],f=[0,0],u=a=null),t},t.empty=function(){return!!s&&l[0]==l[1]||!!c&&f[0]==f[1]},Za.rebind(t,o,"on")};var Ic={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Pc=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],jc=us.format=fs.timeFormat,Uc=jc.utc,Vc=Uc("%Y-%m-%dT%H:%M:%S.%LZ");jc.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ha:Vc,Ha.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ha.toString=Vc.toString,us.second=je(function(t){return new as(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),us.seconds=us.second.range,us.seconds.utc=us.second.utc.range,us.minute=je(function(t){return new as(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),us.minutes=us.minute.range,us.minutes.utc=us.minute.utc.range,us.hour=je(function(t){var e=t.getTimezoneOffset()/60;return new as(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),us.hours=us.hour.range,us.hours.utc=us.hour.utc.range,us.month=je(function(t){return t=us.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),us.months=us.month.range,us.months.utc=us.month.utc.range;var zc=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Hc=[[us.second,1],[us.second,5],[us.second,15],[us.second,30],[us.minute,1],[us.minute,5],[us.minute,15],[us.minute,30],[us.hour,1],[us.hour,3],[us.hour,6],[us.hour,12],[us.day,1],[us.day,2],[us.week,1],[us.month,1],[us.month,3],[us.year,1]],$c=jc.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Sn]]),Gc={range:function(t,e,n){return Za.range(Math.ceil(t/n)*n,+e,n).map(Ga)},floor:Ce,ceil:Ce};Hc.year=us.year,us.scale=function(){return $a(Za.scale.linear(),Hc,$c)};var Yc=Hc.map(function(t){return[t[0].utc,t[1]]}),Wc=Uc.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Sn]]);Yc.year=us.year.utc,us.scale.utc=function(){return $a(Za.scale.linear(),Yc,Wc)},Za.text=Me(function(t){return t.responseText}),Za.json=function(t,e){return Se(t,"application/json",Ya,e)},Za.html=function(t,e){return Se(t,"text/html",Wa,e)},Za.xml=Me(function(t){return t.responseXML}),"function"==typeof define&&define.amd?define(Za):"object"==typeof e&&e.exports&&(e.exports=Za),this.d3=Za}()},{}],2:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),dagre:t("./lib/dagre"),intersect:t("./lib/intersect"),render:t("./lib/render"),util:t("./lib/util"),version:t("./lib/version")}},{"./lib/dagre":9,"./lib/graphlib":10,"./lib/intersect":11,"./lib/render":24,"./lib/util":26,"./lib/version":27}],3:[function(t,e){function n(t,e,n,r){var u=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),a=u.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");i.applyStyle(a,n[r+"Style"])}function r(t,e,n,r){var u=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),a=u.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");i.applyStyle(a,n[r+"Style"])}var i=t("./util");e.exports={"default":n,normal:n,vee:r}},{"./util":26}],4:[function(t,e){function n(t,e){var n=e.nodes().filter(function(t){return r.isSubgraph(e,t)}),i=t.selectAll("g.cluster").data(n,function(t){return t});i.enter().append("g").attr("class","cluster").style("opacity",0).append("rect"),r.applyTransition(i.exit(),e).style("opacity",0).remove(),r.applyTransition(i,e).style("opacity",1),r.applyTransition(i.selectAll("rect"),e).attr("width",function(t){return e.node(t).width}).attr("height",function(t){return e.node(t).height}).attr("x",function(t){var n=e.node(t);return n.x-n.width/2}).attr("y",function(t){var n=e.node(t);return n.y-n.height/2})}var r=t("./util");e.exports=n},{"./util":26}],5:[function(t,e){"use strict";function n(t,e){var n=t.selectAll("g.edgeLabel").data(e.edges(),function(t){return u.edgeToId(t)}).classed("update",!0);return n.selectAll("*").remove(),n.enter().append("g").classed("edgeLabel",!0).style("opacity",0),n.each(function(t){var n=e.edge(t),u=i(a.select(this),e.edge(t),0,0).classed("label",!0),o=u.node().getBBox();n.labelId&&u.attr("id",n.labelId),r.has(n,"width")||(n.width=o.width),r.has(n,"height")||(n.height=o.height)}),u.applyTransition(n.exit(),e).style("opacity",0).remove(),n}var r=t("./lodash"),i=t("./label/add-label"),u=t("./util"),a=t("./d3");e.exports=n},{"./d3":8,"./label/add-label":19,"./lodash":21,"./util":26}],6:[function(t,e){"use strict";function n(t,e,n){var i=t.selectAll("g.edgePath").data(e.edges(),function(t){return l.edgeToId(t)}).classed("update",!0);return a(i,e),o(i,e),l.applyTransition(i,e).style("opacity",1),i.selectAll("path.path").each(function(t){var n=e.edge(t);n.arrowheadId=s.uniqueId("arrowhead");var i=f.select(this).attr("marker-end",function(){return"url(#"+n.arrowheadId+")"}).style("fill","none");l.applyTransition(i,e).attr("d",function(t){return r(e,t)}),n.id&&i.attr("id",n.id),l.applyStyle(i,n.style)}),i.selectAll("defs *").remove(),i.selectAll("defs").each(function(t){var r=e.edge(t),i=n[r.arrowhead];i(f.select(this),r.arrowheadId,r,"arrowhead")}),i}function r(t,e){var n=t.edge(e),r=t.node(e.v),u=t.node(e.w),a=n.points.slice(1,n.points.length-1);return a.unshift(c(r,a[0])),a.push(c(u,a[a.length-1])),i(n,a)}function i(t,e){var n=f.svg.line().x(function(t){return t.x}).y(function(t){return t.y});return s.has(t,"lineInterpolate")&&n.interpolate(t.lineInterpolate),s.has(t,"lineTension")&&n.tension(Number(t.lineTension)),n(e)}function u(t){var e=t.getBBox(),n=t.getTransformToElement(t.ownerSVGElement).translate(e.width/2,e.height/2);return{x:n.e,y:n.f}}function a(t,e){var n=t.enter().append("g").attr("class","edgePath").style("opacity",0);n.append("path").attr("class","path").attr("d",function(t){var n=e.edge(t),r=e.node(t.v).elem,a=s.range(n.points.length).map(function(){return u(r)});return i(n,a)}),n.append("defs")}function o(t,e){var n=t.exit();l.applyTransition(n,e).style("opacity",0).remove(),l.applyTransition(n.select("path.path"),e).attr("d",function(t){var n=e.node(t.v);if(n){var r=s.range(this.pathSegList.length).map(function(){return n});return i({},r)}return f.select(this).attr("d")})}var s=t("./lodash"),c=t("./intersect/intersect-node"),l=t("./util"),f=t("./d3");e.exports=n},{"./d3":8,"./intersect/intersect-node":15,"./lodash":21,"./util":26}],7:[function(t,e){"use strict";function n(t,e,n){var o=e.nodes().filter(function(t){return!u.isSubgraph(e,t)}),s=t.selectAll("g.node").data(o,function(t){return t}).classed("update",!0);return s.selectAll("*").remove(),s.enter().append("g").attr("class","node").style("opacity",0),s.each(function(t){var o=e.node(t),s=a.select(this),c=s.append("g").attr("class","label"),l=i(c,o),f=n[o.shape],h=r.pick(l.node().getBBox(),"width","height");o.elem=this,o.id&&s.attr("id",o.id),o.labelId&&c.attr("id",o.labelId),u.applyClass(s,o.class,(s.classed("update")?"update ":"")+"node"),r.has(o,"width")&&(h.width=o.width),r.has(o,"height")&&(h.height=o.height),h.width+=o.paddingLeft+o.paddingRight,h.height+=o.paddingTop+o.paddingBottom,c.attr("transform","translate("+(o.paddingLeft-o.paddingRight)/2+","+(o.paddingTop-o.paddingBottom)/2+")");var p=f(a.select(this),h,o);u.applyStyle(p,o.style);var d=p.node().getBBox();o.width=d.width,o.height=d.height}),u.applyTransition(s.exit(),e).style("opacity",0).remove(),s}var r=t("./lodash"),i=t("./label/add-label"),u=t("./util"),a=t("./d3");e.exports=n},{"./d3":8,"./label/add-label":19,"./lodash":21,"./util":26}],8:[function(t,e){e.exports=window.d3},{}],9:[function(t,e){var n;if(t)try{n=t("dagre")}catch(r){}n||(n=window.dagre),e.exports=n},{dagre:28}],10:[function(t,e){var n;if(t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:58}],11:[function(t,e){e.exports={node:t("./intersect-node"),circle:t("./intersect-circle"),ellipse:t("./intersect-ellipse"),polygon:t("./intersect-polygon"),rect:t("./intersect-rect")}},{"./intersect-circle":12,"./intersect-ellipse":13,"./intersect-node":15,"./intersect-polygon":16,"./intersect-rect":17}],12:[function(t,e){function n(t,e,n){return r(t,e,e,n)}var r=t("./intersect-ellipse");e.exports=n},{"./intersect-ellipse":13}],13:[function(t,e){function n(t,e,n,r){var i=t.x,u=t.y,a=i-r.x,o=u-r.y,s=Math.sqrt(e*e*o*o+n*n*a*a),c=Math.abs(e*n*a/s);r.xm?(m-y)/g:(m+y)/g,m=a*c-u*l,b=0>m?(m-y)/g:(m+y)/g,{x:v,y:b})}function r(t,e){return t*e>0}e.exports=n},{}],15:[function(t,e){function n(t,e){return t.intersect(e)}e.exports=n},{}],16:[function(t,e){function n(t,e,n){var i=t.x,u=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;e.forEach(function(t){o=Math.min(o,t.x),s=Math.min(s,t.y)});for(var c=i-t.width/2-o,l=u-t.height/2-s,f=0;f1&&a.sort(function(t,e){var r=t.x-n.x,i=t.y-n.y,u=Math.sqrt(r*r+i*i),a=e.x-n.x,o=e.y-n.y,s=Math.sqrt(a*a+o*o);return s>u?-1:u===s?0:1}),a[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}var r=t("./intersect-line");e.exports=n},{"./intersect-line":14}],17:[function(t,e){function n(t,e){var n,r,i=t.x,u=t.y,a=e.x-i,o=e.y-u,s=t.width/2,c=t.height/2;return Math.abs(o)*s>Math.abs(a)*c?(0>o&&(c=-c),n=0===o?0:c*a/o,r=c):(0>a&&(s=-s),n=s,r=0===a?0:s*o/a),{x:i+n,y:u+r}}e.exports=n},{}],18:[function(t,e){function n(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div"),u=e.label;switch(typeof u){case"function":i.insert(u);break;case"object":i.insert(function(){return u});break;default:i.html(u)}r.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var a,o;return i.each(function(){a=this.clientWidth,o=this.clientHeight}),n.attr("width",a).attr("height",o),n}var r=t("../util");e.exports=n},{"../util":26}],19:[function(t,e){function n(t,e){var n=e.label,u=t.append("g");"string"!=typeof n||"html"===e.labelType?i(u,e):r(u,e);var a=u.node().getBBox();return u.attr("transform","translate("+-a.width/2+","+-a.height/2+")"),u}var r=t("./add-text-label"),i=t("./add-html-label");e.exports=n},{"./add-html-label":18,"./add-text-label":20}],20:[function(t,e){function n(t,e){for(var n=t.append("text"),u=r(e.label).split("\n"),a=0;ao;++o)r(t,"borderLeft","_bl",n,a,o),r(t,"borderRight","_br",n,a,o)}}i.each(t.children(),e)}function r(t,e,n,r,i,a){var o={width:0,height:0,rank:a},s=i[e][a-1],c=u.addDummyNode(t,"border",o,n);i[e][a]=c,t.setParent(c,r),s&&t.setEdge(s,c,{weight:1})}var i=t("./lodash"),u=t("./util");e.exports=n},{"./lodash":37,"./util":56}],31:[function(t,e){"use strict";function n(t){var e=t.graph().rankdir.toLowerCase();("lr"===e||"rl"===e)&&i(t)}function r(t){var e=t.graph().rankdir.toLowerCase();("bt"===e||"rl"===e)&&a(t),("lr"===e||"rl"===e)&&(s(t),i(t))}function i(t){l.each(t.nodes(),function(e){u(t.node(e))}),l.each(t.edges(),function(e){u(t.edge(e))})}function u(t){var e=t.width;t.width=t.height,t.height=e}function a(t){l.each(t.nodes(),function(e){o(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,o),l.has(n,"y")&&o(n)})}function o(t){t.y=-t.y}function s(t){l.each(t.nodes(),function(e){c(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,c),l.has(n,"x")&&c(n)})}function c(t){var e=t.x;t.x=t.y,t.y=e}var l=t("./lodash");e.exports={adjust:n,undo:r}},{"./lodash":37}],32:[function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){return"_next"!==t&&"_prev"!==t?e:void 0}e.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;return e!==t?(r(e),e):void 0},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},{}],33:[function(t,e){function n(t){var e=i.buildLayerMatrix(t),n=new u({compound:!0,multigraph:!0}).setGraph({});return r.each(t.nodes(),function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)}),r.each(t.edges(),function(t){n.setEdge(t.v,t.w,{},t.name)}),r.each(e,function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,function(t,e){return n.setEdge(t,e,{style:"invis"}),e})}),n}var r=t("./lodash"),i=t("./util"),u=t("./graphlib").Graph;e.exports={debugOrdering:n}},{"./graphlib":34,"./lodash":37,"./util":56}],34:[function(t,e){e.exports=t(10)},{graphlib:58}],35:[function(t,e){function n(t,e){if(t.nodeCount()<=1)return[];var n=u(t,e||l),i=r(n.graph,n.buckets,n.zeroIdx);return o.flatten(o.map(i,function(e){return t.outEdges(e.v,e.w)}),!0)}function r(t,e,n){for(var r,u=[],a=e[e.length-1],o=e[0];t.nodeCount();){for(;r=o.dequeue();)i(t,e,n,r);for(;r=a.dequeue();)i(t,e,n,r);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(r=e[s].dequeue()){u=u.concat(i(t,e,n,r,!0));break}}return u}function i(t,e,n,r,i){var u=i?[]:void 0;return o.each(t.inEdges(r.v),function(r){var o=t.edge(r),s=t.node(r.v);i&&u.push({v:r.v,w:r.w}),s.out-=o,a(e,n,s)}),o.each(t.outEdges(r.v),function(r){var i=t.edge(r),u=r.w,o=t.node(u);o.in-=i,a(e,n,o)}),t.removeNode(r.v),u}function u(t,e){var n=new s,r=0,i=0;o.each(t.nodes(),function(t){n.setNode(t,{v:t,"in":0,out:0})}),o.each(t.edges(),function(t){var u=n.edge(t.v,t.w)||0,a=e(t),o=u+a;n.setEdge(t.v,t.w,o),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)});var u=o.range(i+r+3).map(function(){return new c}),l=r+1;return o.each(n.nodes(),function(t){a(u,l,n.node(t))}),{graph:n,buckets:u,zeroIdx:l}}function a(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var o=t("./lodash"),s=t("./graphlib").Graph,c=t("./data/list");e.exports=n;var l=o.constant(1)},{"./data/list":32,"./graphlib":34,"./lodash":37}],36:[function(t,e){"use strict";function n(t,e){var n=e&&e.debugTiming?B.time:B.notime;n("layout",function(){var e=n(" buildLayoutGraph",function(){return u(t)});n(" runLayout",function(){r(e,n)}),n(" updateInputGraph",function(){i(t,e)})})}function r(t,e){e(" makeSpaceForEdgeLabels",function(){a(t)}),e(" removeSelfEdges",function(){g(t)}),e(" acyclic",function(){w.run(t)}),e(" nestingGraph.run",function(){C.run(t)}),e(" rank",function(){_(B.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){o(t)}),e(" removeEmptyRanks",function(){D(t)}),e(" nestingGraph.cleanup",function(){C.cleanup(t)}),e(" normalizeRanks",function(){E(t)}),e(" assignRankMinMax",function(){s(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){A.run(t)}),e(" parentDummyChains",function(){k(t)}),e(" addBorderSegments",function(){M(t)}),e(" order",function(){F(t)}),e(" insertSelfEdges",function(){y(t)}),e(" adjustCoordinateSystem",function(){S.adjust(t)}),e(" position",function(){T(t)}),e(" positionSelfEdges",function(){m(t)}),e(" removeBorderNodes",function(){d(t)}),e(" normalize.undo",function(){A.undo(t)}),e(" fixupEdgeLabelCoords",function(){h(t)}),e(" undoCoordinateSystem",function(){S.undo(t)}),e(" translateGraph",function(){l(t)}),e(" assignNodeIntersects",function(){f(t)}),e(" reversePoints",function(){p(t)}),e(" acyclic.undo",function(){w.undo(t)})}function i(t,e){x.each(t.nodes(),function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))}),x.each(t.edges(),function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,x.has(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function u(t){var e=new L({multigraph:!0,compound:!0}),n=b(t.graph());return e.setGraph(x.merge({},q,v(n,N),x.pick(n,R))),x.each(t.nodes(),function(n){var r=b(t.node(n));e.setNode(n,x.defaults(v(r,O),I)),e.setParent(n,t.parent(n))}),x.each(t.edges(),function(n){var r=b(t.edge(n));e.setEdge(n,x.merge({},j,v(r,P),x.pick(r,U)))}),e}function a(t){var e=t.graph();e.ranksep/=2,x.each(t.edges(),function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function o(t){x.each(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i=t.node(e.w),u={rank:(i.rank-r.rank)/2+r.rank,e:e};B.addDummyNode(t,"edge-proxy",u,"_ep")}})}function s(t){var e=0;x.each(t.nodes(),function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=x.max(e,r.maxRank))}),t.graph().maxRank=e}function c(t){x.each(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function l(t){function e(t){var e=t.x,a=t.y,o=t.width,s=t.height;n=Math.min(n,e-o/2),r=Math.max(r,e+o/2),i=Math.min(i,a-s/2),u=Math.max(u,a+s/2)}var n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,u=0,a=t.graph(),o=a.marginx||0,s=a.marginy||0;x.each(t.nodes(),function(n){e(t.node(n))}),x.each(t.edges(),function(n){var r=t.edge(n);x.has(r,"x")&&e(r)}),n-=o,i-=s,x.each(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),x.each(t.edges(),function(e){var r=t.edge(e);x.each(r.points,function(t){t.x-=n,t.y-=i}),x.has(r,"x")&&(r.x-=n),x.has(r,"y")&&(r.y-=i)}),a.width=r-n+o,a.height=u-i+s}function f(t){x.each(t.edges(),function(e){var n,r,i=t.edge(e),u=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=u),i.points.unshift(B.intersectRect(u,n)),i.points.push(B.intersectRect(a,r))})}function h(t){x.each(t.edges(),function(e){var n=t.edge(e);if(x.has(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function p(t){x.each(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function d(t){x.each(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),u=t.node(x.last(n.borderLeft)),a=t.node(x.last(n.borderRight));n.width=Math.abs(a.x-u.x),n.height=Math.abs(i.y-r.y),n.x=u.x+n.width/2,n.y=r.y+n.height/2}}),x.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function g(t){x.each(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function y(t){var e=B.buildLayerMatrix(t);x.each(e,function(e){var n=0;x.each(e,function(e,r){var i=t.node(e);i.order=r+n,x.each(i.selfEdges,function(e){B.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function m(t){x.each(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,u=r.y,a=n.x-i,o=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:u-o},{x:i+5*a/6,y:u-o},{x:i+a,y:u},{x:i+5*a/6,y:u+o},{x:i+2*a/3,y:u+o}],n.label.x=n.x,n.label.y=n.y}})}function v(t,e){return x.mapValues(x.pick(t,e),Number)}function b(t){var e={};return x.each(t,function(t,n){e[n.toLowerCase()]=t}),e}var x=t("./lodash"),w=t("./acyclic"),A=t("./normalize"),_=t("./rank"),E=t("./util").normalizeRanks,k=t("./parent-dummy-chains"),D=t("./util").removeEmptyRanks,C=t("./nesting-graph"),M=t("./add-border-segments"),S=t("./coordinate-system"),F=t("./order"),T=t("./position"),B=t("./util"),L=t("./graphlib").Graph;e.exports=n;var N=["nodesep","edgesep","ranksep","marginx","marginy"],q={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},R=["acyclicer","ranker","rankdir","align"],O=["width","height"],I={width:0,height:0},P=["minlen","weight","width","height","labeloffset"],j={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"]},{"./acyclic":29,"./add-border-segments":30,"./coordinate-system":31,"./graphlib":34,"./lodash":37,"./nesting-graph":38,"./normalize":39,"./order":44,"./parent-dummy-chains":49,"./position":51,"./rank":53,"./util":56}],37:[function(t,e){e.exports=t(21)},{lodash:82}],38:[function(t,e){function n(t){var e=s.addDummyNode(t,"root",{},"_root"),n=i(t),a=o.max(n)-1,c=2*a+1;t.graph().nestingRoot=e,o.each(t.edges(),function(e){t.edge(e).minlen*=c});var l=u(t)+1;o.each(t.children(),function(i){r(t,e,c,l,a,n,i)}),t.graph().nodeRankFactor=c}function r(t,e,n,i,u,a,c){var l=t.children(c);if(!l.length)return void(c!==e&&t.setEdge(e,c,{weight:0,minlen:n}));var f=s.addBorderNode(t,"_bt"),h=s.addBorderNode(t,"_bb"),p=t.node(c);t.setParent(f,c),p.borderTop=f,t.setParent(h,c),p.borderBottom=h,o.each(l,function(o){r(t,e,n,i,u,a,o);var s=t.node(o),l=s.borderTop?s.borderTop:o,p=s.borderBottom?s.borderBottom:o,d=s.borderTop?i:2*i,g=l!==p?1:u-a[c]+1;t.setEdge(f,l,{weight:d,minlen:g,nestingEdge:!0}),t.setEdge(p,h,{weight:d,minlen:g,nestingEdge:!0})}),t.parent(c)||t.setEdge(e,f,{weight:0,minlen:u+a[c]})}function i(t){function e(r,i){var u=t.children(r);u&&u.length&&o.each(u,function(t){e(t,i+1)}),n[r]=i}var n={};return o.each(t.children(),function(t){e(t,1)}),n}function u(t){return o.reduce(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function a(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,o.each(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}var o=t("./lodash"),s=t("./util");e.exports={run:n,cleanup:a}},{"./lodash":37,"./util":56}],39:[function(t,e){"use strict";function n(t){t.graph().dummyChains=[],u.each(t.edges(),function(e){r(t,e)})}function r(t,e){var n=e.v,r=t.node(n).rank,i=e.w,u=t.node(i).rank,o=e.name,s=t.edge(e),c=s.labelRank;if(u!==r+1){t.removeEdge(e);var l,f,h;for(h=0,++r;u>r;++h,++r)s.points=[],f={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},l=a.addDummyNode(t,"edge",f,"_d"),r===c&&(f.width=s.width,f.height=s.height,f.dummy="edge-label",f.labelpos=s.labelpos),t.setEdge(n,l,{weight:s.weight},o),0===h&&t.graph().dummyChains.push(l),n=l;t.setEdge(n,i,{weight:s.weight},o)}}function i(t){u.each(t.graph().dummyChains,function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)})}var u=t("./lodash"),a=t("./util");e.exports={run:n,undo:i}},{"./lodash":37,"./util":56}],40:[function(t,e){function n(t,e,n){var i,u={};r.each(n,function(n){for(var r,a,o=t.parent(n);o;){if(r=t.parent(o),r?(a=u[r],u[r]=o):(a=i,i=o),a&&a!==o)return void e.setEdge(a,o);o=r}})}var r=t("../lodash");e.exports=n},{"../lodash":37}],41:[function(t,e){function n(t,e){return r.map(e,function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})}var r=t("../lodash");e.exports=n},{"../lodash":37}],42:[function(t,e){function n(t,e,n){var a=r(t),o=new u({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(e){return t.node(e)});return i.each(t.nodes(),function(r){var u=t.node(r),s=t.parent(r);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(o.setNode(r),o.setParent(r,s||a),i.each(t[n](r),function(e){var n=e.v===r?e.w:e.v,u=o.edge(n,r),a=i.isUndefined(u)?0:u.weight;o.setEdge(n,r,{weight:t.edge(e).weight+a})}),i.has(u,"minRank")&&o.setNode(r,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))}),o}function r(t){for(var e;t.hasNode(e=i.uniqueId("_root")););return e}var i=t("../lodash"),u=t("../graphlib").Graph;e.exports=n},{"../graphlib":34,"../lodash":37}],43:[function(t,e){"use strict";function n(t,e){for(var n=0,i=1;i0;)e%2&&(n+=s[e+1]),e=e-1>>1,s[e]+=t.weight;c+=t.weight*n})),c}var i=t("../lodash");e.exports=n},{"../lodash":37}],44:[function(t,e){"use strict";function n(t){var e=p.maxRank(t),n=r(t,a.range(1,e+1),"inEdges"),c=r(t,a.range(e-1,-1,-1),"outEdges"),l=o(t);u(t,l);for(var f,h=Number.POSITIVE_INFINITY,d=0,g=0;4>g;++d,++g){i(d%2?n:c,d%4>=2),l=p.buildLayerMatrix(t);var y=s(t,l);h>y&&(g=0,f=a.cloneDeep(l),h=y)}u(t,f)}function r(t,e,n){return a.map(e,function(e){return l(t,e,n)})}function i(t,e){var n=new h;a.each(t,function(t){var r=t.graph().root,i=c(t,r,n,e);a.each(i.vs,function(e,n){t.node(e).order=n}),f(t,n,i.vs)})}function u(t,e){a.each(e,function(e){a.each(e,function(e,n){t.node(e).order=n})})}var a=t("../lodash"),o=t("./init-order"),s=t("./cross-count"),c=t("./sort-subgraph"),l=t("./build-layer-graph"),f=t("./add-subgraph-constraints"),h=t("../graphlib").Graph,p=t("../util");e.exports=n},{"../graphlib":34,"../lodash":37,"../util":56,"./add-subgraph-constraints":40,"./build-layer-graph":42,"./cross-count":43,"./init-order":45,"./sort-subgraph":47}],45:[function(t,e){"use strict";function n(t){function e(i){if(!r.has(n,i)){n[i]=!0;var u=t.node(i);a[u.rank].push(i),r.each(t.successors(i),e)}}var n={},i=r.filter(t.nodes(),function(e){return!t.children(e).length}),u=r.max(r.map(i,function(e){return t.node(e).rank})),a=r.map(r.range(u+1),function(){return[]}),o=r.sortBy(i,function(e){return t.node(e).rank});return r.each(o,e),a}var r=t("../lodash");e.exports=n},{"../lodash":37}],46:[function(t,e){"use strict";function n(t,e){var n={};u.each(t,function(t,e){var r=n[t.v]={indegree:0,"in":[],out:[],vs:[t.v],i:e};u.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)}),u.each(e.edges(),function(t){var e=n[t.v],r=n[t.w];u.isUndefined(e)||u.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))});var i=u.filter(n,function(t){return!t.indegree});return r(i)}function r(t){function e(t){return function(e){e.merged||(u.isUndefined(e.barycenter)||u.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&i(t,e)}}function n(e){return function(n){n.in.push(e),0===--n.indegree&&t.push(n)}}for(var r=[];t.length;){var a=t.pop();r.push(a),u.each(a.in.reverse(),e(a)),u.each(a.out,n(a))}return u.chain(r).filter(function(t){return!t.merged}).map(function(t){return u.pick(t,["vs","i","barycenter","weight"])}).value()}function i(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var u=t("../lodash");e.exports=n},{"../lodash":37}],47:[function(t,e){function n(t,e,c,l){var f=t.children(e),h=t.node(e),p=h?h.borderLeft:void 0,d=h?h.borderRight:void 0,g={};p&&(f=u.filter(f,function(t){return t!==p&&t!==d}));var y=a(t,f);u.each(y,function(e){if(t.children(e.v).length){var r=n(t,e.v,c,l);g[e.v]=r,u.has(r,"barycenter")&&i(e,r)}});var m=o(y,c);r(m,g);var v=s(m,l);if(p&&(v.vs=u.flatten([p,v.vs,d],!0),t.predecessors(p).length)){var b=t.node(t.predecessors(p)[0]),x=t.node(t.predecessors(d)[0]);u.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+b.order+x.order)/(v.weight+2),v.weight+=2}return v}function r(t,e){u.each(t,function(t){t.vs=u.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function i(t,e){u.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var u=t("../lodash"),a=t("./barycenter"),o=t("./resolve-conflicts"),s=t("./sort");e.exports=n},{"../lodash":37,"./barycenter":41,"./resolve-conflicts":46,"./sort":48}],48:[function(t,e){function n(t,e){var n=a.partition(t,function(t){return u.has(t,"barycenter")}),o=n.lhs,s=u.sortBy(n.rhs,function(t){return-t.i}),c=[],l=0,f=0,h=0;o.sort(i(!!e)),h=r(c,s,h),u.each(o,function(t){h+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,f+=t.weight,h=r(c,s,h)});var p={vs:u.flatten(c,!0)};return f&&(p.barycenter=l/f,p.weight=f),p}function r(t,e,n){for(var r;e.length&&(r=u.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function i(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}var u=t("../lodash"),a=t("../util");e.exports=n},{"../lodash":37,"../util":56}],49:[function(t,e){function n(t){var e=i(t);u.each(t.graph().dummyChains,function(n){for(var i=t.node(n),u=i.edgeObj,a=r(t,e,u.v,u.w),o=a.path,s=a.lca,c=0,l=o[c],f=!0;n!==u.w;){if(i=t.node(n),f){for(;(l=o[c])!==s&&t.node(l).maxRanks||c>e[i].lim));for(u=i,i=r;(i=t.parent(i))!==u;)o.push(i);return{path:a.concat(o.reverse()),lca:u}}function i(t){function e(i){var a=r;u.each(t.children(i),e),n[i]={low:a,lim:r++}}var n={},r=0;return u.each(t.children(),e),n}var u=t("./lodash");e.exports=n},{"./lodash":37}],50:[function(t,e){"use strict";function n(t,e){function n(e,n){var a=0,o=0,s=e.length,c=y.last(n);return y.each(n,function(e,l){var f=i(t,e),h=f?t.node(f).order:s;(f||e===c)&&(y.each(n.slice(o,l+1),function(e){y.each(t.predecessors(e),function(n){var i=t.node(n),o=i.order;!(a>o||o>h)||i.dummy&&t.node(e).dummy||u(r,n,e)})}),o=l+1,a=h)}),n}var r={};return y.reduce(e,n),r}function r(t,e){function n(e,n,r,a,o){var s;y.each(y.range(n,r),function(n){s=e[n],t.node(s).dummy&&y.each(t.predecessors(s),function(e){var n=t.node(e);n.dummy&&(n.ordero)&&u(i,e,s)})})}function r(e,r){var i,u=-1,a=0;return y.each(r,function(o,s){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,n(r,a,s,u,i),a=s,u=i)}n(r,a,r.length,i,e.length)}),r}var i={};return y.reduce(e,r),i}function i(t,e){return t.node(e).dummy?y.find(t.predecessors(e),function(e){return t.node(e).dummy}):void 0}function u(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function a(t,e,n){if(e>n){var r=e;e=n,n=r}return y.has(t[e],n)}function o(t,e,n,r){var i={},u={},o={};return y.each(e,function(t){y.each(t,function(t,e){i[t]=t,u[t]=t,o[t]=e})}),y.each(e,function(t){var e=-1;y.each(t,function(t){var s=r(t);if(s.length){s=y.sortBy(s,function(t){return o[t]});for(var c=(s.length-1)/2,l=Math.floor(c),f=Math.ceil(c);f>=l;++l){var h=s[l];u[t]===t&&ea.lim&&(o=a,s=!0);var c=d.filter(e.edges(),function(e){return s===p(t,t.node(e.v),o)&&s!==p(t,t.node(e.w),o)});return d.min(c,function(t){return y(e,t)})}function l(t,e,n,i){var u=n.v,o=n.w;t.removeEdge(u,o),t.setEdge(i.v,i.w,{}),a(t),r(t,e),f(t,e)}function f(t,e){var n=d.find(t.nodes(),function(t){return!e.node(t).parent}),r=v(t,n);r=r.slice(1),d.each(r,function(n){var r=t.node(n).parent,i=e.edge(n,r),u=!1;i||(i=e.edge(r,n),u=!0),e.node(n).rank=e.node(r).rank+(u?i.minlen:-i.minlen)})}function h(t,e,n){return t.hasEdge(e,n)}function p(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var d=t("../lodash"),g=t("./feasible-tree"),y=t("./util").slack,m=t("./util").longestPath,v=t("../graphlib").alg.preorder,b=t("../graphlib").alg.postorder,x=t("../util").simplify;e.exports=n,n.initLowLimValues=a,n.initCutValues=r,n.calcCutValue=u,n.leaveEdge=s,n.enterEdge=c,n.exchangeEdges=l},{"../graphlib":34,"../lodash":37,"../util":56,"./feasible-tree":52,"./util":55}],55:[function(t,e){"use strict";function n(t){function e(r){var u=t.node(r);if(i.has(n,r))return u.rank;n[r]=!0;var a=i.min(i.map(t.outEdges(r),function(n){return e(n.w)-t.edge(n).minlen}));return a===Number.POSITIVE_INFINITY&&(a=0),u.rank=a}var n={};i.each(t.sources(),e)}function r(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var i=t("../lodash");e.exports={longestPath:n,slack:r}},{"../lodash":37}],56:[function(t,e){"use strict";function n(t,e,n,r){var i;do i=y.uniqueId(r);while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function r(t){var e=(new m).setGraph(t.graph());return y.each(t.nodes(),function(n){e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function i(t){var e=new m({multigraph:t.isMultigraph()}).setGraph(t.graph());return y.each(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function u(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.outEdges(e),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function a(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.inEdges(e),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function o(t,e){var n=t.x,r=t.y,i=e.x-n,u=e.y-r,a=t.width/2,o=t.height/2;if(!i&&!u)throw new Error("Not possible to find intersection inside of the rectangle");var s,c;return Math.abs(u)*a>Math.abs(i)*o?(0>u&&(o=-o),s=o*i/u,c=o):(0>i&&(a=-a),s=a,c=a*u/i),{x:n+s,y:r+c}}function s(t){var e=y.map(y.range(h(t)+1),function(){return[]});return y.each(t.nodes(),function(n){var r=t.node(n),i=r.rank;y.isUndefined(i)||(e[i][r.order]=n)}),e}function c(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank}));y.each(t.nodes(),function(n){var r=t.node(n);y.has(r,"rank")&&(r.rank-=e)})}function l(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank})),n=[];y.each(t.nodes(),function(r){var i=t.node(r).rank-e;y.has(n,i)||(n[i]=[]),n[i].push(r)});var r=0,i=t.graph().nodeRankFactor;y.each(n,function(e,n){y.isUndefined(e)&&n%i!==0?--r:r&&y.each(e,function(e){t.node(e).rank+=r})})}function f(t,e,r,i){var u={width:0,height:0};return arguments.length>=4&&(u.rank=r,u.order=i),n(t,"border",u,e)}function h(t){return y.max(y.map(t.nodes(),function(e){var n=t.node(e).rank;return y.isUndefined(n)?void 0:n}))}function p(t,e){var n={lhs:[],rhs:[]};return y.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function d(t,e){var n=y.now();try{return e()}finally{console.log(t+" time: "+(y.now()-n)+"ms")}}function g(t,e){return e()}var y=t("./lodash"),m=t("./graphlib").Graph;e.exports={addDummyNode:n,simplify:r,asNonCompoundGraph:i,successorWeights:u,predecessorWeights:a,intersectRect:o,buildLayerMatrix:s,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:f,maxRank:h,partition:p,time:d,notime:g}},{"./graphlib":34,"./lodash":37}],57:[function(t,e){e.exports="0.6.4"},{}],58:[function(t,e){var n=t("./lib");e.exports={Graph:n.Graph,json:t("./lib/json"),alg:t("./lib/alg"),version:n.version}},{"./lib":74,"./lib/alg":65,"./lib/json":75}],59:[function(t,e){function n(t){function e(u){r.has(i,u)||(i[u]=!0,n.push(u),r.each(t.successors(u),e),r.each(t.predecessors(u),e))}var n,i={},u=[];return r.each(t.nodes(),function(t){n=[],e(t),n.length&&u.push(n)}),u}var r=t("../lodash");e.exports=n},{"../lodash":76}],60:[function(t,e){function n(t,e,n){i.isArray(e)||(e=[e]);var u=[],a={};return i.each(e,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);r(t,e,"post"===n,a,u)}),u}function r(t,e,n,u,a){i.has(u,e)||(u[e]=!0,n||a.push(e),i.each(t.neighbors(e),function(e){r(t,e,n,u,a)}),n&&a.push(e))}var i=t("../lodash");e.exports=n},{"../lodash":76}],61:[function(t,e){function n(t,e,n){return i.transform(t.nodes(),function(i,u){i[u]=r(t,u,e,n)},{})}var r=t("./dijkstra"),i=t("../lodash");e.exports=n},{"../lodash":76,"./dijkstra":62}],62:[function(t,e){function n(t,e,n,i){return r(t,String(e),n||a,i||function(e){return t.outEdges(e)})}function r(t,e,n,r){var i,a,o={},s=new u,c=function(t){var e=t.v!==i?t.v:t.w,r=o[e],u=n(t),c=a.distance+u;if(0>u)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+u);c0&&(i=s.removeMin(),a=o[i],a.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return o}var i=t("../lodash"),u=t("../data/priority-queue");e.exports=n;var a=i.constant(1)},{"../data/priority-queue":72,"../lodash":76}],63:[function(t,e){function n(t){return r.filter(i(t),function(t){return t.length>1 +})}var r=t("../lodash"),i=t("./tarjan");e.exports=n},{"../lodash":76,"./tarjan":70}],64:[function(t,e){function n(t,e,n){return r(t,e||u,n||function(e){return t.outEdges(e)})}function r(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,u=e(n);r[t][i]={distance:u,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var u=r[n];i.forEach(function(n){var r=u[t],i=e[n],a=u[n],o=r.distance+i.distance;oi&&(s[n]=a,c.decrease(n,i))}}var a,o=new i,s={},c=new u;if(0===t.nodeCount())return o;r.each(t.nodes(),function(t){c.add(t,Number.POSITIVE_INFINITY),o.setNode(t)}),c.decrease(t.nodes()[0],0);for(var l=!1;c.size()>0;){if(a=c.removeMin(),r.has(s,a))o.setEdge(a,s[a]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(a).forEach(n)}return o}var r=t("../lodash"),i=t("../graph"),u=t("../data/priority-queue");e.exports=n},{"../data/priority-queue":72,"../graph":73,"../lodash":76}],70:[function(t,e){function n(t){function e(o){var s=u[o]={onStack:!0,lowlink:n,index:n++};if(i.push(o),t.successors(o).forEach(function(t){r.has(u,t)?u[t].onStack&&(s.lowlink=Math.min(s.lowlink,u[t].index)):(e(t),s.lowlink=Math.min(s.lowlink,u[t].lowlink))}),s.lowlink===s.index){var c,l=[];do c=i.pop(),u[c].onStack=!1,l.push(c);while(o!==c);a.push(l)}}var n=0,i=[],u={},a=[];return t.nodes().forEach(function(t){r.has(u,t)||e(t)}),a}var r=t("../lodash");e.exports=n},{"../lodash":76}],71:[function(t,e){function n(t){function e(o){if(i.has(u,o))throw new r;i.has(n,o)||(u[o]=!0,n[o]=!0,i.each(t.predecessors(o),e),delete u[o],a.push(o))}var n={},u={},a=[];if(i.each(t.sinks(),e),i.size(n)!==t.nodeCount())throw new r;return a}function r(){}var i=t("../lodash");e.exports=n,n.CycleException=r},{"../lodash":76}],72:[function(t,e){function n(){this._arr=[],this._keyIndices={}}var r=t("../lodash");e.exports=n,n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(t){return t.key})},n.prototype.has=function(t){return r.has(this._keyIndices,t)},n.prototype.priority=function(t){var e=this._keyIndices[t];return void 0!==e?this._arr[e].priority:void 0},n.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,u=i.length;return n[t]=u,i.push({key:t,priority:e}),this._decrease(u),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},n.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},n.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1,!(n[e].priorityn){var i=e;e=n,n=i}return e+f+n+f+(s.isUndefined(r)?c:r)}function a(t,e,n,r){if(!t&&e>n){var i=e;e=n,n=i}var u={v:e,w:n};return r&&(u.name=r),u}function o(t,e){return u(t,e.v,e.w,e.name)}var s=t("./lodash");e.exports=n;var c="\x00",l="\x00",f="";n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(t){return this._label=t,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultNodeLabelFn=t,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return s.keys(this._nodes)},n.prototype.sources=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._in[t])},this)},n.prototype.sinks=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._out[t])},this)},n.prototype.setNodes=function(t,e){var n=arguments;return s.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},n.prototype.setNode=function(t,e){return s.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},n.prototype.node=function(t){return this._nodes[t]},n.prototype.hasNode=function(t){return s.has(this._nodes,t)},n.prototype.removeNode=function(t){var e=this;if(s.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],s.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),s.each(s.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],s.each(s.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},n.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(s.isUndefined(e))e=l;else{for(var n=e;!s.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},n.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},n.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},n.prototype.children=function(t){if(s.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return s.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},n.prototype.predecessors=function(t){var e=this._preds[t];return e?s.keys(e):void 0},n.prototype.successors=function(t){var e=this._sucs[t];return e?s.keys(e):void 0},n.prototype.neighbors=function(t){var e=this.predecessors(t);return e?s.union(e,this.successors(t)):void 0},n.prototype.setDefaultEdgeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultEdgeLabelFn=t,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return s.values(this._edgeObjs)},n.prototype.setPath=function(t,e){var n=this,r=arguments;return s.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},n.prototype.setEdge=function(){var t,e,n,i,o=!1;s.isPlainObject(arguments[0])?(t=arguments[0].v,e=arguments[0].w,n=arguments[0].name,2===arguments.length&&(i=arguments[1],o=!0)):(t=arguments[0],e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,s.isUndefined(n)||(n=""+n);var c=u(this._isDirected,t,e,n);if(s.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=i),this;if(!s.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[c]=o?i:this._defaultEdgeLabelFn(t,e,n);var l=a(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[c]=l,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][c]=l,this._out[t][c]=l,this._edgeCount++,this},n.prototype.edge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return this._edgeLabels[r]},n.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return s.has(this._edgeLabels,r)},n.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):u(this._isDirected,t,e,n),a=this._edgeObjs[r];return a&&(t=a.v,e=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},n.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.v===e}):r}},n.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.w===e}):r}},n.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);return n?n.concat(this.outEdges(t,e)):void 0}},{"./lodash":76}],74:[function(t,e){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":73,"./version":77}],75:[function(t,e){function n(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:r(t),edges:i(t)};return a.isUndefined(t.graph())||(e.value=a.clone(t.graph())),e}function r(t){return a.map(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return a.isUndefined(n)||(i.value=n),a.isUndefined(r)||(i.parent=r),i})}function i(t){return a.map(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return a.isUndefined(e.name)||(r.name=e.name),a.isUndefined(n)||(r.value=n),r})}function u(t){var e=new o(t.options).setGraph(t.value);return a.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),a.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var a=t("./lodash"),o=t("./graph");e.exports={write:n,read:u}},{"./graph":73,"./lodash":76}],76:[function(t,e){e.exports=t(21)},{lodash:82}],77:[function(t,e){e.exports="1.0.1"},{}],78:[function(){},{}],79:[function(t,e,n){(function(t){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;u--){var a=u>=0?arguments[u]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,i="/"===a.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),u="/"===a(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&u&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),u=r(e.split("/")),a=Math.min(i.length,u.length),o=a,s=0;a>s;s++)if(i[s]!==u[s]){o=s;break}for(var c=[],s=o;se&&(e=t.length+e),t.substr(e,n)}}).call(this,t("1YiZ5S"))},{"1YiZ5S":80}],80:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],81:[function(t,e,n){(function(t){!function(r){var i="object"==typeof n&&n,u="object"==typeof e&&e&&e.exports==i&&e,a="object"==typeof t&&t;(a.global===a||a.window===a)&&(r=a);var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,f={"Á":"Aacute","á":"aacute","Ă":"Abreve","ă":"abreve","∾":"ac","∿":"acd","∾̳":"acE","Â":"Acirc","â":"acirc","´":"acute","А":"Acy","а":"acy","Æ":"AElig","æ":"aelig","⁡":"af","𝔄":"Afr","𝔞":"afr","À":"Agrave","à":"agrave","ℵ":"aleph","Α":"Alpha","α":"alpha","Ā":"Amacr","ā":"amacr","⨿":"amalg","&":"amp","⩕":"andand","⩓":"And","∧":"and","⩜":"andd","⩘":"andslope","⩚":"andv","∠":"ang","⦤":"ange","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","∡":"angmsd","∟":"angrt","⊾":"angrtvb","⦝":"angrtvbd","∢":"angsph","Å":"angst","⍼":"angzarr","Ą":"Aogon","ą":"aogon","𝔸":"Aopf","𝕒":"aopf","⩯":"apacir","≈":"ap","⩰":"apE","≊":"ape","≋":"apid","'":"apos","å":"aring","𝒜":"Ascr","𝒶":"ascr","≔":"colone","*":"ast","≍":"CupCap","Ã":"Atilde","ã":"atilde","Ä":"Auml","ä":"auml","∳":"awconint","⨑":"awint","≌":"bcong","϶":"bepsi","‵":"bprime","∽":"bsim","⋍":"bsime","∖":"setmn","⫧":"Barv","⊽":"barvee","⌅":"barwed","⌆":"Barwed","⎵":"bbrk","⎶":"bbrktbrk","Б":"Bcy","б":"bcy","„":"bdquo","∵":"becaus","⦰":"bemptyv","ℬ":"Bscr","Β":"Beta","β":"beta","ℶ":"beth","≬":"twixt","𝔅":"Bfr","𝔟":"bfr","⋂":"xcap","◯":"xcirc","⋃":"xcup","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨆":"xsqcup","★":"starf","▽":"xdtri","△":"xutri","⨄":"xuplus","⋁":"Vee","⋀":"Wedge","⤍":"rbarr","⧫":"lozf","▪":"squf","▴":"utrif","▾":"dtrif","◂":"ltrif","▸":"rtrif","␣":"blank","▒":"blk12","░":"blk14","▓":"blk34","█":"block","=⃥":"bne","≡⃥":"bnequiv","⫭":"bNot","⌐":"bnot","𝔹":"Bopf","𝕓":"bopf","⊥":"bot","⋈":"bowtie","⧉":"boxbox","┐":"boxdl","╕":"boxdL","╖":"boxDl","╗":"boxDL","┌":"boxdr","╒":"boxdR","╓":"boxDr","╔":"boxDR","─":"boxh","═":"boxH","┬":"boxhd","╤":"boxHd","╥":"boxhD","╦":"boxHD","┴":"boxhu","╧":"boxHu","╨":"boxhU","╩":"boxHU","⊟":"minusb","⊞":"plusb","⊠":"timesb","┘":"boxul","╛":"boxuL","╜":"boxUl","╝":"boxUL","└":"boxur","╘":"boxuR","╙":"boxUr","╚":"boxUR","│":"boxv","║":"boxV","┼":"boxvh","╪":"boxvH","╫":"boxVh","╬":"boxVH","┤":"boxvl","╡":"boxvL","╢":"boxVl","╣":"boxVL","├":"boxvr","╞":"boxvR","╟":"boxVr","╠":"boxVR","˘":"breve","¦":"brvbar","𝒷":"bscr","⁏":"bsemi","⧅":"bsolb","\\":"bsol","⟈":"bsolhsub","•":"bull","≎":"bump","⪮":"bumpE","≏":"bumpe","Ć":"Cacute","ć":"cacute","⩄":"capand","⩉":"capbrcup","⩋":"capcap","∩":"cap","⋒":"Cap","⩇":"capcup","⩀":"capdot","ⅅ":"DD","∩︀":"caps","⁁":"caret","ˇ":"caron","ℭ":"Cfr","⩍":"ccaps","Č":"Ccaron","č":"ccaron","Ç":"Ccedil","ç":"ccedil","Ĉ":"Ccirc","ĉ":"ccirc","∰":"Cconint","⩌":"ccups","⩐":"ccupssm","Ċ":"Cdot","ċ":"cdot","¸":"cedil","⦲":"cemptyv","¢":"cent","·":"middot","𝔠":"cfr","Ч":"CHcy","ч":"chcy","✓":"check","Χ":"Chi","χ":"chi","ˆ":"circ","≗":"cire","↺":"olarr","↻":"orarr","⊛":"oast","⊚":"ocir","⊝":"odash","⊙":"odot","®":"reg","Ⓢ":"oS","⊖":"ominus","⊕":"oplus","⊗":"otimes","○":"cir","⧃":"cirE","⨐":"cirfnint","⫯":"cirmid","⧂":"cirscir","∲":"cwconint","”":"rdquo","’":"rsquo","♣":"clubs",":":"colon","∷":"Colon","⩴":"Colone",",":"comma","@":"commat","∁":"comp","∘":"compfn","ℂ":"Copf","≅":"cong","⩭":"congdot","≡":"equiv","∮":"oint","∯":"Conint","𝕔":"copf","∐":"coprod","©":"copy","℗":"copysr","↵":"crarr","✗":"cross","⨯":"Cross","𝒞":"Cscr","𝒸":"cscr","⫏":"csub","⫑":"csube","⫐":"csup","⫒":"csupe","⋯":"ctdot","⤸":"cudarrl","⤵":"cudarrr","⋞":"cuepr","⋟":"cuesc","↶":"cularr","⤽":"cularrp","⩈":"cupbrcap","⩆":"cupcap","∪":"cup","⋓":"Cup","⩊":"cupcup","⊍":"cupdot","⩅":"cupor","∪︀":"cups","↷":"curarr","⤼":"curarrm","⋎":"cuvee","⋏":"cuwed","¤":"curren","∱":"cwint","⌭":"cylcty","†":"dagger","‡":"Dagger","ℸ":"daleth","↓":"darr","↡":"Darr","⇓":"dArr","‐":"dash","⫤":"Dashv","⊣":"dashv","⤏":"rBarr","˝":"dblac","Ď":"Dcaron","ď":"dcaron","Д":"Dcy","д":"dcy","⇊":"ddarr","ⅆ":"dd","⤑":"DDotrahd","⩷":"eDDot","°":"deg","∇":"Del","Δ":"Delta","δ":"delta","⦱":"demptyv","⥿":"dfisht","𝔇":"Dfr","𝔡":"dfr","⥥":"dHar","⇃":"dharl","⇂":"dharr","˙":"dot","`":"grave","˜":"tilde","⋄":"diam","♦":"diams","¨":"die","ϝ":"gammad","⋲":"disin","÷":"div","⋇":"divonx","Ђ":"DJcy","ђ":"djcy","⌞":"dlcorn","⌍":"dlcrop",$:"dollar","𝔻":"Dopf","𝕕":"dopf","⃜":"DotDot","≐":"doteq","≑":"eDot","∸":"minusd","∔":"plusdo","⊡":"sdotb","⇐":"lArr","⇔":"iff","⟸":"xlArr","⟺":"xhArr","⟹":"xrArr","⇒":"rArr","⊨":"vDash","⇑":"uArr","⇕":"vArr","∥":"par","⤓":"DownArrowBar","⇵":"duarr","̑":"DownBreve","⥐":"DownLeftRightVector","⥞":"DownLeftTeeVector","⥖":"DownLeftVectorBar","↽":"lhard","⥟":"DownRightTeeVector","⥗":"DownRightVectorBar","⇁":"rhard","↧":"mapstodown","⊤":"top","⤐":"RBarr","⌟":"drcorn","⌌":"drcrop","𝒟":"Dscr","𝒹":"dscr","Ѕ":"DScy","ѕ":"dscy","⧶":"dsol","Đ":"Dstrok","đ":"dstrok","⋱":"dtdot","▿":"dtri","⥯":"duhar","⦦":"dwangle","Џ":"DZcy","џ":"dzcy","⟿":"dzigrarr","É":"Eacute","é":"eacute","⩮":"easter","Ě":"Ecaron","ě":"ecaron","Ê":"Ecirc","ê":"ecirc","≖":"ecir","≕":"ecolon","Э":"Ecy","э":"ecy","Ė":"Edot","ė":"edot","ⅇ":"ee","≒":"efDot","𝔈":"Efr","𝔢":"efr","⪚":"eg","È":"Egrave","è":"egrave","⪖":"egs","⪘":"egsdot","⪙":"el","∈":"in","⏧":"elinters","ℓ":"ell","⪕":"els","⪗":"elsdot","Ē":"Emacr","ē":"emacr","∅":"empty","◻":"EmptySmallSquare","▫":"EmptyVerySmallSquare"," ":"emsp13"," ":"emsp14"," ":"emsp","Ŋ":"ENG","ŋ":"eng"," ":"ensp","Ę":"Eogon","ę":"eogon","𝔼":"Eopf","𝕖":"eopf","⋕":"epar","⧣":"eparsl","⩱":"eplus","ε":"epsi","Ε":"Epsilon","ϵ":"epsiv","≂":"esim","⩵":"Equal","=":"equals","≟":"equest","⇌":"rlhar","⩸":"equivDD","⧥":"eqvparsl","⥱":"erarr","≓":"erDot","ℯ":"escr","ℰ":"Escr","⩳":"Esim","Η":"Eta","η":"eta","Ð":"ETH","ð":"eth","Ë":"Euml","ë":"euml","€":"euro","!":"excl","∃":"exist","Ф":"Fcy","ф":"fcy","♀":"female","ffi":"ffilig","ff":"fflig","ffl":"ffllig","𝔉":"Ffr","𝔣":"ffr","fi":"filig","◼":"FilledSmallSquare",fj:"fjlig","♭":"flat","fl":"fllig","▱":"fltns","ƒ":"fnof","𝔽":"Fopf","𝕗":"fopf","∀":"forall","⋔":"fork","⫙":"forkv","ℱ":"Fscr","⨍":"fpartint","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","⅔":"frac23","⅖":"frac25","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","⁄":"frasl","⌢":"frown","𝒻":"fscr","ǵ":"gacute","Γ":"Gamma","γ":"gamma","Ϝ":"Gammad","⪆":"gap","Ğ":"Gbreve","ğ":"gbreve","Ģ":"Gcedil","Ĝ":"Gcirc","ĝ":"gcirc","Г":"Gcy","г":"gcy","Ġ":"Gdot","ġ":"gdot","≥":"ge","≧":"gE","⪌":"gEl","⋛":"gel","⩾":"ges","⪩":"gescc","⪀":"gesdot","⪂":"gesdoto","⪄":"gesdotol","⋛︀":"gesl","⪔":"gesles","𝔊":"Gfr","𝔤":"gfr","≫":"gg","⋙":"Gg","ℷ":"gimel","Ѓ":"GJcy","ѓ":"gjcy","⪥":"gla","≷":"gl","⪒":"glE","⪤":"glj","⪊":"gnap","⪈":"gne","≩":"gnE","⋧":"gnsim","𝔾":"Gopf","𝕘":"gopf","⪢":"GreaterGreater","≳":"gsim","𝒢":"Gscr","ℊ":"gscr","⪎":"gsime","⪐":"gsiml","⪧":"gtcc","⩺":"gtcir",">":"gt","⋗":"gtdot","⦕":"gtlPar","⩼":"gtquest","⥸":"gtrarr","≩︀":"gvnE"," ":"hairsp","ℋ":"Hscr","Ъ":"HARDcy","ъ":"hardcy","⥈":"harrcir","↔":"harr","↭":"harrw","^":"Hat","ℏ":"hbar","Ĥ":"Hcirc","ĥ":"hcirc","♥":"hearts","…":"mldr","⊹":"hercon","𝔥":"hfr","ℌ":"Hfr","⤥":"searhk","⤦":"swarhk","⇿":"hoarr","∻":"homtht","↩":"larrhk","↪":"rarrhk","𝕙":"hopf","ℍ":"Hopf","―":"horbar","𝒽":"hscr","Ħ":"Hstrok","ħ":"hstrok","⁃":"hybull","Í":"Iacute","í":"iacute","⁣":"ic","Î":"Icirc","î":"icirc","И":"Icy","и":"icy","İ":"Idot","Е":"IEcy","е":"iecy","¡":"iexcl","𝔦":"ifr","ℑ":"Im","Ì":"Igrave","ì":"igrave","ⅈ":"ii","⨌":"qint","∭":"tint","⧜":"iinfin","℩":"iiota","IJ":"IJlig","ij":"ijlig","Ī":"Imacr","ī":"imacr","ℐ":"Iscr","ı":"imath","⊷":"imof","Ƶ":"imped","℅":"incare","∞":"infin","⧝":"infintie","⊺":"intcal","∫":"int","∬":"Int","ℤ":"Zopf","⨗":"intlarhk","⨼":"iprod","⁢":"it","Ё":"IOcy","ё":"iocy","Į":"Iogon","į":"iogon","𝕀":"Iopf","𝕚":"iopf","Ι":"Iota","ι":"iota","¿":"iquest","𝒾":"iscr","⋵":"isindot","⋹":"isinE","⋴":"isins","⋳":"isinsv","Ĩ":"Itilde","ĩ":"itilde","І":"Iukcy","і":"iukcy","Ï":"Iuml","ï":"iuml","Ĵ":"Jcirc","ĵ":"jcirc","Й":"Jcy","й":"jcy","𝔍":"Jfr","𝔧":"jfr","ȷ":"jmath","𝕁":"Jopf","𝕛":"jopf","𝒥":"Jscr","𝒿":"jscr","Ј":"Jsercy","ј":"jsercy","Є":"Jukcy","є":"jukcy","Κ":"Kappa","κ":"kappa","ϰ":"kappav","Ķ":"Kcedil","ķ":"kcedil","К":"Kcy","к":"kcy","𝔎":"Kfr","𝔨":"kfr","ĸ":"kgreen","Х":"KHcy","х":"khcy","Ќ":"KJcy","ќ":"kjcy","𝕂":"Kopf","𝕜":"kopf","𝒦":"Kscr","𝓀":"kscr","⇚":"lAarr","Ĺ":"Lacute","ĺ":"lacute","⦴":"laemptyv","ℒ":"Lscr","Λ":"Lambda","λ":"lambda","⟨":"lang","⟪":"Lang","⦑":"langd","⪅":"lap","«":"laquo","⇤":"larrb","⤟":"larrbfs","←":"larr","↞":"Larr","⤝":"larrfs","↫":"larrlp","⤹":"larrpl","⥳":"larrsim","↢":"larrtl","⤙":"latail","⤛":"lAtail","⪫":"lat","⪭":"late","⪭︀":"lates","⤌":"lbarr","⤎":"lBarr","❲":"lbbrk","{":"lcub","[":"lsqb","⦋":"lbrke","⦏":"lbrksld","⦍":"lbrkslu","Ľ":"Lcaron","ľ":"lcaron","Ļ":"Lcedil","ļ":"lcedil","⌈":"lceil","Л":"Lcy","л":"lcy","⤶":"ldca","“":"ldquo","⥧":"ldrdhar","⥋":"ldrushar","↲":"ldsh","≤":"le","≦":"lE","⇆":"lrarr","⟦":"lobrk","⥡":"LeftDownTeeVector","⥙":"LeftDownVectorBar","⌊":"lfloor","↼":"lharu","⇇":"llarr","⇋":"lrhar","⥎":"LeftRightVector","↤":"mapstoleft","⥚":"LeftTeeVector","⋋":"lthree","⧏":"LeftTriangleBar","⊲":"vltri","⊴":"ltrie","⥑":"LeftUpDownVector","⥠":"LeftUpTeeVector","⥘":"LeftUpVectorBar","↿":"uharl","⥒":"LeftVectorBar","⪋":"lEg","⋚":"leg","⩽":"les","⪨":"lescc","⩿":"lesdot","⪁":"lesdoto","⪃":"lesdotor","⋚︀":"lesg","⪓":"lesges","⋖":"ltdot","≶":"lg","⪡":"LessLess","≲":"lsim","⥼":"lfisht","𝔏":"Lfr","𝔩":"lfr","⪑":"lgE","⥢":"lHar","⥪":"lharul","▄":"lhblk","Љ":"LJcy","љ":"ljcy","≪":"ll","⋘":"Ll","⥫":"llhard","◺":"lltri","Ŀ":"Lmidot","ŀ":"lmidot","⎰":"lmoust","⪉":"lnap","⪇":"lne","≨":"lnE","⋦":"lnsim","⟬":"loang","⇽":"loarr","⟵":"xlarr","⟷":"xharr","⟼":"xmap","⟶":"xrarr","↬":"rarrlp","⦅":"lopar","𝕃":"Lopf","𝕝":"lopf","⨭":"loplus","⨴":"lotimes","∗":"lowast",_:"lowbar","↙":"swarr","↘":"searr","◊":"loz","(":"lpar","⦓":"lparlt","⥭":"lrhard","‎":"lrm","⊿":"lrtri","‹":"lsaquo","𝓁":"lscr","↰":"lsh","⪍":"lsime","⪏":"lsimg","‘":"lsquo","‚":"sbquo","Ł":"Lstrok","ł":"lstrok","⪦":"ltcc","⩹":"ltcir","<":"lt","⋉":"ltimes","⥶":"ltlarr","⩻":"ltquest","◃":"ltri","⦖":"ltrPar","⥊":"lurdshar","⥦":"luruhar","≨︀":"lvnE","¯":"macr","♂":"male","✠":"malt","⤅":"Map","↦":"map","↥":"mapstoup","▮":"marker","⨩":"mcomma","М":"Mcy","м":"mcy","—":"mdash","∺":"mDDot"," ":"MediumSpace","ℳ":"Mscr","𝔐":"Mfr","𝔪":"mfr","℧":"mho","µ":"micro","⫰":"midcir","∣":"mid","−":"minus","⨪":"minusdu","∓":"mp","⫛":"mlcp","⊧":"models","𝕄":"Mopf","𝕞":"mopf","𝓂":"mscr","Μ":"Mu","μ":"mu","⊸":"mumap","Ń":"Nacute","ń":"nacute","∠⃒":"nang","≉":"nap","⩰̸":"napE","≋̸":"napid","ʼn":"napos","♮":"natur","ℕ":"Nopf"," ":"nbsp","≎̸":"nbump","≏̸":"nbumpe","⩃":"ncap","Ň":"Ncaron","ň":"ncaron","Ņ":"Ncedil","ņ":"ncedil","≇":"ncong","⩭̸":"ncongdot","⩂":"ncup","Н":"Ncy","н":"ncy","–":"ndash","⤤":"nearhk","↗":"nearr","⇗":"neArr","≠":"ne","≐̸":"nedot","​":"ZeroWidthSpace","≢":"nequiv","⤨":"toea","≂̸":"nesim","\n":"NewLine","∄":"nexist","𝔑":"Nfr","𝔫":"nfr","≧̸":"ngE","≱":"nge","⩾̸":"nges","⋙̸":"nGg","≵":"ngsim","≫⃒":"nGt","≯":"ngt","≫̸":"nGtv","↮":"nharr","⇎":"nhArr","⫲":"nhpar","∋":"ni","⋼":"nis","⋺":"nisd","Њ":"NJcy","њ":"njcy","↚":"nlarr","⇍":"nlArr","‥":"nldr","≦̸":"nlE","≰":"nle","⩽̸":"nles","≮":"nlt","⋘̸":"nLl","≴":"nlsim","≪⃒":"nLt","⋪":"nltri","⋬":"nltrie","≪̸":"nLtv","∤":"nmid","⁠":"NoBreak","𝕟":"nopf","⫬":"Not","¬":"not","≭":"NotCupCap","∦":"npar","∉":"notin","≹":"ntgl","⋵̸":"notindot","⋹̸":"notinE","⋷":"notinvb","⋶":"notinvc","⧏̸":"NotLeftTriangleBar","≸":"ntlg","⪢̸":"NotNestedGreaterGreater","⪡̸":"NotNestedLessLess","∌":"notni","⋾":"notnivb","⋽":"notnivc","⊀":"npr","⪯̸":"npre","⋠":"nprcue","⧐̸":"NotRightTriangleBar","⋫":"nrtri","⋭":"nrtrie","⊏̸":"NotSquareSubset","⋢":"nsqsube","⊐̸":"NotSquareSuperset","⋣":"nsqsupe","⊂⃒":"vnsub","⊈":"nsube","⊁":"nsc","⪰̸":"nsce","⋡":"nsccue","≿̸":"NotSucceedsTilde","⊃⃒":"vnsup","⊉":"nsupe","≁":"nsim","≄":"nsime","⫽⃥":"nparsl","∂̸":"npart","⨔":"npolint","⤳̸":"nrarrc","↛":"nrarr","⇏":"nrArr","↝̸":"nrarrw","𝒩":"Nscr","𝓃":"nscr","⊄":"nsub","⫅̸":"nsubE","⊅":"nsup","⫆̸":"nsupE","Ñ":"Ntilde","ñ":"ntilde","Ν":"Nu","ν":"nu","#":"num","№":"numero"," ":"numsp","≍⃒":"nvap","⊬":"nvdash","⊭":"nvDash","⊮":"nVdash","⊯":"nVDash","≥⃒":"nvge",">⃒":"nvgt","⤄":"nvHarr","⧞":"nvinfin","⤂":"nvlArr","≤⃒":"nvle","<⃒":"nvlt","⊴⃒":"nvltrie","⤃":"nvrArr","⊵⃒":"nvrtrie","∼⃒":"nvsim","⤣":"nwarhk","↖":"nwarr","⇖":"nwArr","⤧":"nwnear","Ó":"Oacute","ó":"oacute","Ô":"Ocirc","ô":"ocirc","О":"Ocy","о":"ocy","Ő":"Odblac","ő":"odblac","⨸":"odiv","⦼":"odsold","Œ":"OElig","œ":"oelig","⦿":"ofcir","𝔒":"Ofr","𝔬":"ofr","˛":"ogon","Ò":"Ograve","ò":"ograve","⧁":"ogt","⦵":"ohbar","Ω":"ohm","⦾":"olcir","⦻":"olcross","‾":"oline","⧀":"olt","Ō":"Omacr","ō":"omacr","ω":"omega","Ο":"Omicron","ο":"omicron","⦶":"omid","𝕆":"Oopf","𝕠":"oopf","⦷":"opar","⦹":"operp","⩔":"Or","∨":"or","⩝":"ord","ℴ":"oscr","ª":"ordf","º":"ordm","⊶":"origof","⩖":"oror","⩗":"orslope","⩛":"orv","𝒪":"Oscr","Ø":"Oslash","ø":"oslash","⊘":"osol","Õ":"Otilde","õ":"otilde","⨶":"otimesas","⨷":"Otimes","Ö":"Ouml","ö":"ouml","⌽":"ovbar","⏞":"OverBrace","⎴":"tbrk","⏜":"OverParenthesis","¶":"para","⫳":"parsim","⫽":"parsl","∂":"part","П":"Pcy","п":"pcy","%":"percnt",".":"period","‰":"permil","‱":"pertenk","𝔓":"Pfr","𝔭":"pfr","Φ":"Phi","φ":"phi","ϕ":"phiv","☎":"phone","Π":"Pi","π":"pi","ϖ":"piv","ℎ":"planckh","⨣":"plusacir","⨢":"pluscir","+":"plus","⨥":"plusdu","⩲":"pluse","±":"pm","⨦":"plussim","⨧":"plustwo","⨕":"pointint","𝕡":"popf","ℙ":"Popf","£":"pound","⪷":"prap","⪻":"Pr","≺":"pr","≼":"prcue","⪯":"pre","≾":"prsim","⪹":"prnap","⪵":"prnE","⋨":"prnsim","⪳":"prE","′":"prime","″":"Prime","∏":"prod","⌮":"profalar","⌒":"profline","⌓":"profsurf","∝":"prop","⊰":"prurel","𝒫":"Pscr","𝓅":"pscr","Ψ":"Psi","ψ":"psi"," ":"puncsp","𝔔":"Qfr","𝔮":"qfr","𝕢":"qopf","ℚ":"Qopf","⁗":"qprime","𝒬":"Qscr","𝓆":"qscr","⨖":"quatint","?":"quest",'"':"quot","⇛":"rAarr","∽̱":"race","Ŕ":"Racute","ŕ":"racute","√":"Sqrt","⦳":"raemptyv","⟩":"rang","⟫":"Rang","⦒":"rangd","⦥":"range","»":"raquo","⥵":"rarrap","⇥":"rarrb","⤠":"rarrbfs","⤳":"rarrc","→":"rarr","↠":"Rarr","⤞":"rarrfs","⥅":"rarrpl","⥴":"rarrsim","⤖":"Rarrtl","↣":"rarrtl","↝":"rarrw","⤚":"ratail","⤜":"rAtail","∶":"ratio","❳":"rbbrk","}":"rcub","]":"rsqb","⦌":"rbrke","⦎":"rbrksld","⦐":"rbrkslu","Ř":"Rcaron","ř":"rcaron","Ŗ":"Rcedil","ŗ":"rcedil","⌉":"rceil","Р":"Rcy","р":"rcy","⤷":"rdca","⥩":"rdldhar","↳":"rdsh","ℜ":"Re","ℛ":"Rscr","ℝ":"Ropf","▭":"rect","⥽":"rfisht","⌋":"rfloor","𝔯":"rfr","⥤":"rHar","⇀":"rharu","⥬":"rharul","Ρ":"Rho","ρ":"rho","ϱ":"rhov","⇄":"rlarr","⟧":"robrk","⥝":"RightDownTeeVector","⥕":"RightDownVectorBar","⇉":"rrarr","⊢":"vdash","⥛":"RightTeeVector","⋌":"rthree","⧐":"RightTriangleBar","⊳":"vrtri","⊵":"rtrie","⥏":"RightUpDownVector","⥜":"RightUpTeeVector","⥔":"RightUpVectorBar","↾":"uharr","⥓":"RightVectorBar","˚":"ring","‏":"rlm","⎱":"rmoust","⫮":"rnmid","⟭":"roang","⇾":"roarr","⦆":"ropar","𝕣":"ropf","⨮":"roplus","⨵":"rotimes","⥰":"RoundImplies",")":"rpar","⦔":"rpargt","⨒":"rppolint","›":"rsaquo","𝓇":"rscr","↱":"rsh","⋊":"rtimes","▹":"rtri","⧎":"rtriltri","⧴":"RuleDelayed","⥨":"ruluhar","℞":"rx","Ś":"Sacute","ś":"sacute","⪸":"scap","Š":"Scaron","š":"scaron","⪼":"Sc","≻":"sc","≽":"sccue","⪰":"sce","⪴":"scE","Ş":"Scedil","ş":"scedil","Ŝ":"Scirc","ŝ":"scirc","⪺":"scnap","⪶":"scnE","⋩":"scnsim","⨓":"scpolint","≿":"scsim","С":"Scy","с":"scy","⋅":"sdot","⩦":"sdote","⇘":"seArr","§":"sect",";":"semi","⤩":"tosa","✶":"sext","𝔖":"Sfr","𝔰":"sfr","♯":"sharp","Щ":"SHCHcy","щ":"shchcy","Ш":"SHcy","ш":"shcy","↑":"uarr","­":"shy","Σ":"Sigma","σ":"sigma","ς":"sigmaf","∼":"sim","⩪":"simdot","≃":"sime","⪞":"simg","⪠":"simgE","⪝":"siml","⪟":"simlE","≆":"simne","⨤":"simplus","⥲":"simrarr","⨳":"smashp","⧤":"smeparsl","⌣":"smile","⪪":"smt","⪬":"smte","⪬︀":"smtes","Ь":"SOFTcy","ь":"softcy","⌿":"solbar","⧄":"solb","/":"sol","𝕊":"Sopf","𝕤":"sopf","♠":"spades","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊏":"sqsub","⊑":"sqsube","⊐":"sqsup","⊒":"sqsupe","□":"squ","𝒮":"Sscr","𝓈":"sscr","⋆":"Star","☆":"star","⊂":"sub","⋐":"Sub","⪽":"subdot","⫅":"subE","⊆":"sube","⫃":"subedot","⫁":"submult","⫋":"subnE","⊊":"subne","⪿":"subplus","⥹":"subrarr","⫇":"subsim","⫕":"subsub","⫓":"subsup","∑":"sum","♪":"sung","¹":"sup1","²":"sup2","³":"sup3","⊃":"sup","⋑":"Sup","⪾":"supdot","⫘":"supdsub","⫆":"supE","⊇":"supe","⫄":"supedot","⟉":"suphsol","⫗":"suphsub","⥻":"suplarr","⫂":"supmult","⫌":"supnE","⊋":"supne","⫀":"supplus","⫈":"supsim","⫔":"supsub","⫖":"supsup","⇙":"swArr","⤪":"swnwar","ß":"szlig"," ":"Tab","⌖":"target","Τ":"Tau","τ":"tau","Ť":"Tcaron","ť":"tcaron","Ţ":"Tcedil","ţ":"tcedil","Т":"Tcy","т":"tcy","⃛":"tdot","⌕":"telrec","𝔗":"Tfr","𝔱":"tfr","∴":"there4","Θ":"Theta","θ":"theta","ϑ":"thetav","  ":"ThickSpace"," ":"thinsp","Þ":"THORN","þ":"thorn","⨱":"timesbar","×":"times","⨰":"timesd","⌶":"topbot","⫱":"topcir","𝕋":"Topf","𝕥":"topf","⫚":"topfork","‴":"tprime","™":"trade","▵":"utri","≜":"trie","◬":"tridot","⨺":"triminus","⨹":"triplus","⧍":"trisb","⨻":"tritime","⏢":"trpezium","𝒯":"Tscr","𝓉":"tscr","Ц":"TScy","ц":"tscy","Ћ":"TSHcy","ћ":"tshcy","Ŧ":"Tstrok","ŧ":"tstrok","Ú":"Uacute","ú":"uacute","↟":"Uarr","⥉":"Uarrocir","Ў":"Ubrcy","ў":"ubrcy","Ŭ":"Ubreve","ŭ":"ubreve","Û":"Ucirc","û":"ucirc","У":"Ucy","у":"ucy","⇅":"udarr","Ű":"Udblac","ű":"udblac","⥮":"udhar","⥾":"ufisht","𝔘":"Ufr","𝔲":"ufr","Ù":"Ugrave","ù":"ugrave","⥣":"uHar","▀":"uhblk","⌜":"ulcorn","⌏":"ulcrop","◸":"ultri","Ū":"Umacr","ū":"umacr","⏟":"UnderBrace","⏝":"UnderParenthesis","⊎":"uplus","Ų":"Uogon","ų":"uogon","𝕌":"Uopf","𝕦":"uopf","⤒":"UpArrowBar","↕":"varr","υ":"upsi","ϒ":"Upsi","Υ":"Upsilon","⇈":"uuarr","⌝":"urcorn","⌎":"urcrop","Ů":"Uring","ů":"uring","◹":"urtri","𝒰":"Uscr","𝓊":"uscr","⋰":"utdot","Ũ":"Utilde","ũ":"utilde","Ü":"Uuml","ü":"uuml","⦧":"uwangle","⦜":"vangrt","⊊︀":"vsubne","⫋︀":"vsubnE","⊋︀":"vsupne","⫌︀":"vsupnE","⫨":"vBar","⫫":"Vbar","⫩":"vBarv","В":"Vcy","в":"vcy","⊩":"Vdash","⊫":"VDash","⫦":"Vdashl","⊻":"veebar","≚":"veeeq","⋮":"vellip","|":"vert","‖":"Vert","❘":"VerticalSeparator","≀":"wr","𝔙":"Vfr","𝔳":"vfr","𝕍":"Vopf","𝕧":"vopf","𝒱":"Vscr","𝓋":"vscr","⊪":"Vvdash","⦚":"vzigzag","Ŵ":"Wcirc","ŵ":"wcirc","⩟":"wedbar","≙":"wedgeq","℘":"wp","𝔚":"Wfr","𝔴":"wfr","𝕎":"Wopf","𝕨":"wopf","𝒲":"Wscr","𝓌":"wscr","𝔛":"Xfr","𝔵":"xfr","Ξ":"Xi","ξ":"xi","⋻":"xnis","𝕏":"Xopf","𝕩":"xopf","𝒳":"Xscr","𝓍":"xscr","Ý":"Yacute","ý":"yacute","Я":"YAcy","я":"yacy","Ŷ":"Ycirc","ŷ":"ycirc","Ы":"Ycy","ы":"ycy","¥":"yen","𝔜":"Yfr","𝔶":"yfr","Ї":"YIcy","ї":"yicy","𝕐":"Yopf","𝕪":"yopf","𝒴":"Yscr","𝓎":"yscr","Ю":"YUcy","ю":"yucy","ÿ":"yuml","Ÿ":"Yuml","Ź":"Zacute","ź":"zacute","Ž":"Zcaron","ž":"zcaron","З":"Zcy","з":"zcy","Ż":"Zdot","ż":"zdot","ℨ":"Zfr","Ζ":"Zeta","ζ":"zeta","𝔷":"zfr","Ж":"ZHcy","ж":"zhcy","⇝":"zigrarr","𝕫":"zopf","𝒵":"Zscr","𝓏":"zscr","‍":"zwj","‌":"zwnj"},h=/["&'<>`]/g,p={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},d=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g,m={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅","in":"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺","int":"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},v={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},x=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],w=String.fromCharCode,A={},_=A.hasOwnProperty,E=function(t,e){return _.call(t,e) +},k=function(t,e){for(var n=-1,r=t.length;++n=55296&&57343>=t||t>1114111?(e&&S("character reference outside the permissible Unicode range"),"�"):E(b,t)?(e&&S("disallowed character reference"),b[t]):(e&&k(x,t)&&S("disallowed character reference"),t>65535&&(t-=65536,n+=w(t>>>10&1023|55296),t=56320|1023&t),n+=w(t))},M=function(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperCase()+";"},S=function(t){throw Error("Parse error: "+t)},F=function(t,e){e=D(e,F.options);var n=e.strict;n&&g.test(t)&&S("forbidden code point");var r=e.encodeEverything,i=e.useNamedReferences,u=e.allowUnsafeSymbols;return r?(t=t.replace(s,function(t){return i&&E(f,t)?"&"+f[t]+";":M(t)}),i&&(t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),i&&(t=t.replace(l,function(t){return"&"+f[t]+";"}))):i?(u||(t=t.replace(h,function(t){return"&"+f[t]+";"})),t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),t=t.replace(l,function(t){return"&"+f[t]+";"})):u||(t=t.replace(h,M)),t.replace(o,function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),r=1024*(e-55296)+n-56320+65536;return"&#x"+r.toString(16).toUpperCase()+";"}).replace(c,M)};F.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var T=function(t,e){e=D(e,T.options);var n=e.strict;return n&&d.test(t)&&S("malformed character reference"),t.replace(y,function(t,r,i,u,a,o,s,c){var l,f,h,p,d;return r?(l=r,f=i,n&&!f&&S("character reference was not terminated by a semicolon"),C(l,n)):u?(h=u,f=a,n&&!f&&S("character reference was not terminated by a semicolon"),l=parseInt(h,16),C(l,n)):o?(p=o,E(m,p)?m[p]:(n&&S("named character reference was not terminated by a semicolon"),t)):(p=s,d=c,d&&e.isAttributeValue?(n&&"="==d&&S("`&` did not start a character reference"),t):(n&&S("named character reference was not terminated by a semicolon"),v[p]+(d||"")))})};T.options={isAttributeValue:!1,strict:!1};var B=function(t){return t.replace(h,function(t){return p[t]})},L={version:"0.5.0",encode:F,decode:T,escape:B,unescape:T};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return L});else if(i&&!i.nodeType)if(u)u.exports=L;else for(var N in L)E(L,N)&&(i[N]=L[N]);else r.he=L}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],82:[function(t,e,n){(function(t){(function(){function r(t,e,n){for(var r=(n||0)-1,i=t?t.length:0;++r-1?0:-1:t?0:-1}function u(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:x+t,i=e[n]||(e[n]={});"object"==n?(i[r]||(i[r]=[])).push(t):i[r]=!0}}function a(t){return t.charCodeAt(0)}function o(t,e){for(var n=t.criteria,r=e.criteria,i=-1,u=n.length;++io||"undefined"==typeof a)return 1;if(o>a||"undefined"==typeof o)return-1}}return t.index-e.index}function s(t){var e=-1,n=t.length,r=t[0],i=t[n/2|0],a=t[n-1];if(r&&"object"==typeof r&&i&&"object"==typeof i&&a&&"object"==typeof a)return!1;var o=f();o["false"]=o["null"]=o["true"]=o.undefined=!1;var s=f();for(s.array=t,s.cache=o,s.push=u;++ei?0:i);++r=w&&u===r,c=[];if(o){var l=s(e);l?(u=i,e=l):o=!1}for(;++n-1:void 0});return i.pop(),u.pop(),v&&(h(i),h(u)),a}function ee(t,e,n,r,i){(Jr(e)?Xe:si)(e,function(e,u){var a,o,s=e,c=t[u];if(e&&((o=Jr(e))||ci(e))){for(var l=r.length;l--;)if(a=r[l]==e){c=i[l];break}if(!a){var f;n&&(s=n(c,e),(f="undefined"!=typeof s)&&(c=s)),f||(c=o?Jr(c)?c:[]:ci(c)?c:{}),r.push(e),i.push(c),f||ee(c,e,n,r,i)}}else n&&(s=n(c,e),"undefined"==typeof s&&(s=e)),"undefined"!=typeof s&&(c=s);t[u]=c})}function re(t,e){return t+Tr(Wr()*(e-t+1))}function ie(t,e,n){var u=-1,a=se(),o=t?t.length:0,c=[],f=!e&&o>=w&&a===r,d=n||f?l():c;if(f){var g=s(d);a=i,d=g}for(;++u3&&"function"==typeof e[n-2])var r=A(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(r=e[--n]);for(var i=d(arguments,1,n),u=-1,a=l(),o=l();++un?$r(0,u+n):n)||0,Jr(t)?a=i(t,e,n)>-1:"number"==typeof u?a=(qe(t)?t.indexOf(e,n):i(t,e,n))>-1:si(t,function(t){return++r>=n?!(a=t===e):void 0}),a}function Ge(t,n,r){var i=!0;n=e.createCallback(n,r,3);var u=-1,a=t?t.length:0;if("number"==typeof a)for(;++uu&&(u=c)}else n=null==n&&qe(t)?a:e.createCallback(n,r,3),Xe(t,function(t,e,r){var a=n(t,e,r);a>i&&(i=a,u=t)});return u}function en(t,n,r){var i=1/0,u=i;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&Jr(t))for(var o=-1,s=t.length;++oc&&(u=c)}else n=null==n&&qe(t)?a:e.createCallback(n,r,3),Xe(t,function(t,e,r){var a=n(t,e,r);i>a&&(i=a,u=t)});return u}function nn(t,n,r,i){if(!t)return r;var u=arguments.length<3;n=e.createCallback(n,i,4);var a=-1,o=t.length;if("number"==typeof o)for(u&&(r=t[++a]);++an?$r(0,i+n):n||0}else if(n){var u=Cn(t,e);return t[u]===e?u:-1}return r(t,e,n)}function bn(t,n,r){var i=0,u=t?t.length:0;if("number"!=typeof n&&null!=n){var a=u;for(n=e.createCallback(n,r,3);a--&&n(t[a],a,t);)i++}else i=null==n||r?1:n||i;return d(t,0,Gr($r(0,u-i),u))}function xn(){for(var t=[],e=-1,n=arguments.length,u=l(),a=se(),o=a===r,c=l();++e=w&&s(e?t[e]:c)))}var d=t[0],g=-1,y=d?d.length:0,m=[];t:for(;++gn?$r(0,r+n):Gr(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function _n(t){for(var e=arguments,n=0,r=e.length,i=t?t.length:0;++nu;){var o=u+a>>>1;r(t[o])1?arguments:arguments[0],e=-1,n=t?tn(pi(t,"length")):0,r=dr(0>n?0:n);++e2?ae(t,17,d(arguments,2),null,e):ae(t,1,null,null,e)}function Rn(t){for(var e=arguments.length>1?Q(arguments,!0,!1,1):xe(t),n=-1,r=e.length;++n2?ae(e,19,d(arguments,2),null,t):ae(e,3,null,null,t)}function In(){for(var t=arguments,e=t.length;e--;)if(!Se(t[e]))throw new _r;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function Pn(t,e){return e="number"==typeof e?e:+e||t.length,ae(t,4,null,null,null,e)}function jn(t,e,n){var r,i,u,a,o,s,c,l=0,f=!1,h=!0;if(!Se(t))throw new _r;if(e=$r(0,e)||0,n===!0){var p=!0;h=!1}else Fe(n)&&(p=n.leading,f="maxWait"in n&&($r(e,n.maxWait)||0),h="trailing"in n?n.trailing:h);var d=function(){var n=e-(gi()-a);if(0>=n){i&&Fr(i);var f=c;i=s=c=y,f&&(l=gi(),u=t.apply(o,r),s||i||(r=o=null))}else s=Rr(d,n)},g=function(){s&&Fr(s),i=s=c=y,(h||f!==e)&&(l=gi(),u=t.apply(o,r),s||i||(r=o=null))};return function(){if(r=arguments,a=gi(),o=this,c=h&&(s||!p),f===!1)var n=p&&!s;else{i||p||(l=a);var y=f-(a-l),m=0>=y;m?(i&&(i=Fr(i)),l=a,u=t.apply(o,r)):i||(i=Rr(g,y))}return m&&s?s=Fr(s):s||e===f||(s=Rr(d,e)),n&&(m=!0,u=t.apply(o,r)),!m||s||i||(r=o=null),u}}function Un(t){if(!Se(t))throw new _r;var e=d(arguments,1);return Rr(function(){t.apply(y,e)},1)}function Vn(t,e){if(!Se(t))throw new _r;var n=d(arguments,2);return Rr(function(){t.apply(y,n)},e)}function zn(t,e){if(!Se(t))throw new _r;var n=function(){var r=n.cache,i=e?e.apply(this,arguments):x+arguments[0];return Nr.call(r,i)?r[i]:r[i]=t.apply(this,arguments)};return n.cache={},n}function Hn(t){var e,n;if(!Se(t))throw new _r;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function $n(t){return ae(t,16,d(arguments,1))}function Gn(t){return ae(t,32,null,d(arguments,1))}function Yn(t,e,n){var r=!0,i=!0;if(!Se(t))throw new _r;return n===!1?r=!1:Fe(n)&&(r="leading"in n?n.leading:r,i="trailing"in n?n.trailing:i),Y.leading=r,Y.maxWait=e,Y.trailing=i,jn(t,e,Y)}function Wn(t,e){return ae(e,16,[t])}function Zn(t){return function(){return t}}function Xn(t,e,n){var r=typeof t;if(null==t||"function"==r)return A(t,e,n);if("object"!=r)return nr(t);var i=ti(t),u=i[0],a=t[u];return 1!=i.length||a!==a||Fe(a)?function(e){for(var n=i.length,r=!1;n--&&(r=te(e[i[n]],t[i[n]],null,!0)););return r}:function(t){var e=t[u];return a===e&&(0!==a||1/a==1/e)}}function Kn(t){return null==t?"":Ar(t).replace(ii,oe)}function Jn(t){return t}function Qn(t,r,i){var u=!0,a=r&&xe(r);r&&(i||a.length)||(null==i&&(i=r),o=n,r=t,t=e,a=xe(r)),i===!1?u=!1:Fe(i)&&"chain"in i&&(u=i.chain);var o=t,s=Se(o);Xe(a,function(e){var n=t[e]=r[e];s&&(o.prototype[e]=function(){var e=this.__chain__,r=this.__wrapped__,i=[r];qr.apply(i,arguments);var a=n.apply(t,i);if(u||e){if(r===a&&Fe(a))return this;a=new o(a),a.__chain__=e}return a})})}function tr(){return t._=Dr,this}function er(){}function nr(t){return function(e){return e[t]}}function rr(t,e,n){var r=null==t,i=null==e;if(null==n&&("boolean"==typeof t&&i?(n=t,t=1):i||"boolean"!=typeof e||(n=e,i=!0)),r&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0,n||t%1||e%1){var u=Wr();return Gr(t+u*(e-t+parseFloat("1e-"+((u+"").length-1))),e)}return re(t,e)}function ir(t,e){if(t){var n=t[e];return Se(n)?t[e]():n}}function ur(t,n,r){var i=e.templateSettings;t=Ar(t||""),r=ai({},r,i);var u,a=ai({},r.imports,i.imports),o=ti(a),s=ze(a),l=0,f=r.interpolate||B,h="__p += '",p=wr((r.escape||B).source+"|"+f.source+"|"+(f===F?C:B).source+"|"+(r.evaluate||B).source+"|$","g");t.replace(p,function(e,n,r,i,a,o){return r||(r=i),h+=t.slice(l,o).replace(N,c),n&&(h+="' +\n__e("+n+") +\n'"),a&&(u=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=o+e.length,e}),h+="';\n";var d=r.variable,g=d;g||(d="obj",h="with ("+d+") {\n"+h+"\n}\n"),h=(u?h.replace(E,""):h).replace(k,"$1").replace(D,"$1;"),h="function("+d+") {\n"+(g?"":d+" || ("+d+" = {});\n")+"var __t, __p = '', __e = _.escape"+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+R++ +"]")+"\n*/";try{var v=mr(o,"return "+h+m).apply(y,s)}catch(b){throw b.source=h,b}return n?v(n):(v.source=h,v)}function ar(t,e,n){t=(t=+t)>-1?t:0;var r=-1,i=dr(t);for(e=A(e,n,1);++r/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:F,variable:"",imports:{_:e}},jr||(v=function(){function e(){}return function(n){if(Fe(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}());var Kr=Pr?function(t,e){W.value=e,Pr(t,"__bindData__",W)}:er,Jr=Ur||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Cr.call(t)==I||!1},Qr=function(t){var e,n=t,r=[];if(!n)return r;if(!Z[typeof t])return r;for(e in n)Nr.call(n,e)&&r.push(e);return r},ti=Hr?function(t){return Fe(t)?Hr(t):[]}:Qr,ei={"&":"&","<":"<",">":">",'"':""","'":"'"},ni=Ae(ei),ri=wr("("+ti(ni).join("|")+")","g"),ii=wr("["+ti(ei).join("")+"]","g"),ui=function(t,e,n){var r,i=t,u=i;if(!i)return u;var a=arguments,o=0,s="number"==typeof n?2:a.length;if(s>3&&"function"==typeof a[s-2])var c=A(a[--s-1],a[s--],2);else s>2&&"function"==typeof a[s-1]&&(c=a[--s]);for(;++o/g,T=RegExp("^["+_+"]*0+(?=.$)"),B=/($^)/,L=/\bthis\b/,N=/['\n\r\t\u2028\u2029\\]/g,q=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],R=0,O="[object Arguments]",I="[object Array]",P="[object Boolean]",j="[object Date]",U="[object Function]",V="[object Number]",z="[object Object]",H="[object RegExp]",$="[object String]",G={};G[U]=!1,G[O]=G[I]=G[P]=G[j]=G[V]=G[z]=G[H]=G[$]=!0;var Y={leading:!1,maxWait:0,trailing:!1},W={configurable:!1,enumerable:!1,value:null,writable:!1},Z={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},X={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},K=Z[typeof window]&&window||this,J=Z[typeof n]&&n&&!n.nodeType&&n,Q=Z[typeof e]&&e&&!e.nodeType&&e,te=Q&&Q.exports===J&&J,ee=Z[typeof t]&&t;!ee||ee.global!==ee&&ee.window!==ee||(K=ee);var ne=g();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(K._=ne,define(function(){return ne})):J&&Q?te?(Q.exports=ne)._=ne:J._=ne:K._=ne}).call(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],83:[function(t,e){e.exports={name:"mermaid",version:"0.3.2",description:"Markdownish syntax for generating flowcharts",main:"src/main.js",bin:{mermaid:"./bin/mermaid.js"},scripts:{test:"gulp test"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"",license:"MIT",dependencies:{chalk:"^0.5.1",d3:"~3.4.13","dagre-d3":"~0.3.2",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",d3:"~3.4.13","dagre-d3":"~0.3.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.8.9","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-ext-replace":"~0.1.0","gulp-hogan":"^1.1.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~1.0.1","gulp-jison":"~1.0.0","gulp-jshint":"^1.9.0","gulp-less":"^1.3.6","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1",he:"^0.5.0","hogan.js":"^3.0.2",jasmine:"~2.0.1",jison:"~0.4.15","jshint-stylish":"^1.0.0",karma:"~0.12.20","karma-chrome-launcher":"~0.1.5","karma-jasmine":"~0.2.1","karma-requirejs":"~0.2.2",lodash:"^2.4.1","lodash._escapestringchar":"^2.4.1","lodash._objecttypes":"^2.4.1","lodash._reinterpolate":"^2.4.1","lodash._reunescapedhtml":"^2.4.1","lodash.defaults":"^2.4.1","lodash.templatesettings":"^2.4.1","lodash.values":"^2.4.1",marked:"^0.3.2","mock-browser":"^0.90.27",path:"^0.4.9",phantomjs:"^1.9.12",proxyquire:"^1.3.1",rewire:"^2.1.3",rimraf:"^2.2.8","semantic-ui":"^1.4.1",tape:"^3.0.3"}} +},{}],84:[function(t,e){var n;if(t)try{n=t("dagre-d3")}catch(r){}n||(n=window.dagreD3),e.exports=n},{"dagre-d3":2}],85:[function(t,e,n){(function(e){var r=t("./graphDb"),i=t("./parser/flow"),u=t("./parser/dot"),a=t("./dagre-d3");n.addVertices=function(t,n){var r=Object.keys(t),i=function(t,e){var n;for(n=0;n0&&(o=a.classes.join(" "));var s="";s=i(s,a.styles),u="undefined"==typeof a.text?a.id:a.text;var c="";e.mermaid.htmlLabels?c="html":(u=u.replace(/
/g,"\n"),c="text");var l=0,f="";switch(a.type){case"round":l=5,f="rect";break;case"square":f="rect";break;case"diamond":f="question";break;case"odd":f="rect_left_inv_arrow";break;case"odd_right":f="rect_left_inv_arrow";break;case"circle":f="circle";break;default:f="rect"}n.setNode(a.id,{labelType:c,shape:f,label:u,rx:l,ry:l,"class":o,style:s,id:a.id})})},n.addEdges=function(t,n){var r,i=0;t.forEach(function(t){i++,r="arrow_open"===t.type?"none":"normal";var u="";if("undefined"!=typeof t.style)t.style.forEach(function(t){u=u+t+";"});else switch(t.stroke){case"normal":u="stroke: #333; stroke-width: 1.5px;fill:none";break;case"dotted":u="stroke: #333; fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":u="stroke: #333; stroke-width: 3.5px;fill:none"}if("undefined"==typeof t.text)"undefined"==typeof t.style?n.setEdge(t.start,t.end,{style:u,arrowhead:r},i):n.setEdge(t.start,t.end,{style:u,arrowheadStyle:"fill: #333",arrowhead:r},i);else{var a=t.text.replace(/
/g,"\n");"undefined"==typeof t.style?e.mermaid.htmlLabels?n.setEdge(t.start,t.end,{labelType:"html",style:u,labelpos:"c",label:''+t.text+"",arrowheadStyle:"fill: #333",arrowhead:r},i):n.setEdge(t.start,t.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:a,arrowheadStyle:"fill: #333",arrowhead:r},i):n.setEdge(t.start,t.end,{labelType:"text",style:u,arrowheadStyle:"fill: #333",label:a,arrowhead:r},i)}})},n.getClasses=function(t,e){var n;r.clear(),n=e?u.parser:i.parser,n.yy=r,n.parse(t);var a=r.getClasses();return"undefined"==typeof a.default&&(a.default={id:"default"},a.default.styles=["fill:#ffa","stroke:#666","stroke-width:3px"],a.default.nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],a.default.edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),a},n.draw=function(t,e,o){var s;r.clear(),s=o?u.parser:i.parser,s.yy=r,s.parse(t);var c;c=r.getDirection(),"undefined"==typeof c&&(c="TD");var l=new a.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:c,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),f=r.getSubGraphs(),h=0;f.forEach(function(){h+=1;var t="subG"+h;r.addVertex(t,void 0,void 0,void 0)});var p=r.getVertices(),d=r.getEdges();h=0,f.forEach(function(t){h+=1;var e="subG"+h;d3.selectAll("cluster").append("text"),t.nodes.forEach(function(t){l.setParent(t,e)})}),n.addVertices(p,l),n.addEdges(d,l);var g=new a.render;g.shapes().question=function(t,e,n){var r=e.width,i=e.height,u=.8*(r+i),o=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}],s=t.insert("polygon",":first-child").attr("points",o.map(function(t){return t.x+","+t.y}).join(" ")).attr("rx",5).attr("ry",5).attr("transform","translate("+-u/2+","+2*u/4+")");return n.intersect=function(t){return a.intersect.polygon(n,o,t)},s},g.shapes().rect_left_inv_arrow=function(t,e,n){var r=e.width,i=e.height,u=[{x:-i/2,y:0},{x:r,y:0},{x:r,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}],o=t.insert("polygon",":first-child").attr("points",u.map(function(t){return t.x+","+t.y}).join(" ")).attr("transform","translate("+-r/2+","+2*i/4+")");return n.intersect=function(t){return a.intersect.polygon(n,u,t)},o},g.shapes().rect_right_inv_arrow=function(t,e,n){var r=e.width,i=e.height,u=[{x:0,y:0},{x:r+i/2,y:0},{x:r,y:-i/2},{x:r+i/2,y:-i},{x:0,y:-i}],o=t.insert("polygon",":first-child").attr("points",u.map(function(t){return t.x+","+t.y}).join(" ")).attr("transform","translate("+-r/2+","+2*i/4+")");return n.intersect=function(t){return a.intersect.polygon(n,u,t)},o},g.arrows().none=function(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 0 L 0 0 L 0 0 z");a.util.applyStyle(u,n[r+"Style"])};var y=d3.select("#"+e);svgGroup=d3.select("#"+e+" g"),g(d3.select("#"+e+" g"),l);var m=document.querySelector("#mermaidChart0");y.attr("height",l.graph().height),y.attr("width",l.graph().width),y.attr("viewBox",m.getBBox().x+" 0 "+l.graph().width+" "+l.graph().height),setTimeout(function(){console.log("Fixing titles");var t=0;f.forEach(function(n){console.log("Setting id "+e);var r=document.querySelectorAll("#"+e+" .clusters rect"),i=document.querySelectorAll("#"+e+" .cluster");if("undefined"!==n.title){console.log(r[t]);var u=r[t].x.baseVal.value,a=r[t].y.baseVal.value,o=r[t].width.baseVal.value,s=d3.select(i[t]),c=s.append("text");c.attr("x",u+o/2),c.attr("y",a+14),c.attr("fill","black"),c.attr("stroke","none"),c.attr("id",e+"Text"),c.style("text-anchor","middle"),console.log("Title "+n.title),console.log("i",t),console.log("x"+u+o/2),console.log("y"+u),c.text(n.title)}t+=1})},200)}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./dagre-d3":84,"./graphDb":86,"./parser/dot":87,"./parser/flow":88}],86:[function(require,module,exports){var vertices={},edges=[],classes=[],subGraphs=[],direction,funs=[];exports.addVertex=function(t,e,n,r){"undefined"!=typeof t&&0!==t.trim().length&&("undefined"==typeof vertices[t]&&(vertices[t]={id:t,styles:[],classes:[]}),"undefined"!=typeof e&&(vertices[t].text=e),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof r&&null!==r&&r.forEach(function(e){vertices[t].styles.push(e)}))},exports.addLink=function(t,e,n,r){var i={start:t,end:e,type:void 0,text:""};r=n.text,"undefined"!=typeof r&&(i.text=r),"undefined"!=typeof n&&(i.type=n.type,i.stroke=n.stroke),edges.push(i)},exports.updateLink=function(t,e){t.substr(1);edges[t].style=e},exports.addClass=function(t,e){"undefined"==typeof classes[t]&&(classes[t]={id:t,styles:[]}),"undefined"!=typeof e&&null!==e&&e.forEach(function(e){classes[t].styles.push(e)})},exports.setDirection=function(t){direction=t},exports.setClass=function(t,e){t.indexOf(",")>0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)},exports.setClickEvent=function(id,functionName){id.indexOf(",")>0?id.split(",").forEach(function(id2){"undefined"!=typeof vertices[id2]&&funs.push(function(){var elem=document.getElementById(id2);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id2+"')")})})}):"undefined"!=typeof vertices[id]&&funs.push(function(){var elem=document.getElementById(id);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id+"')")})})},exports.bindFunctions=function(){funs.forEach(function(t){t()})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes},exports.clear=function(){vertices={},classes={},edges=[],funs=[],subGraphs=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(t,e){function n(t){var e={"boolean":{},number:{},string:{}},n=[];return t.filter(function(t){var r=typeof t;return r in e?e[r].hasOwnProperty(t)?!1:e[r][t]=!0:n.indexOf(t)>=0?!1:n.push(t)})}var r=[];r=n(r.concat.apply(r,t)),subGraphs.push({nodes:r,title:e})},exports.getSubGraphs=function(){return subGraphs}},{}],87:[function(t,e,n){(function(r){var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,5],r=[1,6],i=[1,12],u=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,17],l=[1,18],f=[1,19],h=[1,20],p=[1,21],d=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],y=[1,37],m=[1,33],v=[1,34],b=[1,35],x=[1,36],w=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],A=[10,28],_=[10,28,37,57,58],E=[2,49],k=[1,45],D=[1,48],C=[1,49],M=[1,52],S=[2,65],F=[1,65],T=[1,66],B=[1,67],L=[1,68],N=[1,69],q=[1,70],R=[1,71],O=[1,72],I=[1,73],P=[8,16,17,18,19,20,21,22,23,24,25,26,47],j=[10,28,37],U={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,n,r,i,u){var a=u.length-1;switch(i){case 1:this.$=u[a-1];break;case 2:this.$=u[a-4];break;case 3:this.$=u[a-5];break;case 4:this.$=u[a-3];break;case 8:case 10:case 11:this.$=u[a];break;case 9:this.$=u[a-1]+""+u[a];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=u[a];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:r.addLink(u[a-1],u[a].id,u[a].op),this.$="oy";break;case 42:r.addLink(u[a-1],u[a].id,u[a].op),this.$={op:u[a-2],id:u[a-1]};break;case 44:this.$={op:u[a-1],id:u[a]};break;case 48:r.addVertex(u[a-1]),this.$=u[a-1];break;case 49:r.addVertex(u[a]),this.$=u[a];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:n,13:r},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d},{6:23,12:n,13:r},e(g,[2,5]),e(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:y,9:25,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},e([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d}),e(w,[2,8]),e(w,[2,10]),e(w,[2,11]),e(w,[2,12]),e(w,[2,13]),e(w,[2,14]),e(w,[2,15]),e(w,[2,16]),e(w,[2,17]),e(w,[2,18]),e(w,[2,19]),e(w,[2,20]),{7:39,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d},{7:30,8:y,9:40,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},{10:[1,41]},{10:[2,21],28:[1,42]},e(A,[2,23]),e(A,[2,24]),e(A,[2,25]),e(_,E,{44:44,32:[1,43],45:k}),e(A,[2,27],{41:46,43:47,57:D,58:C}),e(A,[2,47],{43:47,34:50,41:51,37:M,57:D,58:C}),{34:53,37:M},{34:54,37:M},{34:55,37:M},{7:56,8:[1,57],14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d},{7:30,8:y,9:58,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},e(w,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:y,9:61,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},{7:62,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d},e(_,[2,48]),e(_,S,{14:10,15:11,7:63,46:64,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,48:F,49:T,50:B,51:L,52:N,53:q,54:R,55:O,56:I}),e(A,[2,41],{34:74,37:M}),{7:77,8:y,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,33:76,42:75,47:x},e(P,[2,66]),e(P,[2,67]),e(A,[2,46]),e(A,[2,40],{34:78,37:M}),{7:81,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,38:79,39:[1,80]},e(A,[2,28]),e(A,[2,29]),e(A,[2,30]),{8:[1,82]},{7:30,8:y,9:83,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},{10:[1,84]},{7:30,8:y,9:85,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},{5:[2,2]},{10:[2,22]},e(A,[2,26]),e(_,[2,51],{45:[1,86]}),e(_,[2,52]),e(_,[2,56]),e(_,[2,57]),e(_,[2,58]),e(_,[2,59]),e(_,[2,60]),e(_,[2,61]),e(_,[2,62]),e(_,[2,63]),e(_,[2,64]),e(A,[2,38]),e(j,[2,44],{43:47,41:87,57:D,58:C}),e(j,[2,45],{43:47,41:88,57:D,58:C}),e(_,E,{44:44,45:k}),e(A,[2,39]),{39:[1,89]},e(A,[2,34],{34:90,37:M}),{32:[1,91]},{7:30,8:y,9:92,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},{10:[1,93]},e(_,[2,55]),{10:[1,94]},e(_,S,{46:95,48:F,49:T,50:B,51:L,52:N,53:q,54:R,55:O,56:I}),e(j,[2,42]),e(j,[2,43]),e(A,[2,33],{34:96,37:M}),e(A,[2,32]),{7:97,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d},{10:[1,98]},e(_,[2,54]),{5:[2,3]},e(_,[2,50]),e(A,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},e(_,[2,53]),{7:81,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,38:101},{7:81,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:f,24:h,25:p,26:d,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],u=[],a=this.table,o="",s=0,c=0,l=0,f=2,h=1,p=u.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);d.setInput(t,g.yy),g.yy.lexer=d,g.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;u.push(m);var v=d.options&&d.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,x,w,A,_,E,k,D,C,M={};;){if(w=r[r.length-1],this.defaultActions[w]?A=this.defaultActions[w]:((null===b||"undefined"==typeof b)&&(b=e()),A=a[w]&&a[w][b]),"undefined"==typeof A||!A.length||!A[0]){var S="";C=[];for(E in a[w])this.terminals_[E]&&E>f&&C.push("'"+this.terminals_[E]+"'");S=d.showPosition?"Parse error on line "+(s+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(s+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:m,expected:C})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+b);switch(A[0]){case 1:r.push(b),i.push(d.yytext),u.push(d.yylloc),r.push(A[1]),b=null,x?(b=x,x=null):(c=d.yyleng,o=d.yytext,s=d.yylineno,m=d.yylloc,l>0&&l--);break;case 2:if(k=this.productions_[A[1]][1],M.$=i[i.length-k],M._$={first_line:u[u.length-(k||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(k||1)].first_column,last_column:u[u.length-1].last_column},v&&(M._$.range=[u[u.length-(k||1)].range[0],u[u.length-1].range[1]]),_=this.performAction.apply(M,[o,c,s,g.yy,A[1],i,u].concat(p)),"undefined"!=typeof _)return _;k&&(r=r.slice(0,-1*k*2),i=i.slice(0,-1*k),u=u.slice(0,-1*k)),r.push(this.productions_[A[1]][0]),i.push(M.$),u.push(M._$),D=a[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0}},V=function(){var t={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];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(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),r&&(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 u in i)this[u]=i[u];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),u=0;ue[0].length)){if(e=n,r=u,this.options.backtrack_lexer){if(t=this.test_match(n,i[u]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===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(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>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),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}};return t}();return U.lexer=V,t.prototype=U,U.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":80,fs:78,path:79}],88:[function(t,e,n){(function(r){var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,9,10,12,19,29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],r=[2,2],i=[1,9],u=[1,10],a=[1,11],o=[1,12],s=[1,20],c=[1,23],l=[1,24],f=[1,25],h=[1,26],p=[1,27],d=[1,32],g=[1,21],y=[1,34],m=[1,31],v=[1,33],b=[1,39],x=[1,38],w=[1,35],A=[1,36],_=[1,37],E=[1,9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],k=[29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],D=[2,19],C=[1,51],M=[1,52],S=[1,50],F=[1,75],T=[1,67],B=[1,76],L=[1,63],N=[1,62],q=[1,77],R=[1,78],O=[1,68],I=[1,65],P=[1,64],j=[1,70],U=[1,71],V=[1,72],z=[1,73],H=[1,74],$=[9,10,19],G=[1,85],Y=[1,86],W=[1,87],Z=[1,88],X=[1,89],K=[1,90],J=[1,91],Q=[1,92],te=[1,93],ee=[1,94],ne=[1,95],re=[1,96],ie=[9,10,19,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61],ue=[9,10,12,15,19,36,38,40,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,76,79,81,82,84,85,87,88,89],ae=[9,10,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],oe=[1,110],se=[1,113],ce=[1,111],le=[9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],fe=[9,10,11,12,13,15,16,19,29,32,37,39,41,44,47,49,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89],he=[9,10,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],pe=[2,122],de=[1,139],ge=[1,128],ye=[1,129],me=[1,126],ve=[1,127],be=[1,130],xe=[1,131],we=[1,135],Ae=[1,136],_e=[1,134],Ee=[1,137],ke=[1,125],De=[1,132],Ce=[1,133],Me=[1,138],Se=[76,79,81,82,84,85,87,88,89],Fe=[12,62,76,79,81,82,84,85,87,88,89],Te=[1,164],Be=[1,163],Le=[9,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],Ne=[1,197],qe=[1,194],Re=[1,201],Oe=[1,198],Ie=[1,195],Pe=[1,202],je=[1,192],Ue=[1,193],Ve=[1,196],ze=[1,199],He=[1,200],$e=[11,12,13,15,16,29,32,44,47,49,67,68,69,70,71,76,79,81,82,84,85,87,88,89],Ge=[1,217],Ye=[9,10,19,79],We=[9,10,12,19,44,67,75,76,77,79,81,82,83,84,85],Ze={trace:function(){},yy:{},symbols_:{error:2,mermaidDoc:3,graphConfig:4,document:5,line:6,spaceListNewline:7,statement:8,SEMI:9,EOF:10,GRAPH:11,SPACE:12,DIR:13,FirstStmtSeperator:14,TAGEND:15,TAGSTART:16,UP:17,DOWN:18,NEWLINE:19,spaceList:20,commentStatement:21,verticeStatement:22,separator:23,styleStatement:24,linkStyleStatement:25,classDefStatement:26,classStatement:27,clickStatement:28,subgraph:29,text:30,endStatement:31,end:32,vertex:33,link:34,alphaNum:35,SQS:36,SQE:37,PS:38,PE:39,DIAMOND_START:40,DIAMOND_STOP:41,alphaNumStatement:42,alphaNumToken:43,MINUS:44,linkStatement:45,arrowText:46,"--":47,"-.":48,"==":49,ARROW_POINT:50,ARROW_CIRCLE:51,ARROW_CROSS:52,ARROW_OPEN:53,DOTTED_ARROW_POINT:54,DOTTED_ARROW_CIRCLE:55,DOTTED_ARROW_CROSS:56,DOTTED_ARROW_OPEN:57,THICK_ARROW_POINT:58,THICK_ARROW_CIRCLE:59,THICK_ARROW_CROSS:60,THICK_ARROW_OPEN:61,PIPE:62,textToken:63,commentText:64,commentToken:65,keywords:66,STYLE:67,LINKSTYLE:68,CLASSDEF:69,CLASS:70,CLICK:71,textNoTags:72,textNoTagsToken:73,stylesOpt:74,HEX:75,NUM:76,PCT:77,style:78,COMMA:79,styleComponent:80,ALPHA:81,COLON:82,UNIT:83,BRKT:84,DOT:85,graphCodeTokens:86,PLUS:87,EQUALS:88,MULT:89,TAG_START:90,TAG_END:91,QUOTE:92,$accept:0,$end:1},terminals_:{2:"error",9:"SEMI",10:"EOF",11:"GRAPH",12:"SPACE",13:"DIR",15:"TAGEND",16:"TAGSTART",17:"UP",18:"DOWN",19:"NEWLINE",29:"subgraph",32:"end",36:"SQS",37:"SQE",38:"PS",39:"PE",40:"DIAMOND_START",41:"DIAMOND_STOP",44:"MINUS",47:"--",48:"-.",49:"==",50:"ARROW_POINT",51:"ARROW_CIRCLE",52:"ARROW_CROSS",53:"ARROW_OPEN",54:"DOTTED_ARROW_POINT",55:"DOTTED_ARROW_CIRCLE",56:"DOTTED_ARROW_CROSS",57:"DOTTED_ARROW_OPEN",58:"THICK_ARROW_POINT",59:"THICK_ARROW_CIRCLE",60:"THICK_ARROW_CROSS",61:"THICK_ARROW_OPEN",62:"PIPE",67:"STYLE",68:"LINKSTYLE",69:"CLASSDEF",70:"CLASS",71:"CLICK",75:"HEX",76:"NUM",77:"PCT",79:"COMMA",81:"ALPHA",82:"COLON",83:"UNIT",84:"BRKT",85:"DOT",87:"PLUS",88:"EQUALS",89:"MULT",90:"TAG_START",91:"TAG_END",92:"QUOTE"},productions_:[0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[6,1],[4,4],[4,4],[4,4],[4,4],[4,4],[14,1],[14,1],[14,2],[7,2],[7,2],[7,1],[7,1],[20,2],[20,1],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,6],[8,5],[31,1],[31,2],[23,1],[23,1],[23,1],[22,3],[22,1],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,1],[33,2],[35,1],[35,2],[42,1],[42,3],[34,2],[34,3],[34,1],[34,2],[34,5],[34,6],[34,5],[34,6],[34,5],[34,6],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[46,3],[30,1],[30,2],[64,1],[64,2],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[72,1],[72,2],[26,5],[27,5],[28,5],[24,5],[24,5],[25,5],[21,3],[74,1],[74,3],[78,1],[78,2],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[65,1],[65,1],[63,1],[63,1],[63,1],[63,1],[63,1],[73,1],[73,1],[73,1],[73,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1]],performAction:function(t,e,n,r,i,u){var a=u.length-1; +switch(i){case 2:this.$=[];break;case 3:u[a]!==[]&&u[a-1].push(u[a]),this.$=u[a-1];break;case 4:case 5:case 50:case 52:case 77:case 79:case 90:this.$=u[a];break;case 8:r.setDirection(u[a-1]),this.$=u[a-1];break;case 9:r.setDirection("LR"),this.$=u[a-1];break;case 10:r.setDirection("RL"),this.$=u[a-1];break;case 11:r.setDirection("BT"),this.$=u[a-1];break;case 12:r.setDirection("TB"),this.$=u[a-1];break;case 22:case 24:case 25:case 26:case 27:case 28:this.$=[];break;case 23:this.$=u[a-1];break;case 29:r.addSubGraph(u[a-2],u[a-4]);break;case 30:r.addSubGraph(u[a-2],void 0);break;case 36:r.addLink(u[a-2],u[a],u[a-1]),this.$=[u[a-2],u[a]];break;case 37:this.$=[u[a]];break;case 38:this.$=u[a-3],r.addVertex(u[a-3],u[a-1],"square");break;case 39:this.$=u[a-4],r.addVertex(u[a-4],u[a-2],"square");break;case 40:this.$=u[a-5],r.addVertex(u[a-5],u[a-2],"circle");break;case 41:this.$=u[a-6],r.addVertex(u[a-6],u[a-3],"circle");break;case 42:this.$=u[a-3],r.addVertex(u[a-3],u[a-1],"round");break;case 43:this.$=u[a-4],r.addVertex(u[a-4],u[a-2],"round");break;case 44:this.$=u[a-3],r.addVertex(u[a-3],u[a-1],"diamond");break;case 45:this.$=u[a-4],r.addVertex(u[a-4],u[a-2],"diamond");break;case 46:this.$=u[a-3],r.addVertex(u[a-3],u[a-1],"odd");break;case 47:this.$=u[a-4],r.addVertex(u[a-4],u[a-2],"odd");break;case 48:this.$=u[a],r.addVertex(u[a]);break;case 49:this.$=u[a-1],r.addVertex(u[a-1]);break;case 51:case 78:case 80:case 91:this.$=u[a-1]+""+u[a];break;case 53:this.$=u[a-2]+"-"+u[a];break;case 54:u[a-1].text=u[a],this.$=u[a-1];break;case 55:u[a-2].text=u[a-1],this.$=u[a-2];break;case 56:this.$=u[a];break;case 57:case 76:this.$=u[a-1];break;case 58:case 60:case 62:u[a].text=u[a-2],this.$=u[a];break;case 59:case 61:case 63:u[a-1].text=u[a-3],this.$=u[a-1];break;case 64:this.$={type:"arrow",stroke:"normal"};break;case 65:this.$={type:"arrow_circle",stroke:"normal"};break;case 66:this.$={type:"arrow_cross",stroke:"normal"};break;case 67:this.$={type:"arrow_open",stroke:"normal"};break;case 68:this.$={type:"arrow",stroke:"dotted"};break;case 69:this.$={type:"arrow_circle",stroke:"dotted"};break;case 70:this.$={type:"arrow_cross",stroke:"dotted"};break;case 71:this.$={type:"arrow_open",stroke:"dotted"};break;case 72:this.$={type:"arrow",stroke:"thick"};break;case 73:this.$={type:"arrow_circle",stroke:"thick"};break;case 74:this.$={type:"arrow_cross",stroke:"thick"};break;case 75:this.$={type:"arrow_open",stroke:"thick"};break;case 92:this.$=u[a-4],r.addClass(u[a-2],u[a]);break;case 93:this.$=u[a-4],r.setClass(u[a-2],u[a]);break;case 94:this.$=u[a-4],r.setClickEvent(u[a-2],u[a]);break;case 95:this.$=u[a-4],r.addVertex(u[a-2],void 0,void 0,u[a]);break;case 96:case 97:this.$=u[a-4],r.updateLink(u[a-2],u[a]);break;case 99:this.$=[u[a]];break;case 100:u[a-2].push(u[a]),this.$=u[a-2];break;case 102:this.$=u[a-1]+u[a]}},table:[{3:1,4:2,11:[1,3]},{1:[3]},e(n,r,{5:4}),{12:[1,5]},{1:[2,1],6:6,7:7,8:8,9:i,10:u,12:a,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,33:22,35:28,42:29,43:30,67:c,68:l,69:f,70:h,71:p,76:d,77:g,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{13:[1,40],15:[1,41],16:[1,42],17:[1,43],18:[1,44]},e(E,[2,3]),{8:45,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,33:22,35:28,42:29,43:30,67:c,68:l,69:f,70:h,71:p,76:d,77:g,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},e(E,[2,5]),e(E,[2,6]),e(E,[2,7]),e(k,D,{7:46,12:a,19:o}),e(k,[2,18],{7:47,12:a,19:o}),{19:[1,48]},{9:C,10:M,19:S,23:49},{9:C,10:M,19:S,23:53},{9:C,10:M,19:S,23:54},{9:C,10:M,19:S,23:55},{9:C,10:M,19:S,23:56},{9:C,10:M,19:S,23:57},{9:C,10:M,11:F,12:T,13:B,15:L,16:N,19:S,23:59,29:q,30:58,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{77:[1,79]},e($,[2,37],{34:80,45:81,47:[1,82],48:[1,83],49:[1,84],50:G,51:Y,52:W,53:Z,54:X,55:K,56:J,57:Q,58:te,59:ee,60:ne,61:re}),{12:[1,97]},{12:[1,98]},{12:[1,99]},{12:[1,100]},{12:[1,101]},e(ie,[2,48],{43:30,42:107,12:[1,106],15:[1,105],36:[1,102],38:[1,103],40:[1,104],76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_}),e(ue,[2,50]),e(ue,[2,52],{44:[1,108]}),e(ae,[2,125]),e(ae,[2,126]),e(ae,[2,127]),e(ae,[2,128]),e(ae,[2,129]),e(ae,[2,130]),e(ae,[2,131]),e(ae,[2,132]),e(ae,[2,133]),{9:oe,12:se,14:109,19:ce,20:112},{9:oe,12:se,14:114,19:ce,20:112},{9:oe,12:se,14:115,19:ce,20:112},{9:oe,12:se,14:116,19:ce,20:112},{9:oe,12:se,14:117,19:ce,20:112},e(E,[2,4]),e(k,[2,16]),e(k,[2,17]),e(E,[2,22]),e(E,[2,23]),e(E,[2,33]),e(E,[2,34]),e(E,[2,35]),e(E,[2,24]),e(E,[2,25]),e(E,[2,26]),e(E,[2,27]),e(E,[2,28]),{9:C,10:M,11:F,12:T,13:B,15:L,16:N,19:S,23:118,29:q,32:R,43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},e(le,r,{5:120}),e(fe,[2,77]),e(he,[2,116]),e(he,[2,117]),e(he,[2,118]),e(he,[2,119]),e(he,[2,120]),e(he,[2,121]),e(he,pe),e(he,[2,123]),e(he,[2,124]),e(he,[2,81]),e(he,[2,82]),e(he,[2,83]),e(he,[2,84]),e(he,[2,85]),e(he,[2,86]),e(he,[2,87]),e(he,[2,88]),e(he,[2,89]),{9:de,11:F,12:T,13:B,15:L,16:N,29:q,32:R,36:ge,37:ye,38:me,39:ve,40:be,41:xe,43:66,44:O,47:I,49:P,50:we,51:Ae,52:_e,53:Ee,62:ke,63:123,64:121,65:122,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,86:124,87:w,88:A,89:_,90:De,91:Ce,92:Me},{33:140,35:28,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},e(Se,[2,56],{46:141,12:[1,142],62:[1,143]}),{12:[1,144]},{12:[1,145]},{12:[1,146]},e(Fe,[2,64]),e(Fe,[2,65]),e(Fe,[2,66]),e(Fe,[2,67]),e(Fe,[2,68]),e(Fe,[2,69]),e(Fe,[2,70]),e(Fe,[2,71]),e(Fe,[2,72]),e(Fe,[2,73]),e(Fe,[2,74]),e(Fe,[2,75]),{35:147,42:29,43:30,75:[1,148],76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{76:[1,149]},{35:150,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{35:151,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{35:152,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,30:153,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,30:155,32:R,38:[1,154],43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,30:156,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,30:157,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},e(ie,[2,49]),e(ue,[2,51]),{43:158,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},e(n,[2,8]),e(n,[2,13]),e(n,[2,14]),{19:[1,159]},{12:se,19:[2,21],20:160},e(n,[2,9]),e(n,[2,10]),e(n,[2,11]),e(n,[2,12]),e(le,r,{5:161}),e(fe,[2,78]),{6:6,7:7,8:8,9:i,10:u,12:Te,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,31:162,32:Be,33:22,35:28,42:29,43:30,67:c,68:l,69:f,70:h,71:p,76:d,77:g,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{9:de,11:F,12:T,13:B,15:L,16:N,19:[2,98],29:q,32:R,36:ge,37:ye,38:me,39:ve,40:be,41:xe,43:66,44:O,47:I,49:P,50:we,51:Ae,52:_e,53:Ee,62:ke,63:123,65:165,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,86:124,87:w,88:A,89:_,90:De,91:Ce,92:Me},e(Le,[2,79]),e(Le,[2,114]),e(Le,[2,115]),e(Le,[2,134]),e(Le,[2,135]),e(Le,[2,136]),e(Le,[2,137]),e(Le,[2,138]),e(Le,[2,139]),e(Le,[2,140]),e(Le,[2,141]),e(Le,[2,142]),e(Le,[2,143]),e(Le,[2,144]),e(Le,[2,145]),e(Le,[2,146]),e(Le,[2,147]),e(Le,[2,148]),e($,[2,36]),e(Se,[2,54],{12:[1,166]}),e(Se,[2,57]),{11:F,12:T,13:B,15:L,16:N,29:q,30:167,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,30:168,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,30:169,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,30:170,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{12:[1,171],42:107,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{12:[1,172]},{12:[1,173]},{12:[1,174],42:107,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{12:[1,175],42:107,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{12:[1,176],42:107,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,32:R,37:[1,177],43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,30:178,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,32:R,39:[1,179],43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,32:R,41:[1,180],43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:T,13:B,15:L,16:N,29:q,32:R,37:[1,181],43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},e(ue,[2,53]),e(n,[2,15]),{19:[2,20]},{6:6,7:7,8:8,9:i,10:u,12:Te,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,31:182,32:Be,33:22,35:28,42:29,43:30,67:c,68:l,69:f,70:h,71:p,76:d,77:g,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{9:C,10:M,19:S,23:183},e($,[2,31]),e(k,D,{7:46,31:184,12:Te,19:o,32:Be}),e(Le,[2,80]),e(Se,[2,55]),{11:F,12:T,13:B,15:L,16:N,29:q,32:R,43:66,44:O,47:I,49:P,62:[1,185],63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:[1,186],13:B,15:L,16:N,29:q,32:R,43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:[1,187],13:B,15:L,16:N,29:q,32:R,43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{11:F,12:[1,188],13:B,15:L,16:N,29:q,32:R,43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{12:Ne,44:qe,67:Re,74:189,75:Oe,76:Ie,77:Pe,78:190,80:191,81:je,82:Ue,83:Ve,84:ze,85:He},{12:Ne,44:qe,67:Re,74:203,75:Oe,76:Ie,77:Pe,78:190,80:191,81:je,82:Ue,83:Ve,84:ze,85:He},{12:Ne,44:qe,67:Re,74:204,75:Oe,76:Ie,77:Pe,78:190,80:191,81:je,82:Ue,83:Ve,84:ze,85:He},{12:Ne,44:qe,67:Re,74:205,75:Oe,76:Ie,77:Pe,78:190,80:191,81:je,82:Ue,83:Ve,84:ze,85:He},{35:206,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},{35:207,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},e(ie,[2,38],{12:[1,208]}),{11:F,12:T,13:B,15:L,16:N,29:q,32:R,39:[1,209],43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_},e(ie,[2,42],{12:[1,210]}),e(ie,[2,44],{12:[1,211]}),e(ie,[2,46],{12:[1,212]}),{9:C,10:M,19:S,23:213},e(E,[2,30]),e($,[2,32]),e([12,76,79,81,82,84,85,87,88,89],[2,76]),e($e,pe,{45:214,50:G,51:Y,52:W,53:Z,54:X,55:K,56:J,57:Q,58:te,59:ee,60:ne,61:re}),e($e,pe,{45:215,50:G,51:Y,52:W,53:Z,54:X,55:K,56:J,57:Q,58:te,59:ee,60:ne,61:re}),e($e,pe,{45:216,50:G,51:Y,52:W,53:Z,54:X,55:K,56:J,57:Q,58:te,59:ee,60:ne,61:re}),e($,[2,95],{79:Ge}),e(Ye,[2,99],{80:218,12:Ne,44:qe,67:Re,75:Oe,76:Ie,77:Pe,81:je,82:Ue,83:Ve,84:ze,85:He}),e(We,[2,101]),e(We,[2,103]),e(We,[2,104]),e(We,[2,105]),e(We,[2,106]),e(We,[2,107]),e(We,[2,108]),e(We,[2,109]),e(We,[2,110]),e(We,[2,111]),e(We,[2,112]),e(We,[2,113]),e($,[2,96],{79:Ge}),e($,[2,97],{79:Ge}),e($,[2,92],{79:Ge}),e($,[2,93],{43:30,42:107,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_}),e($,[2,94],{43:30,42:107,76:d,79:y,81:m,82:v,84:b,85:x,87:w,88:A,89:_}),e(ie,[2,39]),{39:[1,219]},e(ie,[2,43]),e(ie,[2,45]),e(ie,[2,47]),e(E,[2,29]),e(Se,[2,58],{12:[1,220]}),e(Se,[2,60],{12:[1,221]}),e(Se,[2,62],{12:[1,222]}),{12:Ne,44:qe,67:Re,75:Oe,76:Ie,77:Pe,78:223,80:191,81:je,82:Ue,83:Ve,84:ze,85:He},e(We,[2,102]),e(ie,[2,40],{12:[1,224]}),e(Se,[2,59]),e(Se,[2,61]),e(Se,[2,63]),e(Ye,[2,100],{80:218,12:Ne,44:qe,67:Re,75:Oe,76:Ie,77:Pe,81:je,82:Ue,83:Ve,84:ze,85:He}),e(ie,[2,41])],defaultActions:{160:[2,20]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],u=[],a=this.table,o="",s=0,c=0,l=0,f=2,h=1,p=u.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);d.setInput(t,g.yy),g.yy.lexer=d,g.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;u.push(m);var v=d.options&&d.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,x,w,A,_,E,k,D,C,M={};;){if(w=r[r.length-1],this.defaultActions[w]?A=this.defaultActions[w]:((null===b||"undefined"==typeof b)&&(b=e()),A=a[w]&&a[w][b]),"undefined"==typeof A||!A.length||!A[0]){var S="";C=[];for(E in a[w])this.terminals_[E]&&E>f&&C.push("'"+this.terminals_[E]+"'");S=d.showPosition?"Parse error on line "+(s+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(s+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:m,expected:C})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+b);switch(A[0]){case 1:r.push(b),i.push(d.yytext),u.push(d.yylloc),r.push(A[1]),b=null,x?(b=x,x=null):(c=d.yyleng,o=d.yytext,s=d.yylineno,m=d.yylloc,l>0&&l--);break;case 2:if(k=this.productions_[A[1]][1],M.$=i[i.length-k],M._$={first_line:u[u.length-(k||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(k||1)].first_column,last_column:u[u.length-1].last_column},v&&(M._$.range=[u[u.length-(k||1)].range[0],u[u.length-1].range[1]]),_=this.performAction.apply(M,[o,c,s,g.yy,A[1],i,u].concat(p)),"undefined"!=typeof _)return _;k&&(r=r.slice(0,-1*k*2),i=i.slice(0,-1*k),u=u.slice(0,-1*k)),r.push(this.productions_[A[1]][0]),i.push(M.$),u.push(M._$),D=a[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0}},Xe=function(){var t={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];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(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),r&&(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 u in i)this[u]=i[u];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),u=0;ue[0].length)){if(e=n,r=u,this.options.backtrack_lexer){if(t=this.test_match(n,i[u]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===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(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>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),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return 67;case 1:return 68;case 2:return 69;case 3:return 70;case 4:return 71;case 5:return 11;case 6:return 29;case 7:return 32;case 8:return 13;case 9:return 13;case 10:return 13;case 11:return 13;case 12:return 13;case 13:return 13;case 14:return 76;case 15:return 84;case 16:return 82;case 17:return 9;case 18:return 79;case 19:return 89;case 20:return 16;case 21:return 15;case 22:return 17;case 23:return 18;case 24:return 52;case 25:return 50;case 26:return 51;case 27:return 53;case 28:return 56;case 29:return 54;case 30:return 55;case 31:return 57;case 32:return 56;case 33:return 54;case 34:return 55;case 35:return 57;case 36:return 60;case 37:return 58;case 38:return 59;case 39:return 61;case 40:return 47;case 41:return 48;case 42:return 49;case 43:return 44;case 44:return 85;case 45:return 87;case 46:return 77;case 47:return 88;case 48:return 88;case 49:return 81;case 50:return 62;case 51:return 38;case 52:return 39;case 53:return 36;case 54:return 37;case 55:return 40;case 56:return 41;case 57:return 92;case 58:return 19;case 59:return 12;case 60:return 10}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:subgraph\b)/,/^(?:end\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:v\b)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-\.-[x])/,/^(?:-\.->)/,/^(?:-\.-[o])/,/^(?:-\.-)/,/^(?:.-[x])/,/^(?:\.->)/,/^(?:\.-[o])/,/^(?:\.-)/,/^(?:==[x])/,/^(?:==>)/,/^(?:==[o])/,/^(?:==[\=])/,/^(?:--)/,/^(?:-\.)/,/^(?:==)/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u005C\u005F-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_\/])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\n)/,/^(?:\s)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60],inclusive:!0}}};return t}();return Ze.lexer=Xe,t.prototype=Ze,Ze.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":80,fs:78,path:79}],89:[function(t,e){var n;if(t)try{n=t("d3")}catch(r){}n||(n=window.d3),e.exports=n},{d3:1}],90:[function(t,e,n){(function(r){var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[6,8,10,11,15,17,19,20,22,33],r=[2,2],i=[1,6],u=[1,8],a=[1,9],o=[1,12],s=[1,13],c=[1,14],l=[1,15],f=[1,17],h=[1,18],p=[2,7],d=[6,8,10,11,15,17,18,19,20,21,22,33],g=[6,8,10,11,15,17,18,19,20,22,33],y=[1,46],m=[1,49],v=[1,53],b={trace:function(){},yy:{},symbols_:{error:2,start:3,SD:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,participant:11,actor:12,signal:13,note_statement:14,title:15,text:16,loop:17,end:18,opt:19,alt:20,"else":21,note:22,placement:23,text2:24,over:25,spaceList:26,actor_pair:27,",":28,left_of:29,right_of:30,signaltype:31,actors:32,ACTOR:33,SOLID_OPEN_ARROW:34,DOTTED_OPEN_ARROW:35,SOLID_ARROW:36,DOTTED_ARROW:37,SOLID_CROSS:38,DOTTED_CROSS:39,TXT:40,$accept:0,$end:1},terminals_:{2:"error",4:"SD",6:"EOF",8:"SPACE",10:"NL",11:"participant",15:"title",16:"text",17:"loop",18:"end",19:"opt",20:"alt",21:"else",22:"note",25:"over",28:",",29:"left_of",30:"right_of",33:"ACTOR",34:"SOLID_OPEN_ARROW",35:"DOTTED_OPEN_ARROW",36:"SOLID_ARROW",37:"DOTTED_ARROW",38:"SOLID_CROSS",39:"DOTTED_CROSS",40:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,3],[9,2],[9,2],[9,4],[9,4],[9,4],[9,7],[14,4],[14,5],[26,2],[26,1],[27,1],[27,3],[23,1],[23,1],[13,4],[32,2],[32,1],[12,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,1],[24,1]],performAction:function(t,e,n,r,i,u){var a=u.length-1;switch(i){case 1:return r.apply(u[a-1]),u[a-1];case 2:this.$=[];break;case 3:u[a-1].push(u[a]),this.$=u[a-1];break;case 4:case 5:this.$=u[a];break;case 6:case 7:this.$=[];break;case 8:this.$=u[a-1];break;case 12:u[a-1].unshift({type:"loopStart",loopText:u[a-2].actor,signalType:r.LINETYPE.LOOP_START}),u[a-1].push({type:"loopEnd",loopText:u[a-2],signalType:r.LINETYPE.LOOP_END}),this.$=u[a-1];break;case 13:u[a-1].unshift({type:"optStart",optText:u[a-2].actor,signalType:r.LINETYPE.OPT_START}),u[a-1].push({type:"optEnd",optText:u[a-2].actor,signalType:r.LINETYPE.OPT_END}),this.$=u[a-1];break;case 14:u[a-4].unshift({type:"altStart",altText:u[a-5].actor,signalType:r.LINETYPE.ALT_START}),u[a-4].push({type:"else",altText:u[a-2].actor,signalType:r.LINETYPE.ALT_ELSE}),u[a-4]=u[a-4].concat(u[a-1]),u[a-4].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=u[a-4];break;case 15:this.$=[u[a-1],{type:"addNote",placement:u[a-2],actor:u[a-1].actor,text:u[a]}];break;case 19:this.$=u[a];break;case 20:this.$=[u[a-2],u[a]];break;case 21:this.$=r.PLACEMENT.LEFTOF;break;case 22:this.$=r.PLACEMENT.RIGHTOF;break;case 23:this.$=[u[a-3],u[a-1],{type:"addMessage",from:u[a-3].actor,to:u[a-1].actor,signalType:u[a-2],msg:u[a]}];break;case 26:this.$={type:"addActor",actor:u[a]};break;case 27:this.$=r.LINETYPE.SOLID_OPEN;break;case 28:this.$=r.LINETYPE.DOTTED_OPEN;break;case 29:this.$=r.LINETYPE.SOLID;break;case 30:this.$=r.LINETYPE.DOTTED;break;case 31:this.$=r.LINETYPE.SOLID_CROSS;break;case 32:this.$=r.LINETYPE.DOTTED_CROSS;break;case 33:this.$=u[a].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(n,r,{5:3}),{6:[1,4],7:5,8:i,9:7,10:u,11:a,12:16,13:10,14:11,15:o,17:s,19:c,20:l,22:f,33:h},e(n,p,{1:[2,1]}),e(d,[2,3]),{9:19,11:a,12:16,13:10,14:11,15:o,17:s,19:c,20:l,22:f,33:h},e(d,[2,5]),e(d,[2,6]),{12:20,33:h},{10:[1,21]},{10:[1,22]},{8:[1,23]},{12:24,33:h},{12:25,33:h},{12:26,33:h},{31:27,34:[1,28],35:[1,29],36:[1,30],37:[1,31],38:[1,32],39:[1,33]},{23:34,25:[1,35],29:[1,36],30:[1,37]},e([6,8,10,11,15,17,18,19,20,21,22,28,33,34,35,36,37,38,39,40],[2,26]),e(d,[2,4]),{10:[1,38]},e(d,[2,9]),e(d,[2,10]),{16:[1,39]},e(g,r,{5:40}),e(g,r,{5:41}),e([6,8,10,11,15,17,19,20,21,22,33],r,{5:42}),{12:43,33:h},{33:[2,27]},{33:[2,28]},{33:[2,29]},{33:[2,30]},{33:[2,31]},{33:[2,32]},{12:44,33:h},{8:y,26:45},{33:[2,21]},{33:[2,22]},e(d,[2,8]),{10:[1,47]},{6:m,7:5,8:i,9:7,10:u,11:a,12:16,13:10,14:11,15:o,17:s,18:[1,48],19:c,20:l,22:f,33:h},{6:m,7:5,8:i,9:7,10:u,11:a,12:16,13:10,14:11,15:o,17:s,18:[1,50],19:c,20:l,22:f,33:h},{6:m,7:5,8:i,9:7,10:u,11:a,12:16,13:10,14:11,15:o,17:s,19:c,20:l,21:[1,51],22:f,33:h},{24:52,40:v},{24:54,40:v},{12:56,27:55,33:h},{8:y,26:57,33:[2,18]},e(d,[2,11]),e(d,[2,12]),e(d,p),e(d,[2,13]),{12:58,33:h},{10:[2,23]},{10:[2,33]},{10:[2,15]},{12:59,33:h},{28:[1,60],33:[2,19]},{33:[2,17]},e(g,r,{5:61}),{10:[2,16]},{12:62,33:h},{6:m,7:5,8:i,9:7,10:u,11:a,12:16,13:10,14:11,15:o,17:s,18:[1,63],19:c,20:l,22:f,33:h},{33:[2,20]},e(d,[2,14])],defaultActions:{28:[2,27],29:[2,28],30:[2,29],31:[2,30],32:[2,31],33:[2,32],36:[2,21],37:[2,22],52:[2,23],53:[2,33],54:[2,15],57:[2,17],59:[2,16],62:[2,20]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=d.lex()||h,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],u=[],a=this.table,o="",s=0,c=0,l=0,f=2,h=1,p=u.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);d.setInput(t,g.yy),g.yy.lexer=d,g.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;u.push(m);var v=d.options&&d.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,x,w,A,_,E,k,D,C,M={};;){if(w=r[r.length-1],this.defaultActions[w]?A=this.defaultActions[w]:((null===b||"undefined"==typeof b)&&(b=e()),A=a[w]&&a[w][b]),"undefined"==typeof A||!A.length||!A[0]){var S="";C=[];for(E in a[w])this.terminals_[E]&&E>f&&C.push("'"+this.terminals_[E]+"'");S=d.showPosition?"Parse error on line "+(s+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(s+1)+": Unexpected "+(b==h?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:m,expected:C}) +}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+b);switch(A[0]){case 1:r.push(b),i.push(d.yytext),u.push(d.yylloc),r.push(A[1]),b=null,x?(b=x,x=null):(c=d.yyleng,o=d.yytext,s=d.yylineno,m=d.yylloc,l>0&&l--);break;case 2:if(k=this.productions_[A[1]][1],M.$=i[i.length-k],M._$={first_line:u[u.length-(k||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(k||1)].first_column,last_column:u[u.length-1].last_column},v&&(M._$.range=[u[u.length-(k||1)].range[0],u[u.length-1].range[1]]),_=this.performAction.apply(M,[o,c,s,g.yy,A[1],i,u].concat(p)),"undefined"!=typeof _)return _;k&&(r=r.slice(0,-1*k*2),i=i.slice(0,-1*k),u=u.slice(0,-1*k)),r.push(this.productions_[A[1]][0]),i.push(M.$),u.push(M._$),D=a[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0}},x=function(){var t={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];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(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),r&&(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 u in i)this[u]=i[u];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),u=0;ue[0].length)){if(e=n,r=u,this.options.backtrack_lexer){if(t=this.test_match(n,i[u]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===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(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>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),t>=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 10;case 1:return 38;case 2:return 39;case 3:return 36;case 4:return 37;case 5:break;case 6:break;case 7:break;case 8:return 11;case 9:return 19;case 10:return 17;case 11:return 20;case 12:return 21;case 13:return 18;case 14:return 29;case 15:return 30;case 16:return 25;case 17:return 22;case 18:return 15;case 19:return 4;case 20:return 28;case 21:return 10;case 22:return 33;case 23:return 34;case 24:return 35;case 25:return 36;case 26:return 37;case 27:return 40;case 28:return 6;case 29:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:[\-][x])/i,/^(?:[\-][\-][x])/i,/^(?:[\-][>][>])/i,/^(?:[\-][\-][>][>])/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:participant\b)/i,/^(?:opt\b)/i,/^(?:loop\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\->:\n,;]+)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],inclusive:!0}}};return t}();return b.lexer=x,t.prototype=b,b.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":80,fs:78,path:79}],91:[function(t,e,n){var r={},i=[],u=[],a=[];n.addActor=function(t,e,n){r[t]={name:e,description:n},i.push(t)},n.addMessage=function(t,e,n,r){u.push({from:t,to:e,message:n,answer:r})},n.addSignal=function(t,e,n,r){u.push({from:t,to:e,message:n,type:r})},n.getMessages=function(){return u},n.getActors=function(){return r},n.getActor=function(t){return r[t]},n.getActorKeys=function(){return Object.keys(r)},n.clear=function(){r={},u=[]},n.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16},n.ARROWTYPE={FILLED:0,OPEN:1},n.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},n.addNote=function(t,e,r){var i={actor:t,placement:e,message:r};a.push(i),u.push({from:t,to:t,message:r,type:n.LINETYPE.NOTE,placement:e})},n.parseError=function(t){console.log("Syntax error:"+t)},n.apply=function(t){if(t instanceof Array)t.forEach(function(t){n.apply(t)});else switch(t.type){case"addActor":n.addActor(t.actor,t.actor,t.actor);break;case"addNote":n.addNote(t.actor,t.placement,t.text);break;case"addMessage":n.addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":n.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":n.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":n.addSignal(void 0,void 0,void 0,t.signalType)}}},{}],92:[function(t,e,n){var r=t("./parser/sequenceDiagram").parser;r.yy=t("./sequenceDb");var i=t("./svgDraw"),u=t("./d3"),a={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35};n.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,list:[],init:function(){this.list=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,r){t[e]="undefined"==typeof t[e]?n:r(n,t[e])},updateLoops:function(t,e,r,i){var u=this,o=0;this.list.forEach(function(s){o++;var c=u.list.length-o+1;u.updateVal(s,"startx",t-c*a.boxMargin,Math.min),u.updateVal(s,"starty",e-c*a.boxMargin,Math.min),u.updateVal(s,"stopx",r+c*a.boxMargin,Math.max),u.updateVal(s,"stopy",i+c*a.boxMargin,Math.max),u.updateVal(n.bounds.data,"startx",t-c*a.boxMargin,Math.min),u.updateVal(n.bounds.data,"starty",e-c*a.boxMargin,Math.min),u.updateVal(n.bounds.data,"stopx",r+c*a.boxMargin,Math.max),u.updateVal(n.bounds.data,"stopy",i+c*a.boxMargin,Math.max)})},insert:function(t,e,r,i){var u,a,o,s;u=Math.min(t,r),o=Math.max(t,r),a=Math.min(e,i),s=Math.max(e,i),this.updateVal(n.bounds.data,"startx",u,Math.min),this.updateVal(n.bounds.data,"starty",a,Math.min),this.updateVal(n.bounds.data,"stopx",o,Math.max),this.updateVal(n.bounds.data,"stopy",s,Math.max),this.updateLoops(u,a,o,s)},newLoop:function(t){this.list.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t})},endLoop:function(){var t=this.list.pop();return t},addElseToLoop:function(t){var e=this.list.pop();e.elsey=n.bounds.getVerticalPos(),e.elseText=t,this.list.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var o=function(t,e,r,u){var o=i.getNoteRect();o.x=e,o.y=r,o.width=a.width,o.class="note";var s=t.append("g"),c=i.drawRect(s,o),l=i.getTextObj();l.x=e,l.y=r+a.noteMargin,l.textMargin=a.noteMargin,l.dy="1em",l.text=u.message,l.class="noteText";var f=i.drawText(s,l),h=f[0][0].getBBox().height;n.bounds.insert(e,r,e+a.width,r+2*a.noteMargin+h),c.attr("height",h+2*a.noteMargin),n.bounds.bumpVerticalPos(h+2*a.noteMargin)},s=function(t,e,i,u,a){var o,s=t.append("g"),c=e+(i-e)/2,l=s.append("text").attr("x",c).attr("y",u-7).style("text-anchor","middle").attr("class","messageText").text(a.message),f=l[0][0].getBBox().width;if(e===i){o=s.append("path").attr("d","M "+e+","+u+" C "+(e+60)+","+(u-10)+" "+(e+60)+","+(u+30)+" "+e+","+(u+20)),n.bounds.bumpVerticalPos(30);var h=Math.max(f/2,100);n.bounds.insert(e-h,n.bounds.getVerticalPos()-10,i+h,n.bounds.getVerticalPos())}else o=s.append("line"),o.attr("x1",e),o.attr("y1",u),o.attr("x2",i),o.attr("y2",u),n.bounds.insert(e,n.bounds.getVerticalPos()-10,i,n.bounds.getVerticalPos());a.type===r.yy.LINETYPE.DOTTED||a.type===r.yy.LINETYPE.DOTTED_CROSS||a.type===r.yy.LINETYPE.DOTTED_OPEN?(o.style("stroke-dasharray","3, 3"),o.attr("class","messageLine1")):o.attr("class","messageLine0"),o.attr("stroke-width",2),o.attr("stroke","black"),o.style("fill","none"),(a.type===r.yy.LINETYPE.SOLID||a.type===r.yy.LINETYPE.DOTTED)&&o.attr("marker-end","url(#arrowhead)"),(a.type===r.yy.LINETYPE.SOLID_CROSS||a.type===r.yy.LINETYPE.DOTTED_CROSS)&&o.attr("marker-end","url(#crosshead)")};e.exports.drawActors=function(t,e,r){var u;for(u=0;u/gi).forEach(function(t){var r=n.append("tspan");r.attr("x",e.x+e.textMargin),r.attr("dy",e.dy),r.text(t)}),"undefined"!=typeof e.class&&n.attr("class",e.class),n},n.drawLabel=function(t,e){var r=n.getNoteRect();r.x=e.x,r.y=e.y,r.width=50,r.height=20,r.fill="#526e52",r.stroke="none",r.class="labelBox",n.drawRect(t,r),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,e.fill="white",n.drawText(t,e)},n.drawActor=function(t,e,r,i){var u=e+i.width/2,a=t.append("g");a.append("line").attr("x1",u).attr("y1",5).attr("x2",u).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999");var o=n.getNoteRect();o.x=e,o.fill="#eaeaea",o.width=i.width,o.height=i.height,o.class="actor",o.rx=3,o.ry=3,n.drawRect(a,o),a.append("text").attr("x",u).attr("y",i.height/2+5).attr("class","actor").style("text-anchor","middle").text(r)},n.drawLoop=function(t,e,r,i){var u=t.append("g"),a=function(t,e,n,r){u.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};a(e.startx,e.starty,e.stopx,e.starty),a(e.stopx,e.starty,e.stopx,e.stopy),a(e.startx,e.stopy,e.stopx,e.stopy),a(e.startx,e.starty,e.startx,e.stopy),"undefined"!=typeof e.elsey&&a(e.startx,e.elsey,e.stopx,e.elsey);var o=n.getTextObj();o.text=r,o.x=e.startx,o.y=e.starty,o.labelMargin=1.5*i.boxMargin,o.class="labelText",o.fill="white",n.drawLabel(u,o),o=n.getTextObj(),o.text="[ "+e.title+" ]",o.x=e.startx+(e.stopx-e.startx)/2,o.y=e.starty+1.5*i.boxMargin,o.anchor="middle",o.class="loopText",n.drawText(u,o),"undefined"!=typeof e.elseText&&(o.text="[ "+e.elseText+" ]",o.y=e.elsey+1.5*i.boxMargin,n.drawText(u,o))},n.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},n.insertArrowCrossHead=function(t){var e=t.append("defs"),n=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},n.getTextObj=function(){var t={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return t},n.getNoteRect=function(){var t={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return t}},{}],94:[function(t,e,n){(function(e){var r=t("./diagrams/flowchart/graphDb"),i=t("./diagrams/flowchart/parser/flow"),u=t("./utils"),a=t("./diagrams/flowchart/flowRenderer"),o=t("./diagrams/sequenceDiagram/sequenceRenderer"),s=t("he"),c=function(t){var e,n=document.querySelectorAll(".mermaid");"undefined"!==t&&o.setConf(JSON.parse(t));var i=0;for(e=0;e/g,">"),f=f.replace(/';var h=u.detectType(f),p={};switch(h){case"graph":p=a.getClasses(f,!1),a.draw(f,l,!1),u.cloneCssStyles(c.firstChild,p),r.bindFunctions();break;case"dotGraph":p=a.getClasses(f,!0),a.draw(f,l,!0),u.cloneCssStyles(c.firstChild,p);break;case"sequenceDiagram":o.draw(f,l),u.cloneCssStyles(c.firstChild,[])}}}};n.tester=function(){},n.version=function(){return t("../package.json").version};var l=function(t,e){return"undefined"==typeof e?!1:t===e};e.mermaid={startOnLoad:!0,htmlLabels:!0,init:function(t){c(t)},version:function(){return n.version()},getParser:function(){return i.parser}},n.contentLoaded=function(){"undefined"!=typeof mermaid_config&&l(!1,mermaid_config.htmlLabels)&&(e.mermaid.htmlLabels=!1),e.mermaid.startOnLoad&&("undefined"!=typeof mermaid_config?l(!0,mermaid_config.startOnLoad)&&e.mermaid.init():e.mermaid.init())},"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",function(){n.contentLoaded()},!1)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../package.json":83,"./diagrams/flowchart/flowRenderer":85,"./diagrams/flowchart/graphDb":86,"./diagrams/flowchart/parser/flow":88,"./diagrams/sequenceDiagram/sequenceRenderer":92,"./utils":95,he:81}],95:[function(t,e){e.exports.detectType=function(t){return t.match(/^\s*sequenceDiagram/)?"sequenceDiagram":t.match(/^\s*sequence/)?"sequence":t.match(/^\s*digraph/)?(console.log("Detected flow syntax"),"dotGraph"):"graph"},e.exports.cloneCssStyles=function(t,e){for(var n="",r=document.styleSheets,i=0;i0&&(n+=o.selectorText+" { "+o.style.cssText+" }\n")}}}var c="",l="";for(var f in e)e.hasOwnProperty(f)&&"undefined"!=typeof f&&("default"===f?(e.default.styles instanceof Array&&(c+="#"+t.id.trim()+" .node { "+e[f].styles.join("; ")+"; }\n"),e.default.nodeLabelStyles instanceof Array&&(c+="#"+t.id.trim()+" .node text { "+e[f].nodeLabelStyles.join("; ")+"; }\n"),e.default.edgeLabelStyles instanceof Array&&(c+="#"+t.id.trim()+" .edgeLabel text { "+e[f].edgeLabelStyles.join("; ")+"; }\n")):e[f].styles instanceof Array&&(l+="#"+t.id.trim()+" ."+f+" { "+e[f].styles.join("; ")+"; }\n"));if(""!==n||""!==c||""!==l){var h=document.createElement("style");h.setAttribute("type","text/css"),h.setAttribute("title","mermaid-svg-internal-css"),h.innerHTML="/* */\n",t.insertBefore(h,t.firstChild)}}},{}]},{},[94]); \ No newline at end of file diff --git a/dist/mermaid.slim.js b/dist/mermaid.slim.js index 50cdf74f2..c990bb401 100644 --- a/dist/mermaid.slim.js +++ b/dist/mermaid.slim.js @@ -1,4 +1,9220 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o b ? 1 : a >= b ? 0 : NaN; + } + d3.descending = function(a, b) { + return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; + }; + d3.min = function(array, f) { + var i = -1, n = array.length, a, b; + if (arguments.length === 1) { + while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined; + while (++i < n) if ((b = array[i]) != null && a > b) a = b; + } else { + while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined; + while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b; + } + return a; + }; + d3.max = function(array, f) { + var i = -1, n = array.length, a, b; + if (arguments.length === 1) { + while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined; + while (++i < n) if ((b = array[i]) != null && b > a) a = b; + } else { + while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined; + while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b; + } + return a; + }; + d3.extent = function(array, f) { + var i = -1, n = array.length, a, b, c; + if (arguments.length === 1) { + while (++i < n && !((a = c = array[i]) != null && a <= a)) a = c = undefined; + while (++i < n) if ((b = array[i]) != null) { + if (a > b) a = b; + if (c < b) c = b; + } + } else { + while (++i < n && !((a = c = f.call(array, array[i], i)) != null && a <= a)) a = undefined; + while (++i < n) if ((b = f.call(array, array[i], i)) != null) { + if (a > b) a = b; + if (c < b) c = b; + } + } + return [ a, c ]; + }; + function d3_number(x) { + return x === null ? NaN : +x; + } + function d3_numeric(x) { + return !isNaN(x); + } + d3.sum = function(array, f) { + var s = 0, n = array.length, a, i = -1; + if (arguments.length === 1) { + while (++i < n) if (d3_numeric(a = +array[i])) s += a; + } else { + while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a; + } + return s; + }; + d3.mean = function(array, f) { + var s = 0, n = array.length, a, i = -1, j = n; + if (arguments.length === 1) { + while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j; + } else { + while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j; + } + return j ? s / j : undefined; + }; + d3.quantile = function(values, p) { + var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h; + return e ? v + e * (values[h] - v) : v; + }; + d3.median = function(array, f) { + var numbers = [], n = array.length, a, i = -1; + if (arguments.length === 1) { + while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a); + } else { + while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a); + } + return numbers.length ? d3.quantile(numbers.sort(d3_ascending), .5) : undefined; + }; + function d3_bisector(compare) { + return { + left: function(a, x, lo, hi) { + if (arguments.length < 3) lo = 0; + if (arguments.length < 4) hi = a.length; + while (lo < hi) { + var mid = lo + hi >>> 1; + if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid; + } + return lo; + }, + right: function(a, x, lo, hi) { + if (arguments.length < 3) lo = 0; + if (arguments.length < 4) hi = a.length; + while (lo < hi) { + var mid = lo + hi >>> 1; + if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1; + } + return lo; + } + }; + } + var d3_bisect = d3_bisector(d3_ascending); + d3.bisectLeft = d3_bisect.left; + d3.bisect = d3.bisectRight = d3_bisect.right; + d3.bisector = function(f) { + return d3_bisector(f.length === 1 ? function(d, x) { + return d3_ascending(f(d), x); + } : f); + }; + d3.shuffle = function(array) { + var m = array.length, t, i; + while (m) { + i = Math.random() * m-- | 0; + t = array[m], array[m] = array[i], array[i] = t; + } + return array; + }; + d3.permute = function(array, indexes) { + var i = indexes.length, permutes = new Array(i); + while (i--) permutes[i] = array[indexes[i]]; + return permutes; + }; + d3.pairs = function(array) { + var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n); + while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ]; + return pairs; + }; + d3.zip = function() { + if (!(n = arguments.length)) return []; + for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) { + for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) { + zip[j] = arguments[j][i]; + } + } + return zips; + }; + function d3_zipLength(d) { + return d.length; + } + d3.transpose = function(matrix) { + return d3.zip.apply(d3, matrix); + }; + d3.keys = function(map) { + var keys = []; + for (var key in map) keys.push(key); + return keys; + }; + d3.values = function(map) { + var values = []; + for (var key in map) values.push(map[key]); + return values; + }; + d3.entries = function(map) { + var entries = []; + for (var key in map) entries.push({ + key: key, + value: map[key] + }); + return entries; + }; + d3.merge = function(arrays) { + var n = arrays.length, m, i = -1, j = 0, merged, array; + while (++i < n) j += arrays[i].length; + merged = new Array(j); + while (--n >= 0) { + array = arrays[n]; + m = array.length; + while (--m >= 0) { + merged[--j] = array[m]; + } + } + return merged; + }; + var abs = Math.abs; + d3.range = function(start, stop, step) { + if (arguments.length < 3) { + step = 1; + if (arguments.length < 2) { + stop = start; + start = 0; + } + } + if ((stop - start) / step === Infinity) throw new Error("infinite range"); + var range = [], k = d3_range_integerScale(abs(step)), i = -1, j; + start *= k, stop *= k, step *= k; + if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k); + return range; + }; + function d3_range_integerScale(x) { + var k = 1; + while (x * k % 1) k *= 10; + return k; + } + function d3_class(ctor, properties) { + for (var key in properties) { + Object.defineProperty(ctor.prototype, key, { + value: properties[key], + enumerable: false + }); + } + } + d3.map = function(object) { + var map = new d3_Map(); + if (object instanceof d3_Map) object.forEach(function(key, value) { + map.set(key, value); + }); else for (var key in object) map.set(key, object[key]); + return map; + }; + function d3_Map() { + this._ = Object.create(null); + } + var d3_map_proto = "__proto__", d3_map_zero = "\x00"; + d3_class(d3_Map, { + has: d3_map_has, + get: function(key) { + return this._[d3_map_escape(key)]; + }, + set: function(key, value) { + return this._[d3_map_escape(key)] = value; + }, + remove: d3_map_remove, + keys: d3_map_keys, + values: function() { + var values = []; + for (var key in this._) values.push(this._[key]); + return values; + }, + entries: function() { + var entries = []; + for (var key in this._) entries.push({ + key: d3_map_unescape(key), + value: this._[key] + }); + return entries; + }, + size: d3_map_size, + empty: d3_map_empty, + forEach: function(f) { + for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]); + } + }); + function d3_map_escape(key) { + return (key += "") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key; + } + function d3_map_unescape(key) { + return (key += "")[0] === d3_map_zero ? key.slice(1) : key; + } + function d3_map_has(key) { + return d3_map_escape(key) in this._; + } + function d3_map_remove(key) { + return (key = d3_map_escape(key)) in this._ && delete this._[key]; + } + function d3_map_keys() { + var keys = []; + for (var key in this._) keys.push(d3_map_unescape(key)); + return keys; + } + function d3_map_size() { + var size = 0; + for (var key in this._) ++size; + return size; + } + function d3_map_empty() { + for (var key in this._) return false; + return true; + } + d3.nest = function() { + var nest = {}, keys = [], sortKeys = [], sortValues, rollup; + function map(mapType, array, depth) { + if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array; + var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values; + while (++i < n) { + if (values = valuesByKey.get(keyValue = key(object = array[i]))) { + values.push(object); + } else { + valuesByKey.set(keyValue, [ object ]); + } + } + if (mapType) { + object = mapType(); + setter = function(keyValue, values) { + object.set(keyValue, map(mapType, values, depth)); + }; + } else { + object = {}; + setter = function(keyValue, values) { + object[keyValue] = map(mapType, values, depth); + }; + } + valuesByKey.forEach(setter); + return object; + } + function entries(map, depth) { + if (depth >= keys.length) return map; + var array = [], sortKey = sortKeys[depth++]; + map.forEach(function(key, keyMap) { + array.push({ + key: key, + values: entries(keyMap, depth) + }); + }); + return sortKey ? array.sort(function(a, b) { + return sortKey(a.key, b.key); + }) : array; + } + nest.map = function(array, mapType) { + return map(mapType, array, 0); + }; + nest.entries = function(array) { + return entries(map(d3.map, array, 0), 0); + }; + nest.key = function(d) { + keys.push(d); + return nest; + }; + nest.sortKeys = function(order) { + sortKeys[keys.length - 1] = order; + return nest; + }; + nest.sortValues = function(order) { + sortValues = order; + return nest; + }; + nest.rollup = function(f) { + rollup = f; + return nest; + }; + return nest; + }; + d3.set = function(array) { + var set = new d3_Set(); + if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]); + return set; + }; + function d3_Set() { + this._ = Object.create(null); + } + d3_class(d3_Set, { + has: d3_map_has, + add: function(key) { + this._[d3_map_escape(key += "")] = true; + return key; + }, + remove: d3_map_remove, + values: d3_map_keys, + size: d3_map_size, + empty: d3_map_empty, + forEach: function(f) { + for (var key in this._) f.call(this, d3_map_unescape(key)); + } + }); + d3.behavior = {}; + d3.rebind = function(target, source) { + var i = 1, n = arguments.length, method; + while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]); + return target; + }; + function d3_rebind(target, source, method) { + return function() { + var value = method.apply(source, arguments); + return value === source ? target : value; + }; + } + function d3_vendorSymbol(object, name) { + if (name in object) return name; + name = name.charAt(0).toUpperCase() + name.slice(1); + for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) { + var prefixName = d3_vendorPrefixes[i] + name; + if (prefixName in object) return prefixName; + } + } + var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ]; + function d3_noop() {} + d3.dispatch = function() { + var dispatch = new d3_dispatch(), i = -1, n = arguments.length; + while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); + return dispatch; + }; + function d3_dispatch() {} + d3_dispatch.prototype.on = function(type, listener) { + var i = type.indexOf("."), name = ""; + if (i >= 0) { + name = type.slice(i + 1); + type = type.slice(0, i); + } + if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener); + if (arguments.length === 2) { + if (listener == null) for (type in this) { + if (this.hasOwnProperty(type)) this[type].on(name, null); + } + return this; + } + }; + function d3_dispatch_event(dispatch) { + var listeners = [], listenerByName = new d3_Map(); + function event() { + var z = listeners, i = -1, n = z.length, l; + while (++i < n) if (l = z[i].on) l.apply(this, arguments); + return dispatch; + } + event.on = function(name, listener) { + var l = listenerByName.get(name), i; + if (arguments.length < 2) return l && l.on; + if (l) { + l.on = null; + listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1)); + listenerByName.remove(name); + } + if (listener) listeners.push(listenerByName.set(name, { + on: listener + })); + return dispatch; + }; + return event; + } + d3.event = null; + function d3_eventPreventDefault() { + d3.event.preventDefault(); + } + function d3_eventSource() { + var e = d3.event, s; + while (s = e.sourceEvent) e = s; + return e; + } + function d3_eventDispatch(target) { + var dispatch = new d3_dispatch(), i = 0, n = arguments.length; + while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); + dispatch.of = function(thiz, argumentz) { + return function(e1) { + try { + var e0 = e1.sourceEvent = d3.event; + e1.target = target; + d3.event = e1; + dispatch[e1.type].apply(thiz, argumentz); + } finally { + d3.event = e0; + } + }; + }; + return dispatch; + } + d3.requote = function(s) { + return s.replace(d3_requote_re, "\\$&"); + }; + var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; + var d3_subclass = {}.__proto__ ? function(object, prototype) { + object.__proto__ = prototype; + } : function(object, prototype) { + for (var property in prototype) object[property] = prototype[property]; + }; + function d3_selection(groups) { + d3_subclass(groups, d3_selectionPrototype); + return groups; + } + var d3_select = function(s, n) { + return n.querySelector(s); + }, d3_selectAll = function(s, n) { + return n.querySelectorAll(s); + }, d3_selectMatcher = d3_documentElement.matches || d3_documentElement[d3_vendorSymbol(d3_documentElement, "matchesSelector")], d3_selectMatches = function(n, s) { + return d3_selectMatcher.call(n, s); + }; + if (typeof Sizzle === "function") { + d3_select = function(s, n) { + return Sizzle(s, n)[0] || null; + }; + d3_selectAll = Sizzle; + d3_selectMatches = Sizzle.matchesSelector; + } + d3.selection = function() { + return d3_selectionRoot; + }; + var d3_selectionPrototype = d3.selection.prototype = []; + d3_selectionPrototype.select = function(selector) { + var subgroups = [], subgroup, subnode, group, node; + selector = d3_selection_selector(selector); + for (var j = -1, m = this.length; ++j < m; ) { + subgroups.push(subgroup = []); + subgroup.parentNode = (group = this[j]).parentNode; + for (var i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + subgroup.push(subnode = selector.call(node, node.__data__, i, j)); + if (subnode && "__data__" in node) subnode.__data__ = node.__data__; + } else { + subgroup.push(null); + } + } + } + return d3_selection(subgroups); + }; + function d3_selection_selector(selector) { + return typeof selector === "function" ? selector : function() { + return d3_select(selector, this); + }; + } + d3_selectionPrototype.selectAll = function(selector) { + var subgroups = [], subgroup, node; + selector = d3_selection_selectorAll(selector); + for (var j = -1, m = this.length; ++j < m; ) { + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j))); + subgroup.parentNode = node; + } + } + } + return d3_selection(subgroups); + }; + function d3_selection_selectorAll(selector) { + return typeof selector === "function" ? selector : function() { + return d3_selectAll(selector, this); + }; + } + var d3_nsPrefix = { + svg: "http://www.w3.org/2000/svg", + xhtml: "http://www.w3.org/1999/xhtml", + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" + }; + d3.ns = { + prefix: d3_nsPrefix, + qualify: function(name) { + var i = name.indexOf(":"), prefix = name; + if (i >= 0) { + prefix = name.slice(0, i); + name = name.slice(i + 1); + } + return d3_nsPrefix.hasOwnProperty(prefix) ? { + space: d3_nsPrefix[prefix], + local: name + } : name; + } + }; + d3_selectionPrototype.attr = function(name, value) { + if (arguments.length < 2) { + if (typeof name === "string") { + var node = this.node(); + name = d3.ns.qualify(name); + return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name); + } + for (value in name) this.each(d3_selection_attr(value, name[value])); + return this; + } + return this.each(d3_selection_attr(name, value)); + }; + function d3_selection_attr(name, value) { + name = d3.ns.qualify(name); + function attrNull() { + this.removeAttribute(name); + } + function attrNullNS() { + this.removeAttributeNS(name.space, name.local); + } + function attrConstant() { + this.setAttribute(name, value); + } + function attrConstantNS() { + this.setAttributeNS(name.space, name.local, value); + } + function attrFunction() { + var x = value.apply(this, arguments); + if (x == null) this.removeAttribute(name); else this.setAttribute(name, x); + } + function attrFunctionNS() { + var x = value.apply(this, arguments); + if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x); + } + return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant; + } + function d3_collapse(s) { + return s.trim().replace(/\s+/g, " "); + } + d3_selectionPrototype.classed = function(name, value) { + if (arguments.length < 2) { + if (typeof name === "string") { + var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1; + if (value = node.classList) { + while (++i < n) if (!value.contains(name[i])) return false; + } else { + value = node.getAttribute("class"); + while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false; + } + return true; + } + for (value in name) this.each(d3_selection_classed(value, name[value])); + return this; + } + return this.each(d3_selection_classed(name, value)); + }; + function d3_selection_classedRe(name) { + return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g"); + } + function d3_selection_classes(name) { + return (name + "").trim().split(/^|\s+/); + } + function d3_selection_classed(name, value) { + name = d3_selection_classes(name).map(d3_selection_classedName); + var n = name.length; + function classedConstant() { + var i = -1; + while (++i < n) name[i](this, value); + } + function classedFunction() { + var i = -1, x = value.apply(this, arguments); + while (++i < n) name[i](this, x); + } + return typeof value === "function" ? classedFunction : classedConstant; + } + function d3_selection_classedName(name) { + var re = d3_selection_classedRe(name); + return function(node, value) { + if (c = node.classList) return value ? c.add(name) : c.remove(name); + var c = node.getAttribute("class") || ""; + if (value) { + re.lastIndex = 0; + if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name)); + } else { + node.setAttribute("class", d3_collapse(c.replace(re, " "))); + } + }; + } + d3_selectionPrototype.style = function(name, value, priority) { + var n = arguments.length; + if (n < 3) { + if (typeof name !== "string") { + if (n < 2) value = ""; + for (priority in name) this.each(d3_selection_style(priority, name[priority], value)); + return this; + } + if (n < 2) return d3_window.getComputedStyle(this.node(), null).getPropertyValue(name); + priority = ""; + } + return this.each(d3_selection_style(name, value, priority)); + }; + function d3_selection_style(name, value, priority) { + function styleNull() { + this.style.removeProperty(name); + } + function styleConstant() { + this.style.setProperty(name, value, priority); + } + function styleFunction() { + var x = value.apply(this, arguments); + if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority); + } + return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant; + } + d3_selectionPrototype.property = function(name, value) { + if (arguments.length < 2) { + if (typeof name === "string") return this.node()[name]; + for (value in name) this.each(d3_selection_property(value, name[value])); + return this; + } + return this.each(d3_selection_property(name, value)); + }; + function d3_selection_property(name, value) { + function propertyNull() { + delete this[name]; + } + function propertyConstant() { + this[name] = value; + } + function propertyFunction() { + var x = value.apply(this, arguments); + if (x == null) delete this[name]; else this[name] = x; + } + return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant; + } + d3_selectionPrototype.text = function(value) { + return arguments.length ? this.each(typeof value === "function" ? function() { + var v = value.apply(this, arguments); + this.textContent = v == null ? "" : v; + } : value == null ? function() { + this.textContent = ""; + } : function() { + this.textContent = value; + }) : this.node().textContent; + }; + d3_selectionPrototype.html = function(value) { + return arguments.length ? this.each(typeof value === "function" ? function() { + var v = value.apply(this, arguments); + this.innerHTML = v == null ? "" : v; + } : value == null ? function() { + this.innerHTML = ""; + } : function() { + this.innerHTML = value; + }) : this.node().innerHTML; + }; + d3_selectionPrototype.append = function(name) { + name = d3_selection_creator(name); + return this.select(function() { + return this.appendChild(name.apply(this, arguments)); + }); + }; + function d3_selection_creator(name) { + return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? function() { + return this.ownerDocument.createElementNS(name.space, name.local); + } : function() { + return this.ownerDocument.createElementNS(this.namespaceURI, name); + }; + } + d3_selectionPrototype.insert = function(name, before) { + name = d3_selection_creator(name); + before = d3_selection_selector(before); + return this.select(function() { + return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null); + }); + }; + d3_selectionPrototype.remove = function() { + return this.each(function() { + var parent = this.parentNode; + if (parent) parent.removeChild(this); + }); + }; + d3_selectionPrototype.data = function(value, key) { + var i = -1, n = this.length, group, node; + if (!arguments.length) { + value = new Array(n = (group = this[0]).length); + while (++i < n) { + if (node = group[i]) { + value[i] = node.__data__; + } + } + return value; + } + function bind(group, groupData) { + var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData; + if (key) { + var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue; + for (i = -1; ++i < n; ) { + if (nodeByKeyValue.has(keyValue = key.call(node = group[i], node.__data__, i))) { + exitNodes[i] = node; + } else { + nodeByKeyValue.set(keyValue, node); + } + keyValues[i] = keyValue; + } + for (i = -1; ++i < m; ) { + if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) { + enterNodes[i] = d3_selection_dataNode(nodeData); + } else if (node !== true) { + updateNodes[i] = node; + node.__data__ = nodeData; + } + nodeByKeyValue.set(keyValue, true); + } + for (i = -1; ++i < n; ) { + if (nodeByKeyValue.get(keyValues[i]) !== true) { + exitNodes[i] = group[i]; + } + } + } else { + for (i = -1; ++i < n0; ) { + node = group[i]; + nodeData = groupData[i]; + if (node) { + node.__data__ = nodeData; + updateNodes[i] = node; + } else { + enterNodes[i] = d3_selection_dataNode(nodeData); + } + } + for (;i < m; ++i) { + enterNodes[i] = d3_selection_dataNode(groupData[i]); + } + for (;i < n; ++i) { + exitNodes[i] = group[i]; + } + } + enterNodes.update = updateNodes; + enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode; + enter.push(enterNodes); + update.push(updateNodes); + exit.push(exitNodes); + } + var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]); + if (typeof value === "function") { + while (++i < n) { + bind(group = this[i], value.call(group, group.parentNode.__data__, i)); + } + } else { + while (++i < n) { + bind(group = this[i], value); + } + } + update.enter = function() { + return enter; + }; + update.exit = function() { + return exit; + }; + return update; + }; + function d3_selection_dataNode(data) { + return { + __data__: data + }; + } + d3_selectionPrototype.datum = function(value) { + return arguments.length ? this.property("__data__", value) : this.property("__data__"); + }; + d3_selectionPrototype.filter = function(filter) { + var subgroups = [], subgroup, group, node; + if (typeof filter !== "function") filter = d3_selection_filter(filter); + for (var j = 0, m = this.length; j < m; j++) { + subgroups.push(subgroup = []); + subgroup.parentNode = (group = this[j]).parentNode; + for (var i = 0, n = group.length; i < n; i++) { + if ((node = group[i]) && filter.call(node, node.__data__, i, j)) { + subgroup.push(node); + } + } + } + return d3_selection(subgroups); + }; + function d3_selection_filter(selector) { + return function() { + return d3_selectMatches(this, selector); + }; + } + d3_selectionPrototype.order = function() { + for (var j = -1, m = this.length; ++j < m; ) { + for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) { + if (node = group[i]) { + if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next); + next = node; + } + } + } + return this; + }; + d3_selectionPrototype.sort = function(comparator) { + comparator = d3_selection_sortComparator.apply(this, arguments); + for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator); + return this.order(); + }; + function d3_selection_sortComparator(comparator) { + if (!arguments.length) comparator = d3_ascending; + return function(a, b) { + return a && b ? comparator(a.__data__, b.__data__) : !a - !b; + }; + } + d3_selectionPrototype.each = function(callback) { + return d3_selection_each(this, function(node, i, j) { + callback.call(node, node.__data__, i, j); + }); + }; + function d3_selection_each(groups, callback) { + for (var j = 0, m = groups.length; j < m; j++) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) { + if (node = group[i]) callback(node, i, j); + } + } + return groups; + } + d3_selectionPrototype.call = function(callback) { + var args = d3_array(arguments); + callback.apply(args[0] = this, args); + return this; + }; + d3_selectionPrototype.empty = function() { + return !this.node(); + }; + d3_selectionPrototype.node = function() { + for (var j = 0, m = this.length; j < m; j++) { + for (var group = this[j], i = 0, n = group.length; i < n; i++) { + var node = group[i]; + if (node) return node; + } + } + return null; + }; + d3_selectionPrototype.size = function() { + var n = 0; + d3_selection_each(this, function() { + ++n; + }); + return n; + }; + function d3_selection_enter(selection) { + d3_subclass(selection, d3_selection_enterPrototype); + return selection; + } + var d3_selection_enterPrototype = []; + d3.selection.enter = d3_selection_enter; + d3.selection.enter.prototype = d3_selection_enterPrototype; + d3_selection_enterPrototype.append = d3_selectionPrototype.append; + d3_selection_enterPrototype.empty = d3_selectionPrototype.empty; + d3_selection_enterPrototype.node = d3_selectionPrototype.node; + d3_selection_enterPrototype.call = d3_selectionPrototype.call; + d3_selection_enterPrototype.size = d3_selectionPrototype.size; + d3_selection_enterPrototype.select = function(selector) { + var subgroups = [], subgroup, subnode, upgroup, group, node; + for (var j = -1, m = this.length; ++j < m; ) { + upgroup = (group = this[j]).update; + subgroups.push(subgroup = []); + subgroup.parentNode = group.parentNode; + for (var i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j)); + subnode.__data__ = node.__data__; + } else { + subgroup.push(null); + } + } + } + return d3_selection(subgroups); + }; + d3_selection_enterPrototype.insert = function(name, before) { + if (arguments.length < 2) before = d3_selection_enterInsertBefore(this); + return d3_selectionPrototype.insert.call(this, name, before); + }; + function d3_selection_enterInsertBefore(enter) { + var i0, j0; + return function(d, i, j) { + var group = enter[j].update, n = group.length, node; + if (j != j0) j0 = j, i0 = 0; + if (i >= i0) i0 = i + 1; + while (!(node = group[i0]) && ++i0 < n) ; + return node; + }; + } + d3_selectionPrototype.transition = function() { + var id = d3_transitionInheritId || ++d3_transitionId, subgroups = [], subgroup, node, transition = d3_transitionInherit || { + time: Date.now(), + ease: d3_ease_cubicInOut, + delay: 0, + duration: 250 + }; + for (var j = -1, m = this.length; ++j < m; ) { + subgroups.push(subgroup = []); + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) d3_transitionNode(node, i, id, transition); + subgroup.push(node); + } + } + return d3_transition(subgroups, id); + }; + d3_selectionPrototype.interrupt = function() { + return this.each(d3_selection_interrupt); + }; + function d3_selection_interrupt() { + var lock = this.__transition__; + if (lock) ++lock.active; + } + d3.select = function(node) { + var group = [ typeof node === "string" ? d3_select(node, d3_document) : node ]; + group.parentNode = d3_documentElement; + return d3_selection([ group ]); + }; + d3.selectAll = function(nodes) { + var group = d3_array(typeof nodes === "string" ? d3_selectAll(nodes, d3_document) : nodes); + group.parentNode = d3_documentElement; + return d3_selection([ group ]); + }; + var d3_selectionRoot = d3.select(d3_documentElement); + d3_selectionPrototype.on = function(type, listener, capture) { + var n = arguments.length; + if (n < 3) { + if (typeof type !== "string") { + if (n < 2) listener = false; + for (capture in type) this.each(d3_selection_on(capture, type[capture], listener)); + return this; + } + if (n < 2) return (n = this.node()["__on" + type]) && n._; + capture = false; + } + return this.each(d3_selection_on(type, listener, capture)); + }; + function d3_selection_on(type, listener, capture) { + var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener; + if (i > 0) type = type.slice(0, i); + var filter = d3_selection_onFilters.get(type); + if (filter) type = filter, wrap = d3_selection_onFilter; + function onRemove() { + var l = this[name]; + if (l) { + this.removeEventListener(type, l, l.$); + delete this[name]; + } + } + function onAdd() { + var l = wrap(listener, d3_array(arguments)); + onRemove.call(this); + this.addEventListener(type, this[name] = l, l.$ = capture); + l._ = listener; + } + function removeAll() { + var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match; + for (var name in this) { + if (match = name.match(re)) { + var l = this[name]; + this.removeEventListener(match[1], l, l.$); + delete this[name]; + } + } + } + return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll; + } + var d3_selection_onFilters = d3.map({ + mouseenter: "mouseover", + mouseleave: "mouseout" + }); + d3_selection_onFilters.forEach(function(k) { + if ("on" + k in d3_document) d3_selection_onFilters.remove(k); + }); + function d3_selection_onListener(listener, argumentz) { + return function(e) { + var o = d3.event; + d3.event = e; + argumentz[0] = this.__data__; + try { + listener.apply(this, argumentz); + } finally { + d3.event = o; + } + }; + } + function d3_selection_onFilter(listener, argumentz) { + var l = d3_selection_onListener(listener, argumentz); + return function(e) { + var target = this, related = e.relatedTarget; + if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) { + l.call(target, e); + } + }; + } + var d3_event_dragSelect = "onselectstart" in d3_document ? null : d3_vendorSymbol(d3_documentElement.style, "userSelect"), d3_event_dragId = 0; + function d3_event_dragSuppress() { + var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault); + if (d3_event_dragSelect) { + var style = d3_documentElement.style, select = style[d3_event_dragSelect]; + style[d3_event_dragSelect] = "none"; + } + return function(suppressClick) { + w.on(name, null); + if (d3_event_dragSelect) style[d3_event_dragSelect] = select; + if (suppressClick) { + function off() { + w.on(click, null); + } + w.on(click, function() { + d3_eventPreventDefault(); + off(); + }, true); + setTimeout(off, 0); + } + }; + } + d3.mouse = function(container) { + return d3_mousePoint(container, d3_eventSource()); + }; + var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0; + function d3_mousePoint(container, e) { + if (e.changedTouches) e = e.changedTouches[0]; + var svg = container.ownerSVGElement || container; + if (svg.createSVGPoint) { + var point = svg.createSVGPoint(); + if (d3_mouse_bug44083 < 0 && (d3_window.scrollX || d3_window.scrollY)) { + svg = d3.select("body").append("svg").style({ + position: "absolute", + top: 0, + left: 0, + margin: 0, + padding: 0, + border: "none" + }, "important"); + var ctm = svg[0][0].getScreenCTM(); + d3_mouse_bug44083 = !(ctm.f || ctm.e); + svg.remove(); + } + if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX, + point.y = e.clientY; + point = point.matrixTransform(container.getScreenCTM().inverse()); + return [ point.x, point.y ]; + } + var rect = container.getBoundingClientRect(); + return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ]; + } + d3.touch = function(container, touches, identifier) { + if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches; + if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) { + if ((touch = touches[i]).identifier === identifier) { + return d3_mousePoint(container, touch); + } + } + }; + d3.behavior.drag = function() { + var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_behavior_dragMouseSubject, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_behavior_dragTouchSubject, "touchmove", "touchend"); + function drag() { + this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart); + } + function dragstart(id, position, subject, move, end) { + return function() { + var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject()).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(), position0 = position(parent, dragId); + if (origin) { + dragOffset = origin.apply(that, arguments); + dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ]; + } else { + dragOffset = [ 0, 0 ]; + } + dispatch({ + type: "dragstart" + }); + function moved() { + var position1 = position(parent, dragId), dx, dy; + if (!position1) return; + dx = position1[0] - position0[0]; + dy = position1[1] - position0[1]; + dragged |= dx | dy; + position0 = position1; + dispatch({ + type: "drag", + x: position1[0] + dragOffset[0], + y: position1[1] + dragOffset[1], + dx: dx, + dy: dy + }); + } + function ended() { + if (!position(parent, dragId)) return; + dragSubject.on(move + dragName, null).on(end + dragName, null); + dragRestore(dragged && d3.event.target === target); + dispatch({ + type: "dragend" + }); + } + }; + } + drag.origin = function(x) { + if (!arguments.length) return origin; + origin = x; + return drag; + }; + return d3.rebind(drag, event, "on"); + }; + function d3_behavior_dragTouchId() { + return d3.event.changedTouches[0].identifier; + } + function d3_behavior_dragTouchSubject() { + return d3.event.target; + } + function d3_behavior_dragMouseSubject() { + return d3_window; + } + d3.touches = function(container, touches) { + if (arguments.length < 2) touches = d3_eventSource().touches; + return touches ? d3_array(touches).map(function(touch) { + var point = d3_mousePoint(container, touch); + point.identifier = touch.identifier; + return point; + }) : []; + }; + var π = Math.PI, τ = 2 * π, halfπ = π / 2, ε = 1e-6, ε2 = ε * ε, d3_radians = π / 180, d3_degrees = 180 / π; + function d3_sgn(x) { + return x > 0 ? 1 : x < 0 ? -1 : 0; + } + function d3_cross2d(a, b, c) { + return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]); + } + function d3_acos(x) { + return x > 1 ? 0 : x < -1 ? π : Math.acos(x); + } + function d3_asin(x) { + return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x); + } + function d3_sinh(x) { + return ((x = Math.exp(x)) - 1 / x) / 2; + } + function d3_cosh(x) { + return ((x = Math.exp(x)) + 1 / x) / 2; + } + function d3_tanh(x) { + return ((x = Math.exp(2 * x)) - 1) / (x + 1); + } + function d3_haversin(x) { + return (x = Math.sin(x / 2)) * x; + } + var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4; + d3.interpolateZoom = function(p0, p1) { + var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2]; + var dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1), dr = r1 - r0, S = (dr || Math.log(w1 / w0)) / ρ; + function interpolate(t) { + var s = t * S; + if (dr) { + var coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0)); + return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ]; + } + return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * s) ]; + } + interpolate.duration = S * 1e3; + return interpolate; + }; + d3.behavior.zoom = function() { + var view = { + x: 0, + y: 0, + k: 1 + }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1; + function zoom(g) { + g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted); + } + zoom.event = function(g) { + g.each(function() { + var dispatch = event.of(this, arguments), view1 = view; + if (d3_transitionInheritId) { + d3.select(this).transition().each("start.zoom", function() { + view = this.__chart__ || { + x: 0, + y: 0, + k: 1 + }; + zoomstarted(dispatch); + }).tween("zoom:zoom", function() { + var dx = size[0], dy = size[1], cx = dx / 2, cy = dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]); + return function(t) { + var l = i(t), k = dx / l[2]; + this.__chart__ = view = { + x: cx - l[0] * k, + y: cy - l[1] * k, + k: k + }; + zoomed(dispatch); + }; + }).each("end.zoom", function() { + zoomended(dispatch); + }); + } else { + this.__chart__ = view; + zoomstarted(dispatch); + zoomed(dispatch); + zoomended(dispatch); + } + }); + }; + zoom.translate = function(_) { + if (!arguments.length) return [ view.x, view.y ]; + view = { + x: +_[0], + y: +_[1], + k: view.k + }; + rescale(); + return zoom; + }; + zoom.scale = function(_) { + if (!arguments.length) return view.k; + view = { + x: view.x, + y: view.y, + k: +_ + }; + rescale(); + return zoom; + }; + zoom.scaleExtent = function(_) { + if (!arguments.length) return scaleExtent; + scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ]; + return zoom; + }; + zoom.center = function(_) { + if (!arguments.length) return center; + center = _ && [ +_[0], +_[1] ]; + return zoom; + }; + zoom.size = function(_) { + if (!arguments.length) return size; + size = _ && [ +_[0], +_[1] ]; + return zoom; + }; + zoom.x = function(z) { + if (!arguments.length) return x1; + x1 = z; + x0 = z.copy(); + view = { + x: 0, + y: 0, + k: 1 + }; + return zoom; + }; + zoom.y = function(z) { + if (!arguments.length) return y1; + y1 = z; + y0 = z.copy(); + view = { + x: 0, + y: 0, + k: 1 + }; + return zoom; + }; + function location(p) { + return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ]; + } + function point(l) { + return [ l[0] * view.k + view.x, l[1] * view.k + view.y ]; + } + function scaleTo(s) { + view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s)); + } + function translateTo(p, l) { + l = point(l); + view.x += p[0] - l[0]; + view.y += p[1] - l[1]; + } + function rescale() { + if (x1) x1.domain(x0.range().map(function(x) { + return (x - view.x) / view.k; + }).map(x0.invert)); + if (y1) y1.domain(y0.range().map(function(y) { + return (y - view.y) / view.k; + }).map(y0.invert)); + } + function zoomstarted(dispatch) { + dispatch({ + type: "zoomstart" + }); + } + function zoomed(dispatch) { + rescale(); + dispatch({ + type: "zoom", + scale: view.k, + translate: [ view.x, view.y ] + }); + } + function zoomended(dispatch) { + dispatch({ + type: "zoomend" + }); + } + function mousedowned() { + var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(); + d3_selection_interrupt.call(that); + zoomstarted(dispatch); + function moved() { + dragged = 1; + translateTo(d3.mouse(that), location0); + zoomed(dispatch); + } + function ended() { + subject.on(mousemove, null).on(mouseup, null); + dragRestore(dragged && d3.event.target === target); + zoomended(dispatch); + } + } + function touchstarted() { + var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(); + d3_selection_interrupt.call(that); + started(); + zoomstarted(dispatch); + subject.on(mousedown, null).on(touchstart, started); + function relocate() { + var touches = d3.touches(that); + scale0 = view.k; + touches.forEach(function(t) { + if (t.identifier in locations0) locations0[t.identifier] = location(t); + }); + return touches; + } + function started() { + var target = d3.event.target; + d3.select(target).on(touchmove, moved).on(touchend, ended); + targets.push(target); + var changed = d3.event.changedTouches; + for (var i = 0, n = changed.length; i < n; ++i) { + locations0[changed[i].identifier] = null; + } + var touches = relocate(), now = Date.now(); + if (touches.length === 1) { + if (now - touchtime < 500) { + var p = touches[0], l = locations0[p.identifier]; + scaleTo(view.k * 2); + translateTo(p, l); + d3_eventPreventDefault(); + zoomed(dispatch); + } + touchtime = now; + } else if (touches.length > 1) { + var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1]; + distance0 = dx * dx + dy * dy; + } + } + function moved() { + var touches = d3.touches(that), p0, l0, p1, l1; + for (var i = 0, n = touches.length; i < n; ++i, l1 = null) { + p1 = touches[i]; + if (l1 = locations0[p1.identifier]) { + if (l0) break; + p0 = p1, l0 = l1; + } + } + if (l1) { + var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0); + p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ]; + l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ]; + scaleTo(scale1 * scale0); + } + touchtime = null; + translateTo(p0, l0); + zoomed(dispatch); + } + function ended() { + if (d3.event.touches.length) { + var changed = d3.event.changedTouches; + for (var i = 0, n = changed.length; i < n; ++i) { + delete locations0[changed[i].identifier]; + } + for (var identifier in locations0) { + return void relocate(); + } + } + d3.selectAll(targets).on(zoomName, null); + subject.on(mousedown, mousedowned).on(touchstart, touchstarted); + dragRestore(); + zoomended(dispatch); + } + } + function mousewheeled() { + var dispatch = event.of(this, arguments); + if (mousewheelTimer) clearTimeout(mousewheelTimer); else translate0 = location(center0 = center || d3.mouse(this)), + d3_selection_interrupt.call(this), zoomstarted(dispatch); + mousewheelTimer = setTimeout(function() { + mousewheelTimer = null; + zoomended(dispatch); + }, 50); + d3_eventPreventDefault(); + scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k); + translateTo(center0, translate0); + zoomed(dispatch); + } + function dblclicked() { + var dispatch = event.of(this, arguments), p = d3.mouse(this), l = location(p), k = Math.log(view.k) / Math.LN2; + zoomstarted(dispatch); + scaleTo(Math.pow(2, d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1)); + translateTo(p, l); + zoomed(dispatch); + zoomended(dispatch); + } + return d3.rebind(zoom, event, "on"); + }; + var d3_behavior_zoomInfinity = [ 0, Infinity ]; + var d3_behavior_zoomDelta, d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() { + return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1); + }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() { + return d3.event.wheelDelta; + }, "mousewheel") : (d3_behavior_zoomDelta = function() { + return -d3.event.detail; + }, "MozMousePixelScroll"); + d3.color = d3_color; + function d3_color() {} + d3_color.prototype.toString = function() { + return this.rgb() + ""; + }; + d3.hsl = d3_hsl; + function d3_hsl(h, s, l) { + return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l); + } + var d3_hslPrototype = d3_hsl.prototype = new d3_color(); + d3_hslPrototype.brighter = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + return new d3_hsl(this.h, this.s, this.l / k); + }; + d3_hslPrototype.darker = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + return new d3_hsl(this.h, this.s, k * this.l); + }; + d3_hslPrototype.rgb = function() { + return d3_hsl_rgb(this.h, this.s, this.l); + }; + function d3_hsl_rgb(h, s, l) { + var m1, m2; + h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h; + s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s; + l = l < 0 ? 0 : l > 1 ? 1 : l; + m2 = l <= .5 ? l * (1 + s) : l + s - l * s; + m1 = 2 * l - m2; + function v(h) { + if (h > 360) h -= 360; else if (h < 0) h += 360; + if (h < 60) return m1 + (m2 - m1) * h / 60; + if (h < 180) return m2; + if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60; + return m1; + } + function vv(h) { + return Math.round(v(h) * 255); + } + return new d3_rgb(vv(h + 120), vv(h), vv(h - 120)); + } + d3.hcl = d3_hcl; + function d3_hcl(h, c, l) { + return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l); + } + var d3_hclPrototype = d3_hcl.prototype = new d3_color(); + d3_hclPrototype.brighter = function(k) { + return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1))); + }; + d3_hclPrototype.darker = function(k) { + return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1))); + }; + d3_hclPrototype.rgb = function() { + return d3_hcl_lab(this.h, this.c, this.l).rgb(); + }; + function d3_hcl_lab(h, c, l) { + if (isNaN(h)) h = 0; + if (isNaN(c)) c = 0; + return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c); + } + d3.lab = d3_lab; + function d3_lab(l, a, b) { + return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b); + } + var d3_lab_K = 18; + var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883; + var d3_labPrototype = d3_lab.prototype = new d3_color(); + d3_labPrototype.brighter = function(k) { + return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); + }; + d3_labPrototype.darker = function(k) { + return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); + }; + d3_labPrototype.rgb = function() { + return d3_lab_rgb(this.l, this.a, this.b); + }; + function d3_lab_rgb(l, a, b) { + var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200; + x = d3_lab_xyz(x) * d3_lab_X; + y = d3_lab_xyz(y) * d3_lab_Y; + z = d3_lab_xyz(z) * d3_lab_Z; + return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z)); + } + function d3_lab_hcl(l, a, b) { + return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l); + } + function d3_lab_xyz(x) { + return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037; + } + function d3_xyz_lab(x) { + return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29; + } + function d3_xyz_rgb(r) { + return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055)); + } + d3.rgb = d3_rgb; + function d3_rgb(r, g, b) { + return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b); + } + function d3_rgbNumber(value) { + return new d3_rgb(value >> 16, value >> 8 & 255, value & 255); + } + function d3_rgbString(value) { + return d3_rgbNumber(value) + ""; + } + var d3_rgbPrototype = d3_rgb.prototype = new d3_color(); + d3_rgbPrototype.brighter = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + var r = this.r, g = this.g, b = this.b, i = 30; + if (!r && !g && !b) return new d3_rgb(i, i, i); + if (r && r < i) r = i; + if (g && g < i) g = i; + if (b && b < i) b = i; + return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k)); + }; + d3_rgbPrototype.darker = function(k) { + k = Math.pow(.7, arguments.length ? k : 1); + return new d3_rgb(k * this.r, k * this.g, k * this.b); + }; + d3_rgbPrototype.hsl = function() { + return d3_rgb_hsl(this.r, this.g, this.b); + }; + d3_rgbPrototype.toString = function() { + return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b); + }; + function d3_rgb_hex(v) { + return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16); + } + function d3_rgb_parse(format, rgb, hsl) { + var r = 0, g = 0, b = 0, m1, m2, color; + m1 = /([a-z]+)\((.*)\)/i.exec(format); + if (m1) { + m2 = m1[2].split(","); + switch (m1[1]) { + case "hsl": + { + return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100); + } + + case "rgb": + { + return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2])); + } + } + } + if (color = d3_rgb_names.get(format)) return rgb(color.r, color.g, color.b); + if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) { + if (format.length === 4) { + r = (color & 3840) >> 4; + r = r >> 4 | r; + g = color & 240; + g = g >> 4 | g; + b = color & 15; + b = b << 4 | b; + } else if (format.length === 7) { + r = (color & 16711680) >> 16; + g = (color & 65280) >> 8; + b = color & 255; + } + } + return rgb(r, g, b); + } + function d3_rgb_hsl(r, g, b) { + var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2; + if (d) { + s = l < .5 ? d / (max + min) : d / (2 - max - min); + if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4; + h *= 60; + } else { + h = NaN; + s = l > 0 && l < 1 ? 0 : h; + } + return new d3_hsl(h, s, l); + } + function d3_rgb_lab(r, g, b) { + r = d3_rgb_xyz(r); + g = d3_rgb_xyz(g); + b = d3_rgb_xyz(b); + var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z); + return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z)); + } + function d3_rgb_xyz(r) { + return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4); + } + function d3_rgb_parseNumber(c) { + var f = parseFloat(c); + return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f; + } + var d3_rgb_names = d3.map({ + aliceblue: 15792383, + antiquewhite: 16444375, + aqua: 65535, + aquamarine: 8388564, + azure: 15794175, + beige: 16119260, + bisque: 16770244, + black: 0, + blanchedalmond: 16772045, + blue: 255, + blueviolet: 9055202, + brown: 10824234, + burlywood: 14596231, + cadetblue: 6266528, + chartreuse: 8388352, + chocolate: 13789470, + coral: 16744272, + cornflowerblue: 6591981, + cornsilk: 16775388, + crimson: 14423100, + cyan: 65535, + darkblue: 139, + darkcyan: 35723, + darkgoldenrod: 12092939, + darkgray: 11119017, + darkgreen: 25600, + darkgrey: 11119017, + darkkhaki: 12433259, + darkmagenta: 9109643, + darkolivegreen: 5597999, + darkorange: 16747520, + darkorchid: 10040012, + darkred: 9109504, + darksalmon: 15308410, + darkseagreen: 9419919, + darkslateblue: 4734347, + darkslategray: 3100495, + darkslategrey: 3100495, + darkturquoise: 52945, + darkviolet: 9699539, + deeppink: 16716947, + deepskyblue: 49151, + dimgray: 6908265, + dimgrey: 6908265, + dodgerblue: 2003199, + firebrick: 11674146, + floralwhite: 16775920, + forestgreen: 2263842, + fuchsia: 16711935, + gainsboro: 14474460, + ghostwhite: 16316671, + gold: 16766720, + goldenrod: 14329120, + gray: 8421504, + green: 32768, + greenyellow: 11403055, + grey: 8421504, + honeydew: 15794160, + hotpink: 16738740, + indianred: 13458524, + indigo: 4915330, + ivory: 16777200, + khaki: 15787660, + lavender: 15132410, + lavenderblush: 16773365, + lawngreen: 8190976, + lemonchiffon: 16775885, + lightblue: 11393254, + lightcoral: 15761536, + lightcyan: 14745599, + lightgoldenrodyellow: 16448210, + lightgray: 13882323, + lightgreen: 9498256, + lightgrey: 13882323, + lightpink: 16758465, + lightsalmon: 16752762, + lightseagreen: 2142890, + lightskyblue: 8900346, + lightslategray: 7833753, + lightslategrey: 7833753, + lightsteelblue: 11584734, + lightyellow: 16777184, + lime: 65280, + limegreen: 3329330, + linen: 16445670, + magenta: 16711935, + maroon: 8388608, + mediumaquamarine: 6737322, + mediumblue: 205, + mediumorchid: 12211667, + mediumpurple: 9662683, + mediumseagreen: 3978097, + mediumslateblue: 8087790, + mediumspringgreen: 64154, + mediumturquoise: 4772300, + mediumvioletred: 13047173, + midnightblue: 1644912, + mintcream: 16121850, + mistyrose: 16770273, + moccasin: 16770229, + navajowhite: 16768685, + navy: 128, + oldlace: 16643558, + olive: 8421376, + olivedrab: 7048739, + orange: 16753920, + orangered: 16729344, + orchid: 14315734, + palegoldenrod: 15657130, + palegreen: 10025880, + paleturquoise: 11529966, + palevioletred: 14381203, + papayawhip: 16773077, + peachpuff: 16767673, + peru: 13468991, + pink: 16761035, + plum: 14524637, + powderblue: 11591910, + purple: 8388736, + red: 16711680, + rosybrown: 12357519, + royalblue: 4286945, + saddlebrown: 9127187, + salmon: 16416882, + sandybrown: 16032864, + seagreen: 3050327, + seashell: 16774638, + sienna: 10506797, + silver: 12632256, + skyblue: 8900331, + slateblue: 6970061, + slategray: 7372944, + slategrey: 7372944, + snow: 16775930, + springgreen: 65407, + steelblue: 4620980, + tan: 13808780, + teal: 32896, + thistle: 14204888, + tomato: 16737095, + turquoise: 4251856, + violet: 15631086, + wheat: 16113331, + white: 16777215, + whitesmoke: 16119285, + yellow: 16776960, + yellowgreen: 10145074 + }); + d3_rgb_names.forEach(function(key, value) { + d3_rgb_names.set(key, d3_rgbNumber(value)); + }); + function d3_functor(v) { + return typeof v === "function" ? v : function() { + return v; + }; + } + d3.functor = d3_functor; + function d3_identity(d) { + return d; + } + d3.xhr = d3_xhrType(d3_identity); + function d3_xhrType(response) { + return function(url, mimeType, callback) { + if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType, + mimeType = null; + return d3_xhr(url, mimeType, response, callback); + }; + } + function d3_xhr(url, mimeType, response, callback) { + var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null; + if (d3_window.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest(); + "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() { + request.readyState > 3 && respond(); + }; + function respond() { + var status = request.status, result; + if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) { + try { + result = response.call(xhr, request); + } catch (e) { + dispatch.error.call(xhr, e); + return; + } + dispatch.load.call(xhr, result); + } else { + dispatch.error.call(xhr, request); + } + } + request.onprogress = function(event) { + var o = d3.event; + d3.event = event; + try { + dispatch.progress.call(xhr, request); + } finally { + d3.event = o; + } + }; + xhr.header = function(name, value) { + name = (name + "").toLowerCase(); + if (arguments.length < 2) return headers[name]; + if (value == null) delete headers[name]; else headers[name] = value + ""; + return xhr; + }; + xhr.mimeType = function(value) { + if (!arguments.length) return mimeType; + mimeType = value == null ? null : value + ""; + return xhr; + }; + xhr.responseType = function(value) { + if (!arguments.length) return responseType; + responseType = value; + return xhr; + }; + xhr.response = function(value) { + response = value; + return xhr; + }; + [ "get", "post" ].forEach(function(method) { + xhr[method] = function() { + return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments))); + }; + }); + xhr.send = function(method, data, callback) { + if (arguments.length === 2 && typeof data === "function") callback = data, data = null; + request.open(method, url, true); + if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*"; + if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]); + if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType); + if (responseType != null) request.responseType = responseType; + if (callback != null) xhr.on("error", callback).on("load", function(request) { + callback(null, request); + }); + dispatch.beforesend.call(xhr, request); + request.send(data == null ? null : data); + return xhr; + }; + xhr.abort = function() { + request.abort(); + return xhr; + }; + d3.rebind(xhr, dispatch, "on"); + return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback)); + } + function d3_xhr_fixCallback(callback) { + return callback.length === 1 ? function(error, request) { + callback(error == null ? request : null); + } : callback; + } + function d3_xhrHasResponse(request) { + var type = request.responseType; + return type && type !== "text" ? request.response : request.responseText; + } + d3.dsv = function(delimiter, mimeType) { + var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0); + function dsv(url, row, callback) { + if (arguments.length < 3) callback = row, row = null; + var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback); + xhr.row = function(_) { + return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row; + }; + return xhr; + } + function response(request) { + return dsv.parse(request.responseText); + } + function typedResponse(f) { + return function(request) { + return dsv.parse(request.responseText, f); + }; + } + dsv.parse = function(text, f) { + var o; + return dsv.parseRows(text, function(row, i) { + if (o) return o(row, i - 1); + var a = new Function("d", "return {" + row.map(function(name, i) { + return JSON.stringify(name) + ": d[" + i + "]"; + }).join(",") + "}"); + o = f ? function(row, i) { + return f(a(row), i); + } : a; + }); + }; + dsv.parseRows = function(text, f) { + var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol; + function token() { + if (I >= N) return EOF; + if (eol) return eol = false, EOL; + var j = I; + if (text.charCodeAt(j) === 34) { + var i = j; + while (i++ < N) { + if (text.charCodeAt(i) === 34) { + if (text.charCodeAt(i + 1) !== 34) break; + ++i; + } + } + I = i + 2; + var c = text.charCodeAt(i + 1); + if (c === 13) { + eol = true; + if (text.charCodeAt(i + 2) === 10) ++I; + } else if (c === 10) { + eol = true; + } + return text.slice(j + 1, i).replace(/""/g, '"'); + } + while (I < N) { + var c = text.charCodeAt(I++), k = 1; + if (c === 10) eol = true; else if (c === 13) { + eol = true; + if (text.charCodeAt(I) === 10) ++I, ++k; + } else if (c !== delimiterCode) continue; + return text.slice(j, I - k); + } + return text.slice(j); + } + while ((t = token()) !== EOF) { + var a = []; + while (t !== EOL && t !== EOF) { + a.push(t); + t = token(); + } + if (f && (a = f(a, n++)) == null) continue; + rows.push(a); + } + return rows; + }; + dsv.format = function(rows) { + if (Array.isArray(rows[0])) return dsv.formatRows(rows); + var fieldSet = new d3_Set(), fields = []; + rows.forEach(function(row) { + for (var field in row) { + if (!fieldSet.has(field)) { + fields.push(fieldSet.add(field)); + } + } + }); + return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) { + return fields.map(function(field) { + return formatValue(row[field]); + }).join(delimiter); + })).join("\n"); + }; + dsv.formatRows = function(rows) { + return rows.map(formatRow).join("\n"); + }; + function formatRow(row) { + return row.map(formatValue).join(delimiter); + } + function formatValue(text) { + return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text; + } + return dsv; + }; + d3.csv = d3.dsv(",", "text/csv"); + d3.tsv = d3.dsv(" ", "text/tab-separated-values"); + var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = d3_window[d3_vendorSymbol(d3_window, "requestAnimationFrame")] || function(callback) { + setTimeout(callback, 17); + }; + d3.timer = function(callback, delay, then) { + var n = arguments.length; + if (n < 2) delay = 0; + if (n < 3) then = Date.now(); + var time = then + delay, timer = { + c: callback, + t: time, + f: false, + n: null + }; + if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer; + d3_timer_queueTail = timer; + if (!d3_timer_interval) { + d3_timer_timeout = clearTimeout(d3_timer_timeout); + d3_timer_interval = 1; + d3_timer_frame(d3_timer_step); + } + }; + function d3_timer_step() { + var now = d3_timer_mark(), delay = d3_timer_sweep() - now; + if (delay > 24) { + if (isFinite(delay)) { + clearTimeout(d3_timer_timeout); + d3_timer_timeout = setTimeout(d3_timer_step, delay); + } + d3_timer_interval = 0; + } else { + d3_timer_interval = 1; + d3_timer_frame(d3_timer_step); + } + } + d3.timer.flush = function() { + d3_timer_mark(); + d3_timer_sweep(); + }; + function d3_timer_mark() { + var now = Date.now(); + d3_timer_active = d3_timer_queueHead; + while (d3_timer_active) { + if (now >= d3_timer_active.t) d3_timer_active.f = d3_timer_active.c(now - d3_timer_active.t); + d3_timer_active = d3_timer_active.n; + } + return now; + } + function d3_timer_sweep() { + var t0, t1 = d3_timer_queueHead, time = Infinity; + while (t1) { + if (t1.f) { + t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n; + } else { + if (t1.t < time) time = t1.t; + t1 = (t0 = t1).n; + } + } + d3_timer_queueTail = t0; + return time; + } + function d3_format_precision(x, p) { + return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1); + } + d3.round = function(x, n) { + return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x); + }; + var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix); + d3.formatPrefix = function(value, precision) { + var i = 0; + if (value) { + if (value < 0) value *= -1; + if (precision) value = d3.round(value, d3_format_precision(value, precision)); + i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10); + i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3)); + } + return d3_formatPrefixes[8 + i / 3]; + }; + function d3_formatPrefix(d, i) { + var k = Math.pow(10, abs(8 - i) * 3); + return { + scale: i > 8 ? function(d) { + return d / k; + } : function(d) { + return d * k; + }, + symbol: d + }; + } + function d3_locale_numberFormat(locale) { + var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) { + var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0; + while (i > 0 && g > 0) { + if (length + g + 1 > width) g = Math.max(1, width - length); + t.push(value.substring(i -= g, i + g)); + if ((length += g + 1) > width) break; + g = locale_grouping[j = (j + 1) % locale_grouping.length]; + } + return t.reverse().join(locale_thousands); + } : d3_identity; + return function(specifier) { + var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "-", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false, exponent = true; + if (precision) precision = +precision.substring(1); + if (zfill || fill === "0" && align === "=") { + zfill = fill = "0"; + align = "="; + } + switch (type) { + case "n": + comma = true; + type = "g"; + break; + + case "%": + scale = 100; + suffix = "%"; + type = "f"; + break; + + case "p": + scale = 100; + suffix = "%"; + type = "r"; + break; + + case "b": + case "o": + case "x": + case "X": + if (symbol === "#") prefix = "0" + type.toLowerCase(); + + case "c": + exponent = false; + + case "d": + integer = true; + precision = 0; + break; + + case "s": + scale = -1; + type = "r"; + break; + } + if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1]; + if (type == "r" && !precision) type = "g"; + if (precision != null) { + if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision)); + } + type = d3_format_types.get(type) || d3_format_typeDefault; + var zcomma = zfill && comma; + return function(value) { + var fullSuffix = suffix; + if (integer && value % 1) return ""; + var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign === "-" ? "" : sign; + if (scale < 0) { + var unit = d3.formatPrefix(value, precision); + value = unit.scale(value); + fullSuffix = unit.symbol + suffix; + } else { + value *= scale; + } + value = type(value, precision); + var i = value.lastIndexOf("."), before, after; + if (i < 0) { + var j = exponent ? value.lastIndexOf("e") : -1; + if (j < 0) before = value, after = ""; else before = value.substring(0, j), after = value.substring(j); + } else { + before = value.substring(0, i); + after = locale_decimal + value.substring(i + 1); + } + if (!zfill && comma) before = formatGroup(before, Infinity); + var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : ""; + if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity); + negative += prefix; + value = before + after; + return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix; + }; + }; + } + var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i; + var d3_format_types = d3.map({ + b: function(x) { + return x.toString(2); + }, + c: function(x) { + return String.fromCharCode(x); + }, + o: function(x) { + return x.toString(8); + }, + x: function(x) { + return x.toString(16); + }, + X: function(x) { + return x.toString(16).toUpperCase(); + }, + g: function(x, p) { + return x.toPrecision(p); + }, + e: function(x, p) { + return x.toExponential(p); + }, + f: function(x, p) { + return x.toFixed(p); + }, + r: function(x, p) { + return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p)))); + } + }); + function d3_format_typeDefault(x) { + return x + ""; + } + var d3_time = d3.time = {}, d3_date = Date; + function d3_date_utc() { + this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]); + } + d3_date_utc.prototype = { + getDate: function() { + return this._.getUTCDate(); + }, + getDay: function() { + return this._.getUTCDay(); + }, + getFullYear: function() { + return this._.getUTCFullYear(); + }, + getHours: function() { + return this._.getUTCHours(); + }, + getMilliseconds: function() { + return this._.getUTCMilliseconds(); + }, + getMinutes: function() { + return this._.getUTCMinutes(); + }, + getMonth: function() { + return this._.getUTCMonth(); + }, + getSeconds: function() { + return this._.getUTCSeconds(); + }, + getTime: function() { + return this._.getTime(); + }, + getTimezoneOffset: function() { + return 0; + }, + valueOf: function() { + return this._.valueOf(); + }, + setDate: function() { + d3_time_prototype.setUTCDate.apply(this._, arguments); + }, + setDay: function() { + d3_time_prototype.setUTCDay.apply(this._, arguments); + }, + setFullYear: function() { + d3_time_prototype.setUTCFullYear.apply(this._, arguments); + }, + setHours: function() { + d3_time_prototype.setUTCHours.apply(this._, arguments); + }, + setMilliseconds: function() { + d3_time_prototype.setUTCMilliseconds.apply(this._, arguments); + }, + setMinutes: function() { + d3_time_prototype.setUTCMinutes.apply(this._, arguments); + }, + setMonth: function() { + d3_time_prototype.setUTCMonth.apply(this._, arguments); + }, + setSeconds: function() { + d3_time_prototype.setUTCSeconds.apply(this._, arguments); + }, + setTime: function() { + d3_time_prototype.setTime.apply(this._, arguments); + } + }; + var d3_time_prototype = Date.prototype; + function d3_time_interval(local, step, number) { + function round(date) { + var d0 = local(date), d1 = offset(d0, 1); + return date - d0 < d1 - date ? d0 : d1; + } + function ceil(date) { + step(date = local(new d3_date(date - 1)), 1); + return date; + } + function offset(date, k) { + step(date = new d3_date(+date), k); + return date; + } + function range(t0, t1, dt) { + var time = ceil(t0), times = []; + if (dt > 1) { + while (time < t1) { + if (!(number(time) % dt)) times.push(new Date(+time)); + step(time, 1); + } + } else { + while (time < t1) times.push(new Date(+time)), step(time, 1); + } + return times; + } + function range_utc(t0, t1, dt) { + try { + d3_date = d3_date_utc; + var utc = new d3_date_utc(); + utc._ = t0; + return range(utc, t1, dt); + } finally { + d3_date = Date; + } + } + local.floor = local; + local.round = round; + local.ceil = ceil; + local.offset = offset; + local.range = range; + var utc = local.utc = d3_time_interval_utc(local); + utc.floor = utc; + utc.round = d3_time_interval_utc(round); + utc.ceil = d3_time_interval_utc(ceil); + utc.offset = d3_time_interval_utc(offset); + utc.range = range_utc; + return local; + } + function d3_time_interval_utc(method) { + return function(date, k) { + try { + d3_date = d3_date_utc; + var utc = new d3_date_utc(); + utc._ = date; + return method(utc, k)._; + } finally { + d3_date = Date; + } + }; + } + d3_time.year = d3_time_interval(function(date) { + date = d3_time.day(date); + date.setMonth(0, 1); + return date; + }, function(date, offset) { + date.setFullYear(date.getFullYear() + offset); + }, function(date) { + return date.getFullYear(); + }); + d3_time.years = d3_time.year.range; + d3_time.years.utc = d3_time.year.utc.range; + d3_time.day = d3_time_interval(function(date) { + var day = new d3_date(2e3, 0); + day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); + return day; + }, function(date, offset) { + date.setDate(date.getDate() + offset); + }, function(date) { + return date.getDate() - 1; + }); + d3_time.days = d3_time.day.range; + d3_time.days.utc = d3_time.day.utc.range; + d3_time.dayOfYear = function(date) { + var year = d3_time.year(date); + return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5); + }; + [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) { + i = 7 - i; + var interval = d3_time[day] = d3_time_interval(function(date) { + (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7); + return date; + }, function(date, offset) { + date.setDate(date.getDate() + Math.floor(offset) * 7); + }, function(date) { + var day = d3_time.year(date).getDay(); + return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i); + }); + d3_time[day + "s"] = interval.range; + d3_time[day + "s"].utc = interval.utc.range; + d3_time[day + "OfYear"] = function(date) { + var day = d3_time.year(date).getDay(); + return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7); + }; + }); + d3_time.week = d3_time.sunday; + d3_time.weeks = d3_time.sunday.range; + d3_time.weeks.utc = d3_time.sunday.utc.range; + d3_time.weekOfYear = d3_time.sundayOfYear; + function d3_locale_timeFormat(locale) { + var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths; + function d3_time_format(template) { + var n = template.length; + function format(date) { + var string = [], i = -1, j = 0, c, p, f; + while (++i < n) { + if (template.charCodeAt(i) === 37) { + string.push(template.slice(j, i)); + if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i); + if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p); + string.push(c); + j = i + 1; + } + } + string.push(template.slice(j, i)); + return string.join(""); + } + format.parse = function(string) { + var d = { + y: 1900, + m: 0, + d: 1, + H: 0, + M: 0, + S: 0, + L: 0, + Z: null + }, i = d3_time_parse(d, template, string, 0); + if (i != string.length) return null; + if ("p" in d) d.H = d.H % 12 + d.p * 12; + var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)(); + if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("w" in d && ("W" in d || "U" in d)) { + date.setFullYear(d.y, 0, 1); + date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7); + } else date.setFullYear(d.y, d.m, d.d); + date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L); + return localZ ? date._ : date; + }; + format.toString = function() { + return template; + }; + return format; + } + function d3_time_parse(date, template, string, j) { + var c, p, t, i = 0, n = template.length, m = string.length; + while (i < n) { + if (j >= m) return -1; + c = template.charCodeAt(i++); + if (c === 37) { + t = template.charAt(i++); + p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t]; + if (!p || (j = p(date, string, j)) < 0) return -1; + } else if (c != string.charCodeAt(j++)) { + return -1; + } + } + return j; + } + d3_time_format.utc = function(template) { + var local = d3_time_format(template); + function format(date) { + try { + d3_date = d3_date_utc; + var utc = new d3_date(); + utc._ = date; + return local(utc); + } finally { + d3_date = Date; + } + } + format.parse = function(string) { + try { + d3_date = d3_date_utc; + var date = local.parse(string); + return date && date._; + } finally { + d3_date = Date; + } + }; + format.toString = local.toString; + return format; + }; + d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti; + var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths); + locale_periods.forEach(function(p, i) { + d3_time_periodLookup.set(p.toLowerCase(), i); + }); + var d3_time_formats = { + a: function(d) { + return locale_shortDays[d.getDay()]; + }, + A: function(d) { + return locale_days[d.getDay()]; + }, + b: function(d) { + return locale_shortMonths[d.getMonth()]; + }, + B: function(d) { + return locale_months[d.getMonth()]; + }, + c: d3_time_format(locale_dateTime), + d: function(d, p) { + return d3_time_formatPad(d.getDate(), p, 2); + }, + e: function(d, p) { + return d3_time_formatPad(d.getDate(), p, 2); + }, + H: function(d, p) { + return d3_time_formatPad(d.getHours(), p, 2); + }, + I: function(d, p) { + return d3_time_formatPad(d.getHours() % 12 || 12, p, 2); + }, + j: function(d, p) { + return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3); + }, + L: function(d, p) { + return d3_time_formatPad(d.getMilliseconds(), p, 3); + }, + m: function(d, p) { + return d3_time_formatPad(d.getMonth() + 1, p, 2); + }, + M: function(d, p) { + return d3_time_formatPad(d.getMinutes(), p, 2); + }, + p: function(d) { + return locale_periods[+(d.getHours() >= 12)]; + }, + S: function(d, p) { + return d3_time_formatPad(d.getSeconds(), p, 2); + }, + U: function(d, p) { + return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2); + }, + w: function(d) { + return d.getDay(); + }, + W: function(d, p) { + return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2); + }, + x: d3_time_format(locale_date), + X: d3_time_format(locale_time), + y: function(d, p) { + return d3_time_formatPad(d.getFullYear() % 100, p, 2); + }, + Y: function(d, p) { + return d3_time_formatPad(d.getFullYear() % 1e4, p, 4); + }, + Z: d3_time_zone, + "%": function() { + return "%"; + } + }; + var d3_time_parsers = { + a: d3_time_parseWeekdayAbbrev, + A: d3_time_parseWeekday, + b: d3_time_parseMonthAbbrev, + B: d3_time_parseMonth, + c: d3_time_parseLocaleFull, + d: d3_time_parseDay, + e: d3_time_parseDay, + H: d3_time_parseHour24, + I: d3_time_parseHour24, + j: d3_time_parseDayOfYear, + L: d3_time_parseMilliseconds, + m: d3_time_parseMonthNumber, + M: d3_time_parseMinutes, + p: d3_time_parseAmPm, + S: d3_time_parseSeconds, + U: d3_time_parseWeekNumberSunday, + w: d3_time_parseWeekdayNumber, + W: d3_time_parseWeekNumberMonday, + x: d3_time_parseLocaleDate, + X: d3_time_parseLocaleTime, + y: d3_time_parseYear, + Y: d3_time_parseFullYear, + Z: d3_time_parseZone, + "%": d3_time_parseLiteralPercent + }; + function d3_time_parseWeekdayAbbrev(date, string, i) { + d3_time_dayAbbrevRe.lastIndex = 0; + var n = d3_time_dayAbbrevRe.exec(string.slice(i)); + return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseWeekday(date, string, i) { + d3_time_dayRe.lastIndex = 0; + var n = d3_time_dayRe.exec(string.slice(i)); + return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseMonthAbbrev(date, string, i) { + d3_time_monthAbbrevRe.lastIndex = 0; + var n = d3_time_monthAbbrevRe.exec(string.slice(i)); + return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseMonth(date, string, i) { + d3_time_monthRe.lastIndex = 0; + var n = d3_time_monthRe.exec(string.slice(i)); + return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function d3_time_parseLocaleFull(date, string, i) { + return d3_time_parse(date, d3_time_formats.c.toString(), string, i); + } + function d3_time_parseLocaleDate(date, string, i) { + return d3_time_parse(date, d3_time_formats.x.toString(), string, i); + } + function d3_time_parseLocaleTime(date, string, i) { + return d3_time_parse(date, d3_time_formats.X.toString(), string, i); + } + function d3_time_parseAmPm(date, string, i) { + var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase()); + return n == null ? -1 : (date.p = n, i); + } + return d3_time_format; + } + var d3_time_formatPads = { + "-": "", + _: " ", + "0": "0" + }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/; + function d3_time_formatPad(value, fill, width) { + var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length; + return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string); + } + function d3_time_formatRe(names) { + return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i"); + } + function d3_time_formatLookup(names) { + var map = new d3_Map(), i = -1, n = names.length; + while (++i < n) map.set(names[i].toLowerCase(), i); + return map; + } + function d3_time_parseWeekdayNumber(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 1)); + return n ? (date.w = +n[0], i + n[0].length) : -1; + } + function d3_time_parseWeekNumberSunday(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i)); + return n ? (date.U = +n[0], i + n[0].length) : -1; + } + function d3_time_parseWeekNumberMonday(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i)); + return n ? (date.W = +n[0], i + n[0].length) : -1; + } + function d3_time_parseFullYear(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 4)); + return n ? (date.y = +n[0], i + n[0].length) : -1; + } + function d3_time_parseYear(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1; + } + function d3_time_parseZone(date, string, i) { + return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string, + i + 5) : -1; + } + function d3_time_expandYear(d) { + return d + (d > 68 ? 1900 : 2e3); + } + function d3_time_parseMonthNumber(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.m = n[0] - 1, i + n[0].length) : -1; + } + function d3_time_parseDay(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.d = +n[0], i + n[0].length) : -1; + } + function d3_time_parseDayOfYear(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 3)); + return n ? (date.j = +n[0], i + n[0].length) : -1; + } + function d3_time_parseHour24(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.H = +n[0], i + n[0].length) : -1; + } + function d3_time_parseMinutes(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.M = +n[0], i + n[0].length) : -1; + } + function d3_time_parseSeconds(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); + return n ? (date.S = +n[0], i + n[0].length) : -1; + } + function d3_time_parseMilliseconds(date, string, i) { + d3_time_numberRe.lastIndex = 0; + var n = d3_time_numberRe.exec(string.slice(i, i + 3)); + return n ? (date.L = +n[0], i + n[0].length) : -1; + } + function d3_time_zone(d) { + var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = abs(z) / 60 | 0, zm = abs(z) % 60; + return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2); + } + function d3_time_parseLiteralPercent(date, string, i) { + d3_time_percentRe.lastIndex = 0; + var n = d3_time_percentRe.exec(string.slice(i, i + 1)); + return n ? i + n[0].length : -1; + } + function d3_time_formatMulti(formats) { + var n = formats.length, i = -1; + while (++i < n) formats[i][0] = this(formats[i][0]); + return function(date) { + var i = 0, f = formats[i]; + while (!f[1](date)) f = formats[++i]; + return f[0](date); + }; + } + d3.locale = function(locale) { + return { + numberFormat: d3_locale_numberFormat(locale), + timeFormat: d3_locale_timeFormat(locale) + }; + }; + var d3_locale_enUS = d3.locale({ + decimal: ".", + thousands: ",", + grouping: [ 3 ], + currency: [ "$", "" ], + dateTime: "%a %b %e %X %Y", + date: "%m/%d/%Y", + time: "%H:%M:%S", + periods: [ "AM", "PM" ], + days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], + shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], + months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], + shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ] + }); + d3.format = d3_locale_enUS.numberFormat; + d3.geo = {}; + function d3_adder() {} + d3_adder.prototype = { + s: 0, + t: 0, + add: function(y) { + d3_adderSum(y, this.t, d3_adderTemp); + d3_adderSum(d3_adderTemp.s, this.s, this); + if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t; + }, + reset: function() { + this.s = this.t = 0; + }, + valueOf: function() { + return this.s; + } + }; + var d3_adderTemp = new d3_adder(); + function d3_adderSum(a, b, o) { + var x = o.s = a + b, bv = x - a, av = x - bv; + o.t = a - av + (b - bv); + } + d3.geo.stream = function(object, listener) { + if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) { + d3_geo_streamObjectType[object.type](object, listener); + } else { + d3_geo_streamGeometry(object, listener); + } + }; + function d3_geo_streamGeometry(geometry, listener) { + if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) { + d3_geo_streamGeometryType[geometry.type](geometry, listener); + } + } + var d3_geo_streamObjectType = { + Feature: function(feature, listener) { + d3_geo_streamGeometry(feature.geometry, listener); + }, + FeatureCollection: function(object, listener) { + var features = object.features, i = -1, n = features.length; + while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener); + } + }; + var d3_geo_streamGeometryType = { + Sphere: function(object, listener) { + listener.sphere(); + }, + Point: function(object, listener) { + object = object.coordinates; + listener.point(object[0], object[1], object[2]); + }, + MultiPoint: function(object, listener) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]); + }, + LineString: function(object, listener) { + d3_geo_streamLine(object.coordinates, listener, 0); + }, + MultiLineString: function(object, listener) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0); + }, + Polygon: function(object, listener) { + d3_geo_streamPolygon(object.coordinates, listener); + }, + MultiPolygon: function(object, listener) { + var coordinates = object.coordinates, i = -1, n = coordinates.length; + while (++i < n) d3_geo_streamPolygon(coordinates[i], listener); + }, + GeometryCollection: function(object, listener) { + var geometries = object.geometries, i = -1, n = geometries.length; + while (++i < n) d3_geo_streamGeometry(geometries[i], listener); + } + }; + function d3_geo_streamLine(coordinates, listener, closed) { + var i = -1, n = coordinates.length - closed, coordinate; + listener.lineStart(); + while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]); + listener.lineEnd(); + } + function d3_geo_streamPolygon(coordinates, listener) { + var i = -1, n = coordinates.length; + listener.polygonStart(); + while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1); + listener.polygonEnd(); + } + d3.geo.area = function(object) { + d3_geo_areaSum = 0; + d3.geo.stream(object, d3_geo_area); + return d3_geo_areaSum; + }; + var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder(); + var d3_geo_area = { + sphere: function() { + d3_geo_areaSum += 4 * π; + }, + point: d3_noop, + lineStart: d3_noop, + lineEnd: d3_noop, + polygonStart: function() { + d3_geo_areaRingSum.reset(); + d3_geo_area.lineStart = d3_geo_areaRingStart; + }, + polygonEnd: function() { + var area = 2 * d3_geo_areaRingSum; + d3_geo_areaSum += area < 0 ? 4 * π + area : area; + d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop; + } + }; + function d3_geo_areaRingStart() { + var λ00, φ00, λ0, cosφ0, sinφ0; + d3_geo_area.point = function(λ, φ) { + d3_geo_area.point = nextPoint; + λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), + sinφ0 = Math.sin(φ); + }; + function nextPoint(λ, φ) { + λ *= d3_radians; + φ = φ * d3_radians / 2 + π / 4; + var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ); + d3_geo_areaRingSum.add(Math.atan2(v, u)); + λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ; + } + d3_geo_area.lineEnd = function() { + nextPoint(λ00, φ00); + }; + } + function d3_geo_cartesian(spherical) { + var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ); + return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ]; + } + function d3_geo_cartesianDot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } + function d3_geo_cartesianCross(a, b) { + return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ]; + } + function d3_geo_cartesianAdd(a, b) { + a[0] += b[0]; + a[1] += b[1]; + a[2] += b[2]; + } + function d3_geo_cartesianScale(vector, k) { + return [ vector[0] * k, vector[1] * k, vector[2] * k ]; + } + function d3_geo_cartesianNormalize(d) { + var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); + d[0] /= l; + d[1] /= l; + d[2] /= l; + } + function d3_geo_spherical(cartesian) { + return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ]; + } + function d3_geo_sphericalEqual(a, b) { + return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε; + } + d3.geo.bounds = function() { + var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range; + var bound = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + bound.point = ringPoint; + bound.lineStart = ringStart; + bound.lineEnd = ringEnd; + dλSum = 0; + d3_geo_area.polygonStart(); + }, + polygonEnd: function() { + d3_geo_area.polygonEnd(); + bound.point = point; + bound.lineStart = lineStart; + bound.lineEnd = lineEnd; + if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90; + range[0] = λ0, range[1] = λ1; + } + }; + function point(λ, φ) { + ranges.push(range = [ λ0 = λ, λ1 = λ ]); + if (φ < φ0) φ0 = φ; + if (φ > φ1) φ1 = φ; + } + function linePoint(λ, φ) { + var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]); + if (p0) { + var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal); + d3_geo_cartesianNormalize(inflection); + inflection = d3_geo_spherical(inflection); + var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180; + if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) { + var φi = inflection[1] * d3_degrees; + if (φi > φ1) φ1 = φi; + } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) { + var φi = -inflection[1] * d3_degrees; + if (φi < φ0) φ0 = φi; + } else { + if (φ < φ0) φ0 = φ; + if (φ > φ1) φ1 = φ; + } + if (antimeridian) { + if (λ < λ_) { + if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; + } else { + if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; + } + } else { + if (λ1 >= λ0) { + if (λ < λ0) λ0 = λ; + if (λ > λ1) λ1 = λ; + } else { + if (λ > λ_) { + if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; + } else { + if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; + } + } + } + } else { + point(λ, φ); + } + p0 = p, λ_ = λ; + } + function lineStart() { + bound.point = linePoint; + } + function lineEnd() { + range[0] = λ0, range[1] = λ1; + bound.point = point; + p0 = null; + } + function ringPoint(λ, φ) { + if (p0) { + var dλ = λ - λ_; + dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ; + } else λ__ = λ, φ__ = φ; + d3_geo_area.point(λ, φ); + linePoint(λ, φ); + } + function ringStart() { + d3_geo_area.lineStart(); + } + function ringEnd() { + ringPoint(λ__, φ__); + d3_geo_area.lineEnd(); + if (abs(dλSum) > ε) λ0 = -(λ1 = 180); + range[0] = λ0, range[1] = λ1; + p0 = null; + } + function angle(λ0, λ1) { + return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1; + } + function compareRanges(a, b) { + return a[0] - b[0]; + } + function withinRange(x, range) { + return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x; + } + return function(feature) { + φ1 = λ1 = -(λ0 = φ0 = Infinity); + ranges = []; + d3.geo.stream(feature, bound); + var n = ranges.length; + if (n) { + ranges.sort(compareRanges); + for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) { + b = ranges[i]; + if (withinRange(b[0], a) || withinRange(b[1], a)) { + if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1]; + if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0]; + } else { + merged.push(a = b); + } + } + var best = -Infinity, dλ; + for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) { + b = merged[i]; + if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1]; + } + } + ranges = range = null; + return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ]; + }; + }(); + d3.geo.centroid = function(object) { + d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; + d3.geo.stream(object, d3_geo_centroid); + var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z; + if (m < ε2) { + x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1; + if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0; + m = x * x + y * y + z * z; + if (m < ε2) return [ NaN, NaN ]; + } + return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ]; + }; + var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2; + var d3_geo_centroid = { + sphere: d3_noop, + point: d3_geo_centroidPoint, + lineStart: d3_geo_centroidLineStart, + lineEnd: d3_geo_centroidLineEnd, + polygonStart: function() { + d3_geo_centroid.lineStart = d3_geo_centroidRingStart; + }, + polygonEnd: function() { + d3_geo_centroid.lineStart = d3_geo_centroidLineStart; + } + }; + function d3_geo_centroidPoint(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians); + d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ)); + } + function d3_geo_centroidPointXYZ(x, y, z) { + ++d3_geo_centroidW0; + d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0; + d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0; + d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0; + } + function d3_geo_centroidLineStart() { + var x0, y0, z0; + d3_geo_centroid.point = function(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians); + x0 = cosφ * Math.cos(λ); + y0 = cosφ * Math.sin(λ); + z0 = Math.sin(φ); + d3_geo_centroid.point = nextPoint; + d3_geo_centroidPointXYZ(x0, y0, z0); + }; + function nextPoint(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z); + d3_geo_centroidW1 += w; + d3_geo_centroidX1 += w * (x0 + (x0 = x)); + d3_geo_centroidY1 += w * (y0 + (y0 = y)); + d3_geo_centroidZ1 += w * (z0 + (z0 = z)); + d3_geo_centroidPointXYZ(x0, y0, z0); + } + } + function d3_geo_centroidLineEnd() { + d3_geo_centroid.point = d3_geo_centroidPoint; + } + function d3_geo_centroidRingStart() { + var λ00, φ00, x0, y0, z0; + d3_geo_centroid.point = function(λ, φ) { + λ00 = λ, φ00 = φ; + d3_geo_centroid.point = nextPoint; + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians); + x0 = cosφ * Math.cos(λ); + y0 = cosφ * Math.sin(λ); + z0 = Math.sin(φ); + d3_geo_centroidPointXYZ(x0, y0, z0); + }; + d3_geo_centroid.lineEnd = function() { + nextPoint(λ00, φ00); + d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd; + d3_geo_centroid.point = d3_geo_centroidPoint; + }; + function nextPoint(λ, φ) { + λ *= d3_radians; + var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u); + d3_geo_centroidX2 += v * cx; + d3_geo_centroidY2 += v * cy; + d3_geo_centroidZ2 += v * cz; + d3_geo_centroidW1 += w; + d3_geo_centroidX1 += w * (x0 + (x0 = x)); + d3_geo_centroidY1 += w * (y0 + (y0 = y)); + d3_geo_centroidZ1 += w * (z0 + (z0 = z)); + d3_geo_centroidPointXYZ(x0, y0, z0); + } + } + function d3_true() { + return true; + } + function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) { + var subject = [], clip = []; + segments.forEach(function(segment) { + if ((n = segment.length - 1) <= 0) return; + var n, p0 = segment[0], p1 = segment[n]; + if (d3_geo_sphericalEqual(p0, p1)) { + listener.lineStart(); + for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]); + listener.lineEnd(); + return; + } + var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false); + a.o = b; + subject.push(a); + clip.push(b); + a = new d3_geo_clipPolygonIntersection(p1, segment, null, false); + b = new d3_geo_clipPolygonIntersection(p1, null, a, true); + a.o = b; + subject.push(a); + clip.push(b); + }); + clip.sort(compare); + d3_geo_clipPolygonLinkCircular(subject); + d3_geo_clipPolygonLinkCircular(clip); + if (!subject.length) return; + for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) { + clip[i].e = entry = !entry; + } + var start = subject[0], points, point; + while (1) { + var current = start, isSubject = true; + while (current.v) if ((current = current.n) === start) return; + points = current.z; + listener.lineStart(); + do { + current.v = current.o.v = true; + if (current.e) { + if (isSubject) { + for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]); + } else { + interpolate(current.x, current.n.x, 1, listener); + } + current = current.n; + } else { + if (isSubject) { + points = current.p.z; + for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]); + } else { + interpolate(current.x, current.p.x, -1, listener); + } + current = current.p; + } + current = current.o; + points = current.z; + isSubject = !isSubject; + } while (!current.v); + listener.lineEnd(); + } + } + function d3_geo_clipPolygonLinkCircular(array) { + if (!(n = array.length)) return; + var n, i = 0, a = array[0], b; + while (++i < n) { + a.n = b = array[i]; + b.p = a; + a = b; + } + a.n = b = array[0]; + b.p = a; + } + function d3_geo_clipPolygonIntersection(point, points, other, entry) { + this.x = point; + this.z = points; + this.o = other; + this.e = entry; + this.v = false; + this.n = this.p = null; + } + function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) { + return function(rotate, listener) { + var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]); + var clip = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + clip.point = pointRing; + clip.lineStart = ringStart; + clip.lineEnd = ringEnd; + segments = []; + polygon = []; + }, + polygonEnd: function() { + clip.point = point; + clip.lineStart = lineStart; + clip.lineEnd = lineEnd; + segments = d3.merge(segments); + var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon); + if (segments.length) { + if (!polygonStarted) listener.polygonStart(), polygonStarted = true; + d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener); + } else if (clipStartInside) { + if (!polygonStarted) listener.polygonStart(), polygonStarted = true; + listener.lineStart(); + interpolate(null, null, 1, listener); + listener.lineEnd(); + } + if (polygonStarted) listener.polygonEnd(), polygonStarted = false; + segments = polygon = null; + }, + sphere: function() { + listener.polygonStart(); + listener.lineStart(); + interpolate(null, null, 1, listener); + listener.lineEnd(); + listener.polygonEnd(); + } + }; + function point(λ, φ) { + var point = rotate(λ, φ); + if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ); + } + function pointLine(λ, φ) { + var point = rotate(λ, φ); + line.point(point[0], point[1]); + } + function lineStart() { + clip.point = pointLine; + line.lineStart(); + } + function lineEnd() { + clip.point = point; + line.lineEnd(); + } + var segments; + var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring; + function pointRing(λ, φ) { + ring.push([ λ, φ ]); + var point = rotate(λ, φ); + ringListener.point(point[0], point[1]); + } + function ringStart() { + ringListener.lineStart(); + ring = []; + } + function ringEnd() { + pointRing(ring[0][0], ring[0][1]); + ringListener.lineEnd(); + var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length; + ring.pop(); + polygon.push(ring); + ring = null; + if (!n) return; + if (clean & 1) { + segment = ringSegments[0]; + var n = segment.length - 1, i = -1, point; + if (n > 0) { + if (!polygonStarted) listener.polygonStart(), polygonStarted = true; + listener.lineStart(); + while (++i < n) listener.point((point = segment[i])[0], point[1]); + listener.lineEnd(); + } + return; + } + if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); + segments.push(ringSegments.filter(d3_geo_clipSegmentLength1)); + } + return clip; + }; + } + function d3_geo_clipSegmentLength1(segment) { + return segment.length > 1; + } + function d3_geo_clipBufferListener() { + var lines = [], line; + return { + lineStart: function() { + lines.push(line = []); + }, + point: function(λ, φ) { + line.push([ λ, φ ]); + }, + lineEnd: d3_noop, + buffer: function() { + var buffer = lines; + lines = []; + line = null; + return buffer; + }, + rejoin: function() { + if (lines.length > 1) lines.push(lines.pop().concat(lines.shift())); + } + }; + } + function d3_geo_clipSort(a, b) { + return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]); + } + var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]); + function d3_geo_clipAntimeridianLine(listener) { + var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean; + return { + lineStart: function() { + listener.lineStart(); + clean = 1; + }, + point: function(λ1, φ1) { + var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0); + if (abs(dλ - π) < ε) { + listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ); + listener.point(sλ0, φ0); + listener.lineEnd(); + listener.lineStart(); + listener.point(sλ1, φ0); + listener.point(λ1, φ0); + clean = 0; + } else if (sλ0 !== sλ1 && dλ >= π) { + if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε; + if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε; + φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1); + listener.point(sλ0, φ0); + listener.lineEnd(); + listener.lineStart(); + listener.point(sλ1, φ0); + clean = 0; + } + listener.point(λ0 = λ1, φ0 = φ1); + sλ0 = sλ1; + }, + lineEnd: function() { + listener.lineEnd(); + λ0 = φ0 = NaN; + }, + clean: function() { + return 2 - clean; + } + }; + } + function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) { + var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1); + return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2; + } + function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) { + var φ; + if (from == null) { + φ = direction * halfπ; + listener.point(-π, φ); + listener.point(0, φ); + listener.point(π, φ); + listener.point(π, 0); + listener.point(π, -φ); + listener.point(0, -φ); + listener.point(-π, -φ); + listener.point(-π, 0); + listener.point(-π, φ); + } else if (abs(from[0] - to[0]) > ε) { + var s = from[0] < to[0] ? π : -π; + φ = direction * s / 2; + listener.point(-s, φ); + listener.point(0, φ); + listener.point(s, φ); + } else { + listener.point(to[0], to[1]); + } + } + function d3_geo_pointInPolygon(point, polygon) { + var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0; + d3_geo_areaRingSum.reset(); + for (var i = 0, n = polygon.length; i < n; ++i) { + var ring = polygon[i], m = ring.length; + if (!m) continue; + var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1; + while (true) { + if (j === m) j = 0; + point = ring[j]; + var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ; + d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ))); + polarAngle += antimeridian ? dλ + sdλ * τ : dλ; + if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) { + var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point)); + d3_geo_cartesianNormalize(arc); + var intersection = d3_geo_cartesianCross(meridianNormal, arc); + d3_geo_cartesianNormalize(intersection); + var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]); + if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) { + winding += antimeridian ^ dλ >= 0 ? 1 : -1; + } + } + if (!j++) break; + λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point; + } + } + return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1; + } + function d3_geo_clipCircle(radius) { + var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians); + return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]); + function visible(λ, φ) { + return Math.cos(λ) * Math.cos(φ) > cr; + } + function clipLine(listener) { + var point0, c0, v0, v00, clean; + return { + lineStart: function() { + v00 = v0 = false; + clean = 1; + }, + point: function(λ, φ) { + var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0; + if (!point0 && (v00 = v0 = v)) listener.lineStart(); + if (v !== v0) { + point2 = intersect(point0, point1); + if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) { + point1[0] += ε; + point1[1] += ε; + v = visible(point1[0], point1[1]); + } + } + if (v !== v0) { + clean = 0; + if (v) { + listener.lineStart(); + point2 = intersect(point1, point0); + listener.point(point2[0], point2[1]); + } else { + point2 = intersect(point0, point1); + listener.point(point2[0], point2[1]); + listener.lineEnd(); + } + point0 = point2; + } else if (notHemisphere && point0 && smallRadius ^ v) { + var t; + if (!(c & c0) && (t = intersect(point1, point0, true))) { + clean = 0; + if (smallRadius) { + listener.lineStart(); + listener.point(t[0][0], t[0][1]); + listener.point(t[1][0], t[1][1]); + listener.lineEnd(); + } else { + listener.point(t[1][0], t[1][1]); + listener.lineEnd(); + listener.lineStart(); + listener.point(t[0][0], t[0][1]); + } + } + } + if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) { + listener.point(point1[0], point1[1]); + } + point0 = point1, v0 = v, c0 = c; + }, + lineEnd: function() { + if (v0) listener.lineEnd(); + point0 = null; + }, + clean: function() { + return clean | (v00 && v0) << 1; + } + }; + } + function intersect(a, b, two) { + var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b); + var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2; + if (!determinant) return !two && a; + var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2); + d3_geo_cartesianAdd(A, B); + var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1); + if (t2 < 0) return; + var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu); + d3_geo_cartesianAdd(q, A); + q = d3_geo_spherical(q); + if (!two) return q; + var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z; + if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z; + var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε; + if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z; + if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) { + var q1 = d3_geo_cartesianScale(u, (-w + t) / uu); + d3_geo_cartesianAdd(q1, A); + return [ q, d3_geo_spherical(q1) ]; + } + } + function code(λ, φ) { + var r = smallRadius ? radius : π - radius, code = 0; + if (λ < -r) code |= 1; else if (λ > r) code |= 2; + if (φ < -r) code |= 4; else if (φ > r) code |= 8; + return code; + } + } + function d3_geom_clipLine(x0, y0, x1, y1) { + return function(line) { + var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r; + r = x0 - ax; + if (!dx && r > 0) return; + r /= dx; + if (dx < 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } else if (dx > 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } + r = x1 - ax; + if (!dx && r < 0) return; + r /= dx; + if (dx < 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } else if (dx > 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } + r = y0 - ay; + if (!dy && r > 0) return; + r /= dy; + if (dy < 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } else if (dy > 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } + r = y1 - ay; + if (!dy && r < 0) return; + r /= dy; + if (dy < 0) { + if (r > t1) return; + if (r > t0) t0 = r; + } else if (dy > 0) { + if (r < t0) return; + if (r < t1) t1 = r; + } + if (t0 > 0) line.a = { + x: ax + t0 * dx, + y: ay + t0 * dy + }; + if (t1 < 1) line.b = { + x: ax + t1 * dx, + y: ay + t1 * dy + }; + return line; + }; + } + var d3_geo_clipExtentMAX = 1e9; + d3.geo.clipExtent = function() { + var x0, y0, x1, y1, stream, clip, clipExtent = { + stream: function(output) { + if (stream) stream.valid = false; + stream = clip(output); + stream.valid = true; + return stream; + }, + extent: function(_) { + if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; + clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]); + if (stream) stream.valid = false, stream = null; + return clipExtent; + } + }; + return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]); + }; + function d3_geo_clipExtent(x0, y0, x1, y1) { + return function(listener) { + var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring; + var clip = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + listener = bufferListener; + segments = []; + polygon = []; + clean = true; + }, + polygonEnd: function() { + listener = listener_; + segments = d3.merge(segments); + var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length; + if (inside || visible) { + listener.polygonStart(); + if (inside) { + listener.lineStart(); + interpolate(null, null, 1, listener); + listener.lineEnd(); + } + if (visible) { + d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener); + } + listener.polygonEnd(); + } + segments = polygon = ring = null; + } + }; + function insidePolygon(p) { + var wn = 0, n = polygon.length, y = p[1]; + for (var i = 0; i < n; ++i) { + for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) { + b = v[j]; + if (a[1] <= y) { + if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn; + } else { + if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn; + } + a = b; + } + } + return wn !== 0; + } + function interpolate(from, to, direction, listener) { + var a = 0, a1 = 0; + if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) { + do { + listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0); + } while ((a = (a + direction + 4) % 4) !== a1); + } else { + listener.point(to[0], to[1]); + } + } + function pointVisible(x, y) { + return x0 <= x && x <= x1 && y0 <= y && y <= y1; + } + function point(x, y) { + if (pointVisible(x, y)) listener.point(x, y); + } + var x__, y__, v__, x_, y_, v_, first, clean; + function lineStart() { + clip.point = linePoint; + if (polygon) polygon.push(ring = []); + first = true; + v_ = false; + x_ = y_ = NaN; + } + function lineEnd() { + if (segments) { + linePoint(x__, y__); + if (v__ && v_) bufferListener.rejoin(); + segments.push(bufferListener.buffer()); + } + clip.point = point; + if (v_) listener.lineEnd(); + } + function linePoint(x, y) { + x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x)); + y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y)); + var v = pointVisible(x, y); + if (polygon) ring.push([ x, y ]); + if (first) { + x__ = x, y__ = y, v__ = v; + first = false; + if (v) { + listener.lineStart(); + listener.point(x, y); + } + } else { + if (v && v_) listener.point(x, y); else { + var l = { + a: { + x: x_, + y: y_ + }, + b: { + x: x, + y: y + } + }; + if (clipLine(l)) { + if (!v_) { + listener.lineStart(); + listener.point(l.a.x, l.a.y); + } + listener.point(l.b.x, l.b.y); + if (!v) listener.lineEnd(); + clean = false; + } else if (v) { + listener.lineStart(); + listener.point(x, y); + clean = false; + } + } + } + x_ = x, y_ = y, v_ = v; + } + return clip; + }; + function corner(p, direction) { + return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2; + } + function compare(a, b) { + return comparePoints(a.x, b.x); + } + function comparePoints(a, b) { + var ca = corner(a, 1), cb = corner(b, 1); + return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0]; + } + } + function d3_geo_compose(a, b) { + function compose(x, y) { + return x = a(x, y), b(x[0], x[1]); + } + if (a.invert && b.invert) compose.invert = function(x, y) { + return x = b.invert(x, y), x && a.invert(x[0], x[1]); + }; + return compose; + } + function d3_geo_conic(projectAt) { + var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1); + p.parallels = function(_) { + if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ]; + return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180); + }; + return p; + } + function d3_geo_conicEqualArea(φ0, φ1) { + var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n; + function forward(λ, φ) { + var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n; + return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ]; + } + forward.invert = function(x, y) { + var ρ0_y = ρ0 - y; + return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ]; + }; + return forward; + } + (d3.geo.conicEqualArea = function() { + return d3_geo_conic(d3_geo_conicEqualArea); + }).raw = d3_geo_conicEqualArea; + d3.geo.albers = function() { + return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070); + }; + d3.geo.albersUsa = function() { + var lower48 = d3.geo.albers(); + var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]); + var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]); + var point, pointStream = { + point: function(x, y) { + point = [ x, y ]; + } + }, lower48Point, alaskaPoint, hawaiiPoint; + function albersUsa(coordinates) { + var x = coordinates[0], y = coordinates[1]; + point = null; + (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y); + return point; + } + albersUsa.invert = function(coordinates) { + var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k; + return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates); + }; + albersUsa.stream = function(stream) { + var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream); + return { + point: function(x, y) { + lower48Stream.point(x, y); + alaskaStream.point(x, y); + hawaiiStream.point(x, y); + }, + sphere: function() { + lower48Stream.sphere(); + alaskaStream.sphere(); + hawaiiStream.sphere(); + }, + lineStart: function() { + lower48Stream.lineStart(); + alaskaStream.lineStart(); + hawaiiStream.lineStart(); + }, + lineEnd: function() { + lower48Stream.lineEnd(); + alaskaStream.lineEnd(); + hawaiiStream.lineEnd(); + }, + polygonStart: function() { + lower48Stream.polygonStart(); + alaskaStream.polygonStart(); + hawaiiStream.polygonStart(); + }, + polygonEnd: function() { + lower48Stream.polygonEnd(); + alaskaStream.polygonEnd(); + hawaiiStream.polygonEnd(); + } + }; + }; + albersUsa.precision = function(_) { + if (!arguments.length) return lower48.precision(); + lower48.precision(_); + alaska.precision(_); + hawaii.precision(_); + return albersUsa; + }; + albersUsa.scale = function(_) { + if (!arguments.length) return lower48.scale(); + lower48.scale(_); + alaska.scale(_ * .35); + hawaii.scale(_); + return albersUsa.translate(lower48.translate()); + }; + albersUsa.translate = function(_) { + if (!arguments.length) return lower48.translate(); + var k = lower48.scale(), x = +_[0], y = +_[1]; + lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point; + alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; + hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; + return albersUsa; + }; + return albersUsa.scale(1070); + }; + var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = { + point: d3_noop, + lineStart: d3_noop, + lineEnd: d3_noop, + polygonStart: function() { + d3_geo_pathAreaPolygon = 0; + d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart; + }, + polygonEnd: function() { + d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop; + d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2); + } + }; + function d3_geo_pathAreaRingStart() { + var x00, y00, x0, y0; + d3_geo_pathArea.point = function(x, y) { + d3_geo_pathArea.point = nextPoint; + x00 = x0 = x, y00 = y0 = y; + }; + function nextPoint(x, y) { + d3_geo_pathAreaPolygon += y0 * x - x0 * y; + x0 = x, y0 = y; + } + d3_geo_pathArea.lineEnd = function() { + nextPoint(x00, y00); + }; + } + var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1; + var d3_geo_pathBounds = { + point: d3_geo_pathBoundsPoint, + lineStart: d3_noop, + lineEnd: d3_noop, + polygonStart: d3_noop, + polygonEnd: d3_noop + }; + function d3_geo_pathBoundsPoint(x, y) { + if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x; + if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x; + if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y; + if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y; + } + function d3_geo_pathBuffer() { + var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = []; + var stream = { + point: point, + lineStart: function() { + stream.point = pointLineStart; + }, + lineEnd: lineEnd, + polygonStart: function() { + stream.lineEnd = lineEndPolygon; + }, + polygonEnd: function() { + stream.lineEnd = lineEnd; + stream.point = point; + }, + pointRadius: function(_) { + pointCircle = d3_geo_pathBufferCircle(_); + return stream; + }, + result: function() { + if (buffer.length) { + var result = buffer.join(""); + buffer = []; + return result; + } + } + }; + function point(x, y) { + buffer.push("M", x, ",", y, pointCircle); + } + function pointLineStart(x, y) { + buffer.push("M", x, ",", y); + stream.point = pointLine; + } + function pointLine(x, y) { + buffer.push("L", x, ",", y); + } + function lineEnd() { + stream.point = point; + } + function lineEndPolygon() { + buffer.push("Z"); + } + return stream; + } + function d3_geo_pathBufferCircle(radius) { + return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z"; + } + var d3_geo_pathCentroid = { + point: d3_geo_pathCentroidPoint, + lineStart: d3_geo_pathCentroidLineStart, + lineEnd: d3_geo_pathCentroidLineEnd, + polygonStart: function() { + d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart; + }, + polygonEnd: function() { + d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; + d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart; + d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd; + } + }; + function d3_geo_pathCentroidPoint(x, y) { + d3_geo_centroidX0 += x; + d3_geo_centroidY0 += y; + ++d3_geo_centroidZ0; + } + function d3_geo_pathCentroidLineStart() { + var x0, y0; + d3_geo_pathCentroid.point = function(x, y) { + d3_geo_pathCentroid.point = nextPoint; + d3_geo_pathCentroidPoint(x0 = x, y0 = y); + }; + function nextPoint(x, y) { + var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); + d3_geo_centroidX1 += z * (x0 + x) / 2; + d3_geo_centroidY1 += z * (y0 + y) / 2; + d3_geo_centroidZ1 += z; + d3_geo_pathCentroidPoint(x0 = x, y0 = y); + } + } + function d3_geo_pathCentroidLineEnd() { + d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; + } + function d3_geo_pathCentroidRingStart() { + var x00, y00, x0, y0; + d3_geo_pathCentroid.point = function(x, y) { + d3_geo_pathCentroid.point = nextPoint; + d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y); + }; + function nextPoint(x, y) { + var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); + d3_geo_centroidX1 += z * (x0 + x) / 2; + d3_geo_centroidY1 += z * (y0 + y) / 2; + d3_geo_centroidZ1 += z; + z = y0 * x - x0 * y; + d3_geo_centroidX2 += z * (x0 + x); + d3_geo_centroidY2 += z * (y0 + y); + d3_geo_centroidZ2 += z * 3; + d3_geo_pathCentroidPoint(x0 = x, y0 = y); + } + d3_geo_pathCentroid.lineEnd = function() { + nextPoint(x00, y00); + }; + } + function d3_geo_pathContext(context) { + var pointRadius = 4.5; + var stream = { + point: point, + lineStart: function() { + stream.point = pointLineStart; + }, + lineEnd: lineEnd, + polygonStart: function() { + stream.lineEnd = lineEndPolygon; + }, + polygonEnd: function() { + stream.lineEnd = lineEnd; + stream.point = point; + }, + pointRadius: function(_) { + pointRadius = _; + return stream; + }, + result: d3_noop + }; + function point(x, y) { + context.moveTo(x, y); + context.arc(x, y, pointRadius, 0, τ); + } + function pointLineStart(x, y) { + context.moveTo(x, y); + stream.point = pointLine; + } + function pointLine(x, y) { + context.lineTo(x, y); + } + function lineEnd() { + stream.point = point; + } + function lineEndPolygon() { + context.closePath(); + } + return stream; + } + function d3_geo_resample(project) { + var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16; + function resample(stream) { + return (maxDepth ? resampleRecursive : resampleNone)(stream); + } + function resampleNone(stream) { + return d3_geo_transformPoint(stream, function(x, y) { + x = project(x, y); + stream.point(x[0], x[1]); + }); + } + function resampleRecursive(stream) { + var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0; + var resample = { + point: point, + lineStart: lineStart, + lineEnd: lineEnd, + polygonStart: function() { + stream.polygonStart(); + resample.lineStart = ringStart; + }, + polygonEnd: function() { + stream.polygonEnd(); + resample.lineStart = lineStart; + } + }; + function point(x, y) { + x = project(x, y); + stream.point(x[0], x[1]); + } + function lineStart() { + x0 = NaN; + resample.point = linePoint; + stream.lineStart(); + } + function linePoint(λ, φ) { + var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ); + resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream); + stream.point(x0, y0); + } + function lineEnd() { + resample.point = point; + stream.lineEnd(); + } + function ringStart() { + lineStart(); + resample.point = ringPoint; + resample.lineEnd = ringEnd; + } + function ringPoint(λ, φ) { + linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0; + resample.point = linePoint; + } + function ringEnd() { + resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream); + resample.lineEnd = lineEnd; + lineEnd(); + } + return resample; + } + function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) { + var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy; + if (d2 > 4 * δ2 && depth--) { + var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2; + if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { + resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream); + stream.point(x2, y2); + resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream); + } + } + } + resample.precision = function(_) { + if (!arguments.length) return Math.sqrt(δ2); + maxDepth = (δ2 = _ * _) > 0 && 16; + return resample; + }; + return resample; + } + d3.geo.path = function() { + var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream; + function path(object) { + if (object) { + if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments)); + if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream); + d3.geo.stream(object, cacheStream); + } + return contextStream.result(); + } + path.area = function(object) { + d3_geo_pathAreaSum = 0; + d3.geo.stream(object, projectStream(d3_geo_pathArea)); + return d3_geo_pathAreaSum; + }; + path.centroid = function(object) { + d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; + d3.geo.stream(object, projectStream(d3_geo_pathCentroid)); + return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ]; + }; + path.bounds = function(object) { + d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity); + d3.geo.stream(object, projectStream(d3_geo_pathBounds)); + return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ]; + }; + path.projection = function(_) { + if (!arguments.length) return projection; + projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity; + return reset(); + }; + path.context = function(_) { + if (!arguments.length) return context; + contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_); + if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius); + return reset(); + }; + path.pointRadius = function(_) { + if (!arguments.length) return pointRadius; + pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_); + return path; + }; + function reset() { + cacheStream = null; + return path; + } + return path.projection(d3.geo.albersUsa()).context(null); + }; + function d3_geo_pathProjectStream(project) { + var resample = d3_geo_resample(function(x, y) { + return project([ x * d3_degrees, y * d3_degrees ]); + }); + return function(stream) { + return d3_geo_projectionRadians(resample(stream)); + }; + } + d3.geo.transform = function(methods) { + return { + stream: function(stream) { + var transform = new d3_geo_transform(stream); + for (var k in methods) transform[k] = methods[k]; + return transform; + } + }; + }; + function d3_geo_transform(stream) { + this.stream = stream; + } + d3_geo_transform.prototype = { + point: function(x, y) { + this.stream.point(x, y); + }, + 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(); + } + }; + function d3_geo_transformPoint(stream, point) { + return { + point: point, + sphere: function() { + stream.sphere(); + }, + lineStart: function() { + stream.lineStart(); + }, + lineEnd: function() { + stream.lineEnd(); + }, + polygonStart: function() { + stream.polygonStart(); + }, + polygonEnd: function() { + stream.polygonEnd(); + } + }; + } + d3.geo.projection = d3_geo_projection; + d3.geo.projectionMutator = d3_geo_projectionMutator; + function d3_geo_projection(project) { + return d3_geo_projectionMutator(function() { + return project; + })(); + } + function d3_geo_projectionMutator(projectAt) { + var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) { + x = project(x, y); + return [ x[0] * k + δx, δy - x[1] * k ]; + }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream; + function projection(point) { + point = projectRotate(point[0] * d3_radians, point[1] * d3_radians); + return [ point[0] * k + δx, δy - point[1] * k ]; + } + function invert(point) { + point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k); + return point && [ point[0] * d3_degrees, point[1] * d3_degrees ]; + } + projection.stream = function(output) { + if (stream) stream.valid = false; + stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output)))); + stream.valid = true; + return stream; + }; + projection.clipAngle = function(_) { + if (!arguments.length) return clipAngle; + preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians); + return invalidate(); + }; + projection.clipExtent = function(_) { + if (!arguments.length) return clipExtent; + clipExtent = _; + postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity; + return invalidate(); + }; + projection.scale = function(_) { + if (!arguments.length) return k; + k = +_; + return reset(); + }; + projection.translate = function(_) { + if (!arguments.length) return [ x, y ]; + x = +_[0]; + y = +_[1]; + return reset(); + }; + projection.center = function(_) { + if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ]; + λ = _[0] % 360 * d3_radians; + φ = _[1] % 360 * d3_radians; + return reset(); + }; + projection.rotate = function(_) { + if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ]; + δλ = _[0] % 360 * d3_radians; + δφ = _[1] % 360 * d3_radians; + δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0; + return reset(); + }; + d3.rebind(projection, projectResample, "precision"); + function reset() { + projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project); + var center = project(λ, φ); + δx = x - center[0] * k; + δy = y + center[1] * k; + return invalidate(); + } + function invalidate() { + if (stream) stream.valid = false, stream = null; + return projection; + } + return function() { + project = projectAt.apply(this, arguments); + projection.invert = project.invert && invert; + return reset(); + }; + } + function d3_geo_projectionRadians(stream) { + return d3_geo_transformPoint(stream, function(x, y) { + stream.point(x * d3_radians, y * d3_radians); + }); + } + function d3_geo_equirectangular(λ, φ) { + return [ λ, φ ]; + } + (d3.geo.equirectangular = function() { + return d3_geo_projection(d3_geo_equirectangular); + }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular; + d3.geo.rotation = function(rotate) { + rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0); + function forward(coordinates) { + coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians); + return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; + } + forward.invert = function(coordinates) { + coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians); + return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; + }; + return forward; + }; + function d3_geo_identityRotation(λ, φ) { + return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ]; + } + d3_geo_identityRotation.invert = d3_geo_equirectangular; + function d3_geo_rotation(δλ, δφ, δγ) { + return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation; + } + function d3_geo_forwardRotationλ(δλ) { + return function(λ, φ) { + return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ]; + }; + } + function d3_geo_rotationλ(δλ) { + var rotation = d3_geo_forwardRotationλ(δλ); + rotation.invert = d3_geo_forwardRotationλ(-δλ); + return rotation; + } + function d3_geo_rotationφγ(δφ, δγ) { + var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ); + function rotation(λ, φ) { + var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ; + return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ]; + } + rotation.invert = function(λ, φ) { + var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ; + return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ]; + }; + return rotation; + } + d3.geo.circle = function() { + var origin = [ 0, 0 ], angle, precision = 6, interpolate; + function circle() { + var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = []; + interpolate(null, null, 1, { + point: function(x, y) { + ring.push(x = rotate(x, y)); + x[0] *= d3_degrees, x[1] *= d3_degrees; + } + }); + return { + type: "Polygon", + coordinates: [ ring ] + }; + } + circle.origin = function(x) { + if (!arguments.length) return origin; + origin = x; + return circle; + }; + circle.angle = function(x) { + if (!arguments.length) return angle; + interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians); + return circle; + }; + circle.precision = function(_) { + if (!arguments.length) return precision; + interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians); + return circle; + }; + return circle.angle(90); + }; + function d3_geo_circleInterpolate(radius, precision) { + var cr = Math.cos(radius), sr = Math.sin(radius); + return function(from, to, direction, listener) { + var step = direction * precision; + if (from != null) { + from = d3_geo_circleAngle(cr, from); + to = d3_geo_circleAngle(cr, to); + if (direction > 0 ? from < to : from > to) from += direction * τ; + } else { + from = radius + direction * τ; + to = radius - .5 * step; + } + for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) { + listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]); + } + }; + } + function d3_geo_circleAngle(cr, point) { + var a = d3_geo_cartesian(point); + a[0] -= cr; + d3_geo_cartesianNormalize(a); + var angle = d3_acos(-a[1]); + return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI); + } + d3.geo.distance = function(a, b) { + var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t; + return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ); + }; + d3.geo.graticule = function() { + var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5; + function graticule() { + return { + type: "MultiLineString", + coordinates: lines() + }; + } + function lines() { + return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) { + return abs(x % DX) > ε; + }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) { + return abs(y % DY) > ε; + }).map(y)); + } + graticule.lines = function() { + return lines().map(function(coordinates) { + return { + type: "LineString", + coordinates: coordinates + }; + }); + }; + graticule.outline = function() { + return { + type: "Polygon", + coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ] + }; + }; + graticule.extent = function(_) { + if (!arguments.length) return graticule.minorExtent(); + return graticule.majorExtent(_).minorExtent(_); + }; + graticule.majorExtent = function(_) { + if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ]; + X0 = +_[0][0], X1 = +_[1][0]; + Y0 = +_[0][1], Y1 = +_[1][1]; + if (X0 > X1) _ = X0, X0 = X1, X1 = _; + if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _; + return graticule.precision(precision); + }; + graticule.minorExtent = function(_) { + if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; + x0 = +_[0][0], x1 = +_[1][0]; + y0 = +_[0][1], y1 = +_[1][1]; + if (x0 > x1) _ = x0, x0 = x1, x1 = _; + if (y0 > y1) _ = y0, y0 = y1, y1 = _; + return graticule.precision(precision); + }; + graticule.step = function(_) { + if (!arguments.length) return graticule.minorStep(); + return graticule.majorStep(_).minorStep(_); + }; + graticule.majorStep = function(_) { + if (!arguments.length) return [ DX, DY ]; + DX = +_[0], DY = +_[1]; + return graticule; + }; + graticule.minorStep = function(_) { + if (!arguments.length) return [ dx, dy ]; + dx = +_[0], dy = +_[1]; + return graticule; + }; + graticule.precision = function(_) { + if (!arguments.length) return precision; + precision = +_; + x = d3_geo_graticuleX(y0, y1, 90); + y = d3_geo_graticuleY(x0, x1, precision); + X = d3_geo_graticuleX(Y0, Y1, 90); + Y = d3_geo_graticuleY(X0, X1, precision); + return graticule; + }; + return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]); + }; + function d3_geo_graticuleX(y0, y1, dy) { + var y = d3.range(y0, y1 - ε, dy).concat(y1); + return function(x) { + return y.map(function(y) { + return [ x, y ]; + }); + }; + } + function d3_geo_graticuleY(x0, x1, dx) { + var x = d3.range(x0, x1 - ε, dx).concat(x1); + return function(y) { + return x.map(function(x) { + return [ x, y ]; + }); + }; + } + function d3_source(d) { + return d.source; + } + function d3_target(d) { + return d.target; + } + d3.geo.greatArc = function() { + var source = d3_source, source_, target = d3_target, target_; + function greatArc() { + return { + type: "LineString", + coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ] + }; + } + greatArc.distance = function() { + return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments)); + }; + greatArc.source = function(_) { + if (!arguments.length) return source; + source = _, source_ = typeof _ === "function" ? null : _; + return greatArc; + }; + greatArc.target = function(_) { + if (!arguments.length) return target; + target = _, target_ = typeof _ === "function" ? null : _; + return greatArc; + }; + greatArc.precision = function() { + return arguments.length ? greatArc : 0; + }; + return greatArc; + }; + d3.geo.interpolate = function(source, target) { + return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians); + }; + function d3_geo_interpolate(x0, y0, x1, y1) { + var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d); + var interpolate = d ? function(t) { + var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1; + return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ]; + } : function() { + return [ x0 * d3_degrees, y0 * d3_degrees ]; + }; + interpolate.distance = d; + return interpolate; + } + d3.geo.length = function(object) { + d3_geo_lengthSum = 0; + d3.geo.stream(object, d3_geo_length); + return d3_geo_lengthSum; + }; + var d3_geo_lengthSum; + var d3_geo_length = { + sphere: d3_noop, + point: d3_noop, + lineStart: d3_geo_lengthLineStart, + lineEnd: d3_noop, + polygonStart: d3_noop, + polygonEnd: d3_noop + }; + function d3_geo_lengthLineStart() { + var λ0, sinφ0, cosφ0; + d3_geo_length.point = function(λ, φ) { + λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ); + d3_geo_length.point = nextPoint; + }; + d3_geo_length.lineEnd = function() { + d3_geo_length.point = d3_geo_length.lineEnd = d3_noop; + }; + function nextPoint(λ, φ) { + var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t); + d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ); + λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ; + } + } + function d3_geo_azimuthal(scale, angle) { + function azimuthal(λ, φ) { + var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ); + return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ]; + } + azimuthal.invert = function(x, y) { + var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c); + return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ]; + }; + return azimuthal; + } + var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) { + return Math.sqrt(2 / (1 + cosλcosφ)); + }, function(ρ) { + return 2 * Math.asin(ρ / 2); + }); + (d3.geo.azimuthalEqualArea = function() { + return d3_geo_projection(d3_geo_azimuthalEqualArea); + }).raw = d3_geo_azimuthalEqualArea; + var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) { + var c = Math.acos(cosλcosφ); + return c && c / Math.sin(c); + }, d3_identity); + (d3.geo.azimuthalEquidistant = function() { + return d3_geo_projection(d3_geo_azimuthalEquidistant); + }).raw = d3_geo_azimuthalEquidistant; + function d3_geo_conicConformal(φ0, φ1) { + var cosφ0 = Math.cos(φ0), t = function(φ) { + return Math.tan(π / 4 + φ / 2); + }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n; + if (!n) return d3_geo_mercator; + function forward(λ, φ) { + if (F > 0) { + if (φ < -halfπ + ε) φ = -halfπ + ε; + } else { + if (φ > halfπ - ε) φ = halfπ - ε; + } + var ρ = F / Math.pow(t(φ), n); + return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ]; + } + forward.invert = function(x, y) { + var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y); + return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ]; + }; + return forward; + } + (d3.geo.conicConformal = function() { + return d3_geo_conic(d3_geo_conicConformal); + }).raw = d3_geo_conicConformal; + function d3_geo_conicEquidistant(φ0, φ1) { + var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0; + if (abs(n) < ε) return d3_geo_equirectangular; + function forward(λ, φ) { + var ρ = G - φ; + return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ]; + } + forward.invert = function(x, y) { + var ρ0_y = G - y; + return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ]; + }; + return forward; + } + (d3.geo.conicEquidistant = function() { + return d3_geo_conic(d3_geo_conicEquidistant); + }).raw = d3_geo_conicEquidistant; + var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) { + return 1 / cosλcosφ; + }, Math.atan); + (d3.geo.gnomonic = function() { + return d3_geo_projection(d3_geo_gnomonic); + }).raw = d3_geo_gnomonic; + function d3_geo_mercator(λ, φ) { + return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ]; + } + d3_geo_mercator.invert = function(x, y) { + return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ]; + }; + function d3_geo_mercatorProjection(project) { + var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto; + m.scale = function() { + var v = scale.apply(m, arguments); + return v === m ? clipAuto ? m.clipExtent(null) : m : v; + }; + m.translate = function() { + var v = translate.apply(m, arguments); + return v === m ? clipAuto ? m.clipExtent(null) : m : v; + }; + m.clipExtent = function(_) { + var v = clipExtent.apply(m, arguments); + if (v === m) { + if (clipAuto = _ == null) { + var k = π * scale(), t = translate(); + clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]); + } + } else if (clipAuto) { + v = null; + } + return v; + }; + return m.clipExtent(null); + } + (d3.geo.mercator = function() { + return d3_geo_mercatorProjection(d3_geo_mercator); + }).raw = d3_geo_mercator; + var d3_geo_orthographic = d3_geo_azimuthal(function() { + return 1; + }, Math.asin); + (d3.geo.orthographic = function() { + return d3_geo_projection(d3_geo_orthographic); + }).raw = d3_geo_orthographic; + var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) { + return 1 / (1 + cosλcosφ); + }, function(ρ) { + return 2 * Math.atan(ρ); + }); + (d3.geo.stereographic = function() { + return d3_geo_projection(d3_geo_stereographic); + }).raw = d3_geo_stereographic; + function d3_geo_transverseMercator(λ, φ) { + return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ]; + } + d3_geo_transverseMercator.invert = function(x, y) { + return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ]; + }; + (d3.geo.transverseMercator = function() { + var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate; + projection.center = function(_) { + return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]); + }; + projection.rotate = function(_) { + return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), + [ _[0], _[1], _[2] - 90 ]); + }; + return rotate([ 0, 0, 90 ]); + }).raw = d3_geo_transverseMercator; + d3.geom = {}; + function d3_geom_pointX(d) { + return d[0]; + } + function d3_geom_pointY(d) { + return d[1]; + } + d3.geom.hull = function(vertices) { + var x = d3_geom_pointX, y = d3_geom_pointY; + if (arguments.length) return hull(vertices); + function hull(data) { + if (data.length < 3) return []; + var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = []; + for (i = 0; i < n; i++) { + points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]); + } + points.sort(d3_geom_hullOrder); + for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]); + var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints); + var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = []; + for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]); + for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]); + return polygon; + } + hull.x = function(_) { + return arguments.length ? (x = _, hull) : x; + }; + hull.y = function(_) { + return arguments.length ? (y = _, hull) : y; + }; + return hull; + }; + function d3_geom_hullUpper(points) { + var n = points.length, hull = [ 0, 1 ], hs = 2; + for (var i = 2; i < n; i++) { + while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs; + hull[hs++] = i; + } + return hull.slice(0, hs); + } + function d3_geom_hullOrder(a, b) { + return a[0] - b[0] || a[1] - b[1]; + } + d3.geom.polygon = function(coordinates) { + d3_subclass(coordinates, d3_geom_polygonPrototype); + return coordinates; + }; + var d3_geom_polygonPrototype = d3.geom.polygon.prototype = []; + d3_geom_polygonPrototype.area = function() { + var i = -1, n = this.length, a, b = this[n - 1], area = 0; + while (++i < n) { + a = b; + b = this[i]; + area += a[1] * b[0] - a[0] * b[1]; + } + return area * .5; + }; + d3_geom_polygonPrototype.centroid = function(k) { + var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c; + if (!arguments.length) k = -1 / (6 * this.area()); + while (++i < n) { + a = b; + b = this[i]; + c = a[0] * b[1] - b[0] * a[1]; + x += (a[0] + b[0]) * c; + y += (a[1] + b[1]) * c; + } + return [ x * k, y * k ]; + }; + d3_geom_polygonPrototype.clip = function(subject) { + var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d; + while (++i < n) { + input = subject.slice(); + subject.length = 0; + b = this[i]; + c = input[(m = input.length - closed) - 1]; + j = -1; + while (++j < m) { + d = input[j]; + if (d3_geom_polygonInside(d, a, b)) { + if (!d3_geom_polygonInside(c, a, b)) { + subject.push(d3_geom_polygonIntersect(c, d, a, b)); + } + subject.push(d); + } else if (d3_geom_polygonInside(c, a, b)) { + subject.push(d3_geom_polygonIntersect(c, d, a, b)); + } + c = d; + } + if (closed) subject.push(subject[0]); + a = b; + } + return subject; + }; + function d3_geom_polygonInside(p, a, b) { + return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]); + } + function d3_geom_polygonIntersect(c, d, a, b) { + var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21); + return [ x1 + ua * x21, y1 + ua * y21 ]; + } + function d3_geom_polygonClosed(coordinates) { + var a = coordinates[0], b = coordinates[coordinates.length - 1]; + return !(a[0] - b[0] || a[1] - b[1]); + } + var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = []; + function d3_geom_voronoiBeach() { + d3_geom_voronoiRedBlackNode(this); + this.edge = this.site = this.circle = null; + } + function d3_geom_voronoiCreateBeach(site) { + var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach(); + beach.site = site; + return beach; + } + function d3_geom_voronoiDetachBeach(beach) { + d3_geom_voronoiDetachCircle(beach); + d3_geom_voronoiBeaches.remove(beach); + d3_geom_voronoiBeachPool.push(beach); + d3_geom_voronoiRedBlackNode(beach); + } + function d3_geom_voronoiRemoveBeach(beach) { + var circle = beach.circle, x = circle.x, y = circle.cy, vertex = { + x: x, + y: y + }, previous = beach.P, next = beach.N, disappearing = [ beach ]; + d3_geom_voronoiDetachBeach(beach); + var lArc = previous; + while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) { + previous = lArc.P; + disappearing.unshift(lArc); + d3_geom_voronoiDetachBeach(lArc); + lArc = previous; + } + disappearing.unshift(lArc); + d3_geom_voronoiDetachCircle(lArc); + var rArc = next; + while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) { + next = rArc.N; + disappearing.push(rArc); + d3_geom_voronoiDetachBeach(rArc); + rArc = next; + } + disappearing.push(rArc); + d3_geom_voronoiDetachCircle(rArc); + var nArcs = disappearing.length, iArc; + for (iArc = 1; iArc < nArcs; ++iArc) { + rArc = disappearing[iArc]; + lArc = disappearing[iArc - 1]; + d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex); + } + lArc = disappearing[0]; + rArc = disappearing[nArcs - 1]; + rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex); + d3_geom_voronoiAttachCircle(lArc); + d3_geom_voronoiAttachCircle(rArc); + } + function d3_geom_voronoiAddBeach(site) { + var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._; + while (node) { + dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x; + if (dxl > ε) node = node.L; else { + dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix); + if (dxr > ε) { + if (!node.R) { + lArc = node; + break; + } + node = node.R; + } else { + if (dxl > -ε) { + lArc = node.P; + rArc = node; + } else if (dxr > -ε) { + lArc = node; + rArc = node.N; + } else { + lArc = rArc = node; + } + break; + } + } + } + var newArc = d3_geom_voronoiCreateBeach(site); + d3_geom_voronoiBeaches.insert(lArc, newArc); + if (!lArc && !rArc) return; + if (lArc === rArc) { + d3_geom_voronoiDetachCircle(lArc); + rArc = d3_geom_voronoiCreateBeach(lArc.site); + d3_geom_voronoiBeaches.insert(newArc, rArc); + newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site); + d3_geom_voronoiAttachCircle(lArc); + d3_geom_voronoiAttachCircle(rArc); + return; + } + if (!rArc) { + newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site); + return; + } + d3_geom_voronoiDetachCircle(lArc); + d3_geom_voronoiDetachCircle(rArc); + var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = { + x: (cy * hb - by * hc) / d + ax, + y: (bx * hc - cx * hb) / d + ay + }; + d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex); + newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex); + rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex); + d3_geom_voronoiAttachCircle(lArc); + d3_geom_voronoiAttachCircle(rArc); + } + function d3_geom_voronoiLeftBreakPoint(arc, directrix) { + var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix; + if (!pby2) return rfocx; + var lArc = arc.P; + if (!lArc) return -Infinity; + site = lArc.site; + var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix; + if (!plby2) return lfocx; + var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2; + if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx; + return (rfocx + lfocx) / 2; + } + function d3_geom_voronoiRightBreakPoint(arc, directrix) { + var rArc = arc.N; + if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix); + var site = arc.site; + return site.y === directrix ? site.x : Infinity; + } + function d3_geom_voronoiCell(site) { + this.site = site; + this.edges = []; + } + d3_geom_voronoiCell.prototype.prepare = function() { + var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge; + while (iHalfEdge--) { + edge = halfEdges[iHalfEdge].edge; + if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1); + } + halfEdges.sort(d3_geom_voronoiHalfEdgeOrder); + return halfEdges.length; + }; + function d3_geom_voronoiCloseCells(extent) { + var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end; + while (iCell--) { + cell = cells[iCell]; + if (!cell || !cell.prepare()) continue; + halfEdges = cell.edges; + nHalfEdges = halfEdges.length; + iHalfEdge = 0; + while (iHalfEdge < nHalfEdges) { + end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y; + start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y; + if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) { + halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? { + x: x0, + y: abs(x2 - x0) < ε ? y2 : y1 + } : abs(y3 - y1) < ε && x1 - x3 > ε ? { + x: abs(y2 - y1) < ε ? x2 : x1, + y: y1 + } : abs(x3 - x1) < ε && y3 - y0 > ε ? { + x: x1, + y: abs(x2 - x1) < ε ? y2 : y0 + } : abs(y3 - y0) < ε && x3 - x0 > ε ? { + x: abs(y2 - y0) < ε ? x2 : x0, + y: y0 + } : null), cell.site, null)); + ++nHalfEdges; + } + } + } + } + function d3_geom_voronoiHalfEdgeOrder(a, b) { + return b.angle - a.angle; + } + function d3_geom_voronoiCircle() { + d3_geom_voronoiRedBlackNode(this); + this.x = this.y = this.arc = this.site = this.cy = null; + } + function d3_geom_voronoiAttachCircle(arc) { + var lArc = arc.P, rArc = arc.N; + if (!lArc || !rArc) return; + var lSite = lArc.site, cSite = arc.site, rSite = rArc.site; + if (lSite === rSite) return; + var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by; + var d = 2 * (ax * cy - ay * cx); + if (d >= -ε2) return; + var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by; + var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle(); + circle.arc = arc; + circle.site = cSite; + circle.x = x + bx; + circle.y = cy + Math.sqrt(x * x + y * y); + circle.cy = cy; + arc.circle = circle; + var before = null, node = d3_geom_voronoiCircles._; + while (node) { + if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) { + if (node.L) node = node.L; else { + before = node.P; + break; + } + } else { + if (node.R) node = node.R; else { + before = node; + break; + } + } + } + d3_geom_voronoiCircles.insert(before, circle); + if (!before) d3_geom_voronoiFirstCircle = circle; + } + function d3_geom_voronoiDetachCircle(arc) { + var circle = arc.circle; + if (circle) { + if (!circle.P) d3_geom_voronoiFirstCircle = circle.N; + d3_geom_voronoiCircles.remove(circle); + d3_geom_voronoiCirclePool.push(circle); + d3_geom_voronoiRedBlackNode(circle); + arc.circle = null; + } + } + function d3_geom_voronoiClipEdges(extent) { + var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e; + while (i--) { + e = edges[i]; + if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) { + e.a = e.b = null; + edges.splice(i, 1); + } + } + } + function d3_geom_voronoiConnectEdge(edge, extent) { + var vb = edge.b; + if (vb) return true; + var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb; + if (ry === ly) { + if (fx < x0 || fx >= x1) return; + if (lx > rx) { + if (!va) va = { + x: fx, + y: y0 + }; else if (va.y >= y1) return; + vb = { + x: fx, + y: y1 + }; + } else { + if (!va) va = { + x: fx, + y: y1 + }; else if (va.y < y0) return; + vb = { + x: fx, + y: y0 + }; + } + } else { + fm = (lx - rx) / (ry - ly); + fb = fy - fm * fx; + if (fm < -1 || fm > 1) { + if (lx > rx) { + if (!va) va = { + x: (y0 - fb) / fm, + y: y0 + }; else if (va.y >= y1) return; + vb = { + x: (y1 - fb) / fm, + y: y1 + }; + } else { + if (!va) va = { + x: (y1 - fb) / fm, + y: y1 + }; else if (va.y < y0) return; + vb = { + x: (y0 - fb) / fm, + y: y0 + }; + } + } else { + if (ly < ry) { + if (!va) va = { + x: x0, + y: fm * x0 + fb + }; else if (va.x >= x1) return; + vb = { + x: x1, + y: fm * x1 + fb + }; + } else { + if (!va) va = { + x: x1, + y: fm * x1 + fb + }; else if (va.x < x0) return; + vb = { + x: x0, + y: fm * x0 + fb + }; + } + } + } + edge.a = va; + edge.b = vb; + return true; + } + function d3_geom_voronoiEdge(lSite, rSite) { + this.l = lSite; + this.r = rSite; + this.a = this.b = null; + } + function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) { + var edge = new d3_geom_voronoiEdge(lSite, rSite); + d3_geom_voronoiEdges.push(edge); + if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va); + if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb); + d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite)); + d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite)); + return edge; + } + function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) { + var edge = new d3_geom_voronoiEdge(lSite, null); + edge.a = va; + edge.b = vb; + d3_geom_voronoiEdges.push(edge); + return edge; + } + function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) { + if (!edge.a && !edge.b) { + edge.a = vertex; + edge.l = lSite; + edge.r = rSite; + } else if (edge.l === rSite) { + edge.b = vertex; + } else { + edge.a = vertex; + } + } + function d3_geom_voronoiHalfEdge(edge, lSite, rSite) { + var va = edge.a, vb = edge.b; + this.edge = edge; + this.site = lSite; + this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y); + } + d3_geom_voronoiHalfEdge.prototype = { + start: function() { + return this.edge.l === this.site ? this.edge.a : this.edge.b; + }, + end: function() { + return this.edge.l === this.site ? this.edge.b : this.edge.a; + } + }; + function d3_geom_voronoiRedBlackTree() { + this._ = null; + } + function d3_geom_voronoiRedBlackNode(node) { + node.U = node.C = node.L = node.R = node.P = node.N = null; + } + d3_geom_voronoiRedBlackTree.prototype = { + insert: function(after, node) { + var parent, grandpa, uncle; + if (after) { + node.P = after; + node.N = after.N; + if (after.N) after.N.P = node; + after.N = node; + if (after.R) { + after = after.R; + while (after.L) after = after.L; + after.L = node; + } else { + after.R = node; + } + parent = after; + } else if (this._) { + after = d3_geom_voronoiRedBlackFirst(this._); + node.P = null; + node.N = after; + after.P = after.L = node; + parent = after; + } else { + node.P = node.N = null; + this._ = node; + parent = null; + } + node.L = node.R = null; + node.U = parent; + node.C = true; + after = node; + while (parent && parent.C) { + grandpa = parent.U; + if (parent === grandpa.L) { + uncle = grandpa.R; + if (uncle && uncle.C) { + parent.C = uncle.C = false; + grandpa.C = true; + after = grandpa; + } else { + if (after === parent.R) { + d3_geom_voronoiRedBlackRotateLeft(this, parent); + after = parent; + parent = after.U; + } + parent.C = false; + grandpa.C = true; + d3_geom_voronoiRedBlackRotateRight(this, grandpa); + } + } else { + uncle = grandpa.L; + if (uncle && uncle.C) { + parent.C = uncle.C = false; + grandpa.C = true; + after = grandpa; + } else { + if (after === parent.L) { + d3_geom_voronoiRedBlackRotateRight(this, parent); + after = parent; + parent = after.U; + } + parent.C = false; + grandpa.C = true; + d3_geom_voronoiRedBlackRotateLeft(this, grandpa); + } + } + parent = after.U; + } + this._.C = false; + }, + remove: function(node) { + if (node.N) node.N.P = node.P; + if (node.P) node.P.N = node.N; + node.N = node.P = null; + var parent = node.U, sibling, left = node.L, right = node.R, next, red; + if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right); + if (parent) { + if (parent.L === node) parent.L = next; else parent.R = next; + } else { + this._ = next; + } + if (left && right) { + red = next.C; + next.C = node.C; + next.L = left; + left.U = next; + if (next !== right) { + parent = next.U; + next.U = node.U; + node = next.R; + parent.L = node; + next.R = right; + right.U = next; + } else { + next.U = parent; + parent = next; + node = next.R; + } + } else { + red = node.C; + node = next; + } + if (node) node.U = parent; + if (red) return; + if (node && node.C) { + node.C = false; + return; + } + do { + if (node === this._) break; + if (node === parent.L) { + sibling = parent.R; + if (sibling.C) { + sibling.C = false; + parent.C = true; + d3_geom_voronoiRedBlackRotateLeft(this, parent); + sibling = parent.R; + } + if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) { + if (!sibling.R || !sibling.R.C) { + sibling.L.C = false; + sibling.C = true; + d3_geom_voronoiRedBlackRotateRight(this, sibling); + sibling = parent.R; + } + sibling.C = parent.C; + parent.C = sibling.R.C = false; + d3_geom_voronoiRedBlackRotateLeft(this, parent); + node = this._; + break; + } + } else { + sibling = parent.L; + if (sibling.C) { + sibling.C = false; + parent.C = true; + d3_geom_voronoiRedBlackRotateRight(this, parent); + sibling = parent.L; + } + if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) { + if (!sibling.L || !sibling.L.C) { + sibling.R.C = false; + sibling.C = true; + d3_geom_voronoiRedBlackRotateLeft(this, sibling); + sibling = parent.L; + } + sibling.C = parent.C; + parent.C = sibling.L.C = false; + d3_geom_voronoiRedBlackRotateRight(this, parent); + node = this._; + break; + } + } + sibling.C = true; + node = parent; + parent = parent.U; + } while (!node.C); + if (node) node.C = false; + } + }; + function d3_geom_voronoiRedBlackRotateLeft(tree, node) { + var p = node, q = node.R, parent = p.U; + if (parent) { + if (parent.L === p) parent.L = q; else parent.R = q; + } else { + tree._ = q; + } + q.U = parent; + p.U = q; + p.R = q.L; + if (p.R) p.R.U = p; + q.L = p; + } + function d3_geom_voronoiRedBlackRotateRight(tree, node) { + var p = node, q = node.L, parent = p.U; + if (parent) { + if (parent.L === p) parent.L = q; else parent.R = q; + } else { + tree._ = q; + } + q.U = parent; + p.U = q; + p.L = q.R; + if (p.L) p.L.U = p; + q.R = p; + } + function d3_geom_voronoiRedBlackFirst(node) { + while (node.L) node = node.L; + return node; + } + function d3_geom_voronoi(sites, bbox) { + var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle; + d3_geom_voronoiEdges = []; + d3_geom_voronoiCells = new Array(sites.length); + d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree(); + d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree(); + while (true) { + circle = d3_geom_voronoiFirstCircle; + if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) { + if (site.x !== x0 || site.y !== y0) { + d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site); + d3_geom_voronoiAddBeach(site); + x0 = site.x, y0 = site.y; + } + site = sites.pop(); + } else if (circle) { + d3_geom_voronoiRemoveBeach(circle.arc); + } else { + break; + } + } + if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox); + var diagram = { + cells: d3_geom_voronoiCells, + edges: d3_geom_voronoiEdges + }; + d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null; + return diagram; + } + function d3_geom_voronoiVertexOrder(a, b) { + return b.y - a.y || b.x - a.x; + } + d3.geom.voronoi = function(points) { + var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent; + if (points) return voronoi(points); + function voronoi(data) { + var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1]; + d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) { + var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) { + var s = e.start(); + return [ s.x, s.y ]; + }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : []; + polygon.point = data[i]; + }); + return polygons; + } + function sites(data) { + return data.map(function(d, i) { + return { + x: Math.round(fx(d, i) / ε) * ε, + y: Math.round(fy(d, i) / ε) * ε, + i: i + }; + }); + } + voronoi.links = function(data) { + return d3_geom_voronoi(sites(data)).edges.filter(function(edge) { + return edge.l && edge.r; + }).map(function(edge) { + return { + source: data[edge.l.i], + target: data[edge.r.i] + }; + }); + }; + voronoi.triangles = function(data) { + var triangles = []; + d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) { + var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l; + while (++j < m) { + e0 = e1; + s0 = s1; + e1 = edges[j].edge; + s1 = e1.l === site ? e1.r : e1.l; + if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) { + triangles.push([ data[i], data[s0.i], data[s1.i] ]); + } + } + }); + return triangles; + }; + voronoi.x = function(_) { + return arguments.length ? (fx = d3_functor(x = _), voronoi) : x; + }; + voronoi.y = function(_) { + return arguments.length ? (fy = d3_functor(y = _), voronoi) : y; + }; + voronoi.clipExtent = function(_) { + if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent; + clipExtent = _ == null ? d3_geom_voronoiClipExtent : _; + return voronoi; + }; + voronoi.size = function(_) { + if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1]; + return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]); + }; + return voronoi; + }; + var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ]; + function d3_geom_voronoiTriangleArea(a, b, c) { + return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y); + } + d3.geom.delaunay = function(vertices) { + return d3.geom.voronoi().triangles(vertices); + }; + d3.geom.quadtree = function(points, x1, y1, x2, y2) { + var x = d3_geom_pointX, y = d3_geom_pointY, compat; + if (compat = arguments.length) { + x = d3_geom_quadtreeCompatX; + y = d3_geom_quadtreeCompatY; + if (compat === 3) { + y2 = y1; + x2 = x1; + y1 = x1 = 0; + } + return quadtree(points); + } + function quadtree(data) { + var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_; + if (x1 != null) { + x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2; + } else { + x2_ = y2_ = -(x1_ = y1_ = Infinity); + xs = [], ys = []; + n = data.length; + if (compat) for (i = 0; i < n; ++i) { + d = data[i]; + if (d.x < x1_) x1_ = d.x; + if (d.y < y1_) y1_ = d.y; + if (d.x > x2_) x2_ = d.x; + if (d.y > y2_) y2_ = d.y; + xs.push(d.x); + ys.push(d.y); + } else for (i = 0; i < n; ++i) { + var x_ = +fx(d = data[i], i), y_ = +fy(d, i); + if (x_ < x1_) x1_ = x_; + if (y_ < y1_) y1_ = y_; + if (x_ > x2_) x2_ = x_; + if (y_ > y2_) y2_ = y_; + xs.push(x_); + ys.push(y_); + } + } + var dx = x2_ - x1_, dy = y2_ - y1_; + if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy; + function insert(n, d, x, y, x1, y1, x2, y2) { + if (isNaN(x) || isNaN(y)) return; + if (n.leaf) { + var nx = n.x, ny = n.y; + if (nx != null) { + if (abs(nx - x) + abs(ny - y) < .01) { + insertChild(n, d, x, y, x1, y1, x2, y2); + } else { + var nPoint = n.point; + n.x = n.y = n.point = null; + insertChild(n, nPoint, nx, ny, x1, y1, x2, y2); + insertChild(n, d, x, y, x1, y1, x2, y2); + } + } else { + n.x = x, n.y = y, n.point = d; + } + } else { + insertChild(n, d, x, y, x1, y1, x2, y2); + } + } + function insertChild(n, d, x, y, x1, y1, x2, y2) { + var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, right = x >= sx, bottom = y >= sy, i = (bottom << 1) + right; + n.leaf = false; + n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode()); + if (right) x1 = sx; else x2 = sx; + if (bottom) y1 = sy; else y2 = sy; + insert(n, d, x, y, x1, y1, x2, y2); + } + var root = d3_geom_quadtreeNode(); + root.add = function(d) { + insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_); + }; + root.visit = function(f) { + d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_); + }; + i = -1; + if (x1 == null) { + while (++i < n) { + insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_); + } + --i; + } else data.forEach(root.add); + xs = ys = data = d = null; + return root; + } + quadtree.x = function(_) { + return arguments.length ? (x = _, quadtree) : x; + }; + quadtree.y = function(_) { + return arguments.length ? (y = _, quadtree) : y; + }; + quadtree.extent = function(_) { + if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ]; + if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], + y2 = +_[1][1]; + return quadtree; + }; + quadtree.size = function(_) { + if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ]; + if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1]; + return quadtree; + }; + return quadtree; + }; + function d3_geom_quadtreeCompatX(d) { + return d.x; + } + function d3_geom_quadtreeCompatY(d) { + return d.y; + } + function d3_geom_quadtreeNode() { + return { + leaf: true, + nodes: [], + point: null, + x: null, + y: null + }; + } + function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) { + if (!f(node, x1, y1, x2, y2)) { + var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes; + if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy); + if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy); + if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2); + if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2); + } + } + d3.interpolateRgb = d3_interpolateRgb; + function d3_interpolateRgb(a, b) { + a = d3.rgb(a); + b = d3.rgb(b); + var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab; + return function(t) { + return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t)); + }; + } + d3.interpolateObject = d3_interpolateObject; + function d3_interpolateObject(a, b) { + var i = {}, c = {}, k; + for (k in a) { + if (k in b) { + i[k] = d3_interpolate(a[k], b[k]); + } else { + c[k] = a[k]; + } + } + for (k in b) { + if (!(k in a)) { + c[k] = b[k]; + } + } + return function(t) { + for (k in i) c[k] = i[k](t); + return c; + }; + } + d3.interpolateNumber = d3_interpolateNumber; + function d3_interpolateNumber(a, b) { + a = +a, b = +b; + return function(t) { + return a * (1 - t) + b * t; + }; + } + d3.interpolateString = d3_interpolateString; + function d3_interpolateString(a, b) { + var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = []; + a = a + "", b = b + ""; + while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) { + if ((bs = bm.index) > bi) { + bs = b.slice(bi, bs); + if (s[i]) s[i] += bs; else s[++i] = bs; + } + if ((am = am[0]) === (bm = bm[0])) { + if (s[i]) s[i] += bm; else s[++i] = bm; + } else { + s[++i] = null; + q.push({ + i: i, + x: d3_interpolateNumber(am, bm) + }); + } + bi = d3_interpolate_numberB.lastIndex; + } + if (bi < b.length) { + bs = b.slice(bi); + if (s[i]) s[i] += bs; else s[++i] = bs; + } + return s.length < 2 ? q[0] ? (b = q[0].x, function(t) { + return b(t) + ""; + }) : function() { + return b; + } : (b = q.length, function(t) { + for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }); + } + var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g"); + d3.interpolate = d3_interpolate; + function d3_interpolate(a, b) { + var i = d3.interpolators.length, f; + while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ; + return f; + } + d3.interpolators = [ function(a, b) { + var t = typeof b; + return (t === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b); + } ]; + d3.interpolateArray = d3_interpolateArray; + function d3_interpolateArray(a, b) { + var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i; + for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i])); + for (;i < na; ++i) c[i] = a[i]; + for (;i < nb; ++i) c[i] = b[i]; + return function(t) { + for (i = 0; i < n0; ++i) c[i] = x[i](t); + return c; + }; + } + var d3_ease_default = function() { + return d3_identity; + }; + var d3_ease = d3.map({ + linear: d3_ease_default, + poly: d3_ease_poly, + quad: function() { + return d3_ease_quad; + }, + cubic: function() { + return d3_ease_cubic; + }, + sin: function() { + return d3_ease_sin; + }, + exp: function() { + return d3_ease_exp; + }, + circle: function() { + return d3_ease_circle; + }, + elastic: d3_ease_elastic, + back: d3_ease_back, + bounce: function() { + return d3_ease_bounce; + } + }); + var d3_ease_mode = d3.map({ + "in": d3_identity, + out: d3_ease_reverse, + "in-out": d3_ease_reflect, + "out-in": function(f) { + return d3_ease_reflect(d3_ease_reverse(f)); + } + }); + d3.ease = function(name) { + var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in"; + t = d3_ease.get(t) || d3_ease_default; + m = d3_ease_mode.get(m) || d3_identity; + return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1)))); + }; + function d3_ease_clamp(f) { + return function(t) { + return t <= 0 ? 0 : t >= 1 ? 1 : f(t); + }; + } + function d3_ease_reverse(f) { + return function(t) { + return 1 - f(1 - t); + }; + } + function d3_ease_reflect(f) { + return function(t) { + return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t)); + }; + } + function d3_ease_quad(t) { + return t * t; + } + function d3_ease_cubic(t) { + return t * t * t; + } + function d3_ease_cubicInOut(t) { + if (t <= 0) return 0; + if (t >= 1) return 1; + var t2 = t * t, t3 = t2 * t; + return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75); + } + function d3_ease_poly(e) { + return function(t) { + return Math.pow(t, e); + }; + } + function d3_ease_sin(t) { + return 1 - Math.cos(t * halfπ); + } + function d3_ease_exp(t) { + return Math.pow(2, 10 * (t - 1)); + } + function d3_ease_circle(t) { + return 1 - Math.sqrt(1 - t * t); + } + function d3_ease_elastic(a, p) { + var s; + if (arguments.length < 2) p = .45; + if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4; + return function(t) { + return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p); + }; + } + function d3_ease_back(s) { + if (!s) s = 1.70158; + return function(t) { + return t * t * ((s + 1) * t - s); + }; + } + function d3_ease_bounce(t) { + return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375; + } + d3.interpolateHcl = d3_interpolateHcl; + function d3_interpolateHcl(a, b) { + a = d3.hcl(a); + b = d3.hcl(b); + var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al; + if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac; + if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; + return function(t) { + return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + ""; + }; + } + d3.interpolateHsl = d3_interpolateHsl; + function d3_interpolateHsl(a, b) { + a = d3.hsl(a); + b = d3.hsl(b); + var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al; + if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as; + if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; + return function(t) { + return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + ""; + }; + } + d3.interpolateLab = d3_interpolateLab; + function d3_interpolateLab(a, b) { + a = d3.lab(a); + b = d3.lab(b); + var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab; + return function(t) { + return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + ""; + }; + } + d3.interpolateRound = d3_interpolateRound; + function d3_interpolateRound(a, b) { + b -= a; + return function(t) { + return Math.round(a + b * t); + }; + } + d3.transform = function(string) { + var g = d3_document.createElementNS(d3.ns.prefix.svg, "g"); + return (d3.transform = function(string) { + if (string != null) { + g.setAttribute("transform", string); + var t = g.transform.baseVal.consolidate(); + } + return new d3_transform(t ? t.matrix : d3_transformIdentity); + })(string); + }; + function d3_transform(m) { + var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0; + if (r0[0] * r1[1] < r1[0] * r0[1]) { + r0[0] *= -1; + r0[1] *= -1; + kx *= -1; + kz *= -1; + } + this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees; + this.translate = [ m.e, m.f ]; + this.scale = [ kx, ky ]; + this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0; + } + d3_transform.prototype.toString = function() { + return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")"; + }; + function d3_transformDot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + function d3_transformNormalize(a) { + var k = Math.sqrt(d3_transformDot(a, a)); + if (k) { + a[0] /= k; + a[1] /= k; + } + return k; + } + function d3_transformCombine(a, b, k) { + a[0] += k * b[0]; + a[1] += k * b[1]; + return a; + } + var d3_transformIdentity = { + a: 1, + b: 0, + c: 0, + d: 1, + e: 0, + f: 0 + }; + d3.interpolateTransform = d3_interpolateTransform; + function d3_interpolateTransform(a, b) { + var s = [], q = [], n, A = d3.transform(a), B = d3.transform(b), ta = A.translate, tb = B.translate, ra = A.rotate, rb = B.rotate, wa = A.skew, wb = B.skew, ka = A.scale, kb = B.scale; + if (ta[0] != tb[0] || ta[1] != tb[1]) { + s.push("translate(", null, ",", null, ")"); + q.push({ + i: 1, + x: d3_interpolateNumber(ta[0], tb[0]) + }, { + i: 3, + x: d3_interpolateNumber(ta[1], tb[1]) + }); + } else if (tb[0] || tb[1]) { + s.push("translate(" + tb + ")"); + } else { + s.push(""); + } + if (ra != rb) { + if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360; + q.push({ + i: s.push(s.pop() + "rotate(", null, ")") - 2, + x: d3_interpolateNumber(ra, rb) + }); + } else if (rb) { + s.push(s.pop() + "rotate(" + rb + ")"); + } + if (wa != wb) { + q.push({ + i: s.push(s.pop() + "skewX(", null, ")") - 2, + x: d3_interpolateNumber(wa, wb) + }); + } else if (wb) { + s.push(s.pop() + "skewX(" + wb + ")"); + } + if (ka[0] != kb[0] || ka[1] != kb[1]) { + n = s.push(s.pop() + "scale(", null, ",", null, ")"); + q.push({ + i: n - 4, + x: d3_interpolateNumber(ka[0], kb[0]) + }, { + i: n - 2, + x: d3_interpolateNumber(ka[1], kb[1]) + }); + } else if (kb[0] != 1 || kb[1] != 1) { + s.push(s.pop() + "scale(" + kb + ")"); + } + n = q.length; + return function(t) { + var i = -1, o; + while (++i < n) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }; + } + function d3_uninterpolateNumber(a, b) { + b = (b -= a = +a) || 1 / b; + return function(x) { + return (x - a) / b; + }; + } + function d3_uninterpolateClamp(a, b) { + b = (b -= a = +a) || 1 / b; + return function(x) { + return Math.max(0, Math.min(1, (x - a) / b)); + }; + } + d3.layout = {}; + d3.layout.bundle = function() { + return function(links) { + var paths = [], i = -1, n = links.length; + while (++i < n) paths.push(d3_layout_bundlePath(links[i])); + return paths; + }; + }; + function d3_layout_bundlePath(link) { + var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ]; + while (start !== lca) { + start = start.parent; + points.push(start); + } + var k = points.length; + while (end !== lca) { + points.splice(k, 0, end); + end = end.parent; + } + return points; + } + function d3_layout_bundleAncestors(node) { + var ancestors = [], parent = node.parent; + while (parent != null) { + ancestors.push(node); + node = parent; + parent = parent.parent; + } + ancestors.push(node); + return ancestors; + } + function d3_layout_bundleLeastCommonAncestor(a, b) { + if (a === b) return a; + var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null; + while (aNode === bNode) { + sharedNode = aNode; + aNode = aNodes.pop(); + bNode = bNodes.pop(); + } + return sharedNode; + } + d3.layout.chord = function() { + var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords; + function relayout() { + var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j; + chords = []; + groups = []; + k = 0, i = -1; + while (++i < n) { + x = 0, j = -1; + while (++j < n) { + x += matrix[i][j]; + } + groupSums.push(x); + subgroupIndex.push(d3.range(n)); + k += x; + } + if (sortGroups) { + groupIndex.sort(function(a, b) { + return sortGroups(groupSums[a], groupSums[b]); + }); + } + if (sortSubgroups) { + subgroupIndex.forEach(function(d, i) { + d.sort(function(a, b) { + return sortSubgroups(matrix[i][a], matrix[i][b]); + }); + }); + } + k = (τ - padding * n) / k; + x = 0, i = -1; + while (++i < n) { + x0 = x, j = -1; + while (++j < n) { + var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k; + subgroups[di + "-" + dj] = { + index: di, + subindex: dj, + startAngle: a0, + endAngle: a1, + value: v + }; + } + groups[di] = { + index: di, + startAngle: x0, + endAngle: x, + value: (x - x0) / k + }; + x += padding; + } + i = -1; + while (++i < n) { + j = i - 1; + while (++j < n) { + var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i]; + if (source.value || target.value) { + chords.push(source.value < target.value ? { + source: target, + target: source + } : { + source: source, + target: target + }); + } + } + } + if (sortChords) resort(); + } + function resort() { + chords.sort(function(a, b) { + return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2); + }); + } + chord.matrix = function(x) { + if (!arguments.length) return matrix; + n = (matrix = x) && matrix.length; + chords = groups = null; + return chord; + }; + chord.padding = function(x) { + if (!arguments.length) return padding; + padding = x; + chords = groups = null; + return chord; + }; + chord.sortGroups = function(x) { + if (!arguments.length) return sortGroups; + sortGroups = x; + chords = groups = null; + return chord; + }; + chord.sortSubgroups = function(x) { + if (!arguments.length) return sortSubgroups; + sortSubgroups = x; + chords = null; + return chord; + }; + chord.sortChords = function(x) { + if (!arguments.length) return sortChords; + sortChords = x; + if (chords) resort(); + return chord; + }; + chord.chords = function() { + if (!chords) relayout(); + return chords; + }; + chord.groups = function() { + if (!groups) relayout(); + return groups; + }; + return chord; + }; + d3.layout.force = function() { + var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges; + function repulse(node) { + return function(quad, x1, _, x2) { + if (quad.point !== node) { + var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy; + if (dw * dw / theta2 < dn) { + if (dn < chargeDistance2) { + var k = quad.charge / dn; + node.px -= dx * k; + node.py -= dy * k; + } + return true; + } + if (quad.point && dn && dn < chargeDistance2) { + var k = quad.pointCharge / dn; + node.px -= dx * k; + node.py -= dy * k; + } + } + return !quad.charge; + }; + } + force.tick = function() { + if ((alpha *= .99) < .005) { + event.end({ + type: "end", + alpha: alpha = 0 + }); + return true; + } + var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y; + for (i = 0; i < m; ++i) { + o = links[i]; + s = o.source; + t = o.target; + x = t.x - s.x; + y = t.y - s.y; + if (l = x * x + y * y) { + l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l; + x *= l; + y *= l; + t.x -= x * (k = s.weight / (t.weight + s.weight)); + t.y -= y * k; + s.x += x * (k = 1 - k); + s.y += y * k; + } + } + if (k = alpha * gravity) { + x = size[0] / 2; + y = size[1] / 2; + i = -1; + if (k) while (++i < n) { + o = nodes[i]; + o.x += (x - o.x) * k; + o.y += (y - o.y) * k; + } + } + if (charge) { + d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges); + i = -1; + while (++i < n) { + if (!(o = nodes[i]).fixed) { + q.visit(repulse(o)); + } + } + } + i = -1; + while (++i < n) { + o = nodes[i]; + if (o.fixed) { + o.x = o.px; + o.y = o.py; + } else { + o.x -= (o.px - (o.px = o.x)) * friction; + o.y -= (o.py - (o.py = o.y)) * friction; + } + } + event.tick({ + type: "tick", + alpha: alpha + }); + }; + force.nodes = function(x) { + if (!arguments.length) return nodes; + nodes = x; + return force; + }; + force.links = function(x) { + if (!arguments.length) return links; + links = x; + return force; + }; + force.size = function(x) { + if (!arguments.length) return size; + size = x; + return force; + }; + force.linkDistance = function(x) { + if (!arguments.length) return linkDistance; + linkDistance = typeof x === "function" ? x : +x; + return force; + }; + force.distance = force.linkDistance; + force.linkStrength = function(x) { + if (!arguments.length) return linkStrength; + linkStrength = typeof x === "function" ? x : +x; + return force; + }; + force.friction = function(x) { + if (!arguments.length) return friction; + friction = +x; + return force; + }; + force.charge = function(x) { + if (!arguments.length) return charge; + charge = typeof x === "function" ? x : +x; + return force; + }; + force.chargeDistance = function(x) { + if (!arguments.length) return Math.sqrt(chargeDistance2); + chargeDistance2 = x * x; + return force; + }; + force.gravity = function(x) { + if (!arguments.length) return gravity; + gravity = +x; + return force; + }; + force.theta = function(x) { + if (!arguments.length) return Math.sqrt(theta2); + theta2 = x * x; + return force; + }; + force.alpha = function(x) { + if (!arguments.length) return alpha; + x = +x; + if (alpha) { + if (x > 0) alpha = x; else alpha = 0; + } else if (x > 0) { + event.start({ + type: "start", + alpha: alpha = x + }); + d3.timer(force.tick); + } + return force; + }; + force.start = function() { + var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o; + for (i = 0; i < n; ++i) { + (o = nodes[i]).index = i; + o.weight = 0; + } + for (i = 0; i < m; ++i) { + o = links[i]; + if (typeof o.source == "number") o.source = nodes[o.source]; + if (typeof o.target == "number") o.target = nodes[o.target]; + ++o.source.weight; + ++o.target.weight; + } + for (i = 0; i < n; ++i) { + o = nodes[i]; + if (isNaN(o.x)) o.x = position("x", w); + if (isNaN(o.y)) o.y = position("y", h); + if (isNaN(o.px)) o.px = o.x; + if (isNaN(o.py)) o.py = o.y; + } + distances = []; + if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance; + strengths = []; + if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength; + charges = []; + if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge; + function position(dimension, size) { + if (!neighbors) { + neighbors = new Array(n); + for (j = 0; j < n; ++j) { + neighbors[j] = []; + } + for (j = 0; j < m; ++j) { + var o = links[j]; + neighbors[o.source.index].push(o.target); + neighbors[o.target.index].push(o.source); + } + } + var candidates = neighbors[i], j = -1, m = candidates.length, x; + while (++j < m) if (!isNaN(x = candidates[j][dimension])) return x; + return Math.random() * size; + } + return force.resume(); + }; + force.resume = function() { + return force.alpha(.1); + }; + force.stop = function() { + return force.alpha(0); + }; + force.drag = function() { + if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend); + if (!arguments.length) return drag; + this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag); + }; + function dragmove(d) { + d.px = d3.event.x, d.py = d3.event.y; + force.resume(); + } + return d3.rebind(force, event, "on"); + }; + function d3_layout_forceDragstart(d) { + d.fixed |= 2; + } + function d3_layout_forceDragend(d) { + d.fixed &= ~6; + } + function d3_layout_forceMouseover(d) { + d.fixed |= 4; + d.px = d.x, d.py = d.y; + } + function d3_layout_forceMouseout(d) { + d.fixed &= ~4; + } + function d3_layout_forceAccumulate(quad, alpha, charges) { + var cx = 0, cy = 0; + quad.charge = 0; + if (!quad.leaf) { + var nodes = quad.nodes, n = nodes.length, i = -1, c; + while (++i < n) { + c = nodes[i]; + if (c == null) continue; + d3_layout_forceAccumulate(c, alpha, charges); + quad.charge += c.charge; + cx += c.charge * c.cx; + cy += c.charge * c.cy; + } + } + if (quad.point) { + if (!quad.leaf) { + quad.point.x += Math.random() - .5; + quad.point.y += Math.random() - .5; + } + var k = alpha * charges[quad.point.index]; + quad.charge += quad.pointCharge = k; + cx += k * quad.point.x; + cy += k * quad.point.y; + } + quad.cx = cx / quad.charge; + quad.cy = cy / quad.charge; + } + var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity; + d3.layout.hierarchy = function() { + var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue; + function hierarchy(root) { + var stack = [ root ], nodes = [], node; + root.depth = 0; + while ((node = stack.pop()) != null) { + nodes.push(node); + if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) { + var n, childs, child; + while (--n >= 0) { + stack.push(child = childs[n]); + child.parent = node; + child.depth = node.depth + 1; + } + if (value) node.value = 0; + node.children = childs; + } else { + if (value) node.value = +value.call(hierarchy, node, node.depth) || 0; + delete node.children; + } + } + d3_layout_hierarchyVisitAfter(root, function(node) { + var childs, parent; + if (sort && (childs = node.children)) childs.sort(sort); + if (value && (parent = node.parent)) parent.value += node.value; + }); + return nodes; + } + hierarchy.sort = function(x) { + if (!arguments.length) return sort; + sort = x; + return hierarchy; + }; + hierarchy.children = function(x) { + if (!arguments.length) return children; + children = x; + return hierarchy; + }; + hierarchy.value = function(x) { + if (!arguments.length) return value; + value = x; + return hierarchy; + }; + hierarchy.revalue = function(root) { + if (value) { + d3_layout_hierarchyVisitBefore(root, function(node) { + if (node.children) node.value = 0; + }); + d3_layout_hierarchyVisitAfter(root, function(node) { + var parent; + if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0; + if (parent = node.parent) parent.value += node.value; + }); + } + return root; + }; + return hierarchy; + }; + function d3_layout_hierarchyRebind(object, hierarchy) { + d3.rebind(object, hierarchy, "sort", "children", "value"); + object.nodes = object; + object.links = d3_layout_hierarchyLinks; + return object; + } + function d3_layout_hierarchyVisitBefore(node, callback) { + var nodes = [ node ]; + while ((node = nodes.pop()) != null) { + callback(node); + if ((children = node.children) && (n = children.length)) { + var n, children; + while (--n >= 0) nodes.push(children[n]); + } + } + } + function d3_layout_hierarchyVisitAfter(node, callback) { + var nodes = [ node ], nodes2 = []; + while ((node = nodes.pop()) != null) { + nodes2.push(node); + if ((children = node.children) && (n = children.length)) { + var i = -1, n, children; + while (++i < n) nodes.push(children[i]); + } + } + while ((node = nodes2.pop()) != null) { + callback(node); + } + } + function d3_layout_hierarchyChildren(d) { + return d.children; + } + function d3_layout_hierarchyValue(d) { + return d.value; + } + function d3_layout_hierarchySort(a, b) { + return b.value - a.value; + } + function d3_layout_hierarchyLinks(nodes) { + return d3.merge(nodes.map(function(parent) { + return (parent.children || []).map(function(child) { + return { + source: parent, + target: child + }; + }); + })); + } + d3.layout.partition = function() { + var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ]; + function position(node, x, dx, dy) { + var children = node.children; + node.x = x; + node.y = node.depth * dy; + node.dx = dx; + node.dy = dy; + if (children && (n = children.length)) { + var i = -1, n, c, d; + dx = node.value ? dx / node.value : 0; + while (++i < n) { + position(c = children[i], x, d = c.value * dx, dy); + x += d; + } + } + } + function depth(node) { + var children = node.children, d = 0; + if (children && (n = children.length)) { + var i = -1, n; + while (++i < n) d = Math.max(d, depth(children[i])); + } + return 1 + d; + } + function partition(d, i) { + var nodes = hierarchy.call(this, d, i); + position(nodes[0], 0, size[0], size[1] / depth(nodes[0])); + return nodes; + } + partition.size = function(x) { + if (!arguments.length) return size; + size = x; + return partition; + }; + return d3_layout_hierarchyRebind(partition, hierarchy); + }; + d3.layout.pie = function() { + var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ; + function pie(data) { + var values = data.map(function(d, i) { + return +value.call(pie, d, i); + }); + var a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle); + var k = ((typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a) / d3.sum(values); + var index = d3.range(data.length); + if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) { + return values[j] - values[i]; + } : function(i, j) { + return sort(data[i], data[j]); + }); + var arcs = []; + index.forEach(function(i) { + var d; + arcs[i] = { + data: data[i], + value: d = values[i], + startAngle: a, + endAngle: a += d * k + }; + }); + return arcs; + } + pie.value = function(x) { + if (!arguments.length) return value; + value = x; + return pie; + }; + pie.sort = function(x) { + if (!arguments.length) return sort; + sort = x; + return pie; + }; + pie.startAngle = function(x) { + if (!arguments.length) return startAngle; + startAngle = x; + return pie; + }; + pie.endAngle = function(x) { + if (!arguments.length) return endAngle; + endAngle = x; + return pie; + }; + return pie; + }; + var d3_layout_pieSortByValue = {}; + d3.layout.stack = function() { + var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY; + function stack(data, index) { + if (!(n = data.length)) return data; + var series = data.map(function(d, i) { + return values.call(stack, d, i); + }); + var points = series.map(function(d) { + return d.map(function(v, i) { + return [ x.call(stack, v, i), y.call(stack, v, i) ]; + }); + }); + var orders = order.call(stack, points, index); + series = d3.permute(series, orders); + points = d3.permute(points, orders); + var offsets = offset.call(stack, points, index); + var m = series[0].length, n, i, j, o; + for (j = 0; j < m; ++j) { + out.call(stack, series[0][j], o = offsets[j], points[0][j][1]); + for (i = 1; i < n; ++i) { + out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]); + } + } + return data; + } + stack.values = function(x) { + if (!arguments.length) return values; + values = x; + return stack; + }; + stack.order = function(x) { + if (!arguments.length) return order; + order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault; + return stack; + }; + stack.offset = function(x) { + if (!arguments.length) return offset; + offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero; + return stack; + }; + stack.x = function(z) { + if (!arguments.length) return x; + x = z; + return stack; + }; + stack.y = function(z) { + if (!arguments.length) return y; + y = z; + return stack; + }; + stack.out = function(z) { + if (!arguments.length) return out; + out = z; + return stack; + }; + return stack; + }; + function d3_layout_stackX(d) { + return d.x; + } + function d3_layout_stackY(d) { + return d.y; + } + function d3_layout_stackOut(d, y0, y) { + d.y0 = y0; + d.y = y; + } + var d3_layout_stackOrders = d3.map({ + "inside-out": function(data) { + var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) { + return max[a] - max[b]; + }), top = 0, bottom = 0, tops = [], bottoms = []; + for (i = 0; i < n; ++i) { + j = index[i]; + if (top < bottom) { + top += sums[j]; + tops.push(j); + } else { + bottom += sums[j]; + bottoms.push(j); + } + } + return bottoms.reverse().concat(tops); + }, + reverse: function(data) { + return d3.range(data.length).reverse(); + }, + "default": d3_layout_stackOrderDefault + }); + var d3_layout_stackOffsets = d3.map({ + silhouette: function(data) { + var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = []; + for (j = 0; j < m; ++j) { + for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; + if (o > max) max = o; + sums.push(o); + } + for (j = 0; j < m; ++j) { + y0[j] = (max - sums[j]) / 2; + } + return y0; + }, + wiggle: function(data) { + var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = []; + y0[0] = o = o0 = 0; + for (j = 1; j < m; ++j) { + for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1]; + for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) { + for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) { + s3 += (data[k][j][1] - data[k][j - 1][1]) / dx; + } + s2 += s3 * data[i][j][1]; + } + y0[j] = o -= s1 ? s2 / s1 * dx : 0; + if (o < o0) o0 = o; + } + for (j = 0; j < m; ++j) y0[j] -= o0; + return y0; + }, + expand: function(data) { + var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = []; + for (j = 0; j < m; ++j) { + for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; + if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k; + } + for (j = 0; j < m; ++j) y0[j] = 0; + return y0; + }, + zero: d3_layout_stackOffsetZero + }); + function d3_layout_stackOrderDefault(data) { + return d3.range(data.length); + } + function d3_layout_stackOffsetZero(data) { + var j = -1, m = data[0].length, y0 = []; + while (++j < m) y0[j] = 0; + return y0; + } + function d3_layout_stackMaxIndex(array) { + var i = 1, j = 0, v = array[0][1], k, n = array.length; + for (;i < n; ++i) { + if ((k = array[i][1]) > v) { + j = i; + v = k; + } + } + return j; + } + function d3_layout_stackReduceSum(d) { + return d.reduce(d3_layout_stackSum, 0); + } + function d3_layout_stackSum(p, d) { + return p + d[1]; + } + d3.layout.histogram = function() { + var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges; + function histogram(data, i) { + var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x; + while (++i < m) { + bin = bins[i] = []; + bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]); + bin.y = 0; + } + if (m > 0) { + i = -1; + while (++i < n) { + x = values[i]; + if (x >= range[0] && x <= range[1]) { + bin = bins[d3.bisect(thresholds, x, 1, m) - 1]; + bin.y += k; + bin.push(data[i]); + } + } + } + return bins; + } + histogram.value = function(x) { + if (!arguments.length) return valuer; + valuer = x; + return histogram; + }; + histogram.range = function(x) { + if (!arguments.length) return ranger; + ranger = d3_functor(x); + return histogram; + }; + histogram.bins = function(x) { + if (!arguments.length) return binner; + binner = typeof x === "number" ? function(range) { + return d3_layout_histogramBinFixed(range, x); + } : d3_functor(x); + return histogram; + }; + histogram.frequency = function(x) { + if (!arguments.length) return frequency; + frequency = !!x; + return histogram; + }; + return histogram; + }; + function d3_layout_histogramBinSturges(range, values) { + return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1)); + } + function d3_layout_histogramBinFixed(range, n) { + var x = -1, b = +range[0], m = (range[1] - b) / n, f = []; + while (++x <= n) f[x] = m * x + b; + return f; + } + function d3_layout_histogramRange(values) { + return [ d3.min(values), d3.max(values) ]; + } + d3.layout.pack = function() { + var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius; + function pack(d, i) { + var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() { + return radius; + }; + root.x = root.y = 0; + d3_layout_hierarchyVisitAfter(root, function(d) { + d.r = +r(d.value); + }); + d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings); + if (padding) { + var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2; + d3_layout_hierarchyVisitAfter(root, function(d) { + d.r += dr; + }); + d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings); + d3_layout_hierarchyVisitAfter(root, function(d) { + d.r -= dr; + }); + } + d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h)); + return nodes; + } + pack.size = function(_) { + if (!arguments.length) return size; + size = _; + return pack; + }; + pack.radius = function(_) { + if (!arguments.length) return radius; + radius = _ == null || typeof _ === "function" ? _ : +_; + return pack; + }; + pack.padding = function(_) { + if (!arguments.length) return padding; + padding = +_; + return pack; + }; + return d3_layout_hierarchyRebind(pack, hierarchy); + }; + function d3_layout_packSort(a, b) { + return a.value - b.value; + } + function d3_layout_packInsert(a, b) { + var c = a._pack_next; + a._pack_next = b; + b._pack_prev = a; + b._pack_next = c; + c._pack_prev = b; + } + function d3_layout_packSplice(a, b) { + a._pack_next = b; + b._pack_prev = a; + } + function d3_layout_packIntersects(a, b) { + var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r; + return .999 * dr * dr > dx * dx + dy * dy; + } + function d3_layout_packSiblings(node) { + if (!(nodes = node.children) || !(n = nodes.length)) return; + var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n; + function bound(node) { + xMin = Math.min(node.x - node.r, xMin); + xMax = Math.max(node.x + node.r, xMax); + yMin = Math.min(node.y - node.r, yMin); + yMax = Math.max(node.y + node.r, yMax); + } + nodes.forEach(d3_layout_packLink); + a = nodes[0]; + a.x = -a.r; + a.y = 0; + bound(a); + if (n > 1) { + b = nodes[1]; + b.x = b.r; + b.y = 0; + bound(b); + if (n > 2) { + c = nodes[2]; + d3_layout_packPlace(a, b, c); + bound(c); + d3_layout_packInsert(a, c); + a._pack_prev = c; + d3_layout_packInsert(c, b); + b = a._pack_next; + for (i = 3; i < n; i++) { + d3_layout_packPlace(a, b, c = nodes[i]); + var isect = 0, s1 = 1, s2 = 1; + for (j = b._pack_next; j !== b; j = j._pack_next, s1++) { + if (d3_layout_packIntersects(j, c)) { + isect = 1; + break; + } + } + if (isect == 1) { + for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) { + if (d3_layout_packIntersects(k, c)) { + break; + } + } + } + if (isect) { + if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b); + i--; + } else { + d3_layout_packInsert(a, c); + b = c; + bound(c); + } + } + } + } + var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0; + for (i = 0; i < n; i++) { + c = nodes[i]; + c.x -= cx; + c.y -= cy; + cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y)); + } + node.r = cr; + nodes.forEach(d3_layout_packUnlink); + } + function d3_layout_packLink(node) { + node._pack_next = node._pack_prev = node; + } + function d3_layout_packUnlink(node) { + delete node._pack_next; + delete node._pack_prev; + } + function d3_layout_packTransform(node, x, y, k) { + var children = node.children; + node.x = x += k * node.x; + node.y = y += k * node.y; + node.r *= k; + if (children) { + var i = -1, n = children.length; + while (++i < n) d3_layout_packTransform(children[i], x, y, k); + } + } + function d3_layout_packPlace(a, b, c) { + var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y; + if (db && (dx || dy)) { + var da = b.r + c.r, dc = dx * dx + dy * dy; + da *= da; + db *= db; + var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc); + c.x = a.x + x * dx + y * dy; + c.y = a.y + x * dy - y * dx; + } else { + c.x = a.x + db; + c.y = a.y; + } + } + d3.layout.tree = function() { + var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null; + function tree(d, i) { + var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0); + d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z; + d3_layout_hierarchyVisitBefore(root1, secondWalk); + if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else { + var left = root0, right = root0, bottom = root0; + d3_layout_hierarchyVisitBefore(root0, function(node) { + if (node.x < left.x) left = node; + if (node.x > right.x) right = node; + if (node.depth > bottom.depth) bottom = node; + }); + var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1); + d3_layout_hierarchyVisitBefore(root0, function(node) { + node.x = (node.x + tx) * kx; + node.y = node.depth * ky; + }); + } + return nodes; + } + function wrapTree(root0) { + var root1 = { + A: null, + children: [ root0 ] + }, queue = [ root1 ], node1; + while ((node1 = queue.pop()) != null) { + for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) { + queue.push((children[i] = child = { + _: children[i], + parent: node1, + children: (child = children[i].children) && child.slice() || [], + A: null, + a: null, + z: 0, + m: 0, + c: 0, + s: 0, + t: null, + i: i + }).a = child); + } + } + return root1.children[0]; + } + function firstWalk(v) { + var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null; + if (children.length) { + d3_layout_treeShift(v); + var midpoint = (children[0].z + children[children.length - 1].z) / 2; + if (w) { + v.z = w.z + separation(v._, w._); + v.m = v.z - midpoint; + } else { + v.z = midpoint; + } + } else if (w) { + v.z = w.z + separation(v._, w._); + } + v.parent.A = apportion(v, w, v.parent.A || siblings[0]); + } + function secondWalk(v) { + v._.x = v.z + v.parent.m; + v.m += v.parent.m; + } + function apportion(v, w, ancestor) { + if (w) { + var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift; + while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) { + vom = d3_layout_treeLeft(vom); + vop = d3_layout_treeRight(vop); + vop.a = v; + shift = vim.z + sim - vip.z - sip + separation(vim._, vip._); + if (shift > 0) { + d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift); + sip += shift; + sop += shift; + } + sim += vim.m; + sip += vip.m; + som += vom.m; + sop += vop.m; + } + if (vim && !d3_layout_treeRight(vop)) { + vop.t = vim; + vop.m += sim - sop; + } + if (vip && !d3_layout_treeLeft(vom)) { + vom.t = vip; + vom.m += sip - som; + ancestor = v; + } + } + return ancestor; + } + function sizeNode(node) { + node.x *= size[0]; + node.y = node.depth * size[1]; + } + tree.separation = function(x) { + if (!arguments.length) return separation; + separation = x; + return tree; + }; + tree.size = function(x) { + if (!arguments.length) return nodeSize ? null : size; + nodeSize = (size = x) == null ? sizeNode : null; + return tree; + }; + tree.nodeSize = function(x) { + if (!arguments.length) return nodeSize ? size : null; + nodeSize = (size = x) == null ? null : sizeNode; + return tree; + }; + return d3_layout_hierarchyRebind(tree, hierarchy); + }; + function d3_layout_treeSeparation(a, b) { + return a.parent == b.parent ? 1 : 2; + } + function d3_layout_treeLeft(v) { + var children = v.children; + return children.length ? children[0] : v.t; + } + function d3_layout_treeRight(v) { + var children = v.children, n; + return (n = children.length) ? children[n - 1] : v.t; + } + function d3_layout_treeMove(wm, wp, shift) { + var change = shift / (wp.i - wm.i); + wp.c -= change; + wp.s += shift; + wm.c += change; + wp.z += shift; + wp.m += shift; + } + function d3_layout_treeShift(v) { + var shift = 0, change = 0, children = v.children, i = children.length, w; + while (--i >= 0) { + w = children[i]; + w.z += shift; + w.m += shift; + shift += w.s + (change += w.c); + } + } + function d3_layout_treeAncestor(vim, v, ancestor) { + return vim.a.parent === v.parent ? vim.a : ancestor; + } + d3.layout.cluster = function() { + var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false; + function cluster(d, i) { + var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0; + d3_layout_hierarchyVisitAfter(root, function(node) { + var children = node.children; + if (children && children.length) { + node.x = d3_layout_clusterX(children); + node.y = d3_layout_clusterY(children); + } else { + node.x = previousNode ? x += separation(node, previousNode) : 0; + node.y = 0; + previousNode = node; + } + }); + var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2; + d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) { + node.x = (node.x - root.x) * size[0]; + node.y = (root.y - node.y) * size[1]; + } : function(node) { + node.x = (node.x - x0) / (x1 - x0) * size[0]; + node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1]; + }); + return nodes; + } + cluster.separation = function(x) { + if (!arguments.length) return separation; + separation = x; + return cluster; + }; + cluster.size = function(x) { + if (!arguments.length) return nodeSize ? null : size; + nodeSize = (size = x) == null; + return cluster; + }; + cluster.nodeSize = function(x) { + if (!arguments.length) return nodeSize ? size : null; + nodeSize = (size = x) != null; + return cluster; + }; + return d3_layout_hierarchyRebind(cluster, hierarchy); + }; + function d3_layout_clusterY(children) { + return 1 + d3.max(children, function(child) { + return child.y; + }); + } + function d3_layout_clusterX(children) { + return children.reduce(function(x, child) { + return x + child.x; + }, 0) / children.length; + } + function d3_layout_clusterLeft(node) { + var children = node.children; + return children && children.length ? d3_layout_clusterLeft(children[0]) : node; + } + function d3_layout_clusterRight(node) { + var children = node.children, n; + return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node; + } + d3.layout.treemap = function() { + var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5)); + function scale(children, k) { + var i = -1, n = children.length, child, area; + while (++i < n) { + area = (child = children[i]).value * (k < 0 ? 0 : k); + child.area = isNaN(area) || area <= 0 ? 0 : area; + } + } + function squarify(node) { + var children = node.children; + if (children && children.length) { + var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n; + scale(remaining, rect.dx * rect.dy / node.value); + row.area = 0; + while ((n = remaining.length) > 0) { + row.push(child = remaining[n - 1]); + row.area += child.area; + if (mode !== "squarify" || (score = worst(row, u)) <= best) { + remaining.pop(); + best = score; + } else { + row.area -= row.pop().area; + position(row, u, rect, false); + u = Math.min(rect.dx, rect.dy); + row.length = row.area = 0; + best = Infinity; + } + } + if (row.length) { + position(row, u, rect, true); + row.length = row.area = 0; + } + children.forEach(squarify); + } + } + function stickify(node) { + var children = node.children; + if (children && children.length) { + var rect = pad(node), remaining = children.slice(), child, row = []; + scale(remaining, rect.dx * rect.dy / node.value); + row.area = 0; + while (child = remaining.pop()) { + row.push(child); + row.area += child.area; + if (child.z != null) { + position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length); + row.length = row.area = 0; + } + } + children.forEach(stickify); + } + } + function worst(row, u) { + var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length; + while (++i < n) { + if (!(r = row[i].area)) continue; + if (r < rmin) rmin = r; + if (r > rmax) rmax = r; + } + s *= s; + u *= u; + return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity; + } + function position(row, u, rect, flush) { + var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o; + if (u == rect.dx) { + if (flush || v > rect.dy) v = rect.dy; + while (++i < n) { + o = row[i]; + o.x = x; + o.y = y; + o.dy = v; + x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0); + } + o.z = true; + o.dx += rect.x + rect.dx - x; + rect.y += v; + rect.dy -= v; + } else { + if (flush || v > rect.dx) v = rect.dx; + while (++i < n) { + o = row[i]; + o.x = x; + o.y = y; + o.dx = v; + y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0); + } + o.z = false; + o.dy += rect.y + rect.dy - y; + rect.x += v; + rect.dx -= v; + } + } + function treemap(d) { + var nodes = stickies || hierarchy(d), root = nodes[0]; + root.x = 0; + root.y = 0; + root.dx = size[0]; + root.dy = size[1]; + if (stickies) hierarchy.revalue(root); + scale([ root ], root.dx * root.dy / root.value); + (stickies ? stickify : squarify)(root); + if (sticky) stickies = nodes; + return nodes; + } + treemap.size = function(x) { + if (!arguments.length) return size; + size = x; + return treemap; + }; + treemap.padding = function(x) { + if (!arguments.length) return padding; + function padFunction(node) { + var p = x.call(treemap, node, node.depth); + return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p); + } + function padConstant(node) { + return d3_layout_treemapPad(node, x); + } + var type; + pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ], + padConstant) : padConstant; + return treemap; + }; + treemap.round = function(x) { + if (!arguments.length) return round != Number; + round = x ? Math.round : Number; + return treemap; + }; + treemap.sticky = function(x) { + if (!arguments.length) return sticky; + sticky = x; + stickies = null; + return treemap; + }; + treemap.ratio = function(x) { + if (!arguments.length) return ratio; + ratio = x; + return treemap; + }; + treemap.mode = function(x) { + if (!arguments.length) return mode; + mode = x + ""; + return treemap; + }; + return d3_layout_hierarchyRebind(treemap, hierarchy); + }; + function d3_layout_treemapPadNull(node) { + return { + x: node.x, + y: node.y, + dx: node.dx, + dy: node.dy + }; + } + function d3_layout_treemapPad(node, padding) { + var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2]; + if (dx < 0) { + x += dx / 2; + dx = 0; + } + if (dy < 0) { + y += dy / 2; + dy = 0; + } + return { + x: x, + y: y, + dx: dx, + dy: dy + }; + } + d3.random = { + normal: function(µ, σ) { + var n = arguments.length; + if (n < 2) σ = 1; + if (n < 1) µ = 0; + return function() { + var x, y, r; + do { + x = Math.random() * 2 - 1; + y = Math.random() * 2 - 1; + r = x * x + y * y; + } while (!r || r > 1); + return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r); + }; + }, + logNormal: function() { + var random = d3.random.normal.apply(d3, arguments); + return function() { + return Math.exp(random()); + }; + }, + bates: function(m) { + var random = d3.random.irwinHall(m); + return function() { + return random() / m; + }; + }, + irwinHall: function(m) { + return function() { + for (var s = 0, j = 0; j < m; j++) s += Math.random(); + return s; + }; + } + }; + d3.scale = {}; + function d3_scaleExtent(domain) { + var start = domain[0], stop = domain[domain.length - 1]; + return start < stop ? [ start, stop ] : [ stop, start ]; + } + function d3_scaleRange(scale) { + return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range()); + } + function d3_scale_bilinear(domain, range, uninterpolate, interpolate) { + var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]); + return function(x) { + return i(u(x)); + }; + } + function d3_scale_nice(domain, nice) { + var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx; + if (x1 < x0) { + dx = i0, i0 = i1, i1 = dx; + dx = x0, x0 = x1, x1 = dx; + } + domain[i0] = nice.floor(x0); + domain[i1] = nice.ceil(x1); + return domain; + } + function d3_scale_niceStep(step) { + return step ? { + floor: function(x) { + return Math.floor(x / step) * step; + }, + ceil: function(x) { + return Math.ceil(x / step) * step; + } + } : d3_scale_niceIdentity; + } + var d3_scale_niceIdentity = { + floor: d3_identity, + ceil: d3_identity + }; + function d3_scale_polylinear(domain, range, uninterpolate, interpolate) { + var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1; + if (domain[k] < domain[0]) { + domain = domain.slice().reverse(); + range = range.slice().reverse(); + } + while (++j <= k) { + u.push(uninterpolate(domain[j - 1], domain[j])); + i.push(interpolate(range[j - 1], range[j])); + } + return function(x) { + var j = d3.bisect(domain, x, 1, k) - 1; + return i[j](u[j](x)); + }; + } + d3.scale.linear = function() { + return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false); + }; + function d3_scale_linear(domain, range, interpolate, clamp) { + var output, input; + function rescale() { + var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber; + output = linear(domain, range, uninterpolate, interpolate); + input = linear(range, domain, uninterpolate, d3_interpolate); + return scale; + } + function scale(x) { + return output(x); + } + scale.invert = function(y) { + return input(y); + }; + scale.domain = function(x) { + if (!arguments.length) return domain; + domain = x.map(Number); + return rescale(); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + return rescale(); + }; + scale.rangeRound = function(x) { + return scale.range(x).interpolate(d3_interpolateRound); + }; + scale.clamp = function(x) { + if (!arguments.length) return clamp; + clamp = x; + return rescale(); + }; + scale.interpolate = function(x) { + if (!arguments.length) return interpolate; + interpolate = x; + return rescale(); + }; + scale.ticks = function(m) { + return d3_scale_linearTicks(domain, m); + }; + scale.tickFormat = function(m, format) { + return d3_scale_linearTickFormat(domain, m, format); + }; + scale.nice = function(m) { + d3_scale_linearNice(domain, m); + return rescale(); + }; + scale.copy = function() { + return d3_scale_linear(domain, range, interpolate, clamp); + }; + return rescale(); + } + function d3_scale_linearRebind(scale, linear) { + return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp"); + } + function d3_scale_linearNice(domain, m) { + return d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2])); + } + function d3_scale_linearTickRange(domain, m) { + if (m == null) m = 10; + var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step; + if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2; + extent[0] = Math.ceil(extent[0] / step) * step; + extent[1] = Math.floor(extent[1] / step) * step + step * .5; + extent[2] = step; + return extent; + } + function d3_scale_linearTicks(domain, m) { + return d3.range.apply(d3, d3_scale_linearTickRange(domain, m)); + } + function d3_scale_linearTickFormat(domain, m, format) { + var range = d3_scale_linearTickRange(domain, m); + if (format) { + var match = d3_format_re.exec(format); + match.shift(); + if (match[8] === "s") { + var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1]))); + if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2])); + match[8] = "f"; + format = d3.format(match.join("")); + return function(d) { + return format(prefix.scale(d)) + prefix.symbol; + }; + } + if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range); + format = match.join(""); + } else { + format = ",." + d3_scale_linearPrecision(range[2]) + "f"; + } + return d3.format(format); + } + var d3_scale_linearFormatSignificant = { + s: 1, + g: 1, + p: 1, + r: 1, + e: 1 + }; + function d3_scale_linearPrecision(value) { + return -Math.floor(Math.log(value) / Math.LN10 + .01); + } + function d3_scale_linearFormatPrecision(type, range) { + var p = d3_scale_linearPrecision(range[2]); + return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2; + } + d3.scale.log = function() { + return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]); + }; + function d3_scale_log(linear, base, positive, domain) { + function log(x) { + return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base); + } + function pow(x) { + return positive ? Math.pow(base, x) : -Math.pow(base, -x); + } + function scale(x) { + return linear(log(x)); + } + scale.invert = function(x) { + return pow(linear.invert(x)); + }; + scale.domain = function(x) { + if (!arguments.length) return domain; + positive = x[0] >= 0; + linear.domain((domain = x.map(Number)).map(log)); + return scale; + }; + scale.base = function(_) { + if (!arguments.length) return base; + base = +_; + linear.domain(domain.map(log)); + return scale; + }; + scale.nice = function() { + var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative); + linear.domain(niced); + domain = niced.map(pow); + return scale; + }; + scale.ticks = function() { + var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base; + if (isFinite(j - i)) { + if (positive) { + for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k); + ticks.push(pow(i)); + } else { + ticks.push(pow(i)); + for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k); + } + for (i = 0; ticks[i] < u; i++) {} + for (j = ticks.length; ticks[j - 1] > v; j--) {} + ticks = ticks.slice(i, j); + } + return ticks; + }; + scale.tickFormat = function(n, format) { + if (!arguments.length) return d3_scale_logFormat; + if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format); + var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12, + Math.floor), e; + return function(d) { + return d / pow(f(log(d) + e)) <= k ? format(d) : ""; + }; + }; + scale.copy = function() { + return d3_scale_log(linear.copy(), base, positive, domain); + }; + return d3_scale_linearRebind(scale, linear); + } + var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = { + floor: function(x) { + return -Math.ceil(-x); + }, + ceil: function(x) { + return -Math.floor(-x); + } + }; + d3.scale.pow = function() { + return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]); + }; + function d3_scale_pow(linear, exponent, domain) { + var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent); + function scale(x) { + return linear(powp(x)); + } + scale.invert = function(x) { + return powb(linear.invert(x)); + }; + scale.domain = function(x) { + if (!arguments.length) return domain; + linear.domain((domain = x.map(Number)).map(powp)); + return scale; + }; + scale.ticks = function(m) { + return d3_scale_linearTicks(domain, m); + }; + scale.tickFormat = function(m, format) { + return d3_scale_linearTickFormat(domain, m, format); + }; + scale.nice = function(m) { + return scale.domain(d3_scale_linearNice(domain, m)); + }; + scale.exponent = function(x) { + if (!arguments.length) return exponent; + powp = d3_scale_powPow(exponent = x); + powb = d3_scale_powPow(1 / exponent); + linear.domain(domain.map(powp)); + return scale; + }; + scale.copy = function() { + return d3_scale_pow(linear.copy(), exponent, domain); + }; + return d3_scale_linearRebind(scale, linear); + } + function d3_scale_powPow(e) { + return function(x) { + return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e); + }; + } + d3.scale.sqrt = function() { + return d3.scale.pow().exponent(.5); + }; + d3.scale.ordinal = function() { + return d3_scale_ordinal([], { + t: "range", + a: [ [] ] + }); + }; + function d3_scale_ordinal(domain, ranger) { + var index, range, rangeBand; + function scale(x) { + return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length]; + } + function steps(start, step) { + return d3.range(domain.length).map(function(i) { + return start + step * i; + }); + } + scale.domain = function(x) { + if (!arguments.length) return domain; + domain = []; + index = new d3_Map(); + var i = -1, n = x.length, xi; + while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi)); + return scale[ranger.t].apply(scale, ranger.a); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + rangeBand = 0; + ranger = { + t: "range", + a: arguments + }; + return scale; + }; + scale.rangePoints = function(x, padding) { + if (arguments.length < 2) padding = 0; + var start = x[0], stop = x[1], step = (stop - start) / (Math.max(1, domain.length - 1) + padding); + range = steps(domain.length < 2 ? (start + stop) / 2 : start + step * padding / 2, step); + rangeBand = 0; + ranger = { + t: "rangePoints", + a: arguments + }; + return scale; + }; + scale.rangeBands = function(x, padding, outerPadding) { + if (arguments.length < 2) padding = 0; + if (arguments.length < 3) outerPadding = padding; + var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding); + range = steps(start + step * outerPadding, step); + if (reverse) range.reverse(); + rangeBand = step * (1 - padding); + ranger = { + t: "rangeBands", + a: arguments + }; + return scale; + }; + scale.rangeRoundBands = function(x, padding, outerPadding) { + if (arguments.length < 2) padding = 0; + if (arguments.length < 3) outerPadding = padding; + var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding)), error = stop - start - (domain.length - padding) * step; + range = steps(start + Math.round(error / 2), step); + if (reverse) range.reverse(); + rangeBand = Math.round(step * (1 - padding)); + ranger = { + t: "rangeRoundBands", + a: arguments + }; + return scale; + }; + scale.rangeBand = function() { + return rangeBand; + }; + scale.rangeExtent = function() { + return d3_scaleExtent(ranger.a[0]); + }; + scale.copy = function() { + return d3_scale_ordinal(domain, ranger); + }; + return scale.domain(domain); + } + d3.scale.category10 = function() { + return d3.scale.ordinal().range(d3_category10); + }; + d3.scale.category20 = function() { + return d3.scale.ordinal().range(d3_category20); + }; + d3.scale.category20b = function() { + return d3.scale.ordinal().range(d3_category20b); + }; + d3.scale.category20c = function() { + return d3.scale.ordinal().range(d3_category20c); + }; + var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString); + var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString); + var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString); + var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString); + d3.scale.quantile = function() { + return d3_scale_quantile([], []); + }; + function d3_scale_quantile(domain, range) { + var thresholds; + function rescale() { + var k = 0, q = range.length; + thresholds = []; + while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q); + return scale; + } + function scale(x) { + if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)]; + } + scale.domain = function(x) { + if (!arguments.length) return domain; + domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending); + return rescale(); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + return rescale(); + }; + scale.quantiles = function() { + return thresholds; + }; + scale.invertExtent = function(y) { + y = range.indexOf(y); + return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ]; + }; + scale.copy = function() { + return d3_scale_quantile(domain, range); + }; + return rescale(); + } + d3.scale.quantize = function() { + return d3_scale_quantize(0, 1, [ 0, 1 ]); + }; + function d3_scale_quantize(x0, x1, range) { + var kx, i; + function scale(x) { + return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))]; + } + function rescale() { + kx = range.length / (x1 - x0); + i = range.length - 1; + return scale; + } + scale.domain = function(x) { + if (!arguments.length) return [ x0, x1 ]; + x0 = +x[0]; + x1 = +x[x.length - 1]; + return rescale(); + }; + scale.range = function(x) { + if (!arguments.length) return range; + range = x; + return rescale(); + }; + scale.invertExtent = function(y) { + y = range.indexOf(y); + y = y < 0 ? NaN : y / kx + x0; + return [ y, y + 1 / kx ]; + }; + scale.copy = function() { + return d3_scale_quantize(x0, x1, range); + }; + return rescale(); + } + d3.scale.threshold = function() { + return d3_scale_threshold([ .5 ], [ 0, 1 ]); + }; + function d3_scale_threshold(domain, range) { + function scale(x) { + if (x <= x) return range[d3.bisect(domain, x)]; + } + scale.domain = function(_) { + if (!arguments.length) return domain; + domain = _; + return scale; + }; + scale.range = function(_) { + if (!arguments.length) return range; + range = _; + return scale; + }; + scale.invertExtent = function(y) { + y = range.indexOf(y); + return [ domain[y - 1], domain[y] ]; + }; + scale.copy = function() { + return d3_scale_threshold(domain, range); + }; + return scale; + } + d3.scale.identity = function() { + return d3_scale_identity([ 0, 1 ]); + }; + function d3_scale_identity(domain) { + function identity(x) { + return +x; + } + identity.invert = identity; + identity.domain = identity.range = function(x) { + if (!arguments.length) return domain; + domain = x.map(identity); + return identity; + }; + identity.ticks = function(m) { + return d3_scale_linearTicks(domain, m); + }; + identity.tickFormat = function(m, format) { + return d3_scale_linearTickFormat(domain, m, format); + }; + identity.copy = function() { + return d3_scale_identity(domain); + }; + return identity; + } + d3.svg = {}; + d3.svg.arc = function() { + var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle; + function arc() { + var r0 = innerRadius.apply(this, arguments), r1 = outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset, a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset, da = (a1 < a0 && (da = a0, + a0 = a1, a1 = da), a1 - a0), df = da < π ? "0" : "1", c0 = Math.cos(a0), s0 = Math.sin(a0), c1 = Math.cos(a1), s1 = Math.sin(a1); + return da >= d3_svg_arcMax ? r0 ? "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "M0," + r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + -r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + r0 + "Z" : "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "Z" : r0 ? "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L" + r0 * c1 + "," + r0 * s1 + "A" + r0 + "," + r0 + " 0 " + df + ",0 " + r0 * c0 + "," + r0 * s0 + "Z" : "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L0,0" + "Z"; + } + arc.innerRadius = function(v) { + if (!arguments.length) return innerRadius; + innerRadius = d3_functor(v); + return arc; + }; + arc.outerRadius = function(v) { + if (!arguments.length) return outerRadius; + outerRadius = d3_functor(v); + return arc; + }; + arc.startAngle = function(v) { + if (!arguments.length) return startAngle; + startAngle = d3_functor(v); + return arc; + }; + arc.endAngle = function(v) { + if (!arguments.length) return endAngle; + endAngle = d3_functor(v); + return arc; + }; + arc.centroid = function() { + var r = (innerRadius.apply(this, arguments) + outerRadius.apply(this, arguments)) / 2, a = (startAngle.apply(this, arguments) + endAngle.apply(this, arguments)) / 2 + d3_svg_arcOffset; + return [ Math.cos(a) * r, Math.sin(a) * r ]; + }; + return arc; + }; + var d3_svg_arcOffset = -halfπ, d3_svg_arcMax = τ - ε; + function d3_svg_arcInnerRadius(d) { + return d.innerRadius; + } + function d3_svg_arcOuterRadius(d) { + return d.outerRadius; + } + function d3_svg_arcStartAngle(d) { + return d.startAngle; + } + function d3_svg_arcEndAngle(d) { + return d.endAngle; + } + function d3_svg_line(projection) { + var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7; + function line(data) { + var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y); + function segment() { + segments.push("M", interpolate(projection(points), tension)); + } + while (++i < n) { + if (defined.call(this, d = data[i], i)) { + points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]); + } else if (points.length) { + segment(); + points = []; + } + } + if (points.length) segment(); + return segments.length ? segments.join("") : null; + } + line.x = function(_) { + if (!arguments.length) return x; + x = _; + return line; + }; + line.y = function(_) { + if (!arguments.length) return y; + y = _; + return line; + }; + line.defined = function(_) { + if (!arguments.length) return defined; + defined = _; + return line; + }; + line.interpolate = function(_) { + if (!arguments.length) return interpolateKey; + if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; + return line; + }; + line.tension = function(_) { + if (!arguments.length) return tension; + tension = _; + return line; + }; + return line; + } + d3.svg.line = function() { + return d3_svg_line(d3_identity); + }; + var d3_svg_lineInterpolators = d3.map({ + linear: d3_svg_lineLinear, + "linear-closed": d3_svg_lineLinearClosed, + step: d3_svg_lineStep, + "step-before": d3_svg_lineStepBefore, + "step-after": d3_svg_lineStepAfter, + basis: d3_svg_lineBasis, + "basis-open": d3_svg_lineBasisOpen, + "basis-closed": d3_svg_lineBasisClosed, + bundle: d3_svg_lineBundle, + cardinal: d3_svg_lineCardinal, + "cardinal-open": d3_svg_lineCardinalOpen, + "cardinal-closed": d3_svg_lineCardinalClosed, + monotone: d3_svg_lineMonotone + }); + d3_svg_lineInterpolators.forEach(function(key, value) { + value.key = key; + value.closed = /-closed$/.test(key); + }); + function d3_svg_lineLinear(points) { + return points.join("L"); + } + function d3_svg_lineLinearClosed(points) { + return d3_svg_lineLinear(points) + "Z"; + } + function d3_svg_lineStep(points) { + var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; + while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]); + if (n > 1) path.push("H", p[0]); + return path.join(""); + } + function d3_svg_lineStepBefore(points) { + var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; + while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]); + return path.join(""); + } + function d3_svg_lineStepAfter(points) { + var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; + while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]); + return path.join(""); + } + function d3_svg_lineCardinalOpen(points, tension) { + return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, points.length - 1), d3_svg_lineCardinalTangents(points, tension)); + } + function d3_svg_lineCardinalClosed(points, tension) { + return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), + points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension)); + } + function d3_svg_lineCardinal(points, tension) { + return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension)); + } + function d3_svg_lineHermite(points, tangents) { + if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) { + return d3_svg_lineLinear(points); + } + var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1; + if (quad) { + path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1]; + p0 = points[1]; + pi = 2; + } + if (tangents.length > 1) { + t = tangents[1]; + p = points[pi]; + pi++; + path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; + for (var i = 2; i < tangents.length; i++, pi++) { + p = points[pi]; + t = tangents[i]; + path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; + } + } + if (quad) { + var lp = points[pi]; + path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1]; + } + return path; + } + function d3_svg_lineCardinalTangents(points, tension) { + var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length; + while (++i < n) { + p0 = p1; + p1 = p2; + p2 = points[i]; + tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]); + } + return tangents; + } + function d3_svg_lineBasis(points) { + if (points.length < 3) return d3_svg_lineLinear(points); + var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; + points.push(points[n - 1]); + while (++i <= n) { + pi = points[i]; + px.shift(); + px.push(pi[0]); + py.shift(); + py.push(pi[1]); + d3_svg_lineBasisBezier(path, px, py); + } + points.pop(); + path.push("L", pi); + return path.join(""); + } + function d3_svg_lineBasisOpen(points) { + if (points.length < 4) return d3_svg_lineLinear(points); + var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ]; + while (++i < 3) { + pi = points[i]; + px.push(pi[0]); + py.push(pi[1]); + } + path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py)); + --i; + while (++i < n) { + pi = points[i]; + px.shift(); + px.push(pi[0]); + py.shift(); + py.push(pi[1]); + d3_svg_lineBasisBezier(path, px, py); + } + return path.join(""); + } + function d3_svg_lineBasisClosed(points) { + var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = []; + while (++i < 4) { + pi = points[i % n]; + px.push(pi[0]); + py.push(pi[1]); + } + path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; + --i; + while (++i < m) { + pi = points[i % n]; + px.shift(); + px.push(pi[0]); + py.shift(); + py.push(pi[1]); + d3_svg_lineBasisBezier(path, px, py); + } + return path.join(""); + } + function d3_svg_lineBundle(points, tension) { + var n = points.length - 1; + if (n) { + var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t; + while (++i <= n) { + p = points[i]; + t = i / n; + p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx); + p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy); + } + } + return d3_svg_lineBasis(points); + } + function d3_svg_lineDot4(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; + } + var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ]; + function d3_svg_lineBasisBezier(path, x, y) { + path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y)); + } + function d3_svg_lineSlope(p0, p1) { + return (p1[1] - p0[1]) / (p1[0] - p0[0]); + } + function d3_svg_lineFiniteDifferences(points) { + var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1); + while (++i < j) { + m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2; + } + m[i] = d; + return m; + } + function d3_svg_lineMonotoneTangents(points) { + var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1; + while (++i < j) { + d = d3_svg_lineSlope(points[i], points[i + 1]); + if (abs(d) < ε) { + m[i] = m[i + 1] = 0; + } else { + a = m[i] / d; + b = m[i + 1] / d; + s = a * a + b * b; + if (s > 9) { + s = d * 3 / Math.sqrt(s); + m[i] = s * a; + m[i + 1] = s * b; + } + } + } + i = -1; + while (++i <= j) { + s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i])); + tangents.push([ s || 0, m[i] * s || 0 ]); + } + return tangents; + } + function d3_svg_lineMonotone(points) { + return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points)); + } + d3.svg.line.radial = function() { + var line = d3_svg_line(d3_svg_lineRadial); + line.radius = line.x, delete line.x; + line.angle = line.y, delete line.y; + return line; + }; + function d3_svg_lineRadial(points) { + var point, i = -1, n = points.length, r, a; + while (++i < n) { + point = points[i]; + r = point[0]; + a = point[1] + d3_svg_arcOffset; + point[0] = r * Math.cos(a); + point[1] = r * Math.sin(a); + } + return points; + } + function d3_svg_area(projection) { + var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7; + function area(data) { + var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() { + return x; + } : d3_functor(x1), fy1 = y0 === y1 ? function() { + return y; + } : d3_functor(y1), x, y; + function segment() { + segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z"); + } + while (++i < n) { + if (defined.call(this, d = data[i], i)) { + points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]); + points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]); + } else if (points0.length) { + segment(); + points0 = []; + points1 = []; + } + } + if (points0.length) segment(); + return segments.length ? segments.join("") : null; + } + area.x = function(_) { + if (!arguments.length) return x1; + x0 = x1 = _; + return area; + }; + area.x0 = function(_) { + if (!arguments.length) return x0; + x0 = _; + return area; + }; + area.x1 = function(_) { + if (!arguments.length) return x1; + x1 = _; + return area; + }; + area.y = function(_) { + if (!arguments.length) return y1; + y0 = y1 = _; + return area; + }; + area.y0 = function(_) { + if (!arguments.length) return y0; + y0 = _; + return area; + }; + area.y1 = function(_) { + if (!arguments.length) return y1; + y1 = _; + return area; + }; + area.defined = function(_) { + if (!arguments.length) return defined; + defined = _; + return area; + }; + area.interpolate = function(_) { + if (!arguments.length) return interpolateKey; + if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; + interpolateReverse = interpolate.reverse || interpolate; + L = interpolate.closed ? "M" : "L"; + return area; + }; + area.tension = function(_) { + if (!arguments.length) return tension; + tension = _; + return area; + }; + return area; + } + d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter; + d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore; + d3.svg.area = function() { + return d3_svg_area(d3_identity); + }; + d3.svg.area.radial = function() { + var area = d3_svg_area(d3_svg_lineRadial); + area.radius = area.x, delete area.x; + area.innerRadius = area.x0, delete area.x0; + area.outerRadius = area.x1, delete area.x1; + area.angle = area.y, delete area.y; + area.startAngle = area.y0, delete area.y0; + area.endAngle = area.y1, delete area.y1; + return area; + }; + d3.svg.chord = function() { + var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle; + function chord(d, i) { + var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i); + return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z"; + } + function subgroup(self, f, d, i) { + var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) + d3_svg_arcOffset, a1 = endAngle.call(self, subgroup, i) + d3_svg_arcOffset; + return { + r: r, + a0: a0, + a1: a1, + p0: [ r * Math.cos(a0), r * Math.sin(a0) ], + p1: [ r * Math.cos(a1), r * Math.sin(a1) ] + }; + } + function equals(a, b) { + return a.a0 == b.a0 && a.a1 == b.a1; + } + function arc(r, p, a) { + return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p; + } + function curve(r0, p0, r1, p1) { + return "Q 0,0 " + p1; + } + chord.radius = function(v) { + if (!arguments.length) return radius; + radius = d3_functor(v); + return chord; + }; + chord.source = function(v) { + if (!arguments.length) return source; + source = d3_functor(v); + return chord; + }; + chord.target = function(v) { + if (!arguments.length) return target; + target = d3_functor(v); + return chord; + }; + chord.startAngle = function(v) { + if (!arguments.length) return startAngle; + startAngle = d3_functor(v); + return chord; + }; + chord.endAngle = function(v) { + if (!arguments.length) return endAngle; + endAngle = d3_functor(v); + return chord; + }; + return chord; + }; + function d3_svg_chordRadius(d) { + return d.radius; + } + d3.svg.diagonal = function() { + var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection; + function diagonal(d, i) { + var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, { + x: p0.x, + y: m + }, { + x: p3.x, + y: m + }, p3 ]; + p = p.map(projection); + return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3]; + } + diagonal.source = function(x) { + if (!arguments.length) return source; + source = d3_functor(x); + return diagonal; + }; + diagonal.target = function(x) { + if (!arguments.length) return target; + target = d3_functor(x); + return diagonal; + }; + diagonal.projection = function(x) { + if (!arguments.length) return projection; + projection = x; + return diagonal; + }; + return diagonal; + }; + function d3_svg_diagonalProjection(d) { + return [ d.x, d.y ]; + } + d3.svg.diagonal.radial = function() { + var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection; + diagonal.projection = function(x) { + return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection; + }; + return diagonal; + }; + function d3_svg_diagonalRadialProjection(projection) { + return function() { + var d = projection.apply(this, arguments), r = d[0], a = d[1] + d3_svg_arcOffset; + return [ r * Math.cos(a), r * Math.sin(a) ]; + }; + } + d3.svg.symbol = function() { + var type = d3_svg_symbolType, size = d3_svg_symbolSize; + function symbol(d, i) { + return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i)); + } + symbol.type = function(x) { + if (!arguments.length) return type; + type = d3_functor(x); + return symbol; + }; + symbol.size = function(x) { + if (!arguments.length) return size; + size = d3_functor(x); + return symbol; + }; + return symbol; + }; + function d3_svg_symbolSize() { + return 64; + } + function d3_svg_symbolType() { + return "circle"; + } + function d3_svg_symbolCircle(size) { + var r = Math.sqrt(size / π); + return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z"; + } + var d3_svg_symbols = d3.map({ + circle: d3_svg_symbolCircle, + cross: function(size) { + var r = Math.sqrt(size / 5) / 2; + return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z"; + }, + diamond: function(size) { + var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30; + return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z"; + }, + square: function(size) { + var r = Math.sqrt(size) / 2; + return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z"; + }, + "triangle-down": function(size) { + var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; + return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z"; + }, + "triangle-up": function(size) { + var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; + return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z"; + } + }); + d3.svg.symbolTypes = d3_svg_symbols.keys(); + var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians); + function d3_transition(groups, id) { + d3_subclass(groups, d3_transitionPrototype); + groups.id = id; + return groups; + } + var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit; + d3_transitionPrototype.call = d3_selectionPrototype.call; + d3_transitionPrototype.empty = d3_selectionPrototype.empty; + d3_transitionPrototype.node = d3_selectionPrototype.node; + d3_transitionPrototype.size = d3_selectionPrototype.size; + d3.transition = function(selection) { + return arguments.length ? d3_transitionInheritId ? selection.transition() : selection : d3_selectionRoot.transition(); + }; + d3.transition.prototype = d3_transitionPrototype; + d3_transitionPrototype.select = function(selector) { + var id = this.id, subgroups = [], subgroup, subnode, node; + selector = d3_selection_selector(selector); + for (var j = -1, m = this.length; ++j < m; ) { + subgroups.push(subgroup = []); + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) { + if ("__data__" in node) subnode.__data__ = node.__data__; + d3_transitionNode(subnode, i, id, node.__transition__[id]); + subgroup.push(subnode); + } else { + subgroup.push(null); + } + } + } + return d3_transition(subgroups, id); + }; + d3_transitionPrototype.selectAll = function(selector) { + var id = this.id, subgroups = [], subgroup, subnodes, node, subnode, transition; + selector = d3_selection_selectorAll(selector); + for (var j = -1, m = this.length; ++j < m; ) { + for (var group = this[j], i = -1, n = group.length; ++i < n; ) { + if (node = group[i]) { + transition = node.__transition__[id]; + subnodes = selector.call(node, node.__data__, i, j); + subgroups.push(subgroup = []); + for (var k = -1, o = subnodes.length; ++k < o; ) { + if (subnode = subnodes[k]) d3_transitionNode(subnode, k, id, transition); + subgroup.push(subnode); + } + } + } + } + return d3_transition(subgroups, id); + }; + d3_transitionPrototype.filter = function(filter) { + var subgroups = [], subgroup, group, node; + if (typeof filter !== "function") filter = d3_selection_filter(filter); + for (var j = 0, m = this.length; j < m; j++) { + subgroups.push(subgroup = []); + for (var group = this[j], i = 0, n = group.length; i < n; i++) { + if ((node = group[i]) && filter.call(node, node.__data__, i, j)) { + subgroup.push(node); + } + } + } + return d3_transition(subgroups, this.id); + }; + d3_transitionPrototype.tween = function(name, tween) { + var id = this.id; + if (arguments.length < 2) return this.node().__transition__[id].tween.get(name); + return d3_selection_each(this, tween == null ? function(node) { + node.__transition__[id].tween.remove(name); + } : function(node) { + node.__transition__[id].tween.set(name, tween); + }); + }; + function d3_transition_tween(groups, name, value, tween) { + var id = groups.id; + return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) { + node.__transition__[id].tween.set(name, tween(value.call(node, node.__data__, i, j))); + } : (value = tween(value), function(node) { + node.__transition__[id].tween.set(name, value); + })); + } + d3_transitionPrototype.attr = function(nameNS, value) { + if (arguments.length < 2) { + for (value in nameNS) this.attr(value, nameNS[value]); + return this; + } + var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS); + function attrNull() { + this.removeAttribute(name); + } + function attrNullNS() { + this.removeAttributeNS(name.space, name.local); + } + function attrTween(b) { + return b == null ? attrNull : (b += "", function() { + var a = this.getAttribute(name), i; + return a !== b && (i = interpolate(a, b), function(t) { + this.setAttribute(name, i(t)); + }); + }); + } + function attrTweenNS(b) { + return b == null ? attrNullNS : (b += "", function() { + var a = this.getAttributeNS(name.space, name.local), i; + return a !== b && (i = interpolate(a, b), function(t) { + this.setAttributeNS(name.space, name.local, i(t)); + }); + }); + } + return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween); + }; + d3_transitionPrototype.attrTween = function(nameNS, tween) { + var name = d3.ns.qualify(nameNS); + function attrTween(d, i) { + var f = tween.call(this, d, i, this.getAttribute(name)); + return f && function(t) { + this.setAttribute(name, f(t)); + }; + } + function attrTweenNS(d, i) { + var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local)); + return f && function(t) { + this.setAttributeNS(name.space, name.local, f(t)); + }; + } + return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween); + }; + d3_transitionPrototype.style = function(name, value, priority) { + var n = arguments.length; + if (n < 3) { + if (typeof name !== "string") { + if (n < 2) value = ""; + for (priority in name) this.style(priority, name[priority], value); + return this; + } + priority = ""; + } + function styleNull() { + this.style.removeProperty(name); + } + function styleString(b) { + return b == null ? styleNull : (b += "", function() { + var a = d3_window.getComputedStyle(this, null).getPropertyValue(name), i; + return a !== b && (i = d3_interpolate(a, b), function(t) { + this.style.setProperty(name, i(t), priority); + }); + }); + } + return d3_transition_tween(this, "style." + name, value, styleString); + }; + d3_transitionPrototype.styleTween = function(name, tween, priority) { + if (arguments.length < 3) priority = ""; + function styleTween(d, i) { + var f = tween.call(this, d, i, d3_window.getComputedStyle(this, null).getPropertyValue(name)); + return f && function(t) { + this.style.setProperty(name, f(t), priority); + }; + } + return this.tween("style." + name, styleTween); + }; + d3_transitionPrototype.text = function(value) { + return d3_transition_tween(this, "text", value, d3_transition_text); + }; + function d3_transition_text(b) { + if (b == null) b = ""; + return function() { + this.textContent = b; + }; + } + d3_transitionPrototype.remove = function() { + return this.each("end.transition", function() { + var p; + if (this.__transition__.count < 2 && (p = this.parentNode)) p.removeChild(this); + }); + }; + d3_transitionPrototype.ease = function(value) { + var id = this.id; + if (arguments.length < 1) return this.node().__transition__[id].ease; + if (typeof value !== "function") value = d3.ease.apply(d3, arguments); + return d3_selection_each(this, function(node) { + node.__transition__[id].ease = value; + }); + }; + d3_transitionPrototype.delay = function(value) { + var id = this.id; + if (arguments.length < 1) return this.node().__transition__[id].delay; + return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { + node.__transition__[id].delay = +value.call(node, node.__data__, i, j); + } : (value = +value, function(node) { + node.__transition__[id].delay = value; + })); + }; + d3_transitionPrototype.duration = function(value) { + var id = this.id; + if (arguments.length < 1) return this.node().__transition__[id].duration; + return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { + node.__transition__[id].duration = Math.max(1, value.call(node, node.__data__, i, j)); + } : (value = Math.max(1, value), function(node) { + node.__transition__[id].duration = value; + })); + }; + d3_transitionPrototype.each = function(type, listener) { + var id = this.id; + if (arguments.length < 2) { + var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId; + d3_transitionInheritId = id; + d3_selection_each(this, function(node, i, j) { + d3_transitionInherit = node.__transition__[id]; + type.call(node, node.__data__, i, j); + }); + d3_transitionInherit = inherit; + d3_transitionInheritId = inheritId; + } else { + d3_selection_each(this, function(node) { + var transition = node.__transition__[id]; + (transition.event || (transition.event = d3.dispatch("start", "end"))).on(type, listener); + }); + } + return this; + }; + d3_transitionPrototype.transition = function() { + var id0 = this.id, id1 = ++d3_transitionId, subgroups = [], subgroup, group, node, transition; + for (var j = 0, m = this.length; j < m; j++) { + subgroups.push(subgroup = []); + for (var group = this[j], i = 0, n = group.length; i < n; i++) { + if (node = group[i]) { + transition = Object.create(node.__transition__[id0]); + transition.delay += transition.duration; + d3_transitionNode(node, i, id1, transition); + } + subgroup.push(node); + } + } + return d3_transition(subgroups, id1); + }; + function d3_transitionNode(node, i, id, inherit) { + var lock = node.__transition__ || (node.__transition__ = { + active: 0, + count: 0 + }), transition = lock[id]; + if (!transition) { + var time = inherit.time; + transition = lock[id] = { + tween: new d3_Map(), + time: time, + ease: inherit.ease, + delay: inherit.delay, + duration: inherit.duration + }; + ++lock.count; + d3.timer(function(elapsed) { + var d = node.__data__, ease = transition.ease, delay = transition.delay, duration = transition.duration, timer = d3_timer_active, tweened = []; + timer.t = delay + time; + if (delay <= elapsed) return start(elapsed - delay); + timer.c = start; + function start(elapsed) { + if (lock.active > id) return stop(); + lock.active = id; + transition.event && transition.event.start.call(node, d, i); + transition.tween.forEach(function(key, value) { + if (value = value.call(node, d, i)) { + tweened.push(value); + } + }); + d3.timer(function() { + timer.c = tick(elapsed || 1) ? d3_true : tick; + return 1; + }, 0, time); + } + function tick(elapsed) { + if (lock.active !== id) return stop(); + var t = elapsed / duration, e = ease(t), n = tweened.length; + while (n > 0) { + tweened[--n].call(node, e); + } + if (t >= 1) { + transition.event && transition.event.end.call(node, d, i); + return stop(); + } + } + function stop() { + if (--lock.count) delete lock[id]; else delete node.__transition__; + return 1; + } + }, 0, time); + } + } + d3.svg.axis = function() { + var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_; + function axis(g) { + g.each(function() { + var g = d3.select(this); + var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy(); + var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform; + var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), + d3.transition(path)); + tickEnter.append("line"); + tickEnter.append("text"); + var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"), sign = orient === "top" || orient === "left" ? -1 : 1, x1, x2, y1, y2; + if (orient === "bottom" || orient === "top") { + tickTransform = d3_svg_axisX, x1 = "x", y1 = "y", x2 = "x2", y2 = "y2"; + text.attr("dy", sign < 0 ? "0em" : ".71em").style("text-anchor", "middle"); + pathUpdate.attr("d", "M" + range[0] + "," + sign * outerTickSize + "V0H" + range[1] + "V" + sign * outerTickSize); + } else { + tickTransform = d3_svg_axisY, x1 = "y", y1 = "x", x2 = "y2", y2 = "x2"; + text.attr("dy", ".32em").style("text-anchor", sign < 0 ? "end" : "start"); + pathUpdate.attr("d", "M" + sign * outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + sign * outerTickSize); + } + lineEnter.attr(y2, sign * innerTickSize); + textEnter.attr(y1, sign * tickSpacing); + lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize); + textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing); + if (scale1.rangeBand) { + var x = scale1, dx = x.rangeBand() / 2; + scale0 = scale1 = function(d) { + return x(d) + dx; + }; + } else if (scale0.rangeBand) { + scale0 = scale1; + } else { + tickExit.call(tickTransform, scale1, scale0); + } + tickEnter.call(tickTransform, scale0, scale1); + tickUpdate.call(tickTransform, scale1, scale1); + }); + } + axis.scale = function(x) { + if (!arguments.length) return scale; + scale = x; + return axis; + }; + axis.orient = function(x) { + if (!arguments.length) return orient; + orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient; + return axis; + }; + axis.ticks = function() { + if (!arguments.length) return tickArguments_; + tickArguments_ = arguments; + return axis; + }; + axis.tickValues = function(x) { + if (!arguments.length) return tickValues; + tickValues = x; + return axis; + }; + axis.tickFormat = function(x) { + if (!arguments.length) return tickFormat_; + tickFormat_ = x; + return axis; + }; + axis.tickSize = function(x) { + var n = arguments.length; + if (!n) return innerTickSize; + innerTickSize = +x; + outerTickSize = +arguments[n - 1]; + return axis; + }; + axis.innerTickSize = function(x) { + if (!arguments.length) return innerTickSize; + innerTickSize = +x; + return axis; + }; + axis.outerTickSize = function(x) { + if (!arguments.length) return outerTickSize; + outerTickSize = +x; + return axis; + }; + axis.tickPadding = function(x) { + if (!arguments.length) return tickPadding; + tickPadding = +x; + return axis; + }; + axis.tickSubdivide = function() { + return arguments.length && axis; + }; + return axis; + }; + var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = { + top: 1, + right: 1, + bottom: 1, + left: 1 + }; + function d3_svg_axisX(selection, x0, x1) { + selection.attr("transform", function(d) { + var v0 = x0(d); + return "translate(" + (isFinite(v0) ? v0 : x1(d)) + ",0)"; + }); + } + function d3_svg_axisY(selection, y0, y1) { + selection.attr("transform", function(d) { + var v0 = y0(d); + return "translate(0," + (isFinite(v0) ? v0 : y1(d)) + ")"; + }); + } + d3.svg.brush = function() { + var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0]; + function brush(g) { + g.each(function() { + var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart); + var background = g.selectAll(".background").data([ 0 ]); + background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"); + g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move"); + var resize = g.selectAll(".resize").data(resizes, d3_identity); + resize.exit().remove(); + resize.enter().append("g").attr("class", function(d) { + return "resize " + d; + }).style("cursor", function(d) { + return d3_svg_brushCursor[d]; + }).append("rect").attr("x", function(d) { + return /[ew]$/.test(d) ? -3 : null; + }).attr("y", function(d) { + return /^[ns]/.test(d) ? -3 : null; + }).attr("width", 6).attr("height", 6).style("visibility", "hidden"); + resize.style("display", brush.empty() ? "none" : null); + var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range; + if (x) { + range = d3_scaleRange(x); + backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]); + redrawX(gUpdate); + } + if (y) { + range = d3_scaleRange(y); + backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]); + redrawY(gUpdate); + } + redraw(gUpdate); + }); + } + brush.event = function(g) { + g.each(function() { + var event_ = event.of(this, arguments), extent1 = { + x: xExtent, + y: yExtent, + i: xExtentDomain, + j: yExtentDomain + }, extent0 = this.__chart__ || extent1; + this.__chart__ = extent1; + if (d3_transitionInheritId) { + d3.select(this).transition().each("start.brush", function() { + xExtentDomain = extent0.i; + yExtentDomain = extent0.j; + xExtent = extent0.x; + yExtent = extent0.y; + event_({ + type: "brushstart" + }); + }).tween("brush:brush", function() { + var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y); + xExtentDomain = yExtentDomain = null; + return function(t) { + xExtent = extent1.x = xi(t); + yExtent = extent1.y = yi(t); + event_({ + type: "brush", + mode: "resize" + }); + }; + }).each("end.brush", function() { + xExtentDomain = extent1.i; + yExtentDomain = extent1.j; + event_({ + type: "brush", + mode: "resize" + }); + event_({ + type: "brushend" + }); + }); + } else { + event_({ + type: "brushstart" + }); + event_({ + type: "brush", + mode: "resize" + }); + event_({ + type: "brushend" + }); + } + }); + }; + function redraw(g) { + g.selectAll(".resize").attr("transform", function(d) { + return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")"; + }); + } + function redrawX(g) { + g.select(".extent").attr("x", xExtent[0]); + g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]); + } + function redrawY(g) { + g.select(".extent").attr("y", yExtent[0]); + g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]); + } + function brushstart() { + var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(), center, origin = d3.mouse(target), offset; + var w = d3.select(d3_window).on("keydown.brush", keydown).on("keyup.brush", keyup); + if (d3.event.changedTouches) { + w.on("touchmove.brush", brushmove).on("touchend.brush", brushend); + } else { + w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend); + } + g.interrupt().selectAll("*").interrupt(); + if (dragging) { + origin[0] = xExtent[0] - origin[0]; + origin[1] = yExtent[0] - origin[1]; + } else if (resizing) { + var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing); + offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ]; + origin[0] = xExtent[ex]; + origin[1] = yExtent[ey]; + } else if (d3.event.altKey) center = origin.slice(); + g.style("pointer-events", "none").selectAll(".resize").style("display", null); + d3.select("body").style("cursor", eventTarget.style("cursor")); + event_({ + type: "brushstart" + }); + brushmove(); + function keydown() { + if (d3.event.keyCode == 32) { + if (!dragging) { + center = null; + origin[0] -= xExtent[1]; + origin[1] -= yExtent[1]; + dragging = 2; + } + d3_eventPreventDefault(); + } + } + function keyup() { + if (d3.event.keyCode == 32 && dragging == 2) { + origin[0] += xExtent[1]; + origin[1] += yExtent[1]; + dragging = 0; + d3_eventPreventDefault(); + } + } + function brushmove() { + var point = d3.mouse(target), moved = false; + if (offset) { + point[0] += offset[0]; + point[1] += offset[1]; + } + if (!dragging) { + if (d3.event.altKey) { + if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ]; + origin[0] = xExtent[+(point[0] < center[0])]; + origin[1] = yExtent[+(point[1] < center[1])]; + } else center = null; + } + if (resizingX && move1(point, x, 0)) { + redrawX(g); + moved = true; + } + if (resizingY && move1(point, y, 1)) { + redrawY(g); + moved = true; + } + if (moved) { + redraw(g); + event_({ + type: "brush", + mode: dragging ? "move" : "resize" + }); + } + } + function move1(point, scale, i) { + var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max; + if (dragging) { + r0 -= position; + r1 -= size + position; + } + min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i]; + if (dragging) { + max = (min += position) + size; + } else { + if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min)); + if (position < min) { + max = min; + min = position; + } else { + max = position; + } + } + if (extent[0] != min || extent[1] != max) { + if (i) yExtentDomain = null; else xExtentDomain = null; + extent[0] = min; + extent[1] = max; + return true; + } + } + function brushend() { + brushmove(); + g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null); + d3.select("body").style("cursor", null); + w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null); + dragRestore(); + event_({ + type: "brushend" + }); + } + } + brush.x = function(z) { + if (!arguments.length) return x; + x = z; + resizes = d3_svg_brushResizes[!x << 1 | !y]; + return brush; + }; + brush.y = function(z) { + if (!arguments.length) return y; + y = z; + resizes = d3_svg_brushResizes[!x << 1 | !y]; + return brush; + }; + brush.clamp = function(z) { + if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null; + if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z; + return brush; + }; + brush.extent = function(z) { + var x0, x1, y0, y1, t; + if (!arguments.length) { + if (x) { + if (xExtentDomain) { + x0 = xExtentDomain[0], x1 = xExtentDomain[1]; + } else { + x0 = xExtent[0], x1 = xExtent[1]; + if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1); + if (x1 < x0) t = x0, x0 = x1, x1 = t; + } + } + if (y) { + if (yExtentDomain) { + y0 = yExtentDomain[0], y1 = yExtentDomain[1]; + } else { + y0 = yExtent[0], y1 = yExtent[1]; + if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1); + if (y1 < y0) t = y0, y0 = y1, y1 = t; + } + } + return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ]; + } + if (x) { + x0 = z[0], x1 = z[1]; + if (y) x0 = x0[0], x1 = x1[0]; + xExtentDomain = [ x0, x1 ]; + if (x.invert) x0 = x(x0), x1 = x(x1); + if (x1 < x0) t = x0, x0 = x1, x1 = t; + if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ]; + } + if (y) { + y0 = z[0], y1 = z[1]; + if (x) y0 = y0[1], y1 = y1[1]; + yExtentDomain = [ y0, y1 ]; + if (y.invert) y0 = y(y0), y1 = y(y1); + if (y1 < y0) t = y0, y0 = y1, y1 = t; + if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ]; + } + return brush; + }; + brush.clear = function() { + if (!brush.empty()) { + xExtent = [ 0, 0 ], yExtent = [ 0, 0 ]; + xExtentDomain = yExtentDomain = null; + } + return brush; + }; + brush.empty = function() { + return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1]; + }; + return d3.rebind(brush, event, "on"); + }; + var d3_svg_brushCursor = { + n: "ns-resize", + e: "ew-resize", + s: "ns-resize", + w: "ew-resize", + nw: "nwse-resize", + ne: "nesw-resize", + se: "nwse-resize", + sw: "nesw-resize" + }; + var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ]; + var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat; + var d3_time_formatUtc = d3_time_format.utc; + var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ"); + d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso; + function d3_time_formatIsoNative(date) { + return date.toISOString(); + } + d3_time_formatIsoNative.parse = function(string) { + var date = new Date(string); + return isNaN(date) ? null : date; + }; + d3_time_formatIsoNative.toString = d3_time_formatIso.toString; + d3_time.second = d3_time_interval(function(date) { + return new d3_date(Math.floor(date / 1e3) * 1e3); + }, function(date, offset) { + date.setTime(date.getTime() + Math.floor(offset) * 1e3); + }, function(date) { + return date.getSeconds(); + }); + d3_time.seconds = d3_time.second.range; + d3_time.seconds.utc = d3_time.second.utc.range; + d3_time.minute = d3_time_interval(function(date) { + return new d3_date(Math.floor(date / 6e4) * 6e4); + }, function(date, offset) { + date.setTime(date.getTime() + Math.floor(offset) * 6e4); + }, function(date) { + return date.getMinutes(); + }); + d3_time.minutes = d3_time.minute.range; + d3_time.minutes.utc = d3_time.minute.utc.range; + d3_time.hour = d3_time_interval(function(date) { + var timezone = date.getTimezoneOffset() / 60; + return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5); + }, function(date, offset) { + date.setTime(date.getTime() + Math.floor(offset) * 36e5); + }, function(date) { + return date.getHours(); + }); + d3_time.hours = d3_time.hour.range; + d3_time.hours.utc = d3_time.hour.utc.range; + d3_time.month = d3_time_interval(function(date) { + date = d3_time.day(date); + date.setDate(1); + return date; + }, function(date, offset) { + date.setMonth(date.getMonth() + offset); + }, function(date) { + return date.getMonth(); + }); + d3_time.months = d3_time.month.range; + d3_time.months.utc = d3_time.month.utc.range; + function d3_time_scale(linear, methods, format) { + function scale(x) { + return linear(x); + } + scale.invert = function(x) { + return d3_time_scaleDate(linear.invert(x)); + }; + scale.domain = function(x) { + if (!arguments.length) return linear.domain().map(d3_time_scaleDate); + linear.domain(x); + return scale; + }; + function tickMethod(extent, count) { + var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target); + return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) { + return d / 31536e6; + }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i]; + } + scale.nice = function(interval, skip) { + var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval); + if (method) interval = method[0], skip = method[1]; + function skipped(date) { + return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length; + } + return scale.domain(d3_scale_nice(domain, skip > 1 ? { + floor: function(date) { + while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1); + return date; + }, + ceil: function(date) { + while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1); + return date; + } + } : interval)); + }; + scale.ticks = function(interval, skip) { + var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ { + range: interval + }, skip ]; + if (method) interval = method[0], skip = method[1]; + return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip); + }; + scale.tickFormat = function() { + return format; + }; + scale.copy = function() { + return d3_time_scale(linear.copy(), methods, format); + }; + return d3_scale_linearRebind(scale, linear); + } + function d3_time_scaleDate(t) { + return new Date(t); + } + var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ]; + var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ]; + var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) { + return d.getMilliseconds(); + } ], [ ":%S", function(d) { + return d.getSeconds(); + } ], [ "%I:%M", function(d) { + return d.getMinutes(); + } ], [ "%I %p", function(d) { + return d.getHours(); + } ], [ "%a %d", function(d) { + return d.getDay() && d.getDate() != 1; + } ], [ "%b %d", function(d) { + return d.getDate() != 1; + } ], [ "%B", function(d) { + return d.getMonth(); + } ], [ "%Y", d3_true ] ]); + var d3_time_scaleMilliseconds = { + range: function(start, stop, step) { + return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate); + }, + floor: d3_identity, + ceil: d3_identity + }; + d3_time_scaleLocalMethods.year = d3_time.year; + d3_time.scale = function() { + return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat); + }; + var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) { + return [ m[0].utc, m[1] ]; + }); + var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) { + return d.getUTCMilliseconds(); + } ], [ ":%S", function(d) { + return d.getUTCSeconds(); + } ], [ "%I:%M", function(d) { + return d.getUTCMinutes(); + } ], [ "%I %p", function(d) { + return d.getUTCHours(); + } ], [ "%a %d", function(d) { + return d.getUTCDay() && d.getUTCDate() != 1; + } ], [ "%b %d", function(d) { + return d.getUTCDate() != 1; + } ], [ "%B", function(d) { + return d.getUTCMonth(); + } ], [ "%Y", d3_true ] ]); + d3_time_scaleUtcMethods.year = d3_time.year.utc; + d3_time.scale.utc = function() { + return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat); + }; + d3.text = d3_xhrType(function(request) { + return request.responseText; + }); + d3.json = function(url, callback) { + return d3_xhr(url, "application/json", d3_json, callback); + }; + function d3_json(request) { + return JSON.parse(request.responseText); + } + d3.html = function(url, callback) { + return d3_xhr(url, "text/html", d3_html, callback); + }; + function d3_html(request) { + var range = d3_document.createRange(); + range.selectNode(d3_document.body); + return range.createContextualFragment(request.responseText); + } + d3.xml = d3_xhrType(function(request) { + return request.responseXML; + }); + if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; + this.d3 = d3; +}(); +},{}],2:[function(require,module,exports){ /** * @license * Copyright (c) 2012-2013 Chris Pettitt @@ -30,7 +9246,7 @@ module.exports = { version: require("./lib/version") }; -},{"./lib/dagre":8,"./lib/graphlib":9,"./lib/intersect":10,"./lib/render":23,"./lib/util":25,"./lib/version":26}],2:[function(require,module,exports){ +},{"./lib/dagre":9,"./lib/graphlib":10,"./lib/intersect":11,"./lib/render":24,"./lib/util":26,"./lib/version":27}],3:[function(require,module,exports){ var util = require("./util"); module.exports = { @@ -75,7 +9291,7 @@ function vee(parent, id, edge, type) { util.applyStyle(path, edge[type + "Style"]); } -},{"./util":25}],3:[function(require,module,exports){ +},{"./util":26}],4:[function(require,module,exports){ var util = require("./util"); module.exports = createClusters; @@ -110,7 +9326,7 @@ function createClusters(selection, g) { }); } -},{"./util":25}],4:[function(require,module,exports){ +},{"./util":26}],5:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -147,7 +9363,7 @@ function createEdgeLabels(selection, g) { return svgEdgeLabels; } -},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],5:[function(require,module,exports){ +},{"./d3":8,"./label/add-label":19,"./lodash":21,"./util":26}],6:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -266,7 +9482,7 @@ function exit(svgPaths, g) { }); } -},{"./d3":7,"./intersect/intersect-node":14,"./lodash":20,"./util":25}],6:[function(require,module,exports){ +},{"./d3":8,"./intersect/intersect-node":15,"./lodash":21,"./util":26}],7:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -325,11 +9541,11 @@ function createNodes(selection, g, shapes) { return svgNodes; } -},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],7:[function(require,module,exports){ +},{"./d3":8,"./label/add-label":19,"./lodash":21,"./util":26}],8:[function(require,module,exports){ // Stub to get D3 either via NPM or from the global object module.exports = window.d3; -},{}],8:[function(require,module,exports){ +},{}],9:[function(require,module,exports){ /* global window */ var dagre; @@ -346,7 +9562,7 @@ if (!dagre) { module.exports = dagre; -},{"dagre":27}],9:[function(require,module,exports){ +},{"dagre":28}],10:[function(require,module,exports){ /* global window */ var graphlib; @@ -363,7 +9579,7 @@ if (!graphlib) { module.exports = graphlib; -},{"graphlib":77}],10:[function(require,module,exports){ +},{"graphlib":78}],11:[function(require,module,exports){ module.exports = { node: require("./intersect-node"), circle: require("./intersect-circle"), @@ -372,7 +9588,7 @@ module.exports = { rect: require("./intersect-rect") }; -},{"./intersect-circle":11,"./intersect-ellipse":12,"./intersect-node":14,"./intersect-polygon":15,"./intersect-rect":16}],11:[function(require,module,exports){ +},{"./intersect-circle":12,"./intersect-ellipse":13,"./intersect-node":15,"./intersect-polygon":16,"./intersect-rect":17}],12:[function(require,module,exports){ var intersectEllipse = require("./intersect-ellipse"); module.exports = intersectCircle; @@ -381,7 +9597,7 @@ function intersectCircle(node, rx, point) { return intersectEllipse(node, rx, rx, point); } -},{"./intersect-ellipse":12}],12:[function(require,module,exports){ +},{"./intersect-ellipse":13}],13:[function(require,module,exports){ module.exports = intersectEllipse; function intersectEllipse(node, rx, ry, point) { @@ -408,7 +9624,7 @@ function intersectEllipse(node, rx, ry, point) { } -},{}],13:[function(require,module,exports){ +},{}],14:[function(require,module,exports){ module.exports = intersectLine; /* @@ -480,14 +9696,14 @@ function sameSign(r1, r2) { return r1 * r2 > 0; } -},{}],14:[function(require,module,exports){ +},{}],15:[function(require,module,exports){ module.exports = intersectNode; function intersectNode(node, point) { return node.intersect(point); } -},{}],15:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ var intersectLine = require("./intersect-line"); module.exports = intersectPolygon; @@ -544,7 +9760,7 @@ function intersectPolygon(node, polyPoints, point) { return intersections[0]; } -},{"./intersect-line":13}],16:[function(require,module,exports){ +},{"./intersect-line":14}],17:[function(require,module,exports){ module.exports = intersectRect; function intersectRect(node, point) { @@ -578,7 +9794,7 @@ function intersectRect(node, point) { return {x: x + sx, y: y + sy}; } -},{}],17:[function(require,module,exports){ +},{}],18:[function(require,module,exports){ var util = require("../util"); module.exports = addHtmlLabel; @@ -623,7 +9839,7 @@ function addHtmlLabel(root, node) { return fo; } -},{"../util":25}],18:[function(require,module,exports){ +},{"../util":26}],19:[function(require,module,exports){ var addTextLabel = require("./add-text-label"), addHtmlLabel = require("./add-html-label"); @@ -648,7 +9864,7 @@ function addLabel(root, node) { return labelSvg; } -},{"./add-html-label":17,"./add-text-label":19}],19:[function(require,module,exports){ +},{"./add-html-label":18,"./add-text-label":20}],20:[function(require,module,exports){ var util = require("../util"); module.exports = addTextLabel; @@ -695,7 +9911,7 @@ function processEscapeSequences(text) { return newText; } -},{"../util":25}],20:[function(require,module,exports){ +},{"../util":26}],21:[function(require,module,exports){ /* global window */ var lodash; @@ -712,7 +9928,7 @@ if (!lodash) { module.exports = lodash; -},{"lodash":101}],21:[function(require,module,exports){ +},{"lodash":102}],22:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -736,7 +9952,7 @@ function positionEdgeLabels(selection, g) { .attr("transform", translate); } -},{"./d3":7,"./lodash":20,"./util":25}],22:[function(require,module,exports){ +},{"./d3":8,"./lodash":21,"./util":26}],23:[function(require,module,exports){ "use strict"; var util = require("./util"), @@ -759,7 +9975,7 @@ function positionNodes(selection, g) { .attr("transform", translate); } -},{"./d3":7,"./util":25}],23:[function(require,module,exports){ +},{"./d3":8,"./util":26}],24:[function(require,module,exports){ var _ = require("./lodash"), layout = require("./dagre").layout; @@ -925,7 +10141,7 @@ function createOrSelectGroup(root, name) { return selection; } -},{"./arrows":2,"./create-clusters":3,"./create-edge-labels":4,"./create-edge-paths":5,"./create-nodes":6,"./dagre":8,"./lodash":20,"./position-edge-labels":21,"./position-nodes":22,"./shapes":24}],24:[function(require,module,exports){ +},{"./arrows":3,"./create-clusters":4,"./create-edge-labels":5,"./create-edge-paths":6,"./create-nodes":7,"./dagre":9,"./lodash":21,"./position-edge-labels":22,"./position-nodes":23,"./shapes":25}],25:[function(require,module,exports){ "use strict"; var intersectRect = require("./intersect/intersect-rect"), @@ -984,7 +10200,7 @@ function circle(parent, bbox, node) { return shapeSvg; } -},{"./intersect/intersect-circle":11,"./intersect/intersect-ellipse":12,"./intersect/intersect-rect":16}],25:[function(require,module,exports){ +},{"./intersect/intersect-circle":12,"./intersect/intersect-ellipse":13,"./intersect/intersect-rect":17}],26:[function(require,module,exports){ var _ = require("./lodash"); // Public utility functions @@ -1040,10 +10256,10 @@ function applyTransition(selection, g) { return selection; } -},{"./lodash":20}],26:[function(require,module,exports){ +},{"./lodash":21}],27:[function(require,module,exports){ module.exports = "0.3.2"; -},{}],27:[function(require,module,exports){ +},{}],28:[function(require,module,exports){ /* Copyright (c) 2012-2014 Chris Pettitt @@ -1078,7 +10294,7 @@ module.exports = { version: require("./lib/version") }; -},{"./lib/debug":32,"./lib/graphlib":33,"./lib/layout":35,"./lib/util":55,"./lib/version":56}],28:[function(require,module,exports){ +},{"./lib/debug":33,"./lib/graphlib":34,"./lib/layout":36,"./lib/util":56,"./lib/version":57}],29:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -1147,7 +10363,7 @@ function undo(g) { }); } -},{"./greedy-fas":34,"./lodash":36}],29:[function(require,module,exports){ +},{"./greedy-fas":35,"./lodash":37}],30:[function(require,module,exports){ var _ = require("./lodash"), util = require("./util"); @@ -1187,7 +10403,7 @@ function addBorderNode(g, prop, prefix, sg, sgNode, rank) { } } -},{"./lodash":36,"./util":55}],30:[function(require,module,exports){ +},{"./lodash":37,"./util":56}],31:[function(require,module,exports){ "use strict"; var _ = require("./lodash"); @@ -1261,7 +10477,7 @@ function swapXYOne(attrs) { attrs.y = x; } -},{"./lodash":36}],31:[function(require,module,exports){ +},{"./lodash":37}],32:[function(require,module,exports){ /* * Simple doubly linked list implementation derived from Cormen, et al., * "Introduction to Algorithms". @@ -1319,7 +10535,7 @@ function filterOutLinks(k, v) { } } -},{}],32:[function(require,module,exports){ +},{}],33:[function(require,module,exports){ var _ = require("./lodash"), util = require("./util"), Graph = require("./graphlib").Graph; @@ -1355,9 +10571,9 @@ function debugOrdering(g) { return h; } -},{"./graphlib":33,"./lodash":36,"./util":55}],33:[function(require,module,exports){ -module.exports=require(9) -},{"graphlib":57}],34:[function(require,module,exports){ +},{"./graphlib":34,"./lodash":37,"./util":56}],34:[function(require,module,exports){ +module.exports=require(10) +},{"graphlib":58}],35:[function(require,module,exports){ var _ = require("./lodash"), Graph = require("./graphlib").Graph, List = require("./data/list"); @@ -1477,7 +10693,7 @@ function assignBucket(buckets, zeroIdx, entry) { } } -},{"./data/list":31,"./graphlib":33,"./lodash":36}],35:[function(require,module,exports){ +},{"./data/list":32,"./graphlib":34,"./lodash":37}],36:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -1871,9 +11087,9 @@ function canonicalize(attrs) { return newAttrs; } -},{"./acyclic":28,"./add-border-segments":29,"./coordinate-system":30,"./graphlib":33,"./lodash":36,"./nesting-graph":37,"./normalize":38,"./order":43,"./parent-dummy-chains":48,"./position":50,"./rank":52,"./util":55}],36:[function(require,module,exports){ -module.exports=require(20) -},{"lodash":101}],37:[function(require,module,exports){ +},{"./acyclic":29,"./add-border-segments":30,"./coordinate-system":31,"./graphlib":34,"./lodash":37,"./nesting-graph":38,"./normalize":39,"./order":44,"./parent-dummy-chains":49,"./position":51,"./rank":53,"./util":56}],37:[function(require,module,exports){ +module.exports=require(21) +},{"lodash":102}],38:[function(require,module,exports){ var _ = require("./lodash"), util = require("./util"); @@ -2007,7 +11223,7 @@ function cleanup(g) { }); } -},{"./lodash":36,"./util":55}],38:[function(require,module,exports){ +},{"./lodash":37,"./util":56}],39:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -2099,7 +11315,7 @@ function undo(g) { }); } -},{"./lodash":36,"./util":55}],39:[function(require,module,exports){ +},{"./lodash":37,"./util":56}],40:[function(require,module,exports){ var _ = require("../lodash"); module.exports = addSubgraphConstraints; @@ -2154,7 +11370,7 @@ function addSubgraphConstraints(g, cg, vs) { */ } -},{"../lodash":36}],40:[function(require,module,exports){ +},{"../lodash":37}],41:[function(require,module,exports){ var _ = require("../lodash"); module.exports = barycenter; @@ -2184,7 +11400,7 @@ function barycenter(g, movable) { } -},{"../lodash":36}],41:[function(require,module,exports){ +},{"../lodash":37}],42:[function(require,module,exports){ var _ = require("../lodash"), Graph = require("../graphlib").Graph; @@ -2259,7 +11475,7 @@ function createRootNode(g) { return v; } -},{"../graphlib":33,"../lodash":36}],42:[function(require,module,exports){ +},{"../graphlib":34,"../lodash":37}],43:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -2331,7 +11547,7 @@ function twoLayerCrossCount(g, northLayer, southLayer) { return cc; } -},{"../lodash":36}],43:[function(require,module,exports){ +},{"../lodash":37}],44:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -2412,7 +11628,7 @@ function assignOrder(g, layering) { }); } -},{"../graphlib":33,"../lodash":36,"../util":55,"./add-subgraph-constraints":39,"./build-layer-graph":41,"./cross-count":42,"./init-order":44,"./sort-subgraph":46}],44:[function(require,module,exports){ +},{"../graphlib":34,"../lodash":37,"../util":56,"./add-subgraph-constraints":40,"./build-layer-graph":42,"./cross-count":43,"./init-order":45,"./sort-subgraph":47}],45:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -2452,7 +11668,7 @@ function initOrder(g) { return layers; } -},{"../lodash":36}],45:[function(require,module,exports){ +},{"../lodash":37}],46:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -2577,7 +11793,7 @@ function mergeEntries(target, source) { source.merged = true; } -},{"../lodash":36}],46:[function(require,module,exports){ +},{"../lodash":37}],47:[function(require,module,exports){ var _ = require("../lodash"), barycenter = require("./barycenter"), resolveConflicts = require("./resolve-conflicts"), @@ -2655,7 +11871,7 @@ function mergeBarycenters(target, other) { } } -},{"../lodash":36,"./barycenter":40,"./resolve-conflicts":45,"./sort":47}],47:[function(require,module,exports){ +},{"../lodash":37,"./barycenter":41,"./resolve-conflicts":46,"./sort":48}],48:[function(require,module,exports){ var _ = require("../lodash"), util = require("../util"); @@ -2714,7 +11930,7 @@ function compareWithBias(bias) { }; } -},{"../lodash":36,"../util":55}],48:[function(require,module,exports){ +},{"../lodash":37,"../util":56}],49:[function(require,module,exports){ var _ = require("./lodash"); module.exports = parentDummyChains; @@ -2802,7 +12018,7 @@ function postorder(g) { return result; } -},{"./lodash":36}],49:[function(require,module,exports){ +},{"./lodash":37}],50:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -3203,7 +12419,7 @@ function width(g, v) { return g.node(v).width; } -},{"../lodash":36,"../util":55}],50:[function(require,module,exports){ +},{"../lodash":37,"../util":56}],51:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -3235,7 +12451,7 @@ function positionY(g) { } -},{"../lodash":36,"../util":55,"./bk":49}],51:[function(require,module,exports){ +},{"../lodash":37,"../util":56,"./bk":50}],52:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -3326,7 +12542,7 @@ function shiftRanks(t, g, delta) { }); } -},{"../graphlib":33,"../lodash":36,"./util":54}],52:[function(require,module,exports){ +},{"../graphlib":34,"../lodash":37,"./util":55}],53:[function(require,module,exports){ "use strict"; var rankUtil = require("./util"), @@ -3376,7 +12592,7 @@ function networkSimplexRanker(g) { networkSimplex(g); } -},{"./feasible-tree":51,"./network-simplex":53,"./util":54}],53:[function(require,module,exports){ +},{"./feasible-tree":52,"./network-simplex":54,"./util":55}],54:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -3612,7 +12828,7 @@ function isDescendant(tree, vLabel, rootLabel) { return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; } -},{"../graphlib":33,"../lodash":36,"../util":55,"./feasible-tree":51,"./util":54}],54:[function(require,module,exports){ +},{"../graphlib":34,"../lodash":37,"../util":56,"./feasible-tree":52,"./util":55}],55:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -3675,7 +12891,7 @@ function slack(g, e) { return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; } -},{"../lodash":36}],55:[function(require,module,exports){ +},{"../lodash":37}],56:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -3913,10 +13129,10 @@ function notime(name, fn) { return fn(); } -},{"./graphlib":33,"./lodash":36}],56:[function(require,module,exports){ +},{"./graphlib":34,"./lodash":37}],57:[function(require,module,exports){ module.exports = "0.6.4"; -},{}],57:[function(require,module,exports){ +},{}],58:[function(require,module,exports){ /** * Copyright (c) 2014, Chris Pettitt * All rights reserved. @@ -3956,7 +13172,7 @@ module.exports = { version: lib.version }; -},{"./lib":73,"./lib/alg":64,"./lib/json":74}],58:[function(require,module,exports){ +},{"./lib":74,"./lib/alg":65,"./lib/json":75}],59:[function(require,module,exports){ var _ = require("../lodash"); module.exports = components; @@ -3985,7 +13201,7 @@ function components(g) { return cmpts; } -},{"../lodash":75}],59:[function(require,module,exports){ +},{"../lodash":76}],60:[function(require,module,exports){ var _ = require("../lodash"); module.exports = dfs; @@ -4026,7 +13242,7 @@ function doDfs(g, v, postorder, visited, acc) { } } -},{"../lodash":75}],60:[function(require,module,exports){ +},{"../lodash":76}],61:[function(require,module,exports){ var dijkstra = require("./dijkstra"), _ = require("../lodash"); @@ -4038,7 +13254,7 @@ function dijkstraAll(g, weightFunc, edgeFunc) { }, {}); } -},{"../lodash":75,"./dijkstra":61}],61:[function(require,module,exports){ +},{"../lodash":76,"./dijkstra":62}],62:[function(require,module,exports){ var _ = require("../lodash"), PriorityQueue = require("../data/priority-queue"); @@ -4094,7 +13310,7 @@ function runDijkstra(g, source, weightFn, edgeFn) { return results; } -},{"../data/priority-queue":71,"../lodash":75}],62:[function(require,module,exports){ +},{"../data/priority-queue":72,"../lodash":76}],63:[function(require,module,exports){ var _ = require("../lodash"), tarjan = require("./tarjan"); @@ -4104,7 +13320,7 @@ function findCycles(g) { return _.filter(tarjan(g), function(cmpt) { return cmpt.length > 1; }); } -},{"../lodash":75,"./tarjan":69}],63:[function(require,module,exports){ +},{"../lodash":76,"./tarjan":70}],64:[function(require,module,exports){ var _ = require("../lodash"); module.exports = floydWarshall; @@ -4156,7 +13372,7 @@ function runFloydWarshall(g, weightFn, edgeFn) { return results; } -},{"../lodash":75}],64:[function(require,module,exports){ +},{"../lodash":76}],65:[function(require,module,exports){ module.exports = { components: require("./components"), dijkstra: require("./dijkstra"), @@ -4171,7 +13387,7 @@ module.exports = { topsort: require("./topsort") }; -},{"./components":58,"./dijkstra":61,"./dijkstra-all":60,"./find-cycles":62,"./floyd-warshall":63,"./is-acyclic":65,"./postorder":66,"./preorder":67,"./prim":68,"./tarjan":69,"./topsort":70}],65:[function(require,module,exports){ +},{"./components":59,"./dijkstra":62,"./dijkstra-all":61,"./find-cycles":63,"./floyd-warshall":64,"./is-acyclic":66,"./postorder":67,"./preorder":68,"./prim":69,"./tarjan":70,"./topsort":71}],66:[function(require,module,exports){ var topsort = require("./topsort"); module.exports = isAcyclic; @@ -4188,7 +13404,7 @@ function isAcyclic(g) { return true; } -},{"./topsort":70}],66:[function(require,module,exports){ +},{"./topsort":71}],67:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = postorder; @@ -4197,7 +13413,7 @@ function postorder(g, vs) { return dfs(g, vs, "post"); } -},{"./dfs":59}],67:[function(require,module,exports){ +},{"./dfs":60}],68:[function(require,module,exports){ var dfs = require("./dfs"); module.exports = preorder; @@ -4206,7 +13422,7 @@ function preorder(g, vs) { return dfs(g, vs, "pre"); } -},{"./dfs":59}],68:[function(require,module,exports){ +},{"./dfs":60}],69:[function(require,module,exports){ var _ = require("../lodash"), Graph = require("../graph"), PriorityQueue = require("../data/priority-queue"); @@ -4260,7 +13476,7 @@ function prim(g, weightFunc) { return result; } -},{"../data/priority-queue":71,"../graph":72,"../lodash":75}],69:[function(require,module,exports){ +},{"../data/priority-queue":72,"../graph":73,"../lodash":76}],70:[function(require,module,exports){ var _ = require("../lodash"); module.exports = tarjan; @@ -4309,7 +13525,7 @@ function tarjan(g) { return results; } -},{"../lodash":75}],70:[function(require,module,exports){ +},{"../lodash":76}],71:[function(require,module,exports){ var _ = require("../lodash"); module.exports = topsort; @@ -4345,7 +13561,7 @@ function topsort(g) { function CycleException() {} -},{"../lodash":75}],71:[function(require,module,exports){ +},{"../lodash":76}],72:[function(require,module,exports){ var _ = require("../lodash"); module.exports = PriorityQueue; @@ -4499,7 +13715,7 @@ PriorityQueue.prototype._swap = function(i, j) { keyIndices[origArrI.key] = j; }; -},{"../lodash":75}],72:[function(require,module,exports){ +},{"../lodash":76}],73:[function(require,module,exports){ "use strict"; var _ = require("./lodash"); @@ -4969,14 +14185,14 @@ function edgeObjToId(isDirected, edgeObj) { return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); } -},{"./lodash":75}],73:[function(require,module,exports){ +},{"./lodash":76}],74:[function(require,module,exports){ // Includes only the "core" of graphlib module.exports = { Graph: require("./graph"), version: require("./version") }; -},{"./graph":72,"./version":76}],74:[function(require,module,exports){ +},{"./graph":73,"./version":77}],75:[function(require,module,exports){ var _ = require("./lodash"), Graph = require("./graph"); @@ -5044,42 +14260,42 @@ function read(json) { return g; } -},{"./graph":72,"./lodash":75}],75:[function(require,module,exports){ -module.exports=require(20) -},{"lodash":101}],76:[function(require,module,exports){ +},{"./graph":73,"./lodash":76}],76:[function(require,module,exports){ +module.exports=require(21) +},{"lodash":102}],77:[function(require,module,exports){ module.exports = '1.0.1'; -},{}],77:[function(require,module,exports){ -arguments[4][57][0].apply(exports,arguments) -},{"./lib":93,"./lib/alg":84,"./lib/json":94}],78:[function(require,module,exports){ -module.exports=require(58) -},{"../lodash":95}],79:[function(require,module,exports){ +},{}],78:[function(require,module,exports){ +arguments[4][58][0].apply(exports,arguments) +},{"./lib":94,"./lib/alg":85,"./lib/json":95}],79:[function(require,module,exports){ module.exports=require(59) -},{"../lodash":95}],80:[function(require,module,exports){ +},{"../lodash":96}],80:[function(require,module,exports){ module.exports=require(60) -},{"../lodash":95,"./dijkstra":81}],81:[function(require,module,exports){ +},{"../lodash":96}],81:[function(require,module,exports){ module.exports=require(61) -},{"../data/priority-queue":91,"../lodash":95}],82:[function(require,module,exports){ +},{"../lodash":96,"./dijkstra":82}],82:[function(require,module,exports){ module.exports=require(62) -},{"../lodash":95,"./tarjan":89}],83:[function(require,module,exports){ +},{"../data/priority-queue":92,"../lodash":96}],83:[function(require,module,exports){ module.exports=require(63) -},{"../lodash":95}],84:[function(require,module,exports){ -arguments[4][64][0].apply(exports,arguments) -},{"./components":78,"./dijkstra":81,"./dijkstra-all":80,"./find-cycles":82,"./floyd-warshall":83,"./is-acyclic":85,"./postorder":86,"./preorder":87,"./prim":88,"./tarjan":89,"./topsort":90}],85:[function(require,module,exports){ -module.exports=require(65) -},{"./topsort":90}],86:[function(require,module,exports){ +},{"../lodash":96,"./tarjan":90}],84:[function(require,module,exports){ +module.exports=require(64) +},{"../lodash":96}],85:[function(require,module,exports){ +arguments[4][65][0].apply(exports,arguments) +},{"./components":79,"./dijkstra":82,"./dijkstra-all":81,"./find-cycles":83,"./floyd-warshall":84,"./is-acyclic":86,"./postorder":87,"./preorder":88,"./prim":89,"./tarjan":90,"./topsort":91}],86:[function(require,module,exports){ module.exports=require(66) -},{"./dfs":79}],87:[function(require,module,exports){ +},{"./topsort":91}],87:[function(require,module,exports){ module.exports=require(67) -},{"./dfs":79}],88:[function(require,module,exports){ -arguments[4][68][0].apply(exports,arguments) -},{"../data/priority-queue":91,"../graph":92,"../lodash":95}],89:[function(require,module,exports){ -module.exports=require(69) -},{"../lodash":95}],90:[function(require,module,exports){ +},{"./dfs":80}],88:[function(require,module,exports){ +module.exports=require(68) +},{"./dfs":80}],89:[function(require,module,exports){ +arguments[4][69][0].apply(exports,arguments) +},{"../data/priority-queue":92,"../graph":93,"../lodash":96}],90:[function(require,module,exports){ module.exports=require(70) -},{"../lodash":95}],91:[function(require,module,exports){ +},{"../lodash":96}],91:[function(require,module,exports){ module.exports=require(71) -},{"../lodash":95}],92:[function(require,module,exports){ +},{"../lodash":96}],92:[function(require,module,exports){ +module.exports=require(72) +},{"../lodash":96}],93:[function(require,module,exports){ "use strict"; var _ = require("./lodash"); @@ -5540,18 +14756,18 @@ function edgeObjToId(isDirected, edgeObj) { return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name); } -},{"./lodash":95}],93:[function(require,module,exports){ -arguments[4][73][0].apply(exports,arguments) -},{"./graph":92,"./version":96}],94:[function(require,module,exports){ +},{"./lodash":96}],94:[function(require,module,exports){ arguments[4][74][0].apply(exports,arguments) -},{"./graph":92,"./lodash":95}],95:[function(require,module,exports){ -module.exports=require(20) -},{"lodash":101}],96:[function(require,module,exports){ +},{"./graph":93,"./version":97}],95:[function(require,module,exports){ +arguments[4][75][0].apply(exports,arguments) +},{"./graph":93,"./lodash":96}],96:[function(require,module,exports){ +module.exports=require(21) +},{"lodash":102}],97:[function(require,module,exports){ module.exports = '0.9.1'; -},{}],97:[function(require,module,exports){ - },{}],98:[function(require,module,exports){ + +},{}],99:[function(require,module,exports){ (function (process){ // Copyright Joyent, Inc. and other Node contributors. // @@ -5779,7 +14995,7 @@ var substr = 'ab'.substr(-1) === 'b' ; }).call(this,require("1YiZ5S")) -},{"1YiZ5S":99}],99:[function(require,module,exports){ +},{"1YiZ5S":100}],100:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -5844,7 +15060,7 @@ process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; -},{}],100:[function(require,module,exports){ +},{}],101:[function(require,module,exports){ (function (global){ /*! http://mths.be/he v0.5.0 by @mathias | MIT license */ ;(function(root) { @@ -6177,7 +15393,7 @@ process.chdir = function (dir) { }(this)); }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],101:[function(require,module,exports){ +},{}],102:[function(require,module,exports){ (function (global){ /** * @license @@ -12966,7 +22182,7 @@ process.chdir = function (dir) { }.call(this)); }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],102:[function(require,module,exports){ +},{}],103:[function(require,module,exports){ module.exports={ "name": "mermaid", "version": "0.3.2", @@ -12986,6 +22202,7 @@ module.exports={ "license": "MIT", "dependencies": { "chalk": "^0.5.1", + "d3": "~3.4.13", "dagre-d3": "~0.3.2", "he": "^0.5.0", "minimist": "^1.1.0", @@ -13040,6 +22257,7 @@ module.exports={ "mock-browser": "^0.90.27", "path": "^0.4.9", "phantomjs": "^1.9.12", + "proxyquire": "^1.3.1", "rewire": "^2.1.3", "rimraf": "^2.2.8", "semantic-ui": "^1.4.1", @@ -13047,7 +22265,7 @@ module.exports={ } } -},{}],103:[function(require,module,exports){ +},{}],104:[function(require,module,exports){ /** * Created by knut on 15-01-14. */ @@ -13072,7 +22290,7 @@ exports.getInfo = function(){ }; -},{}],104:[function(require,module,exports){ +},{}],105:[function(require,module,exports){ /** * Created by knut on 14-12-11. */ @@ -13117,7 +22335,7 @@ exports.draw = function (txt, id, ver) { svg.attr("width", 400 ); //svg.attr("viewBox", '0 0 300 150'); }; -},{"./exampleDb":103,"./parser/example.js":105}],105:[function(require,module,exports){ +},{"./exampleDb":104,"./parser/example.js":106}],106:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -13744,7 +22962,7 @@ if (typeof module !== 'undefined' && require.main === module) { } } }).call(this,require("1YiZ5S")) -},{"1YiZ5S":99,"fs":97,"path":98}],106:[function(require,module,exports){ +},{"1YiZ5S":100,"fs":98,"path":99}],107:[function(require,module,exports){ /* global window */ var dagreD3; @@ -13761,7 +22979,7 @@ if (!dagreD3) { module.exports = dagreD3; -},{"dagre-d3":1}],107:[function(require,module,exports){ +},{"dagre-d3":2}],108:[function(require,module,exports){ (function (global){ /** * Created by knut on 14-12-11. @@ -14184,7 +23402,7 @@ exports.draw = function (text, id,isDot) { },200); }; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./dagre-d3":106,"./graphDb":108,"./parser/dot":109,"./parser/flow":110}],108:[function(require,module,exports){ +},{"./dagre-d3":107,"./graphDb":109,"./parser/dot":110,"./parser/flow":111}],109:[function(require,module,exports){ /** * Created by knut on 14-11-03. */ @@ -14423,7 +23641,7 @@ exports.getSubGraphs = function (list) { return subGraphs; }; -},{}],109:[function(require,module,exports){ +},{}],110:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -15161,7 +24379,7 @@ if (typeof module !== 'undefined' && require.main === module) { } } }).call(this,require("1YiZ5S")) -},{"1YiZ5S":99,"fs":97,"path":98}],110:[function(require,module,exports){ +},{"1YiZ5S":100,"fs":98,"path":99}],111:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -16046,7 +25264,24 @@ if (typeof module !== 'undefined' && require.main === module) { } } }).call(this,require("1YiZ5S")) -},{"1YiZ5S":99,"fs":97,"path":98}],111:[function(require,module,exports){ +},{"1YiZ5S":100,"fs":98,"path":99}],112:[function(require,module,exports){ +/* global window */ + +var d3; + +if (require) { + try { + d3 = require("d3"); + } catch (e) {} +} + +if (!d3) { + d3 = window.d3; +} + +module.exports = d3; + +},{"d3":1}],113:[function(require,module,exports){ (function (process){ /* parser generated by jison 0.4.15 */ /* @@ -16790,7 +26025,7 @@ if (typeof module !== 'undefined' && require.main === module) { } } }).call(this,require("1YiZ5S")) -},{"1YiZ5S":99,"fs":97,"path":98}],112:[function(require,module,exports){ +},{"1YiZ5S":100,"fs":98,"path":99}],114:[function(require,module,exports){ /** * Created by knut on 14-11-19. */ @@ -16923,8 +26158,7 @@ exports.apply = function(param){ // console.log('xxx',param); } }; -},{}],113:[function(require,module,exports){ -/* globals d3 */ +},{}],115:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -16932,6 +26166,7 @@ exports.apply = function(param){ var sq = require('./parser/sequenceDiagram').parser; sq.yy = require('./sequenceDb'); var svgDraw = require('./svgDraw'); +var d3 = require('./d3'); var conf = { diagramMarginX:50, @@ -17270,7 +26505,7 @@ module.exports.draw = function (text, id) { diagram.attr("viewBox", (box.startx-conf.diagramMarginX) + ' -' +conf.diagramMarginY + ' ' + width + ' ' + height); }; -},{"./parser/sequenceDiagram":111,"./sequenceDb":112,"./svgDraw":114}],114:[function(require,module,exports){ +},{"./d3":112,"./parser/sequenceDiagram":113,"./sequenceDb":114,"./svgDraw":116}],116:[function(require,module,exports){ /** * Created by knut on 14-12-20. */ @@ -17500,7 +26735,7 @@ exports.getNoteRect = function(){ return rect; }; -},{}],115:[function(require,module,exports){ +},{}],117:[function(require,module,exports){ (function (global){ var graph = require('./diagrams/flowchart/graphDb'); var flow = require('./diagrams/flowchart/parser/flow'); @@ -17658,7 +26893,7 @@ if(typeof document !== 'undefined'){ }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../package.json":102,"./diagrams/example/exampleRenderer":104,"./diagrams/flowchart/flowRenderer":107,"./diagrams/flowchart/graphDb":108,"./diagrams/flowchart/parser/flow":110,"./diagrams/sequenceDiagram/sequenceRenderer":113,"./utils":116,"he":100}],116:[function(require,module,exports){ +},{"../package.json":103,"./diagrams/example/exampleRenderer":105,"./diagrams/flowchart/flowRenderer":108,"./diagrams/flowchart/graphDb":109,"./diagrams/flowchart/parser/flow":111,"./diagrams/sequenceDiagram/sequenceRenderer":115,"./utils":118,"he":101}],118:[function(require,module,exports){ /** * Created by knut on 14-11-23. */ @@ -17761,4 +26996,4 @@ module.exports.cloneCssStyles = function(svg, classes){ } }; -},{}]},{},[115]) \ No newline at end of file +},{}]},{},[117]) \ No newline at end of file diff --git a/dist/mermaid.slim.min.js b/dist/mermaid.slim.min.js index 7f4ee3b91..342d6b86a 100644 --- a/dist/mermaid.slim.min.js +++ b/dist/mermaid.slim.min.js @@ -1,7 +1,11 @@ -!function e(t,r,n){function i(s,o){if(!r[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);throw new Error("Cannot find module '"+s+"'")}var c=r[s]={exports:{}};t[s][0].call(c.exports,function(e){var r=t[s][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[s].exports}for(var a="function"==typeof require&&require,s=0;sm?(m-y)/g:(m+y)/g,m=s*c-a*l,b=0>m?(m-y)/g:(m+y)/g,{x:v,y:b})}function n(e,t){return e*t>0}t.exports=r},{}],14:[function(e,t){function r(e,t){return e.intersect(t)}t.exports=r},{}],15:[function(e,t){function r(e,t,r){var i=e.x,a=e.y,s=[],o=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY;t.forEach(function(e){o=Math.min(o,e.x),u=Math.min(u,e.y)});for(var c=i-e.width/2-o,l=a-e.height/2-u,h=0;h1&&s.sort(function(e,t){var n=e.x-r.x,i=e.y-r.y,a=Math.sqrt(n*n+i*i),s=t.x-r.x,o=t.y-r.y,u=Math.sqrt(s*s+o*o);return u>a?-1:a===u?0:1}),s[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",e),e)}var n=e("./intersect-line");t.exports=r},{"./intersect-line":13}],16:[function(e,t){function r(e,t){var r,n,i=e.x,a=e.y,s=t.x-i,o=t.y-a,u=e.width/2,c=e.height/2;return Math.abs(o)*u>Math.abs(s)*c?(0>o&&(c=-c),r=0===o?0:c*s/o,n=c):(0>s&&(u=-u),r=u,n=0===s?0:u*o/s),{x:i+r,y:a+n}}t.exports=r},{}],17:[function(e,t){function r(e,t){var r=e.append("foreignObject").attr("width","100000"),i=r.append("xhtml:div"),a=t.label;switch(typeof a){case"function":i.insert(a);break;case"object":i.insert(function(){return a});break;default:i.html(a)}n.applyStyle(i,t.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var s,o;return i.each(function(){s=this.clientWidth,o=this.clientHeight}),r.attr("width",s).attr("height",o),r}var n=e("../util");t.exports=r},{"../util":25}],18:[function(e,t){function r(e,t){var r=t.label,a=e.append("g");"string"!=typeof r||"html"===t.labelType?i(a,t):n(a,t);var s=a.node().getBBox();return a.attr("transform","translate("+-s.width/2+","+-s.height/2+")"),a}var n=e("./add-text-label"),i=e("./add-html-label");t.exports=r},{"./add-html-label":17,"./add-text-label":19}],19:[function(e,t){function r(e,t){for(var r=e.append("text"),a=n(t.label).split("\n"),s=0;so;++o)n(e,"borderLeft","_bl",r,s,o),n(e,"borderRight","_br",r,s,o)}}i.each(e.children(),t)}function n(e,t,r,n,i,s){var o={width:0,height:0,rank:s},u=i[t][s-1],c=a.addDummyNode(e,"border",o,r);i[t][s]=c,e.setParent(c,n),u&&e.setEdge(u,c,{weight:1})}var i=e("./lodash"),a=e("./util");t.exports=r},{"./lodash":36,"./util":55}],30:[function(e,t){"use strict";function r(e){var t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&i(e)}function n(e){var t=e.graph().rankdir.toLowerCase();("bt"===t||"rl"===t)&&s(e),("lr"===t||"rl"===t)&&(u(e),i(e))}function i(e){l.each(e.nodes(),function(t){a(e.node(t))}),l.each(e.edges(),function(t){a(e.edge(t))})}function a(e){var t=e.width;e.width=e.height,e.height=t}function s(e){l.each(e.nodes(),function(t){o(e.node(t))}),l.each(e.edges(),function(t){var r=e.edge(t);l.each(r.points,o),l.has(r,"y")&&o(r)})}function o(e){e.y=-e.y}function u(e){l.each(e.nodes(),function(t){c(e.node(t))}),l.each(e.edges(),function(t){var r=e.edge(t);l.each(r.points,c),l.has(r,"x")&&c(r)})}function c(e){var t=e.x;e.x=e.y,e.y=t}var l=e("./lodash");t.exports={adjust:r,undo:n}},{"./lodash":36}],31:[function(e,t){function r(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function i(e,t){return"_next"!==e&&"_prev"!==e?t:void 0}t.exports=r,r.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;return t!==e?(n(t),t):void 0},r.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},r.prototype.toString=function(){for(var e=[],t=this._sentinel,r=t._prev;r!==t;)e.push(JSON.stringify(r,i)),r=r._prev;return"["+e.join(", ")+"]"}},{}],32:[function(e,t){function r(e){var t=i.buildLayerMatrix(e),r=new a({compound:!0,multigraph:!0}).setGraph({});return n.each(e.nodes(),function(t){r.setNode(t,{label:t}),r.setParent(t,"layer"+e.node(t).rank)}),n.each(e.edges(),function(e){r.setEdge(e.v,e.w,{},e.name)}),n.each(t,function(e,t){var i="layer"+t;r.setNode(i,{rank:"same"}),n.reduce(e,function(e,t){return r.setEdge(e,t,{style:"invis"}),t})}),r}var n=e("./lodash"),i=e("./util"),a=e("./graphlib").Graph;t.exports={debugOrdering:r}},{"./graphlib":33,"./lodash":36,"./util":55}],33:[function(e,t){t.exports=e(9)},{graphlib:57}],34:[function(e,t){function r(e,t){if(e.nodeCount()<=1)return[];var r=a(e,t||l),i=n(r.graph,r.buckets,r.zeroIdx);return o.flatten(o.map(i,function(t){return e.outEdges(t.v,t.w)}),!0)}function n(e,t,r){for(var n,a=[],s=t[t.length-1],o=t[0];e.nodeCount();){for(;n=o.dequeue();)i(e,t,r,n);for(;n=s.dequeue();)i(e,t,r,n);if(e.nodeCount())for(var u=t.length-2;u>0;--u)if(n=t[u].dequeue()){a=a.concat(i(e,t,r,n,!0));break}}return a}function i(e,t,r,n,i){var a=i?[]:void 0;return o.each(e.inEdges(n.v),function(n){var o=e.edge(n),u=e.node(n.v);i&&a.push({v:n.v,w:n.w}),u.out-=o,s(t,r,u)}),o.each(e.outEdges(n.v),function(n){var i=e.edge(n),a=n.w,o=e.node(a);o.in-=i,s(t,r,o)}),e.removeNode(n.v),a}function a(e,t){var r=new u,n=0,i=0;o.each(e.nodes(),function(e){r.setNode(e,{v:e,"in":0,out:0})}),o.each(e.edges(),function(e){var a=r.edge(e.v,e.w)||0,s=t(e),o=a+s;r.setEdge(e.v,e.w,o),i=Math.max(i,r.node(e.v).out+=s),n=Math.max(n,r.node(e.w).in+=s)});var a=o.range(i+n+3).map(function(){return new c}),l=n+1;return o.each(r.nodes(),function(e){s(a,l,r.node(e))}),{graph:r,buckets:a,zeroIdx:l}}function s(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var o=e("./lodash"),u=e("./graphlib").Graph,c=e("./data/list");t.exports=r;var l=o.constant(1)},{"./data/list":31,"./graphlib":33,"./lodash":36}],35:[function(e,t){"use strict";function r(e,t){var r=t&&t.debugTiming?L.time:L.notime;r("layout",function(){var t=r(" buildLayoutGraph",function(){return a(e)});r(" runLayout",function(){n(t,r)}),r(" updateInputGraph",function(){i(e,t)})})}function n(e,t){t(" makeSpaceForEdgeLabels",function(){s(e)}),t(" removeSelfEdges",function(){g(e)}),t(" acyclic",function(){x.run(e)}),t(" nestingGraph.run",function(){C.run(e)}),t(" rank",function(){_(L.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){o(e)}),t(" removeEmptyRanks",function(){k(e)}),t(" nestingGraph.cleanup",function(){C.cleanup(e)}),t(" normalizeRanks",function(){w(e)}),t(" assignRankMinMax",function(){u(e)}),t(" removeEdgeLabelProxies",function(){c(e)}),t(" normalize.run",function(){E.run(e)}),t(" parentDummyChains",function(){D(e)}),t(" addBorderSegments",function(){F(e)}),t(" order",function(){T(e)}),t(" insertSelfEdges",function(){y(e)}),t(" adjustCoordinateSystem",function(){B.adjust(e)}),t(" position",function(){S(e)}),t(" positionSelfEdges",function(){m(e)}),t(" removeBorderNodes",function(){f(e)}),t(" normalize.undo",function(){E.undo(e)}),t(" fixupEdgeLabelCoords",function(){d(e)}),t(" undoCoordinateSystem",function(){B.undo(e)}),t(" translateGraph",function(){l(e)}),t(" assignNodeIntersects",function(){h(e)}),t(" reversePoints",function(){p(e)}),t(" acyclic.undo",function(){x.undo(e)})}function i(e,t){A.each(e.nodes(),function(r){var n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,t.children(r).length&&(n.width=i.width,n.height=i.height))}),A.each(e.edges(),function(r){var n=e.edge(r),i=t.edge(r);n.points=i.points,A.has(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}function a(e){var t=new N({multigraph:!0,compound:!0}),r=b(e.graph());return t.setGraph(A.merge({},O,v(r,I),A.pick(r,R))),A.each(e.nodes(),function(r){var n=b(e.node(r));t.setNode(r,A.defaults(v(n,q),P)),t.setParent(r,e.parent(r))}),A.each(e.edges(),function(r){var n=b(e.edge(r));t.setEdge(r,A.merge({},M,v(n,j),A.pick(n,V)))}),t}function s(e){var t=e.graph();t.ranksep/=2,A.each(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function o(e){A.each(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),i=e.node(t.w),a={rank:(i.rank-n.rank)/2+n.rank,e:t};L.addDummyNode(e,"edge-proxy",a,"_ep")}})}function u(e){var t=0;A.each(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=A.max(t,n.maxRank))}),e.graph().maxRank=t}function c(e){A.each(e.nodes(),function(t){var r=e.node(t);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function l(e){function t(e){var t=e.x,s=e.y,o=e.width,u=e.height;r=Math.min(r,t-o/2),n=Math.max(n,t+o/2),i=Math.min(i,s-u/2),a=Math.max(a,s+u/2)}var r=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,a=0,s=e.graph(),o=s.marginx||0,u=s.marginy||0;A.each(e.nodes(),function(r){t(e.node(r))}),A.each(e.edges(),function(r){var n=e.edge(r);A.has(n,"x")&&t(n)}),r-=o,i-=u,A.each(e.nodes(),function(t){var n=e.node(t);n.x-=r,n.y-=i}),A.each(e.edges(),function(t){var n=e.edge(t);A.each(n.points,function(e){e.x-=r,e.y-=i}),A.has(n,"x")&&(n.x-=r),A.has(n,"y")&&(n.y-=i)}),s.width=n-r+o,s.height=a-i+u}function h(e){A.each(e.edges(),function(t){var r,n,i=e.edge(t),a=e.node(t.v),s=e.node(t.w);i.points?(r=i.points[0],n=i.points[i.points.length-1]):(i.points=[],r=s,n=a),i.points.unshift(L.intersectRect(a,r)),i.points.push(L.intersectRect(s,n))})}function d(e){A.each(e.edges(),function(t){var r=e.edge(t);if(A.has(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}function p(e){A.each(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function f(e){A.each(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(A.last(r.borderLeft)),s=e.node(A.last(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),A.each(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}function g(e){A.each(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function y(e){var t=L.buildLayerMatrix(e);A.each(t,function(t){var r=0;A.each(t,function(t,n){var i=e.node(t);i.order=n+r,A.each(i.selfEdges,function(t){L.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:i.rank,order:n+ ++r,e:t.e,label:t.label},"_se")}),delete i.selfEdges})})}function m(e){A.each(e.nodes(),function(t){var r=e.node(t);if("selfedge"===r.dummy){var n=e.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function v(e,t){return A.mapValues(A.pick(e,t),Number)}function b(e){var t={};return A.each(e,function(e,r){t[r.toLowerCase()]=e}),t}var A=e("./lodash"),x=e("./acyclic"),E=e("./normalize"),_=e("./rank"),w=e("./util").normalizeRanks,D=e("./parent-dummy-chains"),k=e("./util").removeEmptyRanks,C=e("./nesting-graph"),F=e("./add-border-segments"),B=e("./coordinate-system"),T=e("./order"),S=e("./position"),L=e("./util"),N=e("./graphlib").Graph;t.exports=r;var I=["nodesep","edgesep","ranksep","marginx","marginy"],O={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},R=["acyclicer","ranker","rankdir","align"],q=["width","height"],P={width:0,height:0},j=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},V=["labelpos"]},{"./acyclic":28,"./add-border-segments":29,"./coordinate-system":30,"./graphlib":33,"./lodash":36,"./nesting-graph":37,"./normalize":38,"./order":43,"./parent-dummy-chains":48,"./position":50,"./rank":52,"./util":55}],36:[function(e,t){t.exports=e(20)},{lodash:101}],37:[function(e,t){function r(e){var t=u.addDummyNode(e,"root",{},"_root"),r=i(e),s=o.max(r)-1,c=2*s+1;e.graph().nestingRoot=t,o.each(e.edges(),function(t){e.edge(t).minlen*=c});var l=a(e)+1;o.each(e.children(),function(i){n(e,t,c,l,s,r,i)}),e.graph().nodeRankFactor=c}function n(e,t,r,i,a,s,c){var l=e.children(c);if(!l.length)return void(c!==t&&e.setEdge(t,c,{weight:0,minlen:r}));var h=u.addBorderNode(e,"_bt"),d=u.addBorderNode(e,"_bb"),p=e.node(c);e.setParent(h,c),p.borderTop=h,e.setParent(d,c),p.borderBottom=d,o.each(l,function(o){n(e,t,r,i,a,s,o);var u=e.node(o),l=u.borderTop?u.borderTop:o,p=u.borderBottom?u.borderBottom:o,f=u.borderTop?i:2*i,g=l!==p?1:a-s[c]+1;e.setEdge(h,l,{weight:f,minlen:g,nestingEdge:!0}),e.setEdge(p,d,{weight:f,minlen:g,nestingEdge:!0})}),e.parent(c)||e.setEdge(t,h,{weight:0,minlen:a+s[c]})}function i(e){function t(n,i){var a=e.children(n);a&&a.length&&o.each(a,function(e){t(e,i+1)}),r[n]=i}var r={};return o.each(e.children(),function(e){t(e,1)}),r}function a(e){return o.reduce(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function s(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,o.each(e.edges(),function(t){var r=e.edge(t);r.nestingEdge&&e.removeEdge(t)})}var o=e("./lodash"),u=e("./util");t.exports={run:r,cleanup:s}},{"./lodash":36,"./util":55}],38:[function(e,t){"use strict";function r(e){e.graph().dummyChains=[],a.each(e.edges(),function(t){n(e,t)})}function n(e,t){var r=t.v,n=e.node(r).rank,i=t.w,a=e.node(i).rank,o=t.name,u=e.edge(t),c=u.labelRank;if(a!==n+1){e.removeEdge(t);var l,h,d;for(d=0,++n;a>n;++d,++n)u.points=[],h={width:0,height:0,edgeLabel:u,edgeObj:t,rank:n},l=s.addDummyNode(e,"edge",h,"_d"),n===c&&(h.width=u.width,h.height=u.height,h.dummy="edge-label",h.labelpos=u.labelpos),e.setEdge(r,l,{weight:u.weight},o),0===d&&e.graph().dummyChains.push(l),r=l;e.setEdge(r,i,{weight:u.weight},o)}}function i(e){a.each(e.graph().dummyChains,function(t){var r,n=e.node(t),i=n.edgeLabel;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}var a=e("./lodash"),s=e("./util");t.exports={run:r,undo:i}},{"./lodash":36,"./util":55}],39:[function(e,t){function r(e,t,r){var i,a={};n.each(r,function(r){for(var n,s,o=e.parent(r);o;){if(n=e.parent(o),n?(s=a[n],a[n]=o):(s=i,i=o),s&&s!==o)return void t.setEdge(s,o);o=n}})}var n=e("../lodash");t.exports=r},{"../lodash":36}],40:[function(e,t){function r(e,t){return n.map(t,function(t){var r=e.inEdges(t);if(r.length){var i=n.reduce(r,function(t,r){var n=e.edge(r),i=e.node(r.v);return{sum:t.sum+n.weight*i.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}})}var n=e("../lodash");t.exports=r},{"../lodash":36}],41:[function(e,t){function r(e,t,r){var s=n(e),o=new a({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(t){return e.node(t)});return i.each(e.nodes(),function(n){var a=e.node(n),u=e.parent(n);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(o.setNode(n),o.setParent(n,u||s),i.each(e[r](n),function(t){var r=t.v===n?t.w:t.v,a=o.edge(r,n),s=i.isUndefined(a)?0:a.weight;o.setEdge(r,n,{weight:e.edge(t).weight+s})}),i.has(a,"minRank")&&o.setNode(n,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}))}),o}function n(e){for(var t;e.hasNode(t=i.uniqueId("_root")););return t}var i=e("../lodash"),a=e("../graphlib").Graph;t.exports=r},{"../graphlib":33,"../lodash":36}],42:[function(e,t){"use strict";function r(e,t){for(var r=0,i=1;i0;)t%2&&(r+=u[t+1]),t=t-1>>1,u[t]+=e.weight;c+=e.weight*r})),c}var i=e("../lodash");t.exports=r},{"../lodash":36}],43:[function(e,t){"use strict";function r(e){var t=p.maxRank(e),r=n(e,s.range(1,t+1),"inEdges"),c=n(e,s.range(t-1,-1,-1),"outEdges"),l=o(e);a(e,l);for(var h,d=Number.POSITIVE_INFINITY,f=0,g=0;4>g;++f,++g){i(f%2?r:c,f%4>=2),l=p.buildLayerMatrix(e);var y=u(e,l);d>y&&(g=0,h=s.cloneDeep(l),d=y)}a(e,h)}function n(e,t,r){return s.map(t,function(t){return l(e,t,r)})}function i(e,t){var r=new d;s.each(e,function(e){var n=e.graph().root,i=c(e,n,r,t);s.each(i.vs,function(t,r){e.node(t).order=r}),h(e,r,i.vs)})}function a(e,t){s.each(t,function(t){s.each(t,function(t,r){e.node(t).order=r})})}var s=e("../lodash"),o=e("./init-order"),u=e("./cross-count"),c=e("./sort-subgraph"),l=e("./build-layer-graph"),h=e("./add-subgraph-constraints"),d=e("../graphlib").Graph,p=e("../util");t.exports=r},{"../graphlib":33,"../lodash":36,"../util":55,"./add-subgraph-constraints":39,"./build-layer-graph":41,"./cross-count":42,"./init-order":44,"./sort-subgraph":46}],44:[function(e,t){"use strict";function r(e){function t(i){if(!n.has(r,i)){r[i]=!0;var a=e.node(i);s[a.rank].push(i),n.each(e.successors(i),t)}}var r={},i=n.filter(e.nodes(),function(t){return!e.children(t).length}),a=n.max(n.map(i,function(t){return e.node(t).rank})),s=n.map(n.range(a+1),function(){return[]}),o=n.sortBy(i,function(t){return e.node(t).rank});return n.each(o,t),s}var n=e("../lodash");t.exports=r},{"../lodash":36}],45:[function(e,t){"use strict";function r(e,t){var r={};a.each(e,function(e,t){var n=r[e.v]={indegree:0,"in":[],out:[],vs:[e.v],i:t};a.isUndefined(e.barycenter)||(n.barycenter=e.barycenter,n.weight=e.weight)}),a.each(t.edges(),function(e){var t=r[e.v],n=r[e.w];a.isUndefined(t)||a.isUndefined(n)||(n.indegree++,t.out.push(r[e.w]))});var i=a.filter(r,function(e){return!e.indegree});return n(i)}function n(e){function t(e){return function(t){t.merged||(a.isUndefined(t.barycenter)||a.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&i(e,t)}}function r(t){return function(r){r.in.push(t),0===--r.indegree&&e.push(r)}}for(var n=[];e.length;){var s=e.pop();n.push(s),a.each(s.in.reverse(),t(s)),a.each(s.out,r(s))}return a.chain(n).filter(function(e){return!e.merged}).map(function(e){return a.pick(e,["vs","i","barycenter","weight"])}).value()}function i(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}var a=e("../lodash");t.exports=r},{"../lodash":36}],46:[function(e,t){function r(e,t,c,l){var h=e.children(t),d=e.node(t),p=d?d.borderLeft:void 0,f=d?d.borderRight:void 0,g={};p&&(h=a.filter(h,function(e){return e!==p&&e!==f}));var y=s(e,h);a.each(y,function(t){if(e.children(t.v).length){var n=r(e,t.v,c,l);g[t.v]=n,a.has(n,"barycenter")&&i(t,n)}});var m=o(y,c);n(m,g);var v=u(m,l);if(p&&(v.vs=a.flatten([p,v.vs,f],!0),e.predecessors(p).length)){var b=e.node(e.predecessors(p)[0]),A=e.node(e.predecessors(f)[0]);a.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+b.order+A.order)/(v.weight+2),v.weight+=2 -}return v}function n(e,t){a.each(e,function(e){e.vs=a.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})}function i(e,t){a.isUndefined(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var a=e("../lodash"),s=e("./barycenter"),o=e("./resolve-conflicts"),u=e("./sort");t.exports=r},{"../lodash":36,"./barycenter":40,"./resolve-conflicts":45,"./sort":47}],47:[function(e,t){function r(e,t){var r=s.partition(e,function(e){return a.has(e,"barycenter")}),o=r.lhs,u=a.sortBy(r.rhs,function(e){return-e.i}),c=[],l=0,h=0,d=0;o.sort(i(!!t)),d=n(c,u,d),a.each(o,function(e){d+=e.vs.length,c.push(e.vs),l+=e.barycenter*e.weight,h+=e.weight,d=n(c,u,d)});var p={vs:a.flatten(c,!0)};return h&&(p.barycenter=l/h,p.weight=h),p}function n(e,t,r){for(var n;t.length&&(n=a.last(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function i(e){return function(t,r){return t.barycenterr.barycenter?1:e?r.i-t.i:t.i-r.i}}var a=e("../lodash"),s=e("../util");t.exports=r},{"../lodash":36,"../util":55}],48:[function(e,t){function r(e){var t=i(e);a.each(e.graph().dummyChains,function(r){for(var i=e.node(r),a=i.edgeObj,s=n(e,t,a.v,a.w),o=s.path,u=s.lca,c=0,l=o[c],h=!0;r!==a.w;){if(i=e.node(r),h){for(;(l=o[c])!==u&&e.node(l).maxRanku||c>t[i].lim));for(a=i,i=n;(i=e.parent(i))!==a;)o.push(i);return{path:s.concat(o.reverse()),lca:a}}function i(e){function t(i){var s=n;a.each(e.children(i),t),r[i]={low:s,lim:n++}}var r={},n=0;return a.each(e.children(),t),r}var a=e("./lodash");t.exports=r},{"./lodash":36}],49:[function(e,t){"use strict";function r(e,t){function r(t,r){var s=0,o=0,u=t.length,c=y.last(r);return y.each(r,function(t,l){var h=i(e,t),d=h?e.node(h).order:u;(h||t===c)&&(y.each(r.slice(o,l+1),function(t){y.each(e.predecessors(t),function(r){var i=e.node(r),o=i.order;!(s>o||o>d)||i.dummy&&e.node(t).dummy||a(n,r,t)})}),o=l+1,s=d)}),r}var n={};return y.reduce(t,r),n}function n(e,t){function r(t,r,n,s,o){var u;y.each(y.range(r,n),function(r){u=t[r],e.node(u).dummy&&y.each(e.predecessors(u),function(t){var r=e.node(t);r.dummy&&(r.ordero)&&a(i,t,u)})})}function n(t,n){var i,a=-1,s=0;return y.each(n,function(o,u){if("border"===e.node(o).dummy){var c=e.predecessors(o);c.length&&(i=e.node(c[0]).order,r(n,s,u,a,i),s=u,a=i)}r(n,s,n.length,i,t.length)}),n}var i={};return y.reduce(t,n),i}function i(e,t){return e.node(t).dummy?y.find(e.predecessors(t),function(t){return e.node(t).dummy}):void 0}function a(e,t,r){if(t>r){var n=t;t=r,r=n}var i=e[t];i||(e[t]=i={}),i[r]=!0}function s(e,t,r){if(t>r){var n=t;t=r,r=n}return y.has(e[t],r)}function o(e,t,r,n){var i={},a={},o={};return y.each(t,function(e){y.each(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),y.each(t,function(e){var t=-1;y.each(e,function(e){var u=n(e);if(u.length){u=y.sortBy(u,function(e){return o[e]});for(var c=(u.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var d=u[l];a[e]===e&&ts.lim&&(o=s,u=!0);var c=f.filter(t.edges(),function(t){return u===p(e,e.node(t.v),o)&&u!==p(e,e.node(t.w),o)});return f.min(c,function(e){return y(t,e)})}function l(e,t,r,i){var a=r.v,o=r.w;e.removeEdge(a,o),e.setEdge(i.v,i.w,{}),s(e),n(e,t),h(e,t)}function h(e,t){var r=f.find(e.nodes(),function(e){return!t.node(e).parent}),n=v(e,r);n=n.slice(1),f.each(n,function(r){var n=e.node(r).parent,i=t.edge(r,n),a=!1;i||(i=t.edge(n,r),a=!0),t.node(r).rank=t.node(n).rank+(a?i.minlen:-i.minlen)})}function d(e,t,r){return e.hasEdge(t,r)}function p(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var f=e("../lodash"),g=e("./feasible-tree"),y=e("./util").slack,m=e("./util").longestPath,v=e("../graphlib").alg.preorder,b=e("../graphlib").alg.postorder,A=e("../util").simplify;t.exports=r,r.initLowLimValues=s,r.initCutValues=n,r.calcCutValue=a,r.leaveEdge=u,r.enterEdge=c,r.exchangeEdges=l},{"../graphlib":33,"../lodash":36,"../util":55,"./feasible-tree":51,"./util":54}],54:[function(e,t){"use strict";function r(e){function t(n){var a=e.node(n);if(i.has(r,n))return a.rank;r[n]=!0;var s=i.min(i.map(e.outEdges(n),function(r){return t(r.w)-e.edge(r).minlen}));return s===Number.POSITIVE_INFINITY&&(s=0),a.rank=s}var r={};i.each(e.sources(),t)}function n(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var i=e("../lodash");t.exports={longestPath:r,slack:n}},{"../lodash":36}],55:[function(e,t){"use strict";function r(e,t,r,n){var i;do i=y.uniqueId(n);while(e.hasNode(i));return r.dummy=t,e.setNode(i,r),i}function n(e){var t=(new m).setGraph(e.graph());return y.each(e.nodes(),function(r){t.setNode(r,e.node(r))}),y.each(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function i(e){var t=new m({multigraph:e.isMultigraph()}).setGraph(e.graph());return y.each(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),y.each(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function a(e){var t=y.map(e.nodes(),function(t){var r={};return y.each(e.outEdges(t),function(t){r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return y.zipObject(e.nodes(),t)}function s(e){var t=y.map(e.nodes(),function(t){var r={};return y.each(e.inEdges(t),function(t){r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return y.zipObject(e.nodes(),t)}function o(e,t){var r=e.x,n=e.y,i=t.x-r,a=t.y-n,s=e.width/2,o=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,c;return Math.abs(a)*s>Math.abs(i)*o?(0>a&&(o=-o),u=o*i/a,c=o):(0>i&&(s=-s),u=s,c=s*a/i),{x:r+u,y:n+c}}function u(e){var t=y.map(y.range(d(e)+1),function(){return[]});return y.each(e.nodes(),function(r){var n=e.node(r),i=n.rank;y.isUndefined(i)||(t[i][n.order]=r)}),t}function c(e){var t=y.min(y.map(e.nodes(),function(t){return e.node(t).rank}));y.each(e.nodes(),function(r){var n=e.node(r);y.has(n,"rank")&&(n.rank-=t)})}function l(e){var t=y.min(y.map(e.nodes(),function(t){return e.node(t).rank})),r=[];y.each(e.nodes(),function(n){var i=e.node(n).rank-t;y.has(r,i)||(r[i]=[]),r[i].push(n)});var n=0,i=e.graph().nodeRankFactor;y.each(r,function(t,r){y.isUndefined(t)&&r%i!==0?--n:n&&y.each(t,function(t){e.node(t).rank+=n})})}function h(e,t,n,i){var a={width:0,height:0};return arguments.length>=4&&(a.rank=n,a.order=i),r(e,"border",a,t)}function d(e){return y.max(y.map(e.nodes(),function(t){var r=e.node(t).rank;return y.isUndefined(r)?void 0:r}))}function p(e,t){var r={lhs:[],rhs:[]};return y.each(e,function(e){t(e)?r.lhs.push(e):r.rhs.push(e)}),r}function f(e,t){var r=y.now();try{return t()}finally{console.log(e+" time: "+(y.now()-r)+"ms")}}function g(e,t){return t()}var y=e("./lodash"),m=e("./graphlib").Graph;t.exports={addDummyNode:r,simplify:n,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:s,intersectRect:o,buildLayerMatrix:u,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:d,partition:p,time:f,notime:g}},{"./graphlib":33,"./lodash":36}],56:[function(e,t){t.exports="0.6.4"},{}],57:[function(e,t){var r=e("./lib");t.exports={Graph:r.Graph,json:e("./lib/json"),alg:e("./lib/alg"),version:r.version}},{"./lib":73,"./lib/alg":64,"./lib/json":74}],58:[function(e,t){function r(e){function t(a){n.has(i,a)||(i[a]=!0,r.push(a),n.each(e.successors(a),t),n.each(e.predecessors(a),t))}var r,i={},a=[];return n.each(e.nodes(),function(e){r=[],t(e),r.length&&a.push(r)}),a}var n=e("../lodash");t.exports=r},{"../lodash":75}],59:[function(e,t){function r(e,t,r){i.isArray(t)||(t=[t]);var a=[],s={};return i.each(t,function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);n(e,t,"post"===r,s,a)}),a}function n(e,t,r,a,s){i.has(a,t)||(a[t]=!0,r||s.push(t),i.each(e.neighbors(t),function(t){n(e,t,r,a,s)}),r&&s.push(t))}var i=e("../lodash");t.exports=r},{"../lodash":75}],60:[function(e,t){function r(e,t,r){return i.transform(e.nodes(),function(i,a){i[a]=n(e,a,t,r)},{})}var n=e("./dijkstra"),i=e("../lodash");t.exports=r},{"../lodash":75,"./dijkstra":61}],61:[function(e,t){function r(e,t,r,i){return n(e,String(t),r||s,i||function(t){return e.outEdges(t)})}function n(e,t,r,n){var i,s,o={},u=new a,c=function(e){var t=e.v!==i?e.v:e.w,n=o[t],a=r(e),c=s.distance+a;if(0>a)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+a);c0&&(i=u.removeMin(),s=o[i],s.distance!==Number.POSITIVE_INFINITY);)n(i).forEach(c);return o}var i=e("../lodash"),a=e("../data/priority-queue");t.exports=r;var s=i.constant(1)},{"../data/priority-queue":71,"../lodash":75}],62:[function(e,t){function r(e){return n.filter(i(e),function(e){return e.length>1})}var n=e("../lodash"),i=e("./tarjan");t.exports=r},{"../lodash":75,"./tarjan":69}],63:[function(e,t){function r(e,t,r){return n(e,t||a,r||function(t){return e.outEdges(t)})}function n(e,t,r){var n={},i=e.nodes();return i.forEach(function(e){n[e]={},n[e][e]={distance:0},i.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var i=r.v===e?r.w:r.v,a=t(r);n[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){var t=n[e];i.forEach(function(r){var a=n[r];i.forEach(function(r){var n=a[e],i=t[r],s=a[r],o=n.distance+i.distance;oi&&(u[r]=s,c.decrease(r,i))}}var s,o=new i,u={},c=new a;if(0===e.nodeCount())return o;n.each(e.nodes(),function(e){c.add(e,Number.POSITIVE_INFINITY),o.setNode(e)}),c.decrease(e.nodes()[0],0);for(var l=!1;c.size()>0;){if(s=c.removeMin(),n.has(u,s))o.setEdge(s,u[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(r)}return o}var n=e("../lodash"),i=e("../graph"),a=e("../data/priority-queue");t.exports=r},{"../data/priority-queue":71,"../graph":72,"../lodash":75}],69:[function(e,t){function r(e){function t(o){var u=a[o]={onStack:!0,lowlink:r,index:r++};if(i.push(o),e.successors(o).forEach(function(e){n.has(a,e)?a[e].onStack&&(u.lowlink=Math.min(u.lowlink,a[e].index)):(t(e),u.lowlink=Math.min(u.lowlink,a[e].lowlink))}),u.lowlink===u.index){var c,l=[];do c=i.pop(),a[c].onStack=!1,l.push(c);while(o!==c);s.push(l)}}var r=0,i=[],a={},s=[];return e.nodes().forEach(function(e){n.has(a,e)||t(e)}),s}var n=e("../lodash");t.exports=r},{"../lodash":75}],70:[function(e,t){function r(e){function t(o){if(i.has(a,o))throw new n;i.has(r,o)||(a[o]=!0,r[o]=!0,i.each(e.predecessors(o),t),delete a[o],s.push(o))}var r={},a={},s=[];if(i.each(e.sinks(),t),i.size(r)!==e.nodeCount())throw new n;return s}function n(){}var i=e("../lodash");t.exports=r,r.CycleException=n},{"../lodash":75}],71:[function(e,t){function r(){this._arr=[],this._keyIndices={}}var n=e("../lodash");t.exports=r,r.prototype.size=function(){return this._arr.length},r.prototype.keys=function(){return this._arr.map(function(e){return e.key})},r.prototype.has=function(e){return n.has(this._keyIndices,e)},r.prototype.priority=function(e){var t=this._keyIndices[e];return void 0!==t?this._arr[t].priority:void 0},r.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},r.prototype.add=function(e,t){var r=this._keyIndices;if(e=String(e),!n.has(r,e)){var i=this._arr,a=i.length;return r[e]=a,i.push({key:e,priority:t}),this._decrease(a),!0}return!1},r.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},r.prototype.decrease=function(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)},r.prototype._heapify=function(e){var t=this._arr,r=2*e,n=r+1,i=e;r>1,!(r[t].priorityr){var i=t;t=r,r=i}return t+h+r+h+(u.isUndefined(n)?c:n)}function s(e,t,r,n){if(!e&&t>r){var i=t;t=r,r=i}var a={v:t,w:r};return n&&(a.name=n),a}function o(e,t){return a(e,t.v,t.w,t.name)}var u=e("./lodash");t.exports=r;var c="\x00",l="\x00",h="";r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(e){return this._label=e,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(e){return u.isFunction(e)||(e=u.constant(e)),this._defaultNodeLabelFn=e,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return u.keys(this._nodes)},r.prototype.sources=function(){return u.filter(this.nodes(),function(e){return u.isEmpty(this._in[e])},this)},r.prototype.sinks=function(){return u.filter(this.nodes(),function(e){return u.isEmpty(this._out[e])},this)},r.prototype.setNodes=function(e,t){var r=arguments;return u.each(e,function(e){r.length>1?this.setNode(e,t):this.setNode(e)},this),this},r.prototype.setNode=function(e,t){return u.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=l,this._children[e]={},this._children[l][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},r.prototype.node=function(e){return this._nodes[e]},r.prototype.hasNode=function(e){return u.has(this._nodes,e)},r.prototype.removeNode=function(e){var t=this;if(u.has(this._nodes,e)){var r=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],u.each(this.children(e),function(e){this.setParent(e)},this),delete this._children[e]),u.each(u.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],u.each(u.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},r.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(u.isUndefined(t))t=l;else{for(var r=t;!u.isUndefined(r);r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},r.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},r.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==l)return t}},r.prototype.children=function(e){if(u.isUndefined(e)&&(e=l),this._isCompound){var t=this._children[e];if(t)return u.keys(t)}else{if(e===l)return this.nodes();if(this.hasNode(e))return[]}},r.prototype.predecessors=function(e){var t=this._preds[e];return t?u.keys(t):void 0},r.prototype.successors=function(e){var t=this._sucs[e];return t?u.keys(t):void 0},r.prototype.neighbors=function(e){var t=this.predecessors(e);return t?u.union(t,this.successors(e)):void 0},r.prototype.setDefaultEdgeLabel=function(e){return u.isFunction(e)||(e=u.constant(e)),this._defaultEdgeLabelFn=e,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return u.values(this._edgeObjs)},r.prototype.setPath=function(e,t){var r=this,n=arguments;return u.reduce(e,function(e,i){return n.length>1?r.setEdge(e,i,t):r.setEdge(e,i),i}),this},r.prototype.setEdge=function(){var e,t,r,i,o=!1;u.isPlainObject(arguments[0])?(e=arguments[0].v,t=arguments[0].w,r=arguments[0].name,2===arguments.length&&(i=arguments[1],o=!0)):(e=arguments[0],t=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,u.isUndefined(r)||(r=""+r);var c=a(this._isDirected,e,t,r);if(u.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=i),this;if(!u.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=o?i:this._defaultEdgeLabelFn(e,t,r);var l=s(this._isDirected,e,t,r);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[c]=l,n(this._preds[t],e),n(this._sucs[e],t),this._in[t][c]=l,this._out[e][c]=l,this._edgeCount++,this},r.prototype.edge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return this._edgeLabels[n]},r.prototype.hasEdge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return u.has(this._edgeLabels,n)},r.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r),s=this._edgeObjs[n];return s&&(e=s.v,t=s.w,delete this._edgeLabels[n],delete this._edgeObjs[n],i(this._preds[t],e),i(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},r.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var n=u.values(r);return t?u.filter(n,function(e){return e.v===t}):n}},r.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var n=u.values(r);return t?u.filter(n,function(e){return e.w===t}):n}},r.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);return r?r.concat(this.outEdges(e,t)):void 0}},{"./lodash":75}],73:[function(e,t){t.exports={Graph:e("./graph"),version:e("./version")}},{"./graph":72,"./version":76}],74:[function(e,t){function r(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:n(e),edges:i(e)};return s.isUndefined(e.graph())||(t.value=s.clone(e.graph())),t}function n(e){return s.map(e.nodes(),function(t){var r=e.node(t),n=e.parent(t),i={v:t};return s.isUndefined(r)||(i.value=r),s.isUndefined(n)||(i.parent=n),i})}function i(e){return s.map(e.edges(),function(t){var r=e.edge(t),n={v:t.v,w:t.w};return s.isUndefined(t.name)||(n.name=t.name),s.isUndefined(r)||(n.value=r),n})}function a(e){var t=new o(e.options).setGraph(e.value);return s.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),s.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var s=e("./lodash"),o=e("./graph");t.exports={write:r,read:a}},{"./graph":72,"./lodash":75}],75:[function(e,t){t.exports=e(20)},{lodash:101}],76:[function(e,t){t.exports="1.0.1"},{}],77:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{"./lib":93,"./lib/alg":84,"./lib/json":94}],78:[function(e,t){t.exports=e(58)},{"../lodash":95}],79:[function(e,t){t.exports=e(59)},{"../lodash":95}],80:[function(e,t){t.exports=e(60)},{"../lodash":95,"./dijkstra":81}],81:[function(e,t){t.exports=e(61)},{"../data/priority-queue":91,"../lodash":95}],82:[function(e,t){t.exports=e(62)},{"../lodash":95,"./tarjan":89}],83:[function(e,t){t.exports=e(63)},{"../lodash":95}],84:[function(e,t,r){arguments[4][64][0].apply(r,arguments)},{"./components":78,"./dijkstra":81,"./dijkstra-all":80,"./find-cycles":82,"./floyd-warshall":83,"./is-acyclic":85,"./postorder":86,"./preorder":87,"./prim":88,"./tarjan":89,"./topsort":90}],85:[function(e,t){t.exports=e(65)},{"./topsort":90}],86:[function(e,t){t.exports=e(66)},{"./dfs":79}],87:[function(e,t){t.exports=e(67)},{"./dfs":79}],88:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{"../data/priority-queue":91,"../graph":92,"../lodash":95}],89:[function(e,t){t.exports=e(69)},{"../lodash":95}],90:[function(e,t){t.exports=e(70)},{"../lodash":95}],91:[function(e,t){t.exports=e(71)},{"../lodash":95}],92:[function(e,t){"use strict";function r(e){this._isDirected=u.has(e,"directed")?e.directed:!0,this._isMultigraph=u.has(e,"multigraph")?e.multigraph:!1,this._isCompound=u.has(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=u.constant(void 0),this._defaultEdgeLabelFn=u.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[l]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function n(e,t){u.has(e,t)?e[t]++:e[t]=1}function i(e,t){--e[t]||delete e[t]}function a(e,t,r,n){if(!e&&t>r){var i=t;t=r,r=i}return t+h+r+h+(u.isUndefined(n)?c:n)}function s(e,t,r,n){if(!e&&t>r){var i=t;t=r,r=i}var a={v:t,w:r};return n&&(a.name=n),a}function o(e,t){return a(e,t.v,t.w,t.name)}var u=e("./lodash");t.exports=r;var c="\x00",l="\x00",h="";r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(e){return this._label=e,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(e){return u.isFunction(e)||(e=u.constant(e)),this._defaultNodeLabelFn=e,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return u.keys(this._nodes)},r.prototype.sources=function(){return u.filter(this.nodes(),function(e){return u.isEmpty(this._in[e])},this)},r.prototype.sinks=function(){return u.filter(this.nodes(),function(e){return u.isEmpty(this._out[e])},this)},r.prototype.setNodes=function(e,t){var r=arguments;return u.each(e,function(e){r.length>1?this.setNode(e,t):this.setNode(e)},this),this},r.prototype.setNode=function(e,t){return u.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=l,this._children[e]={},this._children[l][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},r.prototype.node=function(e){return this._nodes[e]},r.prototype.hasNode=function(e){return u.has(this._nodes,e)},r.prototype.removeNode=function(e){var t=this;if(u.has(this._nodes,e)){var r=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],u.each(this.children(e),function(e){this.setParent(e)},this),delete this._children[e]),u.each(u.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],u.each(u.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},r.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(u.isUndefined(t))t=l;else{for(var r=t;!u.isUndefined(r);r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},r.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},r.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==l)return t}},r.prototype.children=function(e){if(u.isUndefined(e)&&(e=l),this._isCompound){var t=this._children[e];if(t)return u.keys(t)}else{if(e===l)return this.nodes();if(this.hasNode(e))return[]}},r.prototype.predecessors=function(e){var t=this._preds[e];return t?u.keys(t):void 0},r.prototype.successors=function(e){var t=this._sucs[e];return t?u.keys(t):void 0},r.prototype.neighbors=function(e){var t=this.predecessors(e);return t?u.union(t,this.successors(e)):void 0},r.prototype.setDefaultEdgeLabel=function(e){return u.isFunction(e)||(e=u.constant(e)),this._defaultEdgeLabelFn=e,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return u.values(this._edgeObjs)},r.prototype.setPath=function(e,t){var r=this,n=arguments;return u.reduce(e,function(e,i){return n.length>1?r.setEdge(e,i,t):r.setEdge(e,i),i}),this},r.prototype.setEdge=function(e,t,r,i){var o=arguments.length>2;e=String(e),t=String(t),u.isUndefined(i)||(i=String(i)),u.isPlainObject(arguments[0])&&(e=arguments[0].v,t=arguments[0].w,i=arguments[0].name,2===arguments.length&&(r=arguments[1],o=!0));var c=a(this._isDirected,e,t,i);if(u.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=r),this;if(!u.isUndefined(i)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=o?r:this._defaultEdgeLabelFn(e,t,i);var l=s(this._isDirected,e,t,i);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[c]=l,n(this._preds[t],e),n(this._sucs[e],t),this._in[t][c]=l,this._out[e][c]=l,this._edgeCount++,this},r.prototype.edge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return this._edgeLabels[n]},r.prototype.hasEdge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return u.has(this._edgeLabels,n)},r.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?o(this._isDirected,arguments[0]):a(this._isDirected,e,t,r),s=this._edgeObjs[n]; -return s&&(e=s.v,t=s.w,delete this._edgeLabels[n],delete this._edgeObjs[n],i(this._preds[t],e),i(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},r.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var n=u.values(r);return t?u.filter(n,function(e){return e.v===t}):n}},r.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var n=u.values(r);return t?u.filter(n,function(e){return e.w===t}):n}},r.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);return r?r.concat(this.outEdges(e,t)):void 0}},{"./lodash":95}],93:[function(e,t,r){arguments[4][73][0].apply(r,arguments)},{"./graph":92,"./version":96}],94:[function(e,t,r){arguments[4][74][0].apply(r,arguments)},{"./graph":92,"./lodash":95}],95:[function(e,t){t.exports=e(20)},{lodash:101}],96:[function(e,t){t.exports="0.9.1"},{}],97:[function(){},{}],98:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!i;a--){var s=a>=0?arguments[a]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(e){var i=r.isAbsolute(e),a="/"===s(e,-1);return e=t(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),a=n(t.split("/")),s=Math.min(i.length,a.length),o=s,u=0;s>u;u++)if(i[u]!==a[u]){o=u;break}for(var c=[],u=o;ut&&(t=e.length+t),e.substr(t,r)}}).call(this,e("1YiZ5S"))},{"1YiZ5S":99}],99:[function(e,t){function r(){}var n=t.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=r,n.addListener=r,n.once=r,n.off=r,n.removeListener=r,n.removeAllListeners=r,n.emit=r,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],100:[function(e,t,r){(function(e){!function(n){var i="object"==typeof r&&r,a="object"==typeof t&&t&&t.exports==i&&t,s="object"==typeof e&&e;(s.global===s||s.window===s)&&(n=s);var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,h={"Á":"Aacute","á":"aacute","Ă":"Abreve","ă":"abreve","∾":"ac","∿":"acd","∾̳":"acE","Â":"Acirc","â":"acirc","´":"acute","А":"Acy","а":"acy","Æ":"AElig","æ":"aelig","⁡":"af","𝔄":"Afr","𝔞":"afr","À":"Agrave","à":"agrave","ℵ":"aleph","Α":"Alpha","α":"alpha","Ā":"Amacr","ā":"amacr","⨿":"amalg","&":"amp","⩕":"andand","⩓":"And","∧":"and","⩜":"andd","⩘":"andslope","⩚":"andv","∠":"ang","⦤":"ange","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","∡":"angmsd","∟":"angrt","⊾":"angrtvb","⦝":"angrtvbd","∢":"angsph","Å":"angst","⍼":"angzarr","Ą":"Aogon","ą":"aogon","𝔸":"Aopf","𝕒":"aopf","⩯":"apacir","≈":"ap","⩰":"apE","≊":"ape","≋":"apid","'":"apos","å":"aring","𝒜":"Ascr","𝒶":"ascr","≔":"colone","*":"ast","≍":"CupCap","Ã":"Atilde","ã":"atilde","Ä":"Auml","ä":"auml","∳":"awconint","⨑":"awint","≌":"bcong","϶":"bepsi","‵":"bprime","∽":"bsim","⋍":"bsime","∖":"setmn","⫧":"Barv","⊽":"barvee","⌅":"barwed","⌆":"Barwed","⎵":"bbrk","⎶":"bbrktbrk","Б":"Bcy","б":"bcy","„":"bdquo","∵":"becaus","⦰":"bemptyv","ℬ":"Bscr","Β":"Beta","β":"beta","ℶ":"beth","≬":"twixt","𝔅":"Bfr","𝔟":"bfr","⋂":"xcap","◯":"xcirc","⋃":"xcup","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨆":"xsqcup","★":"starf","▽":"xdtri","△":"xutri","⨄":"xuplus","⋁":"Vee","⋀":"Wedge","⤍":"rbarr","⧫":"lozf","▪":"squf","▴":"utrif","▾":"dtrif","◂":"ltrif","▸":"rtrif","␣":"blank","▒":"blk12","░":"blk14","▓":"blk34","█":"block","=⃥":"bne","≡⃥":"bnequiv","⫭":"bNot","⌐":"bnot","𝔹":"Bopf","𝕓":"bopf","⊥":"bot","⋈":"bowtie","⧉":"boxbox","┐":"boxdl","╕":"boxdL","╖":"boxDl","╗":"boxDL","┌":"boxdr","╒":"boxdR","╓":"boxDr","╔":"boxDR","─":"boxh","═":"boxH","┬":"boxhd","╤":"boxHd","╥":"boxhD","╦":"boxHD","┴":"boxhu","╧":"boxHu","╨":"boxhU","╩":"boxHU","⊟":"minusb","⊞":"plusb","⊠":"timesb","┘":"boxul","╛":"boxuL","╜":"boxUl","╝":"boxUL","└":"boxur","╘":"boxuR","╙":"boxUr","╚":"boxUR","│":"boxv","║":"boxV","┼":"boxvh","╪":"boxvH","╫":"boxVh","╬":"boxVH","┤":"boxvl","╡":"boxvL","╢":"boxVl","╣":"boxVL","├":"boxvr","╞":"boxvR","╟":"boxVr","╠":"boxVR","˘":"breve","¦":"brvbar","𝒷":"bscr","⁏":"bsemi","⧅":"bsolb","\\":"bsol","⟈":"bsolhsub","•":"bull","≎":"bump","⪮":"bumpE","≏":"bumpe","Ć":"Cacute","ć":"cacute","⩄":"capand","⩉":"capbrcup","⩋":"capcap","∩":"cap","⋒":"Cap","⩇":"capcup","⩀":"capdot","ⅅ":"DD","∩︀":"caps","⁁":"caret","ˇ":"caron","ℭ":"Cfr","⩍":"ccaps","Č":"Ccaron","č":"ccaron","Ç":"Ccedil","ç":"ccedil","Ĉ":"Ccirc","ĉ":"ccirc","∰":"Cconint","⩌":"ccups","⩐":"ccupssm","Ċ":"Cdot","ċ":"cdot","¸":"cedil","⦲":"cemptyv","¢":"cent","·":"middot","𝔠":"cfr","Ч":"CHcy","ч":"chcy","✓":"check","Χ":"Chi","χ":"chi","ˆ":"circ","≗":"cire","↺":"olarr","↻":"orarr","⊛":"oast","⊚":"ocir","⊝":"odash","⊙":"odot","®":"reg","Ⓢ":"oS","⊖":"ominus","⊕":"oplus","⊗":"otimes","○":"cir","⧃":"cirE","⨐":"cirfnint","⫯":"cirmid","⧂":"cirscir","∲":"cwconint","”":"rdquo","’":"rsquo","♣":"clubs",":":"colon","∷":"Colon","⩴":"Colone",",":"comma","@":"commat","∁":"comp","∘":"compfn","ℂ":"Copf","≅":"cong","⩭":"congdot","≡":"equiv","∮":"oint","∯":"Conint","𝕔":"copf","∐":"coprod","©":"copy","℗":"copysr","↵":"crarr","✗":"cross","⨯":"Cross","𝒞":"Cscr","𝒸":"cscr","⫏":"csub","⫑":"csube","⫐":"csup","⫒":"csupe","⋯":"ctdot","⤸":"cudarrl","⤵":"cudarrr","⋞":"cuepr","⋟":"cuesc","↶":"cularr","⤽":"cularrp","⩈":"cupbrcap","⩆":"cupcap","∪":"cup","⋓":"Cup","⩊":"cupcup","⊍":"cupdot","⩅":"cupor","∪︀":"cups","↷":"curarr","⤼":"curarrm","⋎":"cuvee","⋏":"cuwed","¤":"curren","∱":"cwint","⌭":"cylcty","†":"dagger","‡":"Dagger","ℸ":"daleth","↓":"darr","↡":"Darr","⇓":"dArr","‐":"dash","⫤":"Dashv","⊣":"dashv","⤏":"rBarr","˝":"dblac","Ď":"Dcaron","ď":"dcaron","Д":"Dcy","д":"dcy","⇊":"ddarr","ⅆ":"dd","⤑":"DDotrahd","⩷":"eDDot","°":"deg","∇":"Del","Δ":"Delta","δ":"delta","⦱":"demptyv","⥿":"dfisht","𝔇":"Dfr","𝔡":"dfr","⥥":"dHar","⇃":"dharl","⇂":"dharr","˙":"dot","`":"grave","˜":"tilde","⋄":"diam","♦":"diams","¨":"die","ϝ":"gammad","⋲":"disin","÷":"div","⋇":"divonx","Ђ":"DJcy","ђ":"djcy","⌞":"dlcorn","⌍":"dlcrop",$:"dollar","𝔻":"Dopf","𝕕":"dopf","⃜":"DotDot","≐":"doteq","≑":"eDot","∸":"minusd","∔":"plusdo","⊡":"sdotb","⇐":"lArr","⇔":"iff","⟸":"xlArr","⟺":"xhArr","⟹":"xrArr","⇒":"rArr","⊨":"vDash","⇑":"uArr","⇕":"vArr","∥":"par","⤓":"DownArrowBar","⇵":"duarr","̑":"DownBreve","⥐":"DownLeftRightVector","⥞":"DownLeftTeeVector","⥖":"DownLeftVectorBar","↽":"lhard","⥟":"DownRightTeeVector","⥗":"DownRightVectorBar","⇁":"rhard","↧":"mapstodown","⊤":"top","⤐":"RBarr","⌟":"drcorn","⌌":"drcrop","𝒟":"Dscr","𝒹":"dscr","Ѕ":"DScy","ѕ":"dscy","⧶":"dsol","Đ":"Dstrok","đ":"dstrok","⋱":"dtdot","▿":"dtri","⥯":"duhar","⦦":"dwangle","Џ":"DZcy","џ":"dzcy","⟿":"dzigrarr","É":"Eacute","é":"eacute","⩮":"easter","Ě":"Ecaron","ě":"ecaron","Ê":"Ecirc","ê":"ecirc","≖":"ecir","≕":"ecolon","Э":"Ecy","э":"ecy","Ė":"Edot","ė":"edot","ⅇ":"ee","≒":"efDot","𝔈":"Efr","𝔢":"efr","⪚":"eg","È":"Egrave","è":"egrave","⪖":"egs","⪘":"egsdot","⪙":"el","∈":"in","⏧":"elinters","ℓ":"ell","⪕":"els","⪗":"elsdot","Ē":"Emacr","ē":"emacr","∅":"empty","◻":"EmptySmallSquare","▫":"EmptyVerySmallSquare"," ":"emsp13"," ":"emsp14"," ":"emsp","Ŋ":"ENG","ŋ":"eng"," ":"ensp","Ę":"Eogon","ę":"eogon","𝔼":"Eopf","𝕖":"eopf","⋕":"epar","⧣":"eparsl","⩱":"eplus","ε":"epsi","Ε":"Epsilon","ϵ":"epsiv","≂":"esim","⩵":"Equal","=":"equals","≟":"equest","⇌":"rlhar","⩸":"equivDD","⧥":"eqvparsl","⥱":"erarr","≓":"erDot","ℯ":"escr","ℰ":"Escr","⩳":"Esim","Η":"Eta","η":"eta","Ð":"ETH","ð":"eth","Ë":"Euml","ë":"euml","€":"euro","!":"excl","∃":"exist","Ф":"Fcy","ф":"fcy","♀":"female","ffi":"ffilig","ff":"fflig","ffl":"ffllig","𝔉":"Ffr","𝔣":"ffr","fi":"filig","◼":"FilledSmallSquare",fj:"fjlig","♭":"flat","fl":"fllig","▱":"fltns","ƒ":"fnof","𝔽":"Fopf","𝕗":"fopf","∀":"forall","⋔":"fork","⫙":"forkv","ℱ":"Fscr","⨍":"fpartint","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","⅔":"frac23","⅖":"frac25","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","⁄":"frasl","⌢":"frown","𝒻":"fscr","ǵ":"gacute","Γ":"Gamma","γ":"gamma","Ϝ":"Gammad","⪆":"gap","Ğ":"Gbreve","ğ":"gbreve","Ģ":"Gcedil","Ĝ":"Gcirc","ĝ":"gcirc","Г":"Gcy","г":"gcy","Ġ":"Gdot","ġ":"gdot","≥":"ge","≧":"gE","⪌":"gEl","⋛":"gel","⩾":"ges","⪩":"gescc","⪀":"gesdot","⪂":"gesdoto","⪄":"gesdotol","⋛︀":"gesl","⪔":"gesles","𝔊":"Gfr","𝔤":"gfr","≫":"gg","⋙":"Gg","ℷ":"gimel","Ѓ":"GJcy","ѓ":"gjcy","⪥":"gla","≷":"gl","⪒":"glE","⪤":"glj","⪊":"gnap","⪈":"gne","≩":"gnE","⋧":"gnsim","𝔾":"Gopf","𝕘":"gopf","⪢":"GreaterGreater","≳":"gsim","𝒢":"Gscr","ℊ":"gscr","⪎":"gsime","⪐":"gsiml","⪧":"gtcc","⩺":"gtcir",">":"gt","⋗":"gtdot","⦕":"gtlPar","⩼":"gtquest","⥸":"gtrarr","≩︀":"gvnE"," ":"hairsp","ℋ":"Hscr","Ъ":"HARDcy","ъ":"hardcy","⥈":"harrcir","↔":"harr","↭":"harrw","^":"Hat","ℏ":"hbar","Ĥ":"Hcirc","ĥ":"hcirc","♥":"hearts","…":"mldr","⊹":"hercon","𝔥":"hfr","ℌ":"Hfr","⤥":"searhk","⤦":"swarhk","⇿":"hoarr","∻":"homtht","↩":"larrhk","↪":"rarrhk","𝕙":"hopf","ℍ":"Hopf","―":"horbar","𝒽":"hscr","Ħ":"Hstrok","ħ":"hstrok","⁃":"hybull","Í":"Iacute","í":"iacute","⁣":"ic","Î":"Icirc","î":"icirc","И":"Icy","и":"icy","İ":"Idot","Е":"IEcy","е":"iecy","¡":"iexcl","𝔦":"ifr","ℑ":"Im","Ì":"Igrave","ì":"igrave","ⅈ":"ii","⨌":"qint","∭":"tint","⧜":"iinfin","℩":"iiota","IJ":"IJlig","ij":"ijlig","Ī":"Imacr","ī":"imacr","ℐ":"Iscr","ı":"imath","⊷":"imof","Ƶ":"imped","℅":"incare","∞":"infin","⧝":"infintie","⊺":"intcal","∫":"int","∬":"Int","ℤ":"Zopf","⨗":"intlarhk","⨼":"iprod","⁢":"it","Ё":"IOcy","ё":"iocy","Į":"Iogon","į":"iogon","𝕀":"Iopf","𝕚":"iopf","Ι":"Iota","ι":"iota","¿":"iquest","𝒾":"iscr","⋵":"isindot","⋹":"isinE","⋴":"isins","⋳":"isinsv","Ĩ":"Itilde","ĩ":"itilde","І":"Iukcy","і":"iukcy","Ï":"Iuml","ï":"iuml","Ĵ":"Jcirc","ĵ":"jcirc","Й":"Jcy","й":"jcy","𝔍":"Jfr","𝔧":"jfr","ȷ":"jmath","𝕁":"Jopf","𝕛":"jopf","𝒥":"Jscr","𝒿":"jscr","Ј":"Jsercy","ј":"jsercy","Є":"Jukcy","є":"jukcy","Κ":"Kappa","κ":"kappa","ϰ":"kappav","Ķ":"Kcedil","ķ":"kcedil","К":"Kcy","к":"kcy","𝔎":"Kfr","𝔨":"kfr","ĸ":"kgreen","Х":"KHcy","х":"khcy","Ќ":"KJcy","ќ":"kjcy","𝕂":"Kopf","𝕜":"kopf","𝒦":"Kscr","𝓀":"kscr","⇚":"lAarr","Ĺ":"Lacute","ĺ":"lacute","⦴":"laemptyv","ℒ":"Lscr","Λ":"Lambda","λ":"lambda","⟨":"lang","⟪":"Lang","⦑":"langd","⪅":"lap","«":"laquo","⇤":"larrb","⤟":"larrbfs","←":"larr","↞":"Larr","⤝":"larrfs","↫":"larrlp","⤹":"larrpl","⥳":"larrsim","↢":"larrtl","⤙":"latail","⤛":"lAtail","⪫":"lat","⪭":"late","⪭︀":"lates","⤌":"lbarr","⤎":"lBarr","❲":"lbbrk","{":"lcub","[":"lsqb","⦋":"lbrke","⦏":"lbrksld","⦍":"lbrkslu","Ľ":"Lcaron","ľ":"lcaron","Ļ":"Lcedil","ļ":"lcedil","⌈":"lceil","Л":"Lcy","л":"lcy","⤶":"ldca","“":"ldquo","⥧":"ldrdhar","⥋":"ldrushar","↲":"ldsh","≤":"le","≦":"lE","⇆":"lrarr","⟦":"lobrk","⥡":"LeftDownTeeVector","⥙":"LeftDownVectorBar","⌊":"lfloor","↼":"lharu","⇇":"llarr","⇋":"lrhar","⥎":"LeftRightVector","↤":"mapstoleft","⥚":"LeftTeeVector","⋋":"lthree","⧏":"LeftTriangleBar","⊲":"vltri","⊴":"ltrie","⥑":"LeftUpDownVector","⥠":"LeftUpTeeVector","⥘":"LeftUpVectorBar","↿":"uharl","⥒":"LeftVectorBar","⪋":"lEg","⋚":"leg","⩽":"les","⪨":"lescc","⩿":"lesdot","⪁":"lesdoto","⪃":"lesdotor","⋚︀":"lesg","⪓":"lesges","⋖":"ltdot","≶":"lg","⪡":"LessLess","≲":"lsim","⥼":"lfisht","𝔏":"Lfr","𝔩":"lfr","⪑":"lgE","⥢":"lHar","⥪":"lharul","▄":"lhblk","Љ":"LJcy","љ":"ljcy","≪":"ll","⋘":"Ll","⥫":"llhard","◺":"lltri","Ŀ":"Lmidot","ŀ":"lmidot","⎰":"lmoust","⪉":"lnap","⪇":"lne","≨":"lnE","⋦":"lnsim","⟬":"loang","⇽":"loarr","⟵":"xlarr","⟷":"xharr","⟼":"xmap","⟶":"xrarr","↬":"rarrlp","⦅":"lopar","𝕃":"Lopf","𝕝":"lopf","⨭":"loplus","⨴":"lotimes","∗":"lowast",_:"lowbar","↙":"swarr","↘":"searr","◊":"loz","(":"lpar","⦓":"lparlt","⥭":"lrhard","‎":"lrm","⊿":"lrtri","‹":"lsaquo","𝓁":"lscr","↰":"lsh","⪍":"lsime","⪏":"lsimg","‘":"lsquo","‚":"sbquo","Ł":"Lstrok","ł":"lstrok","⪦":"ltcc","⩹":"ltcir","<":"lt","⋉":"ltimes","⥶":"ltlarr","⩻":"ltquest","◃":"ltri","⦖":"ltrPar","⥊":"lurdshar","⥦":"luruhar","≨︀":"lvnE","¯":"macr","♂":"male","✠":"malt","⤅":"Map","↦":"map","↥":"mapstoup","▮":"marker","⨩":"mcomma","М":"Mcy","м":"mcy","—":"mdash","∺":"mDDot"," ":"MediumSpace","ℳ":"Mscr","𝔐":"Mfr","𝔪":"mfr","℧":"mho","µ":"micro","⫰":"midcir","∣":"mid","−":"minus","⨪":"minusdu","∓":"mp","⫛":"mlcp","⊧":"models","𝕄":"Mopf","𝕞":"mopf","𝓂":"mscr","Μ":"Mu","μ":"mu","⊸":"mumap","Ń":"Nacute","ń":"nacute","∠⃒":"nang","≉":"nap","⩰̸":"napE","≋̸":"napid","ʼn":"napos","♮":"natur","ℕ":"Nopf"," ":"nbsp","≎̸":"nbump","≏̸":"nbumpe","⩃":"ncap","Ň":"Ncaron","ň":"ncaron","Ņ":"Ncedil","ņ":"ncedil","≇":"ncong","⩭̸":"ncongdot","⩂":"ncup","Н":"Ncy","н":"ncy","–":"ndash","⤤":"nearhk","↗":"nearr","⇗":"neArr","≠":"ne","≐̸":"nedot","​":"ZeroWidthSpace","≢":"nequiv","⤨":"toea","≂̸":"nesim","\n":"NewLine","∄":"nexist","𝔑":"Nfr","𝔫":"nfr","≧̸":"ngE","≱":"nge","⩾̸":"nges","⋙̸":"nGg","≵":"ngsim","≫⃒":"nGt","≯":"ngt","≫̸":"nGtv","↮":"nharr","⇎":"nhArr","⫲":"nhpar","∋":"ni","⋼":"nis","⋺":"nisd","Њ":"NJcy","њ":"njcy","↚":"nlarr","⇍":"nlArr","‥":"nldr","≦̸":"nlE","≰":"nle","⩽̸":"nles","≮":"nlt","⋘̸":"nLl","≴":"nlsim","≪⃒":"nLt","⋪":"nltri","⋬":"nltrie","≪̸":"nLtv","∤":"nmid","⁠":"NoBreak","𝕟":"nopf","⫬":"Not","¬":"not","≭":"NotCupCap","∦":"npar","∉":"notin","≹":"ntgl","⋵̸":"notindot","⋹̸":"notinE","⋷":"notinvb","⋶":"notinvc","⧏̸":"NotLeftTriangleBar","≸":"ntlg","⪢̸":"NotNestedGreaterGreater","⪡̸":"NotNestedLessLess","∌":"notni","⋾":"notnivb","⋽":"notnivc","⊀":"npr","⪯̸":"npre","⋠":"nprcue","⧐̸":"NotRightTriangleBar","⋫":"nrtri","⋭":"nrtrie","⊏̸":"NotSquareSubset","⋢":"nsqsube","⊐̸":"NotSquareSuperset","⋣":"nsqsupe","⊂⃒":"vnsub","⊈":"nsube","⊁":"nsc","⪰̸":"nsce","⋡":"nsccue","≿̸":"NotSucceedsTilde","⊃⃒":"vnsup","⊉":"nsupe","≁":"nsim","≄":"nsime","⫽⃥":"nparsl","∂̸":"npart","⨔":"npolint","⤳̸":"nrarrc","↛":"nrarr","⇏":"nrArr","↝̸":"nrarrw","𝒩":"Nscr","𝓃":"nscr","⊄":"nsub","⫅̸":"nsubE","⊅":"nsup","⫆̸":"nsupE","Ñ":"Ntilde","ñ":"ntilde","Ν":"Nu","ν":"nu","#":"num","№":"numero"," ":"numsp","≍⃒":"nvap","⊬":"nvdash","⊭":"nvDash","⊮":"nVdash","⊯":"nVDash","≥⃒":"nvge",">⃒":"nvgt","⤄":"nvHarr","⧞":"nvinfin","⤂":"nvlArr","≤⃒":"nvle","<⃒":"nvlt","⊴⃒":"nvltrie","⤃":"nvrArr","⊵⃒":"nvrtrie","∼⃒":"nvsim","⤣":"nwarhk","↖":"nwarr","⇖":"nwArr","⤧":"nwnear","Ó":"Oacute","ó":"oacute","Ô":"Ocirc","ô":"ocirc","О":"Ocy","о":"ocy","Ő":"Odblac","ő":"odblac","⨸":"odiv","⦼":"odsold","Œ":"OElig","œ":"oelig","⦿":"ofcir","𝔒":"Ofr","𝔬":"ofr","˛":"ogon","Ò":"Ograve","ò":"ograve","⧁":"ogt","⦵":"ohbar","Ω":"ohm","⦾":"olcir","⦻":"olcross","‾":"oline","⧀":"olt","Ō":"Omacr","ō":"omacr","ω":"omega","Ο":"Omicron","ο":"omicron","⦶":"omid","𝕆":"Oopf","𝕠":"oopf","⦷":"opar","⦹":"operp","⩔":"Or","∨":"or","⩝":"ord","ℴ":"oscr","ª":"ordf","º":"ordm","⊶":"origof","⩖":"oror","⩗":"orslope","⩛":"orv","𝒪":"Oscr","Ø":"Oslash","ø":"oslash","⊘":"osol","Õ":"Otilde","õ":"otilde","⨶":"otimesas","⨷":"Otimes","Ö":"Ouml","ö":"ouml","⌽":"ovbar","⏞":"OverBrace","⎴":"tbrk","⏜":"OverParenthesis","¶":"para","⫳":"parsim","⫽":"parsl","∂":"part","П":"Pcy","п":"pcy","%":"percnt",".":"period","‰":"permil","‱":"pertenk","𝔓":"Pfr","𝔭":"pfr","Φ":"Phi","φ":"phi","ϕ":"phiv","☎":"phone","Π":"Pi","π":"pi","ϖ":"piv","ℎ":"planckh","⨣":"plusacir","⨢":"pluscir","+":"plus","⨥":"plusdu","⩲":"pluse","±":"pm","⨦":"plussim","⨧":"plustwo","⨕":"pointint","𝕡":"popf","ℙ":"Popf","£":"pound","⪷":"prap","⪻":"Pr","≺":"pr","≼":"prcue","⪯":"pre","≾":"prsim","⪹":"prnap","⪵":"prnE","⋨":"prnsim","⪳":"prE","′":"prime","″":"Prime","∏":"prod","⌮":"profalar","⌒":"profline","⌓":"profsurf","∝":"prop","⊰":"prurel","𝒫":"Pscr","𝓅":"pscr","Ψ":"Psi","ψ":"psi"," ":"puncsp","𝔔":"Qfr","𝔮":"qfr","𝕢":"qopf","ℚ":"Qopf","⁗":"qprime","𝒬":"Qscr","𝓆":"qscr","⨖":"quatint","?":"quest",'"':"quot","⇛":"rAarr","∽̱":"race","Ŕ":"Racute","ŕ":"racute","√":"Sqrt","⦳":"raemptyv","⟩":"rang","⟫":"Rang","⦒":"rangd","⦥":"range","»":"raquo","⥵":"rarrap","⇥":"rarrb","⤠":"rarrbfs","⤳":"rarrc","→":"rarr","↠":"Rarr","⤞":"rarrfs","⥅":"rarrpl","⥴":"rarrsim","⤖":"Rarrtl","↣":"rarrtl","↝":"rarrw","⤚":"ratail","⤜":"rAtail","∶":"ratio","❳":"rbbrk","}":"rcub","]":"rsqb","⦌":"rbrke","⦎":"rbrksld","⦐":"rbrkslu","Ř":"Rcaron","ř":"rcaron","Ŗ":"Rcedil","ŗ":"rcedil","⌉":"rceil","Р":"Rcy","р":"rcy","⤷":"rdca","⥩":"rdldhar","↳":"rdsh","ℜ":"Re","ℛ":"Rscr","ℝ":"Ropf","▭":"rect","⥽":"rfisht","⌋":"rfloor","𝔯":"rfr","⥤":"rHar","⇀":"rharu","⥬":"rharul","Ρ":"Rho","ρ":"rho","ϱ":"rhov","⇄":"rlarr","⟧":"robrk","⥝":"RightDownTeeVector","⥕":"RightDownVectorBar","⇉":"rrarr","⊢":"vdash","⥛":"RightTeeVector","⋌":"rthree","⧐":"RightTriangleBar","⊳":"vrtri","⊵":"rtrie","⥏":"RightUpDownVector","⥜":"RightUpTeeVector","⥔":"RightUpVectorBar","↾":"uharr","⥓":"RightVectorBar","˚":"ring","‏":"rlm","⎱":"rmoust","⫮":"rnmid","⟭":"roang","⇾":"roarr","⦆":"ropar","𝕣":"ropf","⨮":"roplus","⨵":"rotimes","⥰":"RoundImplies",")":"rpar","⦔":"rpargt","⨒":"rppolint","›":"rsaquo","𝓇":"rscr","↱":"rsh","⋊":"rtimes","▹":"rtri","⧎":"rtriltri","⧴":"RuleDelayed","⥨":"ruluhar","℞":"rx","Ś":"Sacute","ś":"sacute","⪸":"scap","Š":"Scaron","š":"scaron","⪼":"Sc","≻":"sc","≽":"sccue","⪰":"sce","⪴":"scE","Ş":"Scedil","ş":"scedil","Ŝ":"Scirc","ŝ":"scirc","⪺":"scnap","⪶":"scnE","⋩":"scnsim","⨓":"scpolint","≿":"scsim","С":"Scy","с":"scy","⋅":"sdot","⩦":"sdote","⇘":"seArr","§":"sect",";":"semi","⤩":"tosa","✶":"sext","𝔖":"Sfr","𝔰":"sfr","♯":"sharp","Щ":"SHCHcy","щ":"shchcy","Ш":"SHcy","ш":"shcy","↑":"uarr","­":"shy","Σ":"Sigma","σ":"sigma","ς":"sigmaf","∼":"sim","⩪":"simdot","≃":"sime","⪞":"simg","⪠":"simgE","⪝":"siml","⪟":"simlE","≆":"simne","⨤":"simplus","⥲":"simrarr","⨳":"smashp","⧤":"smeparsl","⌣":"smile","⪪":"smt","⪬":"smte","⪬︀":"smtes","Ь":"SOFTcy","ь":"softcy","⌿":"solbar","⧄":"solb","/":"sol","𝕊":"Sopf","𝕤":"sopf","♠":"spades","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊏":"sqsub","⊑":"sqsube","⊐":"sqsup","⊒":"sqsupe","□":"squ","𝒮":"Sscr","𝓈":"sscr","⋆":"Star","☆":"star","⊂":"sub","⋐":"Sub","⪽":"subdot","⫅":"subE","⊆":"sube","⫃":"subedot","⫁":"submult","⫋":"subnE","⊊":"subne","⪿":"subplus","⥹":"subrarr","⫇":"subsim","⫕":"subsub","⫓":"subsup","∑":"sum","♪":"sung","¹":"sup1","²":"sup2","³":"sup3","⊃":"sup","⋑":"Sup","⪾":"supdot","⫘":"supdsub","⫆":"supE","⊇":"supe","⫄":"supedot","⟉":"suphsol","⫗":"suphsub","⥻":"suplarr","⫂":"supmult","⫌":"supnE","⊋":"supne","⫀":"supplus","⫈":"supsim","⫔":"supsub","⫖":"supsup","⇙":"swArr","⤪":"swnwar","ß":"szlig"," ":"Tab","⌖":"target","Τ":"Tau","τ":"tau","Ť":"Tcaron","ť":"tcaron","Ţ":"Tcedil","ţ":"tcedil","Т":"Tcy","т":"tcy","⃛":"tdot","⌕":"telrec","𝔗":"Tfr","𝔱":"tfr","∴":"there4","Θ":"Theta","θ":"theta","ϑ":"thetav","  ":"ThickSpace"," ":"thinsp","Þ":"THORN","þ":"thorn","⨱":"timesbar","×":"times","⨰":"timesd","⌶":"topbot","⫱":"topcir","𝕋":"Topf","𝕥":"topf","⫚":"topfork","‴":"tprime","™":"trade","▵":"utri","≜":"trie","◬":"tridot","⨺":"triminus","⨹":"triplus","⧍":"trisb","⨻":"tritime","⏢":"trpezium","𝒯":"Tscr","𝓉":"tscr","Ц":"TScy","ц":"tscy","Ћ":"TSHcy","ћ":"tshcy","Ŧ":"Tstrok","ŧ":"tstrok","Ú":"Uacute","ú":"uacute","↟":"Uarr","⥉":"Uarrocir","Ў":"Ubrcy","ў":"ubrcy","Ŭ":"Ubreve","ŭ":"ubreve","Û":"Ucirc","û":"ucirc","У":"Ucy","у":"ucy","⇅":"udarr","Ű":"Udblac","ű":"udblac","⥮":"udhar","⥾":"ufisht","𝔘":"Ufr","𝔲":"ufr","Ù":"Ugrave","ù":"ugrave","⥣":"uHar","▀":"uhblk","⌜":"ulcorn","⌏":"ulcrop","◸":"ultri","Ū":"Umacr","ū":"umacr","⏟":"UnderBrace","⏝":"UnderParenthesis","⊎":"uplus","Ų":"Uogon","ų":"uogon","𝕌":"Uopf","𝕦":"uopf","⤒":"UpArrowBar","↕":"varr","υ":"upsi","ϒ":"Upsi","Υ":"Upsilon","⇈":"uuarr","⌝":"urcorn","⌎":"urcrop","Ů":"Uring","ů":"uring","◹":"urtri","𝒰":"Uscr","𝓊":"uscr","⋰":"utdot","Ũ":"Utilde","ũ":"utilde","Ü":"Uuml","ü":"uuml","⦧":"uwangle","⦜":"vangrt","⊊︀":"vsubne","⫋︀":"vsubnE","⊋︀":"vsupne","⫌︀":"vsupnE","⫨":"vBar","⫫":"Vbar","⫩":"vBarv","В":"Vcy","в":"vcy","⊩":"Vdash","⊫":"VDash","⫦":"Vdashl","⊻":"veebar","≚":"veeeq","⋮":"vellip","|":"vert","‖":"Vert","❘":"VerticalSeparator","≀":"wr","𝔙":"Vfr","𝔳":"vfr","𝕍":"Vopf","𝕧":"vopf","𝒱":"Vscr","𝓋":"vscr","⊪":"Vvdash","⦚":"vzigzag","Ŵ":"Wcirc","ŵ":"wcirc","⩟":"wedbar","≙":"wedgeq","℘":"wp","𝔚":"Wfr","𝔴":"wfr","𝕎":"Wopf","𝕨":"wopf","𝒲":"Wscr","𝓌":"wscr","𝔛":"Xfr","𝔵":"xfr","Ξ":"Xi","ξ":"xi","⋻":"xnis","𝕏":"Xopf","𝕩":"xopf","𝒳":"Xscr","𝓍":"xscr","Ý":"Yacute","ý":"yacute","Я":"YAcy","я":"yacy","Ŷ":"Ycirc","ŷ":"ycirc","Ы":"Ycy","ы":"ycy","¥":"yen","𝔜":"Yfr","𝔶":"yfr","Ї":"YIcy","ї":"yicy","𝕐":"Yopf","𝕪":"yopf","𝒴":"Yscr","𝓎":"yscr","Ю":"YUcy","ю":"yucy","ÿ":"yuml","Ÿ":"Yuml","Ź":"Zacute","ź":"zacute","Ž":"Zcaron","ž":"zcaron","З":"Zcy","з":"zcy","Ż":"Zdot","ż":"zdot","ℨ":"Zfr","Ζ":"Zeta","ζ":"zeta","𝔷":"zfr","Ж":"ZHcy","ж":"zhcy","⇝":"zigrarr","𝕫":"zopf","𝒵":"Zscr","𝓏":"zscr","‍":"zwj","‌":"zwnj"},d=/["&'<>`]/g,p={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g,m={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅","in":"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺","int":"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},v={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},A=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],x=String.fromCharCode,E={},_=E.hasOwnProperty,w=function(e,t){return _.call(e,t) -},D=function(e,t){for(var r=-1,n=e.length;++r=55296&&57343>=e||e>1114111?(t&&B("character reference outside the permissible Unicode range"),"�"):w(b,e)?(t&&B("disallowed character reference"),b[e]):(t&&D(A,e)&&B("disallowed character reference"),e>65535&&(e-=65536,r+=x(e>>>10&1023|55296),e=56320|1023&e),r+=x(e))},F=function(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"},B=function(e){throw Error("Parse error: "+e)},T=function(e,t){t=k(t,T.options);var r=t.strict;r&&g.test(e)&&B("forbidden code point");var n=t.encodeEverything,i=t.useNamedReferences,a=t.allowUnsafeSymbols;return n?(e=e.replace(u,function(e){return i&&w(h,e)?"&"+h[e]+";":F(e)}),i&&(e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),i&&(e=e.replace(l,function(e){return"&"+h[e]+";"}))):i?(a||(e=e.replace(d,function(e){return"&"+h[e]+";"})),e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),e=e.replace(l,function(e){return"&"+h[e]+";"})):a||(e=e.replace(d,F)),e.replace(o,function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=1024*(t-55296)+r-56320+65536;return"&#x"+n.toString(16).toUpperCase()+";"}).replace(c,F)};T.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var S=function(e,t){t=k(t,S.options);var r=t.strict;return r&&f.test(e)&&B("malformed character reference"),e.replace(y,function(e,n,i,a,s,o,u,c){var l,h,d,p,f;return n?(l=n,h=i,r&&!h&&B("character reference was not terminated by a semicolon"),C(l,r)):a?(d=a,h=s,r&&!h&&B("character reference was not terminated by a semicolon"),l=parseInt(d,16),C(l,r)):o?(p=o,w(m,p)?m[p]:(r&&B("named character reference was not terminated by a semicolon"),e)):(p=u,f=c,f&&t.isAttributeValue?(r&&"="==f&&B("`&` did not start a character reference"),e):(r&&B("named character reference was not terminated by a semicolon"),v[p]+(f||"")))})};S.options={isAttributeValue:!1,strict:!1};var L=function(e){return e.replace(d,function(e){return p[e]})},N={version:"0.5.0",encode:T,decode:S,escape:L,unescape:S};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return N});else if(i&&!i.nodeType)if(a)a.exports=N;else for(var I in N)w(N,I)&&(i[I]=N[I]);else n.he=N}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],101:[function(e,t,r){(function(e){(function(){function n(e,t,r){for(var n=(r||0)-1,i=e?e.length:0;++n-1?0:-1:e?0:-1}function a(e){var t=this.cache,r=typeof e;if("boolean"==r||null==e)t[e]=!0;else{"number"!=r&&"string"!=r&&(r="object");var n="number"==r?e:A+e,i=t[r]||(t[r]={});"object"==r?(i[n]||(i[n]=[])).push(e):i[n]=!0}}function s(e){return e.charCodeAt(0)}function o(e,t){for(var r=e.criteria,n=t.criteria,i=-1,a=r.length;++io||"undefined"==typeof s)return 1;if(o>s||"undefined"==typeof o)return-1}}return e.index-t.index}function u(e){var t=-1,r=e.length,n=e[0],i=e[r/2|0],s=e[r-1];if(n&&"object"==typeof n&&i&&"object"==typeof i&&s&&"object"==typeof s)return!1;var o=h();o["false"]=o["null"]=o["true"]=o.undefined=!1;var u=h();for(u.array=e,u.cache=o,u.push=a;++ti?0:i);++n=x&&a===n,c=[];if(o){var l=u(t);l?(a=i,t=l):o=!1}for(;++r-1:void 0});return i.pop(),a.pop(),v&&(d(i),d(a)),s}function tt(e,t,r,n,i){(Jn(t)?Zt:ui)(t,function(t,a){var s,o,u=t,c=e[a];if(t&&((o=Jn(t))||ci(t))){for(var l=n.length;l--;)if(s=n[l]==t){c=i[l];break}if(!s){var h;r&&(u=r(c,t),(h="undefined"!=typeof u)&&(c=u)),h||(c=o?Jn(c)?c:[]:ci(c)?c:{}),n.push(t),i.push(c),h||tt(c,t,r,n,i)}}else r&&(u=r(c,t),"undefined"==typeof u&&(u=t)),"undefined"!=typeof u&&(c=u);e[a]=c})}function nt(e,t){return e+Sn(Wn()*(t-e+1))}function it(e,t,r){var a=-1,s=ut(),o=e?e.length:0,c=[],h=!t&&o>=x&&s===n,f=r||h?l():c;if(h){var g=u(f);s=i,f=g}for(;++a3&&"function"==typeof t[r-2])var n=E(t[--r-1],t[r--],2);else r>2&&"function"==typeof t[r-1]&&(n=t[--r]);for(var i=f(arguments,1,r),a=-1,s=l(),o=l();++ar?Hn(0,a+r):r)||0,Jn(e)?s=i(e,t,r)>-1:"number"==typeof a?s=(Ot(e)?e.indexOf(t,r):i(e,t,r))>-1:ui(e,function(e){return++n>=r?!(s=e===t):void 0}),s}function Yt(e,r,n){var i=!0;r=t.createCallback(r,n,3);var a=-1,s=e?e.length:0;if("number"==typeof s)for(;++aa&&(a=c)}else r=null==r&&Ot(e)?s:t.createCallback(r,n,3),Zt(e,function(e,t,n){var s=r(e,t,n);s>i&&(i=s,a=e)});return a}function tr(e,r,n){var i=1/0,a=i;if("function"!=typeof r&&n&&n[r]===e&&(r=null),null==r&&Jn(e))for(var o=-1,u=e.length;++oc&&(a=c)}else r=null==r&&Ot(e)?s:t.createCallback(r,n,3),Zt(e,function(e,t,n){var s=r(e,t,n);i>s&&(i=s,a=e)});return a}function rr(e,r,n,i){if(!e)return n;var a=arguments.length<3;r=t.createCallback(r,i,4);var s=-1,o=e.length;if("number"==typeof o)for(a&&(n=e[++s]);++sr?Hn(0,i+r):r||0}else if(r){var a=kr(e,t);return e[a]===t?a:-1}return n(e,t,r)}function vr(e,r,n){var i=0,a=e?e.length:0;if("number"!=typeof r&&null!=r){var s=a;for(r=t.createCallback(r,n,3);s--&&r(e[s],s,e);)i++}else i=null==r||n?1:r||i;return f(e,0,Yn(Hn(0,a-i),a))}function br(){for(var e=[],t=-1,r=arguments.length,a=l(),s=ut(),o=s===n,c=l();++t=x&&u(t?e[t]:c)))}var f=e[0],g=-1,y=f?f.length:0,m=[];e:for(;++gr?Hn(0,n+r):Yn(r,n-1))+1);n--;)if(e[n]===t)return n;return-1}function Er(e){for(var t=arguments,r=0,n=t.length,i=e?e.length:0;++ra;){var o=a+s>>>1;n(e[o])1?arguments:arguments[0],t=-1,r=e?er(pi(e,"length")):0,n=fn(0>r?0:r);++t2?st(e,17,f(arguments,2),null,t):st(e,1,null,null,t)}function Or(e){for(var t=arguments.length>1?Q(arguments,!0,!1,1):At(e),r=-1,n=t.length;++r2?st(t,19,f(arguments,2),null,e):st(t,3,null,null,e)}function qr(){for(var e=arguments,t=e.length;t--;)if(!Bt(e[t]))throw new _n;return function(){for(var t=arguments,r=e.length;r--;)t=[e[r].apply(this,t)];return t[0]}}function Pr(e,t){return t="number"==typeof t?t:+t||e.length,st(e,4,null,null,null,t)}function jr(e,t,r){var n,i,a,s,o,u,c,l=0,h=!1,d=!0;if(!Bt(e))throw new _n;if(t=Hn(0,t)||0,r===!0){var p=!0;d=!1}else Tt(r)&&(p=r.leading,h="maxWait"in r&&(Hn(t,r.maxWait)||0),d="trailing"in r?r.trailing:d);var f=function(){var r=t-(gi()-s);if(0>=r){i&&Tn(i);var h=c;i=u=c=y,h&&(l=gi(),a=e.apply(o,n),u||i||(n=o=null))}else u=Rn(f,r)},g=function(){u&&Tn(u),i=u=c=y,(d||h!==t)&&(l=gi(),a=e.apply(o,n),u||i||(n=o=null))};return function(){if(n=arguments,s=gi(),o=this,c=d&&(u||!p),h===!1)var r=p&&!u;else{i||p||(l=s);var y=h-(s-l),m=0>=y;m?(i&&(i=Tn(i)),l=s,a=e.apply(o,n)):i||(i=Rn(g,y))}return m&&u?u=Tn(u):u||t===h||(u=Rn(f,t)),r&&(m=!0,a=e.apply(o,n)),!m||u||i||(n=o=null),a}}function Mr(e){if(!Bt(e))throw new _n;var t=f(arguments,1);return Rn(function(){e.apply(y,t)},1)}function Vr(e,t){if(!Bt(e))throw new _n;var r=f(arguments,2);return Rn(function(){e.apply(y,r)},t)}function Ur(e,t){if(!Bt(e))throw new _n;var r=function(){var n=r.cache,i=t?t.apply(this,arguments):A+arguments[0];return In.call(n,i)?n[i]:n[i]=e.apply(this,arguments)};return r.cache={},r}function $r(e){var t,r;if(!Bt(e))throw new _n;return function(){return t?r:(t=!0,r=e.apply(this,arguments),e=null,r)}}function Gr(e){return st(e,16,f(arguments,1))}function Hr(e){return st(e,32,null,f(arguments,1))}function Yr(e,t,r){var n=!0,i=!0;if(!Bt(e))throw new _n;return r===!1?n=!1:Tt(r)&&(n="leading"in r?r.leading:n,i="trailing"in r?r.trailing:i),z.leading=n,z.maxWait=t,z.trailing=i,jr(e,t,z)}function zr(e,t){return st(t,16,[e])}function Wr(e){return function(){return e}}function Kr(e,t,r){var n=typeof e;if(null==e||"function"==n)return E(e,t,r);if("object"!=n)return tn(e);var i=ei(e),a=i[0],s=e[a];return 1!=i.length||s!==s||Tt(s)?function(t){for(var r=i.length,n=!1;r--&&(n=et(t[i[r]],e[i[r]],null,!0)););return n}:function(e){var t=e[a];return s===t&&(0!==s||1/s==1/t)}}function Zr(e){return null==e?"":En(e).replace(ii,ot)}function Xr(e){return e}function Jr(e,n,i){var a=!0,s=n&&At(n);n&&(i||s.length)||(null==i&&(i=n),o=r,n=e,e=t,s=At(n)),i===!1?a=!1:Tt(i)&&"chain"in i&&(a=i.chain);var o=e,u=Bt(o);Zt(s,function(t){var r=e[t]=n[t];u&&(o.prototype[t]=function(){var t=this.__chain__,n=this.__wrapped__,i=[n];On.apply(i,arguments);var s=r.apply(e,i);if(a||t){if(n===s&&Tt(s))return this;s=new o(s),s.__chain__=t}return s})})}function Qr(){return e._=kn,this}function en(){}function tn(e){return function(t){return t[e]}}function rn(e,t,r){var n=null==e,i=null==t;if(null==r&&("boolean"==typeof e&&i?(r=e,e=1):i||"boolean"!=typeof t||(r=t,i=!0)),n&&i&&(t=1),e=+e||0,i?(t=e,e=0):t=+t||0,r||e%1||t%1){var a=Wn();return Yn(e+a*(t-e+parseFloat("1e-"+((a+"").length-1))),t)}return nt(e,t)}function nn(e,t){if(e){var r=e[t];return Bt(r)?e[t]():r}}function an(e,r,n){var i=t.templateSettings;e=En(e||""),n=si({},n,i);var a,s=si({},n.imports,i.imports),o=ei(s),u=$t(s),l=0,h=n.interpolate||L,d="__p += '",p=xn((n.escape||L).source+"|"+h.source+"|"+(h===T?C:L).source+"|"+(n.evaluate||L).source+"|$","g");e.replace(p,function(t,r,n,i,s,o){return n||(n=i),d+=e.slice(l,o).replace(I,c),r&&(d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=o+t.length,t}),d+="';\n";var f=n.variable,g=f;g||(f="obj",d="with ("+f+") {\n"+d+"\n}\n"),d=(a?d.replace(w,""):d).replace(D,"$1").replace(k,"$1;"),d="function("+f+") {\n"+(g?"":f+" || ("+f+" = {});\n")+"var __t, __p = '', __e = _.escape"+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m="\n/*\n//# sourceURL="+(n.sourceURL||"/lodash/template/source["+R++ +"]")+"\n*/";try{var v=mn(o,"return "+d+m).apply(y,u)}catch(b){throw b.source=d,b}return r?v(r):(v.source=d,v)}function sn(e,t,r){e=(e=+e)>-1?e:0;var n=-1,i=fn(e);for(t=E(t,r,1);++n/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:T,variable:"",imports:{_:t}},Mn||(v=function(){function t(){}return function(r){if(Tt(r)){t.prototype=r;var n=new t;t.prototype=null}return n||e.Object()}}());var Xn=jn?function(e,t){W.value=t,jn(e,"__bindData__",W)}:en,Jn=Vn||function(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Cn.call(e)==P||!1},Qn=function(e){var t,r=e,n=[];if(!r)return n;if(!K[typeof e])return n;for(t in r)In.call(r,t)&&n.push(t);return n},ei=Gn?function(e){return Tt(e)?Gn(e):[]}:Qn,ti={"&":"&","<":"<",">":">",'"':""","'":"'"},ri=Et(ti),ni=xn("("+ei(ri).join("|")+")","g"),ii=xn("["+ei(ti).join("")+"]","g"),ai=function(e,t,r){var n,i=e,a=i;if(!i)return a;var s=arguments,o=0,u="number"==typeof r?2:s.length;if(u>3&&"function"==typeof s[u-2])var c=E(s[--u-1],s[u--],2);else u>2&&"function"==typeof s[u-1]&&(c=s[--u]);for(;++o/g,S=RegExp("^["+_+"]*0+(?=.$)"),L=/($^)/,N=/\bthis\b/,I=/['\n\r\t\u2028\u2029\\]/g,O=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],R=0,q="[object Arguments]",P="[object Array]",j="[object Boolean]",M="[object Date]",V="[object Function]",U="[object Number]",$="[object Object]",G="[object RegExp]",H="[object String]",Y={};Y[V]=!1,Y[q]=Y[P]=Y[j]=Y[M]=Y[U]=Y[$]=Y[G]=Y[H]=!0;var z={leading:!1,maxWait:0,trailing:!1},W={configurable:!1,enumerable:!1,value:null,writable:!1},K={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},X=K[typeof window]&&window||this,J=K[typeof r]&&r&&!r.nodeType&&r,Q=K[typeof t]&&t&&!t.nodeType&&t,et=Q&&Q.exports===J&&J,tt=K[typeof e]&&e;!tt||tt.global!==tt&&tt.window!==tt||(X=tt);var rt=g();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(X._=rt,define(function(){return rt})):J&&Q?et?(Q.exports=rt)._=rt:J._=rt:X._=rt}).call(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],102:[function(e,t){t.exports={name:"mermaid",version:"0.3.2",description:"Markdownish syntax for generating flowcharts",main:"src/main.js",bin:{mermaid:"./bin/mermaid.js"},scripts:{test:"gulp test"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"",license:"MIT",dependencies:{chalk:"^0.5.1","dagre-d3":"~0.3.2",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",d3:"~3.4.13","dagre-d3":"~0.3.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.8.9","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-ext-replace":"~0.1.0","gulp-hogan":"^1.1.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~1.0.1","gulp-jison":"~1.0.0","gulp-jshint":"^1.9.0","gulp-less":"^1.3.6","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1",he:"^0.5.0","hogan.js":"^3.0.2",jasmine:"~2.0.1",jison:"~0.4.15","jshint-stylish":"^1.0.0",karma:"~0.12.20","karma-chrome-launcher":"~0.1.5","karma-jasmine":"~0.2.1","karma-requirejs":"~0.2.2",lodash:"^2.4.1","lodash._escapestringchar":"^2.4.1","lodash._objecttypes":"^2.4.1","lodash._reinterpolate":"^2.4.1","lodash._reunescapedhtml":"^2.4.1","lodash.defaults":"^2.4.1","lodash.templatesettings":"^2.4.1","lodash.values":"^2.4.1",marked:"^0.3.2","mock-browser":"^0.90.27",path:"^0.4.9",phantomjs:"^1.9.12",rewire:"^2.1.3",rimraf:"^2.2.8","semantic-ui":"^1.4.1",tape:"^3.0.3"}} -},{}],103:[function(e,t,r){var n="",i=!1;r.setMessage=function(e){n=e},r.getMessage=function(){return n},r.setInfo=function(e){i=e},r.getInfo=function(){return i}},{}],104:[function(e,t,r){var n=e("./exampleDb"),i=e("./parser/example.js");r.draw=function(e,t,r){var a;a=i.parser,a.yy=n,a.parse(e);var s=d3.select("#"+t),o=s.append("g");o.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+r),s.attr("height",100),s.attr("width",400)}},{"./exampleDb":103,"./parser/example.js":105}],105:[function(e,t,r){(function(n){var i=function(){function e(){this.yy={}}var t=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},r=[6,9,10,12],n={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(e,t,r,n,i,a){var s=a.length-1;switch(i){case 1:return n;case 4:break;case 6:n.setInfo(!0);break;case 7:n.setMessage(a[s]);break;case 8:this.$=a[s-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},t(r,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},t(r,[2,3]),t(r,[2,4]),t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),{13:[1,11]},t(r,[2,8])],defaultActions:{4:[2,1]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){function t(){var e;return e=f.lex()||d,"number"!=typeof e&&(e=r.symbols_[e]||e),e}var r=this,n=[0],i=[null],a=[],s=this.table,o="",u=0,c=0,l=0,h=2,d=1,p=a.slice.call(arguments,1),f=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);f.setInput(e,g.yy),g.yy.lexer=f,g.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var m=f.yylloc;a.push(m);var v=f.options&&f.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,A,x,E,_,w,D,k,C,F={};;){if(x=n[n.length-1],this.defaultActions[x]?E=this.defaultActions[x]:((null===b||"undefined"==typeof b)&&(b=t()),E=s[x]&&s[x][b]),"undefined"==typeof E||!E.length||!E[0]){var B="";C=[];for(w in s[x])this.terminals_[w]&&w>h&&C.push("'"+this.terminals_[w]+"'");B=f.showPosition?"Parse error on line "+(u+1)+":\n"+f.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(u+1)+": Unexpected "+(b==d?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(B,{text:f.match,token:this.terminals_[b]||b,line:f.yylineno,loc:m,expected:C})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+b);switch(E[0]){case 1:n.push(b),i.push(f.yytext),a.push(f.yylloc),n.push(E[1]),b=null,A?(b=A,A=null):(c=f.yyleng,o=f.yytext,u=f.yylineno,m=f.yylloc,l>0&&l--);break;case 2:if(D=this.productions_[E[1]][1],F.$=i[i.length-D],F._$={first_line:a[a.length-(D||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(D||1)].first_column,last_column:a[a.length-1].last_column},v&&(F._$.range=[a[a.length-(D||1)].range[0],a[a.length-1].range[1]]),_=this.performAction.apply(F,[o,c,u,g.yy,E[1],i,a].concat(p)),"undefined"!=typeof _)return _;D&&(n=n.slice(0,-1*D*2),i=i.slice(0,-1*D),a=a.slice(0,-1*D)),n.push(this.productions_[E[1]][0]),i.push(F.$),a.push(F._$),k=s[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},i=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=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),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,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))),n=e[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(e=this.test_match(r,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[n]),e!==!1?e:!1):""===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(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>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(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,t,r,n){switch(r){case 0:return 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return e}();return n.lexer=i,e.prototype=n,n.Parser=e,new e}();"undefined"!=typeof e&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("1YiZ5S"))},{"1YiZ5S":99,fs:97,path:98}],106:[function(e,t){var r;if(e)try{r=e("dagre-d3")}catch(n){}r||(r=window.dagreD3),t.exports=r},{"dagre-d3":1}],107:[function(e,t,r){(function(t){var n=e("./graphDb"),i=e("./parser/flow"),a=e("./parser/dot"),s=e("./dagre-d3");r.addVertices=function(e,r){var n=Object.keys(e),i=function(e,t){var r;for(r=0;r0&&(o=s.classes.join(" "));var u="";u=i(u,s.styles),a="undefined"==typeof s.text?s.id:s.text;var c="";t.mermaid.htmlLabels?c="html":(a=a.replace(/
/g,"\n"),c="text");var l=0,h="";switch(s.type){case"round":l=5,h="rect";break;case"square":h="rect";break;case"diamond":h="question";break;case"odd":h="rect_left_inv_arrow";break;case"odd_right":h="rect_left_inv_arrow";break;case"circle":h="circle";break;default:h="rect"}r.setNode(s.id,{labelType:c,shape:h,label:a,rx:l,ry:l,"class":o,style:u,id:s.id})})},r.addEdges=function(e,r){var n,i=0;e.forEach(function(e){i++,n="arrow_open"===e.type?"none":"normal";var a="";if("undefined"!=typeof e.style)e.style.forEach(function(e){a=a+e+";"});else switch(e.stroke){case"normal":a="stroke: #333; stroke-width: 1.5px;fill:none";break;case"dotted":a="stroke: #333; fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":a="stroke: #333; stroke-width: 3.5px;fill:none"}if("undefined"==typeof e.text)"undefined"==typeof e.style?r.setEdge(e.start,e.end,{style:a,arrowhead:n},i):r.setEdge(e.start,e.end,{style:a,arrowheadStyle:"fill: #333",arrowhead:n},i);else{var s=e.text.replace(/
/g,"\n");"undefined"==typeof e.style?t.mermaid.htmlLabels?r.setEdge(e.start,e.end,{labelType:"html",style:a,labelpos:"c",label:''+e.text+"",arrowheadStyle:"fill: #333",arrowhead:n},i):r.setEdge(e.start,e.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:s,arrowheadStyle:"fill: #333",arrowhead:n},i):r.setEdge(e.start,e.end,{labelType:"text",style:a,arrowheadStyle:"fill: #333",label:s,arrowhead:n},i)}})},r.getClasses=function(e,t){var r;n.clear(),r=t?a.parser:i.parser,r.yy=n,r.parse(e);var s=n.getClasses();return"undefined"==typeof s.default&&(s.default={id:"default"},s.default.styles=["fill:#ffa","stroke:#666","stroke-width:3px"],s.default.nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],s.default.edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),s},r.draw=function(e,t,o){var u;n.clear(),u=o?a.parser:i.parser,u.yy=n,u.parse(e);var c;c=n.getDirection(),"undefined"==typeof c&&(c="TD");var l=new s.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:c,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),h=n.getSubGraphs(),d=0;h.forEach(function(){d+=1;var e="subG"+d;n.addVertex(e,void 0,void 0,void 0)});var p=n.getVertices(),f=n.getEdges();d=0,h.forEach(function(e){d+=1;var t="subG"+d;d3.selectAll("cluster").append("text"),e.nodes.forEach(function(e){l.setParent(e,t)})}),r.addVertices(p,l),r.addEdges(f,l);var g=new s.render;g.shapes().question=function(e,t,r){var n=t.width,i=t.height,a=.8*(n+i),o=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}],u=e.insert("polygon",":first-child").attr("points",o.map(function(e){return e.x+","+e.y}).join(" ")).attr("rx",5).attr("ry",5).attr("transform","translate("+-a/2+","+2*a/4+")");return r.intersect=function(e){return s.intersect.polygon(r,o,e)},u},g.shapes().rect_left_inv_arrow=function(e,t,r){var n=t.width,i=t.height,a=[{x:-i/2,y:0},{x:n,y:0},{x:n,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}],o=e.insert("polygon",":first-child").attr("points",a.map(function(e){return e.x+","+e.y}).join(" ")).attr("transform","translate("+-n/2+","+2*i/4+")");return r.intersect=function(e){return s.intersect.polygon(r,a,e)},o},g.shapes().rect_right_inv_arrow=function(e,t,r){var n=t.width,i=t.height,a=[{x:0,y:0},{x:n+i/2,y:0},{x:n,y:-i/2},{x:n+i/2,y:-i},{x:0,y:-i}],o=e.insert("polygon",":first-child").attr("points",a.map(function(e){return e.x+","+e.y}).join(" ")).attr("transform","translate("+-n/2+","+2*i/4+")");return r.intersect=function(e){return s.intersect.polygon(r,a,e)},o},g.arrows().none=function(e,t,r,n){var i=e.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),a=i.append("path").attr("d","M 0 0 L 0 0 L 0 0 z");s.util.applyStyle(a,r[n+"Style"])};var y=d3.select("#"+t);svgGroup=d3.select("#"+t+" g"),g(d3.select("#"+t+" g"),l);var m=document.querySelector("#mermaidChart0");y.attr("height",l.graph().height),y.attr("width",l.graph().width),y.attr("viewBox",m.getBBox().x+" 0 "+l.graph().width+" "+l.graph().height),setTimeout(function(){var e=0;h.forEach(function(r){var n=document.querySelectorAll("#"+t+" .clusters rect"),i=document.querySelectorAll("#"+t+" .cluster");if("undefined"!==r.title){var a=n[e].x.baseVal.value,s=n[e].y.baseVal.value,o=n[e].width.baseVal.value,u=d3.select(i[e]),c=u.append("text");c.attr("x",a+o/2),c.attr("y",s+14),c.attr("fill","black"),c.attr("stroke","none"),c.attr("id",t+"Text"),c.style("text-anchor","middle"),c.text(r.title)}e+=1})},200)}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./dagre-d3":106,"./graphDb":108,"./parser/dot":109,"./parser/flow":110}],108:[function(require,module,exports){var vertices={},edges=[],classes=[],subGraphs=[],direction,funs=[];exports.addVertex=function(e,t,r,n){"undefined"!=typeof e&&0!==e.trim().length&&("undefined"==typeof vertices[e]&&(vertices[e]={id:e,styles:[],classes:[]}),"undefined"!=typeof t&&(vertices[e].text=t),"undefined"!=typeof r&&(vertices[e].type=r),"undefined"!=typeof r&&(vertices[e].type=r),"undefined"!=typeof n&&null!==n&&n.forEach(function(t){vertices[e].styles.push(t)}))},exports.addLink=function(e,t,r,n){var i={start:e,end:t,type:void 0,text:""};n=r.text,"undefined"!=typeof n&&(i.text=n),"undefined"!=typeof r&&(i.type=r.type,i.stroke=r.stroke),edges.push(i)},exports.updateLink=function(e,t){e.substr(1);edges[e].style=t},exports.addClass=function(e,t){"undefined"==typeof classes[e]&&(classes[e]={id:e,styles:[]}),"undefined"!=typeof t&&null!==t&&t.forEach(function(t){classes[e].styles.push(t)})},exports.setDirection=function(e){direction=e},exports.setClass=function(e,t){e.indexOf(",")>0?e.split(",").forEach(function(e){"undefined"!=typeof vertices[e]&&vertices[e].classes.push(t)}):"undefined"!=typeof vertices[e]&&vertices[e].classes.push(t)},exports.setClickEvent=function(id,functionName){id.indexOf(",")>0?id.split(",").forEach(function(id2){"undefined"!=typeof vertices[id2]&&funs.push(function(){var elem=document.getElementById(id2);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id2+"')")})})}):"undefined"!=typeof vertices[id]&&funs.push(function(){var elem=document.getElementById(id);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id+"')")})})},exports.bindFunctions=function(){funs.forEach(function(e){e()})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes},exports.clear=function(){vertices={},classes={},edges=[],funs=[],subGraphs=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(e,t){function r(e){var t={"boolean":{},number:{},string:{}},r=[];return e.filter(function(e){var n=typeof e;return n in t?t[n].hasOwnProperty(e)?!1:t[n][e]=!0:r.indexOf(e)>=0?!1:r.push(e)})}var n=[];n=r(n.concat.apply(n,e)),subGraphs.push({nodes:n,title:t})},exports.getSubGraphs=function(){return subGraphs}},{}],109:[function(e,t,r){(function(n){var i=function(){function e(){this.yy={}}var t=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},r=[1,5],n=[1,6],i=[1,12],a=[1,13],s=[1,14],o=[1,15],u=[1,16],c=[1,17],l=[1,18],h=[1,19],d=[1,20],p=[1,21],f=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],y=[1,37],m=[1,33],v=[1,34],b=[1,35],A=[1,36],x=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],E=[10,28],_=[10,28,37,57,58],w=[2,49],D=[1,45],k=[1,48],C=[1,49],F=[1,52],B=[2,65],T=[1,65],S=[1,66],L=[1,67],N=[1,68],I=[1,69],O=[1,70],R=[1,71],q=[1,72],P=[1,73],j=[8,16,17,18,19,20,21,22,23,24,25,26,47],M=[10,28,37],V={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(e,t,r,n,i,a){var s=a.length-1;switch(i){case 1:this.$=a[s-1];break;case 2:this.$=a[s-4];break;case 3:this.$=a[s-5];break;case 4:this.$=a[s-3];break;case 8:case 10:case 11:this.$=a[s];break;case 9:this.$=a[s-1]+""+a[s];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=a[s];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:n.addLink(a[s-1],a[s].id,a[s].op),this.$="oy";break;case 42:n.addLink(a[s-1],a[s].id,a[s].op),this.$={op:a[s-2],id:a[s-1]};break;case 44:this.$={op:a[s-1],id:a[s]};break;case 48:n.addVertex(a[s-1]),this.$=a[s-1];break;case 49:n.addVertex(a[s]),this.$=a[s];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:r,13:n},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f},{6:23,12:r,13:n},t(g,[2,5]),t(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:y,9:25,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},t([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f}),t(x,[2,8]),t(x,[2,10]),t(x,[2,11]),t(x,[2,12]),t(x,[2,13]),t(x,[2,14]),t(x,[2,15]),t(x,[2,16]),t(x,[2,17]),t(x,[2,18]),t(x,[2,19]),t(x,[2,20]),{7:39,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f},{7:30,8:y,9:40,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},{10:[1,41]},{10:[2,21],28:[1,42]},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(_,w,{44:44,32:[1,43],45:D}),t(E,[2,27],{41:46,43:47,57:k,58:C}),t(E,[2,47],{43:47,34:50,41:51,37:F,57:k,58:C}),{34:53,37:F},{34:54,37:F},{34:55,37:F},{7:56,8:[1,57],14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f},{7:30,8:y,9:58,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},t(x,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:y,9:61,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},{7:62,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f},t(_,[2,48]),t(_,B,{14:10,15:11,7:63,46:64,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,48:T,49:S,50:L,51:N,52:I,53:O,54:R,55:q,56:P}),t(E,[2,41],{34:74,37:F}),{7:77,8:y,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,33:76,42:75,47:A},t(j,[2,66]),t(j,[2,67]),t(E,[2,46]),t(E,[2,40],{34:78,37:F}),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,38:79,39:[1,80]},t(E,[2,28]),t(E,[2,29]),t(E,[2,30]),{8:[1,82]},{7:30,8:y,9:83,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},{10:[1,84]},{7:30,8:y,9:85,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},{5:[2,2]},{10:[2,22]},t(E,[2,26]),t(_,[2,51],{45:[1,86]}),t(_,[2,52]),t(_,[2,56]),t(_,[2,57]),t(_,[2,58]),t(_,[2,59]),t(_,[2,60]),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),t(_,[2,64]),t(E,[2,38]),t(M,[2,44],{43:47,41:87,57:k,58:C}),t(M,[2,45],{43:47,41:88,57:k,58:C}),t(_,w,{44:44,45:D}),t(E,[2,39]),{39:[1,89]},t(E,[2,34],{34:90,37:F}),{32:[1,91]},{7:30,8:y,9:92,12:m,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:A},{10:[1,93]},t(_,[2,55]),{10:[1,94]},t(_,B,{46:95,48:T,49:S,50:L,51:N,52:I,53:O,54:R,55:q,56:P}),t(M,[2,42]),t(M,[2,43]),t(E,[2,33],{34:96,37:F}),t(E,[2,32]),{7:97,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f},{10:[1,98]},t(_,[2,54]),{5:[2,3]},t(_,[2,50]),t(E,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},t(_,[2,53]),{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,38:101},{7:81,14:10,15:11,16:i,17:a,18:s,19:o,20:u,21:c,22:l,23:h,24:d,25:p,26:f,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){function t(){var e;return e=f.lex()||d,"number"!=typeof e&&(e=r.symbols_[e]||e),e}var r=this,n=[0],i=[null],a=[],s=this.table,o="",u=0,c=0,l=0,h=2,d=1,p=a.slice.call(arguments,1),f=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);f.setInput(e,g.yy),g.yy.lexer=f,g.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var m=f.yylloc;a.push(m);var v=f.options&&f.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,A,x,E,_,w,D,k,C,F={};;){if(x=n[n.length-1],this.defaultActions[x]?E=this.defaultActions[x]:((null===b||"undefined"==typeof b)&&(b=t()),E=s[x]&&s[x][b]),"undefined"==typeof E||!E.length||!E[0]){var B="";C=[];for(w in s[x])this.terminals_[w]&&w>h&&C.push("'"+this.terminals_[w]+"'");B=f.showPosition?"Parse error on line "+(u+1)+":\n"+f.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(u+1)+": Unexpected "+(b==d?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(B,{text:f.match,token:this.terminals_[b]||b,line:f.yylineno,loc:m,expected:C})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+b);switch(E[0]){case 1:n.push(b),i.push(f.yytext),a.push(f.yylloc),n.push(E[1]),b=null,A?(b=A,A=null):(c=f.yyleng,o=f.yytext,u=f.yylineno,m=f.yylloc,l>0&&l--);break;case 2:if(D=this.productions_[E[1]][1],F.$=i[i.length-D],F._$={first_line:a[a.length-(D||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(D||1)].first_column,last_column:a[a.length-1].last_column},v&&(F._$.range=[a[a.length-(D||1)].range[0],a[a.length-1].range[1]]),_=this.performAction.apply(F,[o,c,u,g.yy,E[1],i,a].concat(p)),"undefined"!=typeof _)return _;D&&(n=n.slice(0,-1*D*2),i=i.slice(0,-1*D),a=a.slice(0,-1*D)),n.push(this.productions_[E[1]][0]),i.push(F.$),a.push(F._$),k=s[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},U=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=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),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,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))),n=e[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(e=this.test_match(r,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[n]),e!==!1?e:!1):""===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(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>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(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,r,n){switch(r){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}}; -return e}();return V.lexer=U,e.prototype=V,V.Parser=e,new e}();"undefined"!=typeof e&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("1YiZ5S"))},{"1YiZ5S":99,fs:97,path:98}],110:[function(e,t,r){(function(n){var i=function(){function e(){this.yy={}}var t=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},r=[1,9,10,12,19,29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],n=[2,2],i=[1,9],a=[1,10],s=[1,11],o=[1,12],u=[1,20],c=[1,23],l=[1,24],h=[1,25],d=[1,26],p=[1,27],f=[1,32],g=[1,21],y=[1,34],m=[1,31],v=[1,33],b=[1,39],A=[1,38],x=[1,35],E=[1,36],_=[1,37],w=[1,9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],D=[29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],k=[2,19],C=[1,51],F=[1,52],B=[1,50],T=[1,75],S=[1,67],L=[1,76],N=[1,63],I=[1,62],O=[1,77],R=[1,78],q=[1,68],P=[1,65],j=[1,64],M=[1,70],V=[1,71],U=[1,72],$=[1,73],G=[1,74],H=[9,10,19],Y=[1,85],z=[1,86],W=[1,87],K=[1,88],Z=[1,89],X=[1,90],J=[1,91],Q=[1,92],et=[1,93],tt=[1,94],rt=[1,95],nt=[1,96],it=[9,10,19,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61],at=[9,10,12,15,19,36,38,40,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,76,79,81,82,84,85,87,88,89],st=[9,10,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],ot=[1,110],ut=[1,113],ct=[1,111],lt=[9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],ht=[9,10,11,12,13,15,16,19,29,32,37,39,41,44,47,49,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89],dt=[9,10,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],pt=[2,122],ft=[1,139],gt=[1,128],yt=[1,129],mt=[1,126],vt=[1,127],bt=[1,130],At=[1,131],xt=[1,135],Et=[1,136],_t=[1,134],wt=[1,137],Dt=[1,125],kt=[1,132],Ct=[1,133],Ft=[1,138],Bt=[76,79,81,82,84,85,87,88,89],Tt=[12,62,76,79,81,82,84,85,87,88,89],St=[1,164],Lt=[1,163],Nt=[9,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],It=[1,197],Ot=[1,194],Rt=[1,201],qt=[1,198],Pt=[1,195],jt=[1,202],Mt=[1,192],Vt=[1,193],Ut=[1,196],$t=[1,199],Gt=[1,200],Ht=[11,12,13,15,16,29,32,44,47,49,67,68,69,70,71,76,79,81,82,84,85,87,88,89],Yt=[1,217],zt=[9,10,19,79],Wt=[9,10,12,19,44,67,75,76,77,79,81,82,83,84,85],Kt={trace:function(){},yy:{},symbols_:{error:2,mermaidDoc:3,graphConfig:4,document:5,line:6,spaceListNewline:7,statement:8,SEMI:9,EOF:10,GRAPH:11,SPACE:12,DIR:13,FirstStmtSeperator:14,TAGEND:15,TAGSTART:16,UP:17,DOWN:18,NEWLINE:19,spaceList:20,commentStatement:21,verticeStatement:22,separator:23,styleStatement:24,linkStyleStatement:25,classDefStatement:26,classStatement:27,clickStatement:28,subgraph:29,text:30,endStatement:31,end:32,vertex:33,link:34,alphaNum:35,SQS:36,SQE:37,PS:38,PE:39,DIAMOND_START:40,DIAMOND_STOP:41,alphaNumStatement:42,alphaNumToken:43,MINUS:44,linkStatement:45,arrowText:46,"--":47,"-.":48,"==":49,ARROW_POINT:50,ARROW_CIRCLE:51,ARROW_CROSS:52,ARROW_OPEN:53,DOTTED_ARROW_POINT:54,DOTTED_ARROW_CIRCLE:55,DOTTED_ARROW_CROSS:56,DOTTED_ARROW_OPEN:57,THICK_ARROW_POINT:58,THICK_ARROW_CIRCLE:59,THICK_ARROW_CROSS:60,THICK_ARROW_OPEN:61,PIPE:62,textToken:63,commentText:64,commentToken:65,keywords:66,STYLE:67,LINKSTYLE:68,CLASSDEF:69,CLASS:70,CLICK:71,textNoTags:72,textNoTagsToken:73,stylesOpt:74,HEX:75,NUM:76,PCT:77,style:78,COMMA:79,styleComponent:80,ALPHA:81,COLON:82,UNIT:83,BRKT:84,DOT:85,graphCodeTokens:86,PLUS:87,EQUALS:88,MULT:89,TAG_START:90,TAG_END:91,QUOTE:92,$accept:0,$end:1},terminals_:{2:"error",9:"SEMI",10:"EOF",11:"GRAPH",12:"SPACE",13:"DIR",15:"TAGEND",16:"TAGSTART",17:"UP",18:"DOWN",19:"NEWLINE",29:"subgraph",32:"end",36:"SQS",37:"SQE",38:"PS",39:"PE",40:"DIAMOND_START",41:"DIAMOND_STOP",44:"MINUS",47:"--",48:"-.",49:"==",50:"ARROW_POINT",51:"ARROW_CIRCLE",52:"ARROW_CROSS",53:"ARROW_OPEN",54:"DOTTED_ARROW_POINT",55:"DOTTED_ARROW_CIRCLE",56:"DOTTED_ARROW_CROSS",57:"DOTTED_ARROW_OPEN",58:"THICK_ARROW_POINT",59:"THICK_ARROW_CIRCLE",60:"THICK_ARROW_CROSS",61:"THICK_ARROW_OPEN",62:"PIPE",67:"STYLE",68:"LINKSTYLE",69:"CLASSDEF",70:"CLASS",71:"CLICK",75:"HEX",76:"NUM",77:"PCT",79:"COMMA",81:"ALPHA",82:"COLON",83:"UNIT",84:"BRKT",85:"DOT",87:"PLUS",88:"EQUALS",89:"MULT",90:"TAG_START",91:"TAG_END",92:"QUOTE"},productions_:[0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[6,1],[4,4],[4,4],[4,4],[4,4],[4,4],[14,1],[14,1],[14,2],[7,2],[7,2],[7,1],[7,1],[20,2],[20,1],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,6],[8,5],[31,1],[31,2],[23,1],[23,1],[23,1],[22,3],[22,1],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,1],[33,2],[35,1],[35,2],[42,1],[42,3],[34,2],[34,3],[34,1],[34,2],[34,5],[34,6],[34,5],[34,6],[34,5],[34,6],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[46,3],[30,1],[30,2],[64,1],[64,2],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[72,1],[72,2],[26,5],[27,5],[28,5],[24,5],[24,5],[25,5],[21,3],[74,1],[74,3],[78,1],[78,2],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[65,1],[65,1],[63,1],[63,1],[63,1],[63,1],[63,1],[73,1],[73,1],[73,1],[73,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1]],performAction:function(e,t,r,n,i,a){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:a[s]!==[]&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:case 50:case 52:case 77:case 79:case 90:this.$=a[s];break;case 8:n.setDirection(a[s-1]),this.$=a[s-1];break;case 9:n.setDirection("LR"),this.$=a[s-1];break;case 10:n.setDirection("RL"),this.$=a[s-1];break;case 11:n.setDirection("BT"),this.$=a[s-1];break;case 12:n.setDirection("TB"),this.$=a[s-1];break;case 22:case 24:case 25:case 26:case 27:case 28:this.$=[];break;case 23:this.$=a[s-1];break;case 29:n.addSubGraph(a[s-2],a[s-4]);break;case 30:n.addSubGraph(a[s-2],void 0);break;case 36:n.addLink(a[s-2],a[s],a[s-1]),this.$=[a[s-2],a[s]];break;case 37:this.$=[a[s]];break;case 38:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"square");break;case 39:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"square");break;case 40:this.$=a[s-5],n.addVertex(a[s-5],a[s-2],"circle");break;case 41:this.$=a[s-6],n.addVertex(a[s-6],a[s-3],"circle");break;case 42:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"round");break;case 43:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"round");break;case 44:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"diamond");break;case 45:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"diamond");break;case 46:this.$=a[s-3],n.addVertex(a[s-3],a[s-1],"odd");break;case 47:this.$=a[s-4],n.addVertex(a[s-4],a[s-2],"odd");break;case 48:this.$=a[s],n.addVertex(a[s]);break;case 49:this.$=a[s-1],n.addVertex(a[s-1]);break;case 51:case 78:case 80:case 91:this.$=a[s-1]+""+a[s];break;case 53:this.$=a[s-2]+"-"+a[s];break;case 54:a[s-1].text=a[s],this.$=a[s-1];break;case 55:a[s-2].text=a[s-1],this.$=a[s-2];break;case 56:this.$=a[s];break;case 57:case 76:this.$=a[s-1];break;case 58:case 60:case 62:a[s].text=a[s-2],this.$=a[s];break;case 59:case 61:case 63:a[s-1].text=a[s-3],this.$=a[s-1];break;case 64:this.$={type:"arrow",stroke:"normal"};break;case 65:this.$={type:"arrow_circle",stroke:"normal"};break;case 66:this.$={type:"arrow_cross",stroke:"normal"};break;case 67:this.$={type:"arrow_open",stroke:"normal"};break;case 68:this.$={type:"arrow",stroke:"dotted"};break;case 69:this.$={type:"arrow_circle",stroke:"dotted"};break;case 70:this.$={type:"arrow_cross",stroke:"dotted"};break;case 71:this.$={type:"arrow_open",stroke:"dotted"};break;case 72:this.$={type:"arrow",stroke:"thick"};break;case 73:this.$={type:"arrow_circle",stroke:"thick"};break;case 74:this.$={type:"arrow_cross",stroke:"thick"};break;case 75:this.$={type:"arrow_open",stroke:"thick"};break;case 92:this.$=a[s-4],n.addClass(a[s-2],a[s]);break;case 93:this.$=a[s-4],n.setClass(a[s-2],a[s]);break;case 94:this.$=a[s-4],n.setClickEvent(a[s-2],a[s]);break;case 95:this.$=a[s-4],n.addVertex(a[s-2],void 0,void 0,a[s]);break;case 96:case 97:this.$=a[s-4],n.updateLink(a[s-2],a[s]);break;case 99:this.$=[a[s]];break;case 100:a[s-2].push(a[s]),this.$=a[s-2];break;case 102:this.$=a[s-1]+a[s]}},table:[{3:1,4:2,11:[1,3]},{1:[3]},t(r,n,{5:4}),{12:[1,5]},{1:[2,1],6:6,7:7,8:8,9:i,10:a,12:s,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:u,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:d,71:p,76:f,77:g,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{13:[1,40],15:[1,41],16:[1,42],17:[1,43],18:[1,44]},t(w,[2,3]),{8:45,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:u,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:d,71:p,76:f,77:g,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(D,k,{7:46,12:s,19:o}),t(D,[2,18],{7:47,12:s,19:o}),{19:[1,48]},{9:C,10:F,19:B,23:49},{9:C,10:F,19:B,23:53},{9:C,10:F,19:B,23:54},{9:C,10:F,19:B,23:55},{9:C,10:F,19:B,23:56},{9:C,10:F,19:B,23:57},{9:C,10:F,11:T,12:S,13:L,15:N,16:I,19:B,23:59,29:O,30:58,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{77:[1,79]},t(H,[2,37],{34:80,45:81,47:[1,82],48:[1,83],49:[1,84],50:Y,51:z,52:W,53:K,54:Z,55:X,56:J,57:Q,58:et,59:tt,60:rt,61:nt}),{12:[1,97]},{12:[1,98]},{12:[1,99]},{12:[1,100]},{12:[1,101]},t(it,[2,48],{43:30,42:107,12:[1,106],15:[1,105],36:[1,102],38:[1,103],40:[1,104],76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_}),t(at,[2,50]),t(at,[2,52],{44:[1,108]}),t(st,[2,125]),t(st,[2,126]),t(st,[2,127]),t(st,[2,128]),t(st,[2,129]),t(st,[2,130]),t(st,[2,131]),t(st,[2,132]),t(st,[2,133]),{9:ot,12:ut,14:109,19:ct,20:112},{9:ot,12:ut,14:114,19:ct,20:112},{9:ot,12:ut,14:115,19:ct,20:112},{9:ot,12:ut,14:116,19:ct,20:112},{9:ot,12:ut,14:117,19:ct,20:112},t(w,[2,4]),t(D,[2,16]),t(D,[2,17]),t(w,[2,22]),t(w,[2,23]),t(w,[2,33]),t(w,[2,34]),t(w,[2,35]),t(w,[2,24]),t(w,[2,25]),t(w,[2,26]),t(w,[2,27]),t(w,[2,28]),{9:C,10:F,11:T,12:S,13:L,15:N,16:I,19:B,23:118,29:O,32:R,43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(lt,n,{5:120}),t(ht,[2,77]),t(dt,[2,116]),t(dt,[2,117]),t(dt,[2,118]),t(dt,[2,119]),t(dt,[2,120]),t(dt,[2,121]),t(dt,pt),t(dt,[2,123]),t(dt,[2,124]),t(dt,[2,81]),t(dt,[2,82]),t(dt,[2,83]),t(dt,[2,84]),t(dt,[2,85]),t(dt,[2,86]),t(dt,[2,87]),t(dt,[2,88]),t(dt,[2,89]),{9:ft,11:T,12:S,13:L,15:N,16:I,29:O,32:R,36:gt,37:yt,38:mt,39:vt,40:bt,41:At,43:66,44:q,47:P,49:j,50:xt,51:Et,52:_t,53:wt,62:Dt,63:123,64:121,65:122,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,86:124,87:x,88:E,89:_,90:kt,91:Ct,92:Ft},{33:140,35:28,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(Bt,[2,56],{46:141,12:[1,142],62:[1,143]}),{12:[1,144]},{12:[1,145]},{12:[1,146]},t(Tt,[2,64]),t(Tt,[2,65]),t(Tt,[2,66]),t(Tt,[2,67]),t(Tt,[2,68]),t(Tt,[2,69]),t(Tt,[2,70]),t(Tt,[2,71]),t(Tt,[2,72]),t(Tt,[2,73]),t(Tt,[2,74]),t(Tt,[2,75]),{35:147,42:29,43:30,75:[1,148],76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{76:[1,149]},{35:150,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{35:151,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{35:152,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:153,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:155,32:R,38:[1,154],43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:156,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:157,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(it,[2,49]),t(at,[2,51]),{43:158,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(r,[2,8]),t(r,[2,13]),t(r,[2,14]),{19:[1,159]},{12:ut,19:[2,21],20:160},t(r,[2,9]),t(r,[2,10]),t(r,[2,11]),t(r,[2,12]),t(lt,n,{5:161}),t(ht,[2,78]),{6:6,7:7,8:8,9:i,10:a,12:St,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:u,31:162,32:Lt,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:d,71:p,76:f,77:g,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{9:ft,11:T,12:S,13:L,15:N,16:I,19:[2,98],29:O,32:R,36:gt,37:yt,38:mt,39:vt,40:bt,41:At,43:66,44:q,47:P,49:j,50:xt,51:Et,52:_t,53:wt,62:Dt,63:123,65:165,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,86:124,87:x,88:E,89:_,90:kt,91:Ct,92:Ft},t(Nt,[2,79]),t(Nt,[2,114]),t(Nt,[2,115]),t(Nt,[2,134]),t(Nt,[2,135]),t(Nt,[2,136]),t(Nt,[2,137]),t(Nt,[2,138]),t(Nt,[2,139]),t(Nt,[2,140]),t(Nt,[2,141]),t(Nt,[2,142]),t(Nt,[2,143]),t(Nt,[2,144]),t(Nt,[2,145]),t(Nt,[2,146]),t(Nt,[2,147]),t(Nt,[2,148]),t(H,[2,36]),t(Bt,[2,54],{12:[1,166]}),t(Bt,[2,57]),{11:T,12:S,13:L,15:N,16:I,29:O,30:167,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:168,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:169,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:170,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{12:[1,171],42:107,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{12:[1,172]},{12:[1,173]},{12:[1,174],42:107,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{12:[1,175],42:107,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{12:[1,176],42:107,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,32:R,37:[1,177],43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,30:178,32:R,43:66,44:q,47:P,49:j,63:60,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,32:R,39:[1,179],43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,32:R,41:[1,180],43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:S,13:L,15:N,16:I,29:O,32:R,37:[1,181],43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(at,[2,53]),t(r,[2,15]),{19:[2,20]},{6:6,7:7,8:8,9:i,10:a,12:St,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:u,31:182,32:Lt,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:d,71:p,76:f,77:g,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{9:C,10:F,19:B,23:183},t(H,[2,31]),t(D,k,{7:46,31:184,12:St,19:o,32:Lt}),t(Nt,[2,80]),t(Bt,[2,55]),{11:T,12:S,13:L,15:N,16:I,29:O,32:R,43:66,44:q,47:P,49:j,62:[1,185],63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:[1,186],13:L,15:N,16:I,29:O,32:R,43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:[1,187],13:L,15:N,16:I,29:O,32:R,43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{11:T,12:[1,188],13:L,15:N,16:I,29:O,32:R,43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{12:It,44:Ot,67:Rt,74:189,75:qt,76:Pt,77:jt,78:190,80:191,81:Mt,82:Vt,83:Ut,84:$t,85:Gt},{12:It,44:Ot,67:Rt,74:203,75:qt,76:Pt,77:jt,78:190,80:191,81:Mt,82:Vt,83:Ut,84:$t,85:Gt},{12:It,44:Ot,67:Rt,74:204,75:qt,76:Pt,77:jt,78:190,80:191,81:Mt,82:Vt,83:Ut,84:$t,85:Gt},{12:It,44:Ot,67:Rt,74:205,75:qt,76:Pt,77:jt,78:190,80:191,81:Mt,82:Vt,83:Ut,84:$t,85:Gt},{35:206,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},{35:207,42:29,43:30,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(it,[2,38],{12:[1,208]}),{11:T,12:S,13:L,15:N,16:I,29:O,32:R,39:[1,209],43:66,44:q,47:P,49:j,63:119,66:69,67:M,68:V,69:U,70:$,71:G,73:61,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_},t(it,[2,42],{12:[1,210]}),t(it,[2,44],{12:[1,211]}),t(it,[2,46],{12:[1,212]}),{9:C,10:F,19:B,23:213},t(w,[2,30]),t(H,[2,32]),t([12,76,79,81,82,84,85,87,88,89],[2,76]),t(Ht,pt,{45:214,50:Y,51:z,52:W,53:K,54:Z,55:X,56:J,57:Q,58:et,59:tt,60:rt,61:nt}),t(Ht,pt,{45:215,50:Y,51:z,52:W,53:K,54:Z,55:X,56:J,57:Q,58:et,59:tt,60:rt,61:nt}),t(Ht,pt,{45:216,50:Y,51:z,52:W,53:K,54:Z,55:X,56:J,57:Q,58:et,59:tt,60:rt,61:nt}),t(H,[2,95],{79:Yt}),t(zt,[2,99],{80:218,12:It,44:Ot,67:Rt,75:qt,76:Pt,77:jt,81:Mt,82:Vt,83:Ut,84:$t,85:Gt}),t(Wt,[2,101]),t(Wt,[2,103]),t(Wt,[2,104]),t(Wt,[2,105]),t(Wt,[2,106]),t(Wt,[2,107]),t(Wt,[2,108]),t(Wt,[2,109]),t(Wt,[2,110]),t(Wt,[2,111]),t(Wt,[2,112]),t(Wt,[2,113]),t(H,[2,96],{79:Yt}),t(H,[2,97],{79:Yt}),t(H,[2,92],{79:Yt}),t(H,[2,93],{43:30,42:107,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_}),t(H,[2,94],{43:30,42:107,76:f,79:y,81:m,82:v,84:b,85:A,87:x,88:E,89:_}),t(it,[2,39]),{39:[1,219]},t(it,[2,43]),t(it,[2,45]),t(it,[2,47]),t(w,[2,29]),t(Bt,[2,58],{12:[1,220]}),t(Bt,[2,60],{12:[1,221]}),t(Bt,[2,62],{12:[1,222]}),{12:It,44:Ot,67:Rt,75:qt,76:Pt,77:jt,78:223,80:191,81:Mt,82:Vt,83:Ut,84:$t,85:Gt},t(Wt,[2,102]),t(it,[2,40],{12:[1,224]}),t(Bt,[2,59]),t(Bt,[2,61]),t(Bt,[2,63]),t(zt,[2,100],{80:218,12:It,44:Ot,67:Rt,75:qt,76:Pt,77:jt,81:Mt,82:Vt,83:Ut,84:$t,85:Gt}),t(it,[2,41])],defaultActions:{160:[2,20]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){function t(){var e;return e=f.lex()||d,"number"!=typeof e&&(e=r.symbols_[e]||e),e}var r=this,n=[0],i=[null],a=[],s=this.table,o="",u=0,c=0,l=0,h=2,d=1,p=a.slice.call(arguments,1),f=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);f.setInput(e,g.yy),g.yy.lexer=f,g.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var m=f.yylloc;a.push(m);var v=f.options&&f.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,A,x,E,_,w,D,k,C,F={};;){if(x=n[n.length-1],this.defaultActions[x]?E=this.defaultActions[x]:((null===b||"undefined"==typeof b)&&(b=t()),E=s[x]&&s[x][b]),"undefined"==typeof E||!E.length||!E[0]){var B="";C=[];for(w in s[x])this.terminals_[w]&&w>h&&C.push("'"+this.terminals_[w]+"'");B=f.showPosition?"Parse error on line "+(u+1)+":\n"+f.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(u+1)+": Unexpected "+(b==d?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(B,{text:f.match,token:this.terminals_[b]||b,line:f.yylineno,loc:m,expected:C})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+b);switch(E[0]){case 1:n.push(b),i.push(f.yytext),a.push(f.yylloc),n.push(E[1]),b=null,A?(b=A,A=null):(c=f.yyleng,o=f.yytext,u=f.yylineno,m=f.yylloc,l>0&&l--);break;case 2:if(D=this.productions_[E[1]][1],F.$=i[i.length-D],F._$={first_line:a[a.length-(D||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(D||1)].first_column,last_column:a[a.length-1].last_column},v&&(F._$.range=[a[a.length-(D||1)].range[0],a[a.length-1].range[1]]),_=this.performAction.apply(F,[o,c,u,g.yy,E[1],i,a].concat(p)),"undefined"!=typeof _)return _;D&&(n=n.slice(0,-1*D*2),i=i.slice(0,-1*D),a=a.slice(0,-1*D)),n.push(this.productions_[E[1]][0]),i.push(F.$),a.push(F._$),k=s[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},Zt=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=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),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,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))),n=e[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(e=this.test_match(r,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[n]),e!==!1?e:!1):""===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(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>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(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,r,n){switch(r){case 0:return 67;case 1:return 68;case 2:return 69;case 3:return 70;case 4:return 71;case 5:return 11;case 6:return 29;case 7:return 32;case 8:return 13;case 9:return 13;case 10:return 13;case 11:return 13;case 12:return 13;case 13:return 13;case 14:return 76;case 15:return 84;case 16:return 82;case 17:return 9;case 18:return 79;case 19:return 89;case 20:return 16;case 21:return 15;case 22:return 17;case 23:return 18;case 24:return 52;case 25:return 50;case 26:return 51;case 27:return 53;case 28:return 56;case 29:return 54;case 30:return 55;case 31:return 57;case 32:return 56;case 33:return 54;case 34:return 55;case 35:return 57;case 36:return 60;case 37:return 58;case 38:return 59;case 39:return 61;case 40:return 47;case 41:return 48;case 42:return 49;case 43:return 44;case 44:return 85;case 45:return 87;case 46:return 77;case 47:return 88;case 48:return 88;case 49:return 81;case 50:return 62;case 51:return 38;case 52:return 39;case 53:return 36;case 54:return 37;case 55:return 40;case 56:return 41;case 57:return 92;case 58:return 19;case 59:return 12;case 60:return 10}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:subgraph\b)/,/^(?:end\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:v\b)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-\.-[x])/,/^(?:-\.->)/,/^(?:-\.-[o])/,/^(?:-\.-)/,/^(?:.-[x])/,/^(?:\.->)/,/^(?:\.-[o])/,/^(?:\.-)/,/^(?:==[x])/,/^(?:==>)/,/^(?:==[o])/,/^(?:==[\=])/,/^(?:--)/,/^(?:-\.)/,/^(?:==)/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u005C\u005F-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_\/])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\n)/,/^(?:\s)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60],inclusive:!0}}};return e}();return Kt.lexer=Zt,e.prototype=Kt,Kt.Parser=e,new e}();"undefined"!=typeof e&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("1YiZ5S"))},{"1YiZ5S":99,fs:97,path:98}],111:[function(e,t,r){(function(n){var i=function(){function e(){this.yy={}}var t=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},r=[6,8,10,11,15,17,19,20,22,33],n=[2,2],i=[1,6],a=[1,8],s=[1,9],o=[1,12],u=[1,13],c=[1,14],l=[1,15],h=[1,17],d=[1,18],p=[2,7],f=[6,8,10,11,15,17,18,19,20,21,22,33],g=[6,8,10,11,15,17,18,19,20,22,33],y=[1,46],m=[1,49],v=[1,53],b={trace:function(){},yy:{},symbols_:{error:2,start:3,SD:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,participant:11,actor:12,signal:13,note_statement:14,title:15,text:16,loop:17,end:18,opt:19,alt:20,"else":21,note:22,placement:23,text2:24,over:25,spaceList:26,actor_pair:27,",":28,left_of:29,right_of:30,signaltype:31,actors:32,ACTOR:33,SOLID_OPEN_ARROW:34,DOTTED_OPEN_ARROW:35,SOLID_ARROW:36,DOTTED_ARROW:37,SOLID_CROSS:38,DOTTED_CROSS:39,TXT:40,$accept:0,$end:1},terminals_:{2:"error",4:"SD",6:"EOF",8:"SPACE",10:"NL",11:"participant",15:"title",16:"text",17:"loop",18:"end",19:"opt",20:"alt",21:"else",22:"note",25:"over",28:",",29:"left_of",30:"right_of",33:"ACTOR",34:"SOLID_OPEN_ARROW",35:"DOTTED_OPEN_ARROW",36:"SOLID_ARROW",37:"DOTTED_ARROW",38:"SOLID_CROSS",39:"DOTTED_CROSS",40:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,3],[9,2],[9,2],[9,4],[9,4],[9,4],[9,7],[14,4],[14,5],[26,2],[26,1],[27,1],[27,3],[23,1],[23,1],[13,4],[32,2],[32,1],[12,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,1],[24,1]],performAction:function(e,t,r,n,i,a){var s=a.length-1; -switch(i){case 1:return n.apply(a[s-1]),a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:this.$=a[s-1];break;case 12:a[s-1].unshift({type:"loopStart",loopText:a[s-2].actor,signalType:n.LINETYPE.LOOP_START}),a[s-1].push({type:"loopEnd",loopText:a[s-2],signalType:n.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 13:a[s-1].unshift({type:"optStart",optText:a[s-2].actor,signalType:n.LINETYPE.OPT_START}),a[s-1].push({type:"optEnd",optText:a[s-2].actor,signalType:n.LINETYPE.OPT_END}),this.$=a[s-1];break;case 14:a[s-4].unshift({type:"altStart",altText:a[s-5].actor,signalType:n.LINETYPE.ALT_START}),a[s-4].push({type:"else",altText:a[s-2].actor,signalType:n.LINETYPE.ALT_ELSE}),a[s-4]=a[s-4].concat(a[s-1]),a[s-4].push({type:"altEnd",signalType:n.LINETYPE.ALT_END}),this.$=a[s-4];break;case 15:this.$=[a[s-1],{type:"addNote",placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 19:this.$=a[s];break;case 20:this.$=[a[s-2],a[s]];break;case 21:this.$=n.PLACEMENT.LEFTOF;break;case 22:this.$=n.PLACEMENT.RIGHTOF;break;case 23:this.$=[a[s-3],a[s-1],{type:"addMessage",from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 26:this.$={type:"addActor",actor:a[s]};break;case 27:this.$=n.LINETYPE.SOLID_OPEN;break;case 28:this.$=n.LINETYPE.DOTTED_OPEN;break;case 29:this.$=n.LINETYPE.SOLID;break;case 30:this.$=n.LINETYPE.DOTTED;break;case 31:this.$=n.LINETYPE.SOLID_CROSS;break;case 32:this.$=n.LINETYPE.DOTTED_CROSS;break;case 33:this.$=a[s].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},t(r,n,{5:3}),{6:[1,4],7:5,8:i,9:7,10:a,11:s,12:16,13:10,14:11,15:o,17:u,19:c,20:l,22:h,33:d},t(r,p,{1:[2,1]}),t(f,[2,3]),{9:19,11:s,12:16,13:10,14:11,15:o,17:u,19:c,20:l,22:h,33:d},t(f,[2,5]),t(f,[2,6]),{12:20,33:d},{10:[1,21]},{10:[1,22]},{8:[1,23]},{12:24,33:d},{12:25,33:d},{12:26,33:d},{31:27,34:[1,28],35:[1,29],36:[1,30],37:[1,31],38:[1,32],39:[1,33]},{23:34,25:[1,35],29:[1,36],30:[1,37]},t([6,8,10,11,15,17,18,19,20,21,22,28,33,34,35,36,37,38,39,40],[2,26]),t(f,[2,4]),{10:[1,38]},t(f,[2,9]),t(f,[2,10]),{16:[1,39]},t(g,n,{5:40}),t(g,n,{5:41}),t([6,8,10,11,15,17,19,20,21,22,33],n,{5:42}),{12:43,33:d},{33:[2,27]},{33:[2,28]},{33:[2,29]},{33:[2,30]},{33:[2,31]},{33:[2,32]},{12:44,33:d},{8:y,26:45},{33:[2,21]},{33:[2,22]},t(f,[2,8]),{10:[1,47]},{6:m,7:5,8:i,9:7,10:a,11:s,12:16,13:10,14:11,15:o,17:u,18:[1,48],19:c,20:l,22:h,33:d},{6:m,7:5,8:i,9:7,10:a,11:s,12:16,13:10,14:11,15:o,17:u,18:[1,50],19:c,20:l,22:h,33:d},{6:m,7:5,8:i,9:7,10:a,11:s,12:16,13:10,14:11,15:o,17:u,19:c,20:l,21:[1,51],22:h,33:d},{24:52,40:v},{24:54,40:v},{12:56,27:55,33:d},{8:y,26:57,33:[2,18]},t(f,[2,11]),t(f,[2,12]),t(f,p),t(f,[2,13]),{12:58,33:d},{10:[2,23]},{10:[2,33]},{10:[2,15]},{12:59,33:d},{28:[1,60],33:[2,19]},{33:[2,17]},t(g,n,{5:61}),{10:[2,16]},{12:62,33:d},{6:m,7:5,8:i,9:7,10:a,11:s,12:16,13:10,14:11,15:o,17:u,18:[1,63],19:c,20:l,22:h,33:d},{33:[2,20]},t(f,[2,14])],defaultActions:{28:[2,27],29:[2,28],30:[2,29],31:[2,30],32:[2,31],33:[2,32],36:[2,21],37:[2,22],52:[2,23],53:[2,33],54:[2,15],57:[2,17],59:[2,16],62:[2,20]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){function t(){var e;return e=f.lex()||d,"number"!=typeof e&&(e=r.symbols_[e]||e),e}var r=this,n=[0],i=[null],a=[],s=this.table,o="",u=0,c=0,l=0,h=2,d=1,p=a.slice.call(arguments,1),f=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);f.setInput(e,g.yy),g.yy.lexer=f,g.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var m=f.yylloc;a.push(m);var v=f.options&&f.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,A,x,E,_,w,D,k,C,F={};;){if(x=n[n.length-1],this.defaultActions[x]?E=this.defaultActions[x]:((null===b||"undefined"==typeof b)&&(b=t()),E=s[x]&&s[x][b]),"undefined"==typeof E||!E.length||!E[0]){var B="";C=[];for(w in s[x])this.terminals_[w]&&w>h&&C.push("'"+this.terminals_[w]+"'");B=f.showPosition?"Parse error on line "+(u+1)+":\n"+f.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(u+1)+": Unexpected "+(b==d?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(B,{text:f.match,token:this.terminals_[b]||b,line:f.yylineno,loc:m,expected:C})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+b);switch(E[0]){case 1:n.push(b),i.push(f.yytext),a.push(f.yylloc),n.push(E[1]),b=null,A?(b=A,A=null):(c=f.yyleng,o=f.yytext,u=f.yylineno,m=f.yylloc,l>0&&l--);break;case 2:if(D=this.productions_[E[1]][1],F.$=i[i.length-D],F._$={first_line:a[a.length-(D||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(D||1)].first_column,last_column:a[a.length-1].last_column},v&&(F._$.range=[a[a.length-(D||1)].range[0],a[a.length-1].range[1]]),_=this.performAction.apply(F,[o,c,u,g.yy,E[1],i,a].concat(p)),"undefined"!=typeof _)return _;D&&(n=n.slice(0,-1*D*2),i=i.slice(0,-1*D),a=a.slice(0,-1*D)),n.push(this.productions_[E[1]][0]),i.push(F.$),a.push(F._$),k=s[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0}},A=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=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),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),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(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,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))),n=e[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(e=this.test_match(r,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[n]),e!==!1?e:!1):""===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(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>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(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,t,r,n){switch(r){case 0:return 10;case 1:return 38;case 2:return 39;case 3:return 36;case 4:return 37;case 5:break;case 6:break;case 7:break;case 8:return 11;case 9:return 19;case 10:return 17;case 11:return 20;case 12:return 21;case 13:return 18;case 14:return 29;case 15:return 30;case 16:return 25;case 17:return 22;case 18:return 15;case 19:return 4;case 20:return 28;case 21:return 10;case 22:return 33;case 23:return 34;case 24:return 35;case 25:return 36;case 26:return 37;case 27:return 40;case 28:return 6;case 29:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:[\-][x])/i,/^(?:[\-][\-][x])/i,/^(?:[\-][>][>])/i,/^(?:[\-][\-][>][>])/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:participant\b)/i,/^(?:opt\b)/i,/^(?:loop\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\->:\n,;]+)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],inclusive:!0}}};return e}();return b.lexer=A,e.prototype=b,b.Parser=e,new e}();"undefined"!=typeof e&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("1YiZ5S"))},{"1YiZ5S":99,fs:97,path:98}],112:[function(e,t,r){var n={},i=[],a=[],s=[];r.addActor=function(e,t,r){n[e]={name:t,description:r},i.push(e)},r.addMessage=function(e,t,r,n){a.push({from:e,to:t,message:r,answer:n})},r.addSignal=function(e,t,r,n){a.push({from:e,to:t,message:r,type:n})},r.getMessages=function(){return a},r.getActors=function(){return n},r.getActor=function(e){return n[e]},r.getActorKeys=function(){return Object.keys(n)},r.clear=function(){n={},a=[]},r.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16},r.ARROWTYPE={FILLED:0,OPEN:1},r.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},r.addNote=function(e,t,n){var i={actor:e,placement:t,message:n};s.push(i),a.push({from:e,to:e,message:n,type:r.LINETYPE.NOTE,placement:t})},r.parseError=function(e){console.log("Syntax error:"+e)},r.apply=function(e){if(e instanceof Array)e.forEach(function(e){r.apply(e)});else switch(e.type){case"addActor":r.addActor(e.actor,e.actor,e.actor);break;case"addNote":r.addNote(e.actor,e.placement,e.text);break;case"addMessage":r.addSignal(e.from,e.to,e.msg,e.signalType);break;case"loopStart":r.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":r.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":r.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":r.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":r.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":r.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":r.addSignal(void 0,void 0,void 0,e.signalType)}}},{}],113:[function(e,t,r){var n=e("./parser/sequenceDiagram").parser;n.yy=e("./sequenceDb");var i=e("./svgDraw"),a={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35};r.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,list:[],init:function(){this.list=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(e,t,r,n){e[t]="undefined"==typeof e[t]?r:n(r,e[t])},updateLoops:function(e,t,n,i){var s=this,o=0;this.list.forEach(function(u){o++;var c=s.list.length-o+1;s.updateVal(u,"startx",e-c*a.boxMargin,Math.min),s.updateVal(u,"starty",t-c*a.boxMargin,Math.min),s.updateVal(u,"stopx",n+c*a.boxMargin,Math.max),s.updateVal(u,"stopy",i+c*a.boxMargin,Math.max),s.updateVal(r.bounds.data,"startx",e-c*a.boxMargin,Math.min),s.updateVal(r.bounds.data,"starty",t-c*a.boxMargin,Math.min),s.updateVal(r.bounds.data,"stopx",n+c*a.boxMargin,Math.max),s.updateVal(r.bounds.data,"stopy",i+c*a.boxMargin,Math.max)})},insert:function(e,t,n,i){var a,s,o,u;a=Math.min(e,n),o=Math.max(e,n),s=Math.min(t,i),u=Math.max(t,i),this.updateVal(r.bounds.data,"startx",a,Math.min),this.updateVal(r.bounds.data,"starty",s,Math.min),this.updateVal(r.bounds.data,"stopx",o,Math.max),this.updateVal(r.bounds.data,"stopy",u,Math.max),this.updateLoops(a,s,o,u)},newLoop:function(e){this.list.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e})},endLoop:function(){var e=this.list.pop();return e},addElseToLoop:function(e){var t=this.list.pop();t.elsey=r.bounds.getVerticalPos(),t.elseText=e,this.list.push(t)},bumpVerticalPos:function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var s=function(e,t,n,s){var o=i.getNoteRect();o.x=t,o.y=n,o.width=a.width,o.class="note";var u=e.append("g"),c=i.drawRect(u,o),l=i.getTextObj();l.x=t,l.y=n+a.noteMargin,l.textMargin=a.noteMargin,l.dy="1em",l.text=s.message,l.class="noteText";var h=i.drawText(u,l),d=h[0][0].getBBox().height;r.bounds.insert(t,n,t+a.width,n+2*a.noteMargin+d),c.attr("height",d+2*a.noteMargin),r.bounds.bumpVerticalPos(d+2*a.noteMargin)},o=function(e,t,i,a,s){var o,u=e.append("g"),c=t+(i-t)/2,l=u.append("text").attr("x",c).attr("y",a-7).style("text-anchor","middle").attr("class","messageText").text(s.message),h=l[0][0].getBBox().width;if(t===i){o=u.append("path").attr("d","M "+t+","+a+" C "+(t+60)+","+(a-10)+" "+(t+60)+","+(a+30)+" "+t+","+(a+20)),r.bounds.bumpVerticalPos(30);var d=Math.max(h/2,100);r.bounds.insert(t-d,r.bounds.getVerticalPos()-10,i+d,r.bounds.getVerticalPos())}else o=u.append("line"),o.attr("x1",t),o.attr("y1",a),o.attr("x2",i),o.attr("y2",a),r.bounds.insert(t,r.bounds.getVerticalPos()-10,i,r.bounds.getVerticalPos());s.type===n.yy.LINETYPE.DOTTED||s.type===n.yy.LINETYPE.DOTTED_CROSS||s.type===n.yy.LINETYPE.DOTTED_OPEN?(o.style("stroke-dasharray","3, 3"),o.attr("class","messageLine1")):o.attr("class","messageLine0"),o.attr("stroke-width",2),o.attr("stroke","black"),o.style("fill","none"),(s.type===n.yy.LINETYPE.SOLID||s.type===n.yy.LINETYPE.DOTTED)&&o.attr("marker-end","url(#arrowhead)"),(s.type===n.yy.LINETYPE.SOLID_CROSS||s.type===n.yy.LINETYPE.DOTTED_CROSS)&&o.attr("marker-end","url(#crosshead)")};t.exports.drawActors=function(e,t,n){var s;for(s=0;s/gi).forEach(function(e){var n=r.append("tspan");n.attr("x",t.x+t.textMargin),n.attr("dy",t.dy),n.text(e)}),"undefined"!=typeof t.class&&r.attr("class",t.class),r},r.drawLabel=function(e,t){var n=r.getNoteRect();n.x=t.x,n.y=t.y,n.width=50,n.height=20,n.fill="#526e52",n.stroke="none",n.class="labelBox",r.drawRect(e,n),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,t.fill="white",r.drawText(e,t)},r.drawActor=function(e,t,n,i){var a=t+i.width/2,s=e.append("g");s.append("line").attr("x1",a).attr("y1",5).attr("x2",a).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999");var o=r.getNoteRect();o.x=t,o.fill="#eaeaea",o.width=i.width,o.height=i.height,o.class="actor",o.rx=3,o.ry=3,r.drawRect(s,o),s.append("text").attr("x",a).attr("y",i.height/2+5).attr("class","actor").style("text-anchor","middle").text(n)},r.drawLoop=function(e,t,n,i){var a=e.append("g"),s=function(e,t,r,n){a.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",n).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};s(t.startx,t.starty,t.stopx,t.starty),s(t.stopx,t.starty,t.stopx,t.stopy),s(t.startx,t.stopy,t.stopx,t.stopy),s(t.startx,t.starty,t.startx,t.stopy),"undefined"!=typeof t.elsey&&s(t.startx,t.elsey,t.stopx,t.elsey);var o=r.getTextObj();o.text=n,o.x=t.startx,o.y=t.starty,o.labelMargin=1.5*i.boxMargin,o.class="labelText",o.fill="white",r.drawLabel(a,o),o=r.getTextObj(),o.text="[ "+t.title+" ]",o.x=t.startx+(t.stopx-t.startx)/2,o.y=t.starty+1.5*i.boxMargin,o.anchor="middle",o.class="loopText",r.drawText(a,o),"undefined"!=typeof t.elseText&&(o.text="[ "+t.elseText+" ]",o.y=t.elsey+1.5*i.boxMargin,r.drawText(a,o))},r.insertArrowHead=function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},r.insertArrowCrossHead=function(e){var t=e.append("defs"),r=t.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);r.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),r.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},r.getTextObj=function(){var e={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return e},r.getNoteRect=function(){var e={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return e}},{}],115:[function(e,t,r){(function(t){var n=e("./diagrams/flowchart/graphDb"),i=e("./diagrams/flowchart/parser/flow"),a=e("./utils"),s=e("./diagrams/flowchart/flowRenderer"),o=e("./diagrams/sequenceDiagram/sequenceRenderer"),u=e("./diagrams/example/exampleRenderer"),c=e("he"),l=function(e){var t,i=document.querySelectorAll(".mermaid");"undefined"!==e&&"undefined"!=typeof e&&o.setConf(JSON.parse(e));var l=0;for(t=0;t/g,">"),p=p.replace(/';var f=a.detectType(p),g={};switch(f){case"graph":g=s.getClasses(p,!1),s.draw(p,d,!1),a.cloneCssStyles(h.firstChild,g),n.bindFunctions();break;case"dotGraph":g=s.getClasses(p,!0),s.draw(p,d,!0),a.cloneCssStyles(h.firstChild,g);break;case"sequenceDiagram":o.draw(p,d),a.cloneCssStyles(h.firstChild,[]);break;case"info":u.draw(p,d,r.version()),a.cloneCssStyles(h.firstChild,[])}}}};r.tester=function(){},r.version=function(){return e("../package.json").version};var h=function(e,t){return"undefined"==typeof t?!1:e===t};t.mermaid={startOnLoad:!0,htmlLabels:!0,init:function(e){l(e)},version:function(){return r.version()},getParser:function(){return i.parser}},r.contentLoaded=function(){"undefined"!=typeof mermaid_config&&h(!1,mermaid_config.htmlLabels)&&(t.mermaid.htmlLabels=!1),t.mermaid.startOnLoad&&("undefined"!=typeof mermaid_config?h(!0,mermaid_config.startOnLoad)&&t.mermaid.init():t.mermaid.init())},"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",function(){r.contentLoaded()},!1)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../package.json":102,"./diagrams/example/exampleRenderer":104,"./diagrams/flowchart/flowRenderer":107,"./diagrams/flowchart/graphDb":108,"./diagrams/flowchart/parser/flow":110,"./diagrams/sequenceDiagram/sequenceRenderer":113,"./utils":116,he:100}],116:[function(e,t){t.exports.detectType=function(e){return e.match(/^\s*sequenceDiagram/)?"sequenceDiagram":e.match(/^\s*sequence/)?"sequence":e.match(/^\s*digraph/)?(console.log("Detected dot syntax"),"dotGraph"):e.match(/^\s*info/)?"info":"graph"},t.exports.cloneCssStyles=function(e,t){for(var r="",n=document.styleSheets,i=0;i0&&(r+=o.selectorText+" { "+o.style.cssText+" }\n")}}}var c="",l="";for(var h in t)t.hasOwnProperty(h)&&"undefined"!=typeof h&&("default"===h?(t.default.styles instanceof Array&&(c+="#"+e.id.trim()+" .node { "+t[h].styles.join("; ")+"; }\n"),t.default.nodeLabelStyles instanceof Array&&(c+="#"+e.id.trim()+" .node text { "+t[h].nodeLabelStyles.join("; ")+"; }\n"),t.default.edgeLabelStyles instanceof Array&&(c+="#"+e.id.trim()+" .edgeLabel text { "+t[h].edgeLabelStyles.join("; ")+"; }\n")):t[h].styles instanceof Array&&(l+="#"+e.id.trim()+" ."+h+" { "+t[h].styles.join("; ")+"; }\n"));if(""!==r||""!==c||""!==l){var d=document.createElement("style");d.setAttribute("type","text/css"),d.setAttribute("title","mermaid-svg-internal-css"),d.innerHTML="/* */\n",e.insertBefore(d,e.firstChild)}}},{}]},{},[115]); \ No newline at end of file +!function t(e,n,r){function i(a,o){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!o&&s)return s(a,!0);if(u)return u(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var u="function"==typeof require&&require,a=0;at?-1:t>e?1:t>=e?0:0/0}function n(t){return null===t?0/0:+t}function r(t){return!isNaN(t)}function i(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var u=r+i>>>1;t(e[u],n)<0?r=u+1:i=u}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var u=r+i>>>1;t(e[u],n)>0?i=u:r=u+1}return r}}}function u(t){return t.length}function a(t){for(var e=1;t*e%1;)e*=10;return e}function o(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function s(){this._=Object.create(null)}function c(t){return(t+="")===lo||t[0]===ho?ho+t:t}function l(t){return(t+="")[0]===ho?t.slice(1):t}function h(t){return c(t)in this._}function f(t){return(t=c(t))in this._&&delete this._[t]}function p(){var t=[];for(var e in this._)t.push(l(e));return t}function d(){var t=0;for(var e in this._)++t;return t}function g(){for(var t in this._)return!1;return!0}function y(){this._=Object.create(null)}function m(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function v(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=fo.length;r>n;++n){var i=fo[n]+e;if(i in t)return i}}function b(){}function x(){}function _(t){function e(){for(var e,r=n,i=-1,u=r.length;++in;n++)for(var i,u=t[n],a=0,o=u.length;o>a;a++)(i=u[a])&&e(i,a,n);return t}function U(t){return go(t,wo),t}function V(t){var e,n;return function(r,i,u){var a,o=t[u].update,s=o.length;for(u!=n&&(n=u,e=0),i>=e&&(e=i+1);!(a=o[e])&&++e0&&(t=t.slice(0,o));var c=Eo.get(t);return c&&(t=c,s=Y),o?e?i:r:e?b:u}function $(t,e){return function(n){var r=Za.event;Za.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{Za.event=r}}}function Y(t,e){var n=$(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function G(){var t=".dragsuppress-"+ ++Do,e="click"+t,n=Za.select(to).on("touchmove"+t,w).on("dragstart"+t,w).on("selectstart"+t,w);if(ko){var r=Qa.style,i=r[ko];r[ko]="none"}return function(u){function a(){n.on(e,null)}n.on(t,null),ko&&(r[ko]=i),u&&(n.on(e,function(){w(),a()},!0),setTimeout(a,0))}}function W(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();if(0>Co&&(to.scrollX||to.scrollY)){n=Za.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var i=n[0][0].getScreenCTM();Co=!(i.f||i.e),n.remove()}return Co?(r.x=e.pageX,r.y=e.pageY):(r.x=e.clientX,r.y=e.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var u=t.getBoundingClientRect();return[e.clientX-u.left-t.clientLeft,e.clientY-u.top-t.clientTop]}function Z(){return Za.event.changedTouches[0].identifier}function X(){return Za.event.target}function K(){return to}function J(t){return t>0?1:0>t?-1:0}function Q(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function te(t){return t>1?0:-1>t?Mo:Math.acos(t)}function ee(t){return t>1?Fo:-1>t?-Fo:Math.asin(t)}function ne(t){return((t=Math.exp(t))-1/t)/2}function re(t){return((t=Math.exp(t))+1/t)/2}function ie(t){return((t=Math.exp(2*t))-1)/(t+1)}function ue(t){return(t=Math.sin(t/2))*t}function ae(){}function oe(t,e,n){return this instanceof oe?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof oe?new oe(t.h,t.s,t.l):_e(""+t,we,oe):new oe(t,e,n)}function se(t,e,n){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?u+(a-u)*t/60:180>t?a:240>t?u+(a-u)*(240-t)/60:u}function i(t){return Math.round(255*r(t))}var u,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,a=.5>=n?n*(1+e):n+e-n*e,u=2*n-a,new me(i(t+120),i(t),i(t-120))}function ce(t,e,n){return this instanceof ce?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof ce?new ce(t.h,t.c,t.l):t instanceof he?pe(t.l,t.a,t.b):pe((t=Ae((t=Za.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ce(t,e,n)}function le(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new he(n,Math.cos(t*=Bo)*e,Math.sin(t)*e)}function he(t,e,n){return this instanceof he?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof he?new he(t.l,t.a,t.b):t instanceof ce?le(t.h,t.c,t.l):Ae((t=me(t)).r,t.g,t.b):new he(t,e,n)}function fe(t,e,n){var r=(t+16)/116,i=r+e/500,u=r-n/200;return i=de(i)*Ho,r=de(r)*$o,u=de(u)*Yo,new me(ye(3.2404542*i-1.5371385*r-.4985314*u),ye(-.969266*i+1.8760108*r+.041556*u),ye(.0556434*i-.2040259*r+1.0572252*u))}function pe(t,e,n){return t>0?new ce(Math.atan2(n,e)*No,Math.sqrt(e*e+n*n),t):new ce(0/0,0/0,t)}function de(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ge(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ye(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function me(t,e,n){return this instanceof me?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof me?new me(t.r,t.g,t.b):_e(""+t,me,se):new me(t,e,n)}function ve(t){return new me(t>>16,t>>8&255,255&t)}function be(t){return ve(t)+""}function xe(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function _e(t,e,n){var r,i,u,a=0,o=0,s=0;if(r=/([a-z]+)\((.*)\)/i.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(ke(i[0]),ke(i[1]),ke(i[2]))}return(u=Zo.get(t))?e(u.r,u.g,u.b):(null==t||"#"!==t.charAt(0)||isNaN(u=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&u)>>4,a=a>>4|a,o=240&u,o=o>>4|o,s=15&u,s=s<<4|s):7===t.length&&(a=(16711680&u)>>16,o=(65280&u)>>8,s=255&u)),e(a,o,s))}function we(t,e,n){var r,i,u=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),o=a-u,s=(a+u)/2;return o?(i=.5>s?o/(a+u):o/(2-a-u),r=t==a?(e-n)/o+(n>e?6:0):e==a?(n-t)/o+2:(t-e)/o+4,r*=60):(r=0/0,i=s>0&&1>s?0:r),new oe(r,i,s)}function Ae(t,e,n){t=Ee(t),e=Ee(e),n=Ee(n);var r=ge((.4124564*t+.3575761*e+.1804375*n)/Ho),i=ge((.2126729*t+.7151522*e+.072175*n)/$o),u=ge((.0193339*t+.119192*e+.9503041*n)/Yo);return he(116*i-16,500*(r-i),200*(i-u))}function Ee(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ke(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function De(t){return"function"==typeof t?t:function(){return t}}function Ce(t){return t}function Me(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),Se(e,n,t,r)}}function Se(t,e,n,r){function i(){var t,e=s.status;if(!e&&Te(s)||e>=200&&300>e||304===e){try{t=n.call(u,s)}catch(r){return void a.error.call(u,r)}a.load.call(u,t)}else a.error.call(u,s)}var u={},a=Za.dispatch("beforesend","progress","load","error"),o={},s=new XMLHttpRequest,c=null;return!to.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=i:s.onreadystatechange=function(){s.readyState>3&&i()},s.onprogress=function(t){var e=Za.event;Za.event=t;try{a.progress.call(u,s)}finally{Za.event=e}},u.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?o[t]:(null==e?delete o[t]:o[t]=e+"",u)},u.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",u):e},u.responseType=function(t){return arguments.length?(c=t,u):c},u.response=function(t){return n=t,u},["get","post"].forEach(function(t){u[t]=function(){return u.send.apply(u,[t].concat(Ka(arguments)))}}),u.send=function(n,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),s.open(n,t,!0),null==e||"accept"in o||(o.accept=e+",*/*"),s.setRequestHeader)for(var l in o)s.setRequestHeader(l,o[l]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=i&&u.on("error",i).on("load",function(t){i(null,t)}),a.beforesend.call(u,s),s.send(null==r?null:r),u},u.abort=function(){return s.abort(),u},Za.rebind(u,a,"on"),null==r?u:u.get(Fe(r))}function Fe(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Te(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Le(){var t=Be(),e=Ne()-t;e>24?(isFinite(e)&&(clearTimeout(Qo),Qo=setTimeout(Le,e)),Jo=0):(Jo=1,es(Le))}function Be(){var t=Date.now();for(ts=Xo;ts;)t>=ts.t&&(ts.f=ts.c(t-ts.t)),ts=ts.n;return t}function Ne(){for(var t,e=Xo,n=1/0;e;)e.f?e=t?t.n=e.n:Xo=e.n:(e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Oe(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,u=r&&n?function(t,e){for(var i=t.length,u=[],a=0,o=r[0],s=0;i>0&&o>0&&(s+o+1>e&&(o=Math.max(1,e-s)),u.push(t.substring(i-=o,i+o)),!((s+=o+1)>e));)o=r[a=(a+1)%r.length];return u.reverse().join(n)}:Ce;return function(t){var n=rs.exec(t),r=n[1]||" ",a=n[2]||">",o=n[3]||"-",s=n[4]||"",c=n[5],l=+n[6],h=n[7],f=n[8],p=n[9],d=1,g="",y="",m=!1,v=!0;switch(f&&(f=+f.substring(1)),(c||"0"===r&&"="===a)&&(c=r="0",a="="),p){case"n":h=!0,p="g";break;case"%":d=100,y="%",p="f";break;case"p":d=100,y="%",p="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+p.toLowerCase());case"c":v=!1;case"d":m=!0,f=0;break;case"s":d=-1,p="r"}"$"===s&&(g=i[0],y=i[1]),"r"!=p||f||(p="g"),null!=f&&("g"==p?f=Math.max(1,Math.min(21,f)):("e"==p||"f"==p)&&(f=Math.max(0,Math.min(20,f)))),p=is.get(p)||Ie;var b=c&&h;return function(t){var n=y;if(m&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===o?"":o;if(0>d){var s=Za.formatPrefix(t,f);t=s.scale(t),n=s.symbol+y}else t*=d;t=p(t,f);var x,_,w=t.lastIndexOf(".");if(0>w){var A=v?t.lastIndexOf("e"):-1;0>A?(x=t,_=""):(x=t.substring(0,A),_=t.substring(A))}else x=t.substring(0,w),_=e+t.substring(w+1);!c&&h&&(x=u(x,1/0));var E=g.length+x.length+_.length+(b?0:i.length),k=l>E?new Array(E=l-E+1).join(r):"";return b&&(x=u(k+x,k.length?l-_.length:1/0)),i+=g,t=x+_,("<"===a?i+t+k:">"===a?k+i+t:"^"===a?k.substring(0,E>>=1)+i+t+k.substring(E):i+(b?t:k+t))+n}}}function Ie(t){return t+""}function Pe(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function je(t,e,n){function r(e){var n=t(e),r=u(n,1);return r-e>e-n?n:r}function i(n){return e(n=t(new as(n-1)),1),n}function u(t,n){return e(t=new as(+t),n),t}function a(t,r,u){var a=i(t),o=[];if(u>1)for(;r>a;)n(a)%u||o.push(new Date(+a)),e(a,1);else for(;r>a;)o.push(new Date(+a)),e(a,1);return o}function o(t,e,n){try{as=Pe;var r=new Pe;return r._=t,a(r,e,n)}finally{as=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=u,t.range=a;var s=t.utc=Ue(t);return s.floor=s,s.round=Ue(r),s.ceil=Ue(i),s.offset=Ue(u),s.range=o,t}function Ue(t){return function(e,n){try{as=Pe;var r=new Pe;return r._=e,t(r,n)._}finally{as=Date}}}function Ve(t){function e(t){function e(e){for(var n,i,u,a=[],o=-1,s=0;++oo;){if(r>=c)return-1;if(i=e.charCodeAt(o++),37===i){if(a=e.charAt(o++),u=S[a in ss?e.charAt(o++):a],!u||(r=u(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){w.lastIndex=0;var r=w.exec(e.slice(n));return r?(t.w=A.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){x.lastIndex=0;var r=x.exec(e.slice(n));return r?(t.w=_.get(r[0].toLowerCase()),n+r[0].length):-1}function u(t,e,n){D.lastIndex=0;var r=D.exec(e.slice(n));return r?(t.m=C.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){E.lastIndex=0;var r=E.exec(e.slice(n));return r?(t.m=k.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,r){return n(t,M.c.toString(),e,r)}function s(t,e,r){return n(t,M.x.toString(),e,r)}function c(t,e,r){return n(t,M.X.toString(),e,r)}function l(t,e,n){var r=b.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var h=t.dateTime,f=t.date,p=t.time,d=t.periods,g=t.days,y=t.shortDays,m=t.months,v=t.shortMonths;e.utc=function(t){function n(t){try{as=Pe;var e=new as;return e._=t,r(e)}finally{as=Date}}var r=e(t);return n.parse=function(t){try{as=Pe;var e=r.parse(t);return e&&e._}finally{as=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=cn;var b=Za.map(),x=He(g),_=$e(g),w=He(y),A=$e(y),E=He(m),k=$e(m),D=He(v),C=$e(v);d.forEach(function(t,e){b.set(t.toLowerCase(),e)});var M={a:function(t){return y[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return v[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(h),d:function(t,e){return ze(t.getDate(),e,2)},e:function(t,e){return ze(t.getDate(),e,2)},H:function(t,e){return ze(t.getHours(),e,2)},I:function(t,e){return ze(t.getHours()%12||12,e,2)},j:function(t,e){return ze(1+us.dayOfYear(t),e,3)},L:function(t,e){return ze(t.getMilliseconds(),e,3)},m:function(t,e){return ze(t.getMonth()+1,e,2)},M:function(t,e){return ze(t.getMinutes(),e,2)},p:function(t){return d[+(t.getHours()>=12)]},S:function(t,e){return ze(t.getSeconds(),e,2)},U:function(t,e){return ze(us.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return ze(us.mondayOfYear(t),e,2)},x:e(f),X:e(p),y:function(t,e){return ze(t.getFullYear()%100,e,2)},Y:function(t,e){return ze(t.getFullYear()%1e4,e,4)},Z:on,"%":function(){return"%"}},S={a:r,A:i,b:u,B:a,c:o,d:tn,e:tn,H:nn,I:nn,j:en,L:an,m:Qe,M:rn,p:l,S:un,U:Ge,w:Ye,W:We,x:s,X:c,y:Xe,Y:Ze,Z:Ke,"%":sn};return e}function ze(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",u=i.length;return r+(n>u?new Array(n-u+1).join(e)+i:i)}function He(t){return new RegExp("^(?:"+t.map(Za.requote).join("|")+")","i")}function $e(t){for(var e=new s,n=-1,r=t.length;++n68?1900:2e3)}function Qe(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function tn(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function en(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function nn(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function rn(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function un(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function an(t,e,n){cs.lastIndex=0;var r=cs.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function on(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=co(e)/60|0,i=co(e)%60;return n+ze(r,"0",2)+ze(i,"0",2)}function sn(t,e,n){ls.lastIndex=0;var r=ls.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function cn(t){for(var e=t.length,n=-1;++n=0?1:-1,o=a*n,s=Math.cos(e),c=Math.sin(e),l=u*c,h=i*s+l*Math.cos(o),f=l*a*Math.sin(o);ys.add(Math.atan2(f,h)),r=t,i=s,u=c}var e,n,r,i,u;ms.point=function(a,o){ms.point=t,r=(e=a)*Bo,i=Math.cos(o=(n=o)*Bo/2+Mo/4),u=Math.sin(o)},ms.lineEnd=function(){t(e,n)}}function yn(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function mn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function vn(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 bn(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function _n(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function wn(t){return[Math.atan2(t[1],t[0]),ee(t[2])]}function An(t,e){return co(t[0]-e[0])o;++o)i.point((n=t[o])[0],n[1]);return void i.lineEnd()}var s=new Ln(n,t,null,!0),c=new Ln(n,null,s,!1);s.o=c,u.push(s),a.push(c),s=new Ln(r,t,null,!1),c=new Ln(r,null,s,!0),s.o=c,u.push(s),a.push(c)}}),a.sort(e),Tn(u),Tn(a),u.length){for(var o=0,s=n,c=a.length;c>o;++o)a[o].e=s=!s;for(var l,h,f=u[0];;){for(var p=f,d=!0;p.v;)if((p=p.n)===f)return;l=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(var o=0,c=l.length;c>o;++o)i.point((h=l[o])[0],h[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(d){l=p.p.z;for(var o=l.length-1;o>=0;--o)i.point((h=l[o])[0],h[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,l=p.z,d=!d}while(!p.v);i.lineEnd()}}}function Tn(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0){for(_||(u.polygonStart(),_=!0),u.lineStart();++a1&&2&e&&n.push(n.pop().concat(n.shift())),p.push(n.filter(Nn))}var p,d,g,y=e(u),m=i.invert(r[0],r[1]),v={point:a,lineStart:s,lineEnd:c,polygonStart:function(){v.point=l,v.lineStart=h,v.lineEnd=f,p=[],d=[]},polygonEnd:function(){v.point=a,v.lineStart=s,v.lineEnd=c,p=Za.merge(p);var t=jn(m,d);p.length?(_||(u.polygonStart(),_=!0),Fn(p,Rn,t,n,u)):t&&(_||(u.polygonStart(),_=!0),u.lineStart(),n(null,null,1,u),u.lineEnd()),_&&(u.polygonEnd(),_=!1),p=d=null},sphere:function(){u.polygonStart(),u.lineStart(),n(null,null,1,u),u.lineEnd(),u.polygonEnd()}},b=qn(),x=e(b),_=!1;return v}}function Nn(t){return t.length>1}function qn(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:b,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Rn(t,e){return((t=t.x)[0]<0?t[1]-Fo-To:Fo-t[1])-((e=e.x)[0]<0?e[1]-Fo-To:Fo-e[1])}function On(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(u,a){var o=u>0?Mo:-Mo,s=co(u-n);co(s-Mo)0?Fo:-Fo),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),t.point(u,r),e=0):i!==o&&s>=Mo&&(co(n-i)To?Math.atan((Math.sin(e)*(u=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*u*a)):(e+r)/2}function Pn(t,e,n,r){var i;if(null==t)i=n*Fo,r.point(-Mo,i),r.point(0,i),r.point(Mo,i),r.point(Mo,0),r.point(Mo,-i),r.point(0,-i),r.point(-Mo,-i),r.point(-Mo,0),r.point(-Mo,i);else if(co(t[0]-e[0])>To){var u=t[0]o;++o){var c=e[o],l=c.length;if(l)for(var h=c[0],f=h[0],p=h[1]/2+Mo/4,d=Math.sin(p),g=Math.cos(p),y=1;;){y===l&&(y=0),t=c[y];var m=t[0],v=t[1]/2+Mo/4,b=Math.sin(v),x=Math.cos(v),_=m-f,w=_>=0?1:-1,A=w*_,E=A>Mo,k=d*b;if(ys.add(Math.atan2(k*w*Math.sin(A),g*x+k*Math.cos(A))),u+=E?_+w*So:_,E^f>=n^m>=n){var D=vn(yn(h),yn(t));_n(D);var C=vn(i,D);_n(C);var M=(E^_>=0?-1:1)*ee(C[2]);(r>M||r===M&&(D[0]||D[1]))&&(a+=E^_>=0?1:-1)}if(!y++)break;f=m,d=b,g=x,h=t}}return(-To>u||To>u&&0>ys)^1&a}function Un(t){function e(t,e){return Math.cos(t)*Math.cos(e)>u}function n(t){var n,u,s,c,l;return{lineStart:function(){c=s=!1,l=1},point:function(h,f){var p,d=[h,f],g=e(h,f),y=a?g?0:i(h,f):g?i(h+(0>h?Mo:-Mo),f):0;if(!n&&(c=s=g)&&t.lineStart(),g!==s&&(p=r(n,d),(An(n,p)||An(d,p))&&(d[0]+=To,d[1]+=To,g=e(d[0],d[1]))),g!==s)l=0,g?(t.lineStart(),p=r(d,n),t.point(p[0],p[1])):(p=r(n,d),t.point(p[0],p[1]),t.lineEnd()),n=p;else if(o&&n&&a^g){var m;y&u||!(m=r(d,n,!0))||(l=0,a?(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])))}!g||n&&An(n,d)||t.point(d[0],d[1]),n=d,s=g,u=y},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return l|(c&&s)<<1}}}function r(t,e,n){var r=yn(t),i=yn(e),a=[1,0,0],o=vn(r,i),s=mn(o,o),c=o[0],l=s-c*c;if(!l)return!n&&t;var h=u*s/l,f=-u*c/l,p=vn(a,o),d=xn(a,h),g=xn(o,f);bn(d,g);var y=p,m=mn(d,y),v=mn(y,y),b=m*m-v*(mn(d,d)-1);if(!(0>b)){var x=Math.sqrt(b),_=xn(y,(-m-x)/v);if(bn(_,d),_=wn(_),!n)return _;var w,A=t[0],E=e[0],k=t[1],D=e[1];A>E&&(w=A,A=E,E=w);var C=E-A,M=co(C-Mo)C;if(!M&&k>D&&(w=k,k=D,D=w),S?M?k+D>0^_[1]<(co(_[0]-A)Mo^(A<=_[0]&&_[0]<=E)){var F=xn(y,(-m+x)/v);return bn(F,d),[_,wn(F)]}}}function i(e,n){var r=a?t:Mo-t,i=0;return-r>e?i|=1:e>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var u=Math.cos(t),a=u>0,o=co(u)>To,s=gr(t,6*Bo);return Bn(e,n,s,a?[0,-t]:[-Mo,t-Mo])}function Vn(t,e,n,r){return function(i){var u,a=i.a,o=i.b,s=a.x,c=a.y,l=o.x,h=o.y,f=0,p=1,d=l-s,g=h-c;if(u=t-s,d||!(u>0)){if(u/=d,0>d){if(f>u)return;p>u&&(p=u)}else if(d>0){if(u>p)return;u>f&&(f=u)}if(u=n-s,d||!(0>u)){if(u/=d,0>d){if(u>p)return;u>f&&(f=u)}else if(d>0){if(f>u)return;p>u&&(p=u)}if(u=e-c,g||!(u>0)){if(u/=g,0>g){if(f>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>f&&(f=u)}if(u=r-c,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>f&&(f=u)}else if(g>0){if(f>u)return;p>u&&(p=u)}return f>0&&(i.a={x:s+f*d,y:c+f*g}),1>p&&(i.b={x:s+p*d,y:c+p*g}),i}}}}}}function zn(t,e,n,r){function i(r,i){return co(r[0]-t)0?0:3:co(r[0]-n)0?2:1:co(r[1]-e)0?1:0:i>0?3:2}function u(t,e){return a(t.x,e.x)}function a(t,e){var n=i(t,1),r=i(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){function s(t){for(var e=0,n=y.length,r=t[1],i=0;n>i;++i)for(var u,a=1,o=y[i],s=o.length,c=o[0];s>a;++a)u=o[a],c[1]<=r?u[1]>r&&Q(c,u,t)>0&&++e:u[1]<=r&&Q(c,u,t)<0&&--e,c=u;return 0!==e}function c(u,o,s,c){var l=0,h=0;if(null==u||(l=i(u,s))!==(h=i(o,s))||a(u,o)<0^s>0){do c.point(0===l||3===l?t:n,l>1?r:e);while((l=(l+s+4)%4)!==h)}else c.point(o[0],o[1])}function l(i,u){return i>=t&&n>=i&&u>=e&&r>=u}function h(t,e){l(t,e)&&o.point(t,e)}function f(){S.point=d,y&&y.push(m=[]),E=!0,A=!1,_=w=0/0}function p(){g&&(d(v,b),x&&A&&C.rejoin(),g.push(C.buffer())),S.point=h,A&&o.lineEnd()}function d(t,e){t=Math.max(-Ts,Math.min(Ts,t)),e=Math.max(-Ts,Math.min(Ts,e));var n=l(t,e);if(y&&m.push([t,e]),E)v=t,b=e,x=n,E=!1,n&&(o.lineStart(),o.point(t,e));else if(n&&A)o.point(t,e);else{var r={a:{x:_,y:w},b:{x:t,y:e}};M(r)?(A||(o.lineStart(),o.point(r.a.x,r.a.y)),o.point(r.b.x,r.b.y),n||o.lineEnd(),k=!1):n&&(o.lineStart(),o.point(t,e),k=!1)}_=t,w=e,A=n}var g,y,m,v,b,x,_,w,A,E,k,D=o,C=qn(),M=Vn(t,e,n,r),S={point:h,lineStart:f,lineEnd:p,polygonStart:function(){o=C,g=[],y=[],k=!0},polygonEnd:function(){o=D,g=Za.merge(g);var e=s([t,r]),n=k&&e,i=g.length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),c(null,null,1,o),o.lineEnd()),i&&Fn(g,u,e,c,o),o.polygonEnd()),g=y=m=null}};return S}}function Hn(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),n&&t.invert(n[0],n[1])}),n}function $n(t){var e=0,n=Mo/3,r=or(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Mo/180,n=t[1]*Mo/180):[e/Mo*180,n/Mo*180]},i}function Yn(t,e){function n(t,e){var n=Math.sqrt(u-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),a-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,u=1+r*(2*i-r),a=Math.sqrt(u)/i;return n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/i,ee((u-(t*t+n*n)*i*i)/(2*i))]},n}function Gn(){function t(t,e){Bs+=i*t-r*e,r=t,i=e}var e,n,r,i;Is.point=function(u,a){Is.point=t,e=r=u,n=i=a},Is.lineEnd=function(){t(e,n)}}function Wn(t,e){Ns>t&&(Ns=t),t>Rs&&(Rs=t),qs>e&&(qs=e),e>Os&&(Os=e)}function Zn(){function t(t,e){a.push("M",t,",",e,u)}function e(t,e){a.push("M",t,",",e),o.point=n}function n(t,e){a.push("L",t,",",e)}function r(){o.point=t}function i(){a.push("Z")}var u=Xn(4.5),a=[],o={point:t,lineStart:function(){o.point=e},lineEnd:r,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=r,o.point=t},pointRadius:function(t){return u=Xn(t),o},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return o}function Xn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Kn(t,e){xs+=t,_s+=e,++ws}function Jn(){function t(t,r){var i=t-e,u=r-n,a=Math.sqrt(i*i+u*u);As+=a*(e+t)/2,Es+=a*(n+r)/2,ks+=a,Kn(e=t,n=r)}var e,n;js.point=function(r,i){js.point=t,Kn(e=r,n=i)}}function Qn(){js.point=Kn}function tr(){function t(t,e){var n=t-r,u=e-i,a=Math.sqrt(n*n+u*u);As+=a*(r+t)/2,Es+=a*(i+e)/2,ks+=a,a=i*t-r*e,Ds+=a*(r+t),Cs+=a*(i+e),Ms+=3*a,Kn(r=t,i=e)}var e,n,r,i;js.point=function(u,a){js.point=t,Kn(e=r=u,n=i=a)},js.lineEnd=function(){t(e,n)}}function er(t){function e(e,n){t.moveTo(e,n),t.arc(e,n,a,0,So)}function n(e,n){t.moveTo(e,n),o.point=r}function r(e,n){t.lineTo(e,n)}function i(){o.point=e}function u(){t.closePath()}var a=4.5,o={point:e,lineStart:function(){o.point=n},lineEnd:i,polygonStart:function(){o.lineEnd=u},polygonEnd:function(){o.lineEnd=i,o.point=e},pointRadius:function(t){return a=t,o},result:b};return o}function nr(t){function e(t){return(o?r:n)(t)}function n(e){return ur(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){b=0/0,E.point=u,e.lineStart()}function u(n,r){var u=yn([n,r]),a=t(n,r);i(b,x,v,_,w,A,b=a[0],x=a[1],v=n,_=u[0],w=u[1],A=u[2],o,e),e.point(b,x)}function a(){E.point=n,e.lineEnd()}function s(){r(),E.point=c,E.lineEnd=l}function c(t,e){u(h=t,f=e),p=b,d=x,g=_,y=w,m=A,E.point=u +}function l(){i(b,x,v,_,w,A,p,d,h,g,y,m,o,e),E.lineEnd=a,a()}var h,f,p,d,g,y,m,v,b,x,_,w,A,E={point:n,lineStart:r,lineEnd:a,polygonStart:function(){e.polygonStart(),E.lineStart=s},polygonEnd:function(){e.polygonEnd(),E.lineStart=r}};return E}function i(e,n,r,o,s,c,l,h,f,p,d,g,y,m){var v=l-e,b=h-n,x=v*v+b*b;if(x>4*u&&y--){var _=o+p,w=s+d,A=c+g,E=Math.sqrt(_*_+w*w+A*A),k=Math.asin(A/=E),D=co(co(A)-1)u||co((v*F+b*T)/x-.5)>.3||a>o*p+s*d+c*g)&&(i(e,n,r,o,s,c,M,S,D,_/=E,w/=E,A,y,m),m.point(M,S),i(M,S,D,_,w,A,l,h,f,p,d,g,y,m))}}var u=.5,a=Math.cos(30*Bo),o=16;return e.precision=function(t){return arguments.length?(o=(u=t*t)>0&&16,e):Math.sqrt(u)},e}function rr(t){var e=nr(function(e,n){return t([e*No,n*No])});return function(t){return sr(e(t))}}function ir(t){this.stream=t}function ur(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function ar(t){return or(function(){return t})()}function or(t){function e(t){return t=o(t[0]*Bo,t[1]*Bo),[t[0]*f+s,c-t[1]*f]}function n(t){return t=o.invert((t[0]-s)/f,(c-t[1])/f),t&&[t[0]*No,t[1]*No]}function r(){o=Hn(a=hr(m,v,b),u);var t=u(g,y);return s=p-t[0]*f,c=d+t[1]*f,i()}function i(){return l&&(l.valid=!1,l=null),e}var u,a,o,s,c,l,h=nr(function(t,e){return t=u(t,e),[t[0]*f+s,c-t[1]*f]}),f=150,p=480,d=250,g=0,y=0,m=0,v=0,b=0,x=Fs,_=Ce,w=null,A=null;return e.stream=function(t){return l&&(l.valid=!1),l=sr(x(a,h(_(t)))),l.valid=!0,l},e.clipAngle=function(t){return arguments.length?(x=null==t?(w=t,Fs):Un((w=+t)*Bo),i()):w},e.clipExtent=function(t){return arguments.length?(A=t,_=t?zn(t[0][0],t[0][1],t[1][0],t[1][1]):Ce,i()):A},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(p=+t[0],d=+t[1],r()):[p,d]},e.center=function(t){return arguments.length?(g=t[0]%360*Bo,y=t[1]%360*Bo,r()):[g*No,y*No]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Bo,v=t[1]%360*Bo,b=t.length>2?t[2]%360*Bo:0,r()):[m*No,v*No,b*No]},Za.rebind(e,h,"precision"),function(){return u=t.apply(this,arguments),e.invert=u.invert&&n,r()}}function sr(t){return ur(t,function(e,n){t.point(e*Bo,n*Bo)})}function cr(t,e){return[t,e]}function lr(t,e){return[t>Mo?t-So:-Mo>t?t+So:t,e]}function hr(t,e,n){return t?e||n?Hn(pr(t),dr(e,n)):pr(t):e||n?dr(e,n):lr}function fr(t){return function(e,n){return e+=t,[e>Mo?e-So:-Mo>e?e+So:e,n]}}function pr(t){var e=fr(t);return e.invert=fr(-t),e}function dr(t,e){function n(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*r+o*i;return[Math.atan2(s*u-l*a,o*r-c*i),ee(l*u+s*a)]}var r=Math.cos(t),i=Math.sin(t),u=Math.cos(e),a=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),o=Math.cos(t)*n,s=Math.sin(t)*n,c=Math.sin(e),l=c*u-s*a;return[Math.atan2(s*u+c*a,o*r+l*i),ee(l*r-o*i)]},n}function gr(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,u,a,o){var s=a*e;null!=i?(i=yr(n,i),u=yr(n,u),(a>0?u>i:i>u)&&(i+=a*So)):(i=t+a*So,u=t-.5*s);for(var c,l=i;a>0?l>u:u>l;l-=s)o.point((c=wn([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],c[1])}}function yr(t,e){var n=yn(e);n[0]-=t,_n(n);var r=te(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-To)%(2*Math.PI)}function mr(t,e,n){var r=Za.range(t,e-To,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function vr(t,e,n){var r=Za.range(t,e-To,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function br(t){return t.source}function xr(t){return t.target}function _r(t,e,n,r){var i=Math.cos(e),u=Math.sin(e),a=Math.cos(r),o=Math.sin(r),s=i*Math.cos(t),c=i*Math.sin(t),l=a*Math.cos(n),h=a*Math.sin(n),f=2*Math.asin(Math.sqrt(ue(r-e)+i*a*ue(n-t))),p=1/Math.sin(f),d=f?function(t){var e=Math.sin(t*=f)*p,n=Math.sin(f-t)*p,r=n*s+e*l,i=n*c+e*h,a=n*u+e*o;return[Math.atan2(i,r)*No,Math.atan2(a,Math.sqrt(r*r+i*i))*No]}:function(){return[t*No,e*No]};return d.distance=f,d}function wr(){function t(t,i){var u=Math.sin(i*=Bo),a=Math.cos(i),o=co((t*=Bo)-e),s=Math.cos(o);Us+=Math.atan2(Math.sqrt((o=a*Math.sin(o))*o+(o=r*u-n*a*s)*o),n*u+r*a*s),e=t,n=u,r=a}var e,n,r;Vs.point=function(i,u){e=i*Bo,n=Math.sin(u*=Bo),r=Math.cos(u),Vs.point=t},Vs.lineEnd=function(){Vs.point=Vs.lineEnd=b}}function Ar(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),u=t(r*i);return[u*i*Math.sin(e),u*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),u=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*u,r*a),Math.asin(r&&n*u/r)]},n}function Er(t,e){function n(t,e){a>0?-Fo+To>e&&(e=-Fo+To):e>Fo-To&&(e=Fo-To);var n=a/Math.pow(i(e),u);return[n*Math.sin(u*t),a-n*Math.cos(u*t)]}var r=Math.cos(t),i=function(t){return Math.tan(Mo/4+t/2)},u=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),a=r*Math.pow(i(t),u)/u;return u?(n.invert=function(t,e){var n=a-e,r=J(u)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/u,2*Math.atan(Math.pow(a/r,1/u))-Fo]},n):Dr}function kr(t,e){function n(t,e){var n=u-e;return[n*Math.sin(i*t),u-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),u=r/i+t;return co(i)i;i++){for(;r>1&&Q(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Lr(t,e){return t[0]-e[0]||t[1]-e[1]}function Br(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Nr(t,e,n,r){var i=t[0],u=n[0],a=e[0]-i,o=r[0]-u,s=t[1],c=n[1],l=e[1]-s,h=r[1]-c,f=(o*(s-c)-h*(i-u))/(h*a-o*l);return[i+f*a,s+f*l]}function qr(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function Rr(){ri(this),this.edge=this.site=this.circle=null}function Or(t){var e=tc.pop()||new Rr;return e.site=t,e}function Ir(t){Wr(t),Ks.remove(t),tc.push(t),ri(t)}function Pr(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},u=t.P,a=t.N,o=[t];Ir(t);for(var s=u;s.circle&&co(n-s.circle.x)l;++l)c=o[l],s=o[l-1],ti(c.edge,s.site,c.site,i);s=o[0],c=o[h-1],c.edge=Jr(s.site,c.site,null,i),Gr(s),Gr(c)}function jr(t){for(var e,n,r,i,u=t.x,a=t.y,o=Ks._;o;)if(r=Ur(o,a)-u,r>To)o=o.L;else{if(i=u-Vr(o,a),!(i>To)){r>-To?(e=o.P,n=o):i>-To?(e=o,n=o.N):e=n=o;break}if(!o.R){e=o;break}o=o.R}var s=Or(t);if(Ks.insert(e,s),e||n){if(e===n)return Wr(e),n=Or(e.site),Ks.insert(s,n),s.edge=n.edge=Jr(e.site,s.site),Gr(e),void Gr(n);if(!n)return void(s.edge=Jr(e.site,s.site));Wr(e),Wr(n);var c=e.site,l=c.x,h=c.y,f=t.x-l,p=t.y-h,d=n.site,g=d.x-l,y=d.y-h,m=2*(f*y-p*g),v=f*f+p*p,b=g*g+y*y,x={x:(y*v-p*b)/m+l,y:(f*b-g*v)/m+h};ti(n.edge,c,d,x),s.edge=Jr(c,t,null,x),n.edge=Jr(t,d,null,x),Gr(e),Gr(n)}}function Ur(t,e){var n=t.site,r=n.x,i=n.y,u=i-e;if(!u)return r;var a=t.P;if(!a)return-1/0;n=a.site;var o=n.x,s=n.y,c=s-e;if(!c)return o;var l=o-r,h=1/u-1/c,f=l/c;return h?(-f+Math.sqrt(f*f-2*h*(l*l/(-2*c)-s+c/2+i-u/2)))/h+r:(r+o)/2}function Vr(t,e){var n=t.N;if(n)return Ur(n,e);var r=t.site;return r.y===e?r.x:1/0}function zr(t){this.site=t,this.edges=[]}function Hr(t){for(var e,n,r,i,u,a,o,s,c,l,h=t[0][0],f=t[1][0],p=t[0][1],d=t[1][1],g=Xs,y=g.length;y--;)if(u=g[y],u&&u.prepare())for(o=u.edges,s=o.length,a=0;s>a;)l=o[a].end(),r=l.x,i=l.y,c=o[++a%s].start(),e=c.x,n=c.y,(co(r-e)>To||co(i-n)>To)&&(o.splice(a,0,new ei(Qr(u.site,l,co(r-h)To?{x:h,y:co(e-h)To?{x:co(n-d)To?{x:f,y:co(e-f)To?{x:co(n-p)=-Lo)){var p=s*s+c*c,d=l*l+h*h,g=(h*p-c*d)/f,y=(s*d-l*p)/f,h=y+o,m=ec.pop()||new Yr;m.arc=t,m.site=i,m.x=g+a,m.y=h+Math.sqrt(g*g+y*y),m.cy=h,t.circle=m;for(var v=null,b=Qs._;b;)if(m.yy||y>=o)return;if(f>d){if(u){if(u.y>=c)return}else u={x:y,y:s};n={x:y,y:c}}else{if(u){if(u.yr||r>1)if(f>d){if(u){if(u.y>=c)return}else u={x:(s-i)/r,y:s};n={x:(c-i)/r,y:c}}else{if(u){if(u.yp){if(u){if(u.x>=o)return}else u={x:a,y:r*a+i};n={x:o,y:r*o+i}}else{if(u){if(u.xu&&(i=e.slice(u,i),o[a]?o[a]+=i:o[++a]=i),(n=n[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,s.push({i:a,x:yi(n,r)})),u=ic.lastIndex;return ur;++r)o[(n=s[r]).i]=n.x(t);return o.join("")})}function vi(t,e){for(var n,r=Za.interpolators.length;--r>=0&&!(n=Za.interpolators[r](t,e)););return n}function bi(t,e){var n,r=[],i=[],u=t.length,a=e.length,o=Math.min(t.length,e.length);for(n=0;o>n;++n)r.push(vi(t[n],e[n]));for(;u>n;++n)i[n]=t[n];for(;a>n;++n)i[n]=e[n];return function(t){for(n=0;o>n;++n)i[n]=r[n](t);return i}}function xi(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function _i(t){return function(e){return 1-t(1-e)}}function wi(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function Ai(t){return t*t}function Ei(t){return t*t*t}function ki(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Di(t){return function(e){return Math.pow(e,t)}}function Ci(t){return 1-Math.cos(t*Fo)}function Mi(t){return Math.pow(2,10*(t-1))}function Si(t){return 1-Math.sqrt(1-t*t)}function Fi(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/So*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*So/e)}}function Ti(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Li(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Bi(t,e){t=Za.hcl(t),e=Za.hcl(e);var n=t.h,r=t.c,i=t.l,u=e.h-n,a=e.c-r,o=e.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?e.c:r),isNaN(u)?(u=0,n=isNaN(n)?e.h:n):u>180?u-=360:-180>u&&(u+=360),function(t){return le(n+u*t,r+a*t,i+o*t)+""}}function Ni(t,e){t=Za.hsl(t),e=Za.hsl(e);var n=t.h,r=t.s,i=t.l,u=e.h-n,a=e.s-r,o=e.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?e.s:r),isNaN(u)?(u=0,n=isNaN(n)?e.h:n):u>180?u-=360:-180>u&&(u+=360),function(t){return se(n+u*t,r+a*t,i+o*t)+""}}function qi(t,e){t=Za.lab(t),e=Za.lab(e);var n=t.l,r=t.a,i=t.b,u=e.l-n,a=e.a-r,o=e.b-i;return function(t){return fe(n+u*t,r+a*t,i+o*t)+""}}function Ri(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Oi(t){var e=[t.a,t.b],n=[t.c,t.d],r=Pi(e),i=Ii(e,n),u=Pi(ji(n,e,-i))||0;e[0]*n[1]180?l+=360:l-c>180&&(c+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:yi(c,l)})):l&&r.push(r.pop()+"rotate("+l+")"),h!=f?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:yi(h,f)}):f&&r.push(r.pop()+"skewX("+f+")"),p[0]!=d[0]||p[1]!=d[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:n-4,x:yi(p[0],d[0])},{i:n-2,x:yi(p[1],d[1])})):(1!=d[0]||1!=d[1])&&r.push(r.pop()+"scale("+d+")"),n=i.length,function(t){for(var e,u=-1;++u=0;)n.push(i[r])}function tu(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(u=t.children)&&(i=u.length))for(var i,u,a=-1;++an;++n)(e=t[n][1])>i&&(r=n,i=e);return r}function hu(t){return t.reduce(fu,0)}function fu(t,e){return t+e[1]}function pu(t,e){return du(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function du(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,u=[];++n<=e;)u[n]=i*n+r;return u}function gu(t){return[Za.min(t),Za.max(t)]}function yu(t,e){return t.value-e.value}function mu(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function vu(t,e){t._pack_next=e,e._pack_prev=t}function bu(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function xu(t){function e(t){l=Math.min(t.x-t.r,l),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),p=Math.max(t.y+t.r,p)}if((n=t.children)&&(c=n.length)){var n,r,i,u,a,o,s,c,l=1/0,h=-1/0,f=1/0,p=-1/0;if(n.forEach(_u),r=n[0],r.x=-r.r,r.y=0,e(r),c>1&&(i=n[1],i.x=i.r,i.y=0,e(i),c>2))for(u=n[2],Eu(r,i,u),e(u),mu(r,u),r._pack_prev=u,mu(u,i),i=r._pack_next,a=3;c>a;a++){Eu(r,i,u=n[a]);var d=0,g=1,y=1;for(o=i._pack_next;o!==i;o=o._pack_next,g++)if(bu(o,u)){d=1;break}if(1==d)for(s=r._pack_prev;s!==o._pack_prev&&!bu(s,u);s=s._pack_prev,y++);d?(y>g||g==y&&i.ra;a++)u=n[a],u.x-=m,u.y-=v,b=Math.max(b,u.r+Math.sqrt(u.x*u.x+u.y*u.y));t.r=b,n.forEach(wu)}}function _u(t){t._pack_next=t._pack_prev=t}function wu(t){delete t._pack_next,delete t._pack_prev}function Au(t,e,n,r){var i=t.children;if(t.x=e+=r*t.x,t.y=n+=r*t.y,t.r*=r,i)for(var u=-1,a=i.length;++u=0;)e=i[u],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Fu(t,e,n){return t.a.parent===e.parent?t.a:n}function Tu(t){return 1+Za.max(t,function(t){return t.y})}function Lu(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Bu(t){var e=t.children;return e&&e.length?Bu(e[0]):t}function Nu(t){var e,n=t.children;return n&&(e=n.length)?Nu(n[e-1]):t}function qu(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ru(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],u=t.dy-e[0]-e[2];return 0>i&&(n+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:n,y:r,dx:i,dy:u}}function Ou(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function Iu(t){return t.rangeExtent?t.rangeExtent():Ou(t.range())}function Pu(t,e,n,r){var i=n(t[0],t[1]),u=r(e[0],e[1]);return function(t){return u(i(t))}}function ju(t,e){var n,r=0,i=t.length-1,u=t[r],a=t[i];return u>a&&(n=r,r=i,i=n,n=u,u=a,a=n),t[r]=e.floor(u),t[i]=e.ceil(a),t}function Uu(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:gc}function Vu(t,e,n,r){var i=[],u=[],a=0,o=Math.min(t.length,e.length)-1;for(t[o]2?Vu:Pu,s=r?zi:Vi;return a=i(t,e,s,n),o=i(e,t,s,vi),u}function u(t){return a(t)}var a,o;return u.invert=function(t){return o(t)},u.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},u.range=function(t){return arguments.length?(e=t,i()):e},u.rangeRound=function(t){return u.range(t).interpolate(Ri)},u.clamp=function(t){return arguments.length?(r=t,i()):r},u.interpolate=function(t){return arguments.length?(n=t,i()):n},u.ticks=function(e){return Gu(t,e)},u.tickFormat=function(e,n){return Wu(t,e,n)},u.nice=function(e){return $u(t,e),i()},u.copy=function(){return zu(t,e,n,r)},i()}function Hu(t,e){return Za.rebind(t,e,"range","rangeRound","interpolate","clamp")}function $u(t,e){return ju(t,Uu(Yu(t,e)[2]))}function Yu(t,e){null==e&&(e=10);var n=Ou(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),u=e/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Gu(t,e){return Za.range.apply(Za,Yu(t,e))}function Wu(t,e,n){var r=Yu(t,e);if(n){var i=rs.exec(n);if(i.shift(),"s"===i[8]){var u=Za.formatPrefix(Math.max(co(r[0]),co(r[1])));return i[7]||(i[7]="."+Zu(u.scale(r[2]))),i[8]="f",n=Za.format(i.join("")),function(t){return n(u.scale(t))+u.symbol}}i[7]||(i[7]="."+Xu(i[8],r)),n=i.join("")}else n=",."+Zu(r[2])+"f";return Za.format(n)}function Zu(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Xu(t,e){var n=Zu(e[2]);return t in yc?Math.abs(n-Zu(Math.max(co(e[0]),co(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Ku(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function u(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}return a.invert=function(e){return u(t.invert(e))},a.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(i)),a):r},a.base=function(n){return arguments.length?(e=+n,t.domain(r.map(i)),a):e},a.nice=function(){var e=ju(r.map(i),n?Math:vc);return t.domain(e),r=e.map(u),a},a.ticks=function(){var t=Ou(r),a=[],o=t[0],s=t[1],c=Math.floor(i(o)),l=Math.ceil(i(s)),h=e%1?2:e;if(isFinite(l-c)){if(n){for(;l>c;c++)for(var f=1;h>f;f++)a.push(u(c)*f);a.push(u(c))}else for(a.push(u(c));c++0;f--)a.push(u(c)*f);for(c=0;a[c]s;l--);a=a.slice(c,l)}return a},a.tickFormat=function(t,e){if(!arguments.length)return mc;arguments.length<2?e=mc:"function"!=typeof e&&(e=Za.format(e));var r,o=Math.max(.1,t/a.ticks().length),s=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/u(s(i(t)+r))<=o?e(t):""}},a.copy=function(){return Ku(t.copy(),e,n,r)},Hu(a,t)}function Ju(t,e,n){function r(e){return t(i(e))}var i=Qu(e),u=Qu(1/e);return r.invert=function(e){return u(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(i)),r):n},r.ticks=function(t){return Gu(n,t)},r.tickFormat=function(t,e){return Wu(n,t,e)},r.nice=function(t){return r.domain($u(n,t))},r.exponent=function(a){return arguments.length?(i=Qu(e=a),u=Qu(1/e),t.domain(n.map(i)),r):e},r.copy=function(){return Ju(t.copy(),e,n)},Hu(r,t)}function Qu(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ta(t,e){function n(n){return u[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%u.length]}function r(e,n){return Za.range(t.length).map(function(t){return e+n*t})}var i,u,a;return n.domain=function(r){if(!arguments.length)return t;t=[],i=new s;for(var u,a=-1,o=r.length;++at?[0/0,0/0]:[t>0?o[t-1]:e[0],te?0/0:e/u+t,[e,e+1/u]},r.copy=function(){return na(t,e,n)},i()}function ra(t,e){function n(n){return n>=n?e[Za.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return ra(t,e)},n}function ia(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Gu(t,e)},e.tickFormat=function(e,n){return Wu(t,e,n)},e.copy=function(){return ia(t)},e}function ua(t){return t.innerRadius}function aa(t){return t.outerRadius}function oa(t){return t.startAngle}function sa(t){return t.endAngle}function ca(t){function e(e){function a(){c.push("M",u(t(l),o))}for(var s,c=[],l=[],h=-1,f=e.length,p=De(n),d=De(r);++h1&&i.push("H",r[0]),i.join("")}function pa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1){o=e[1],u=t[s],s++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(u[0]-o[0])+","+(u[1]-o[1])+","+u[0]+","+u[1];for(var c=2;c9&&(i=3*e/Math.sqrt(i),a[o]=i*n,a[o+1]=i*r));for(o=-1;++o<=s;)i=(t[Math.min(s,o+1)][0]-t[Math.max(0,o-1)][0])/(6*(1+a[o]*a[o])),u.push([i||0,a[o]*i||0]);return u}function Sa(t){return t.length<3?la(t):t[0]+va(t,Ma(t))}function Fa(t){for(var e,n,r,i=-1,u=t.length;++in?c():(i.active=n,u.event&&u.event.start.call(t,l,e),u.tween.forEach(function(n,r){(r=r.call(t,l,e))&&g.push(r)}),void Za.timer(function(){return d.c=s(r||1)?Sn:s,1},0,a))}function s(r){if(i.active!==n)return c();for(var a=r/p,o=h(a),s=g.length;s>0;)g[--s].call(t,o);return a>=1?(u.event&&u.event.end.call(t,l,e),c()):void 0}function c(){return--i.count?delete i[n]:delete t.__transition__,1}var l=t.__data__,h=u.ease,f=u.delay,p=u.duration,d=ts,g=[];return d.t=f+a,r>=f?o(r-f):void(d.c=o)},0,a)}}function Va(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function za(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Ha(t){return t.toISOString()}function $a(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,u=Za.bisect(zc,i);return u==zc.length?[e.year,Yu(t.map(function(t){return t/31536e6}),n)[2]]:u?e[i/zc[u-1]1?{floor:function(e){for(;n(e=t.floor(e));)e=Ya(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=Ya(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Ou(r.domain()),u=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return u&&(t=u[0],e=u[1]),t.range(n[0],Ya(+n[1]+1),1>e?1:e)},r.tickFormat=function(){return n},r.copy=function(){return $a(t.copy(),e,n)},Hu(r,t)}function Ya(t){return new Date(t)}function Ga(t){return JSON.parse(t.responseText)}function Wa(t){var e=Ja.createRange();return e.selectNode(Ja.body),e.createContextualFragment(t.responseText)}var Za={version:"3.4.13"};Date.now||(Date.now=function(){return+new Date});var Xa=[].slice,Ka=function(t){return Xa.call(t)},Ja=document,Qa=Ja.documentElement,to=window;try{Ka(Qa.childNodes)[0].nodeType}catch(eo){Ka=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}try{Ja.createElement("div").style.setProperty("opacity",0,"")}catch(no){var ro=to.Element.prototype,io=ro.setAttribute,uo=ro.setAttributeNS,ao=to.CSSStyleDeclaration.prototype,oo=ao.setProperty;ro.setAttribute=function(t,e){io.call(this,t,e+"")},ro.setAttributeNS=function(t,e,n){uo.call(this,t,e,n+"")},ao.setProperty=function(t,e,n){oo.call(this,t,e+"",n)}}Za.ascending=t,Za.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},Za.min=function(t,e){var n,r,i=-1,u=t.length;if(1===arguments.length){for(;++i=n);)n=void 0;for(;++ir&&(n=r)}else{for(;++i=n);)n=void 0;for(;++ir&&(n=r)}return n},Za.max=function(t,e){var n,r,i=-1,u=t.length;if(1===arguments.length){for(;++i=n);)n=void 0;for(;++in&&(n=r)}else{for(;++i=n);)n=void 0;for(;++in&&(n=r)}return n},Za.extent=function(t,e){var n,r,i,u=-1,a=t.length;if(1===arguments.length){for(;++u=n);)n=i=void 0;for(;++ur&&(n=r),r>i&&(i=r))}else{for(;++u=n);)n=void 0;for(;++ur&&(n=r),r>i&&(i=r))}return[n,i]},Za.sum=function(t,e){var n,i=0,u=t.length,a=-1;if(1===arguments.length)for(;++ar?0:r);r>n;)u[n]=[e=i,i=t[++n]];return u},Za.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=Za.min(arguments,u),n=new Array(e);++t=0;)for(r=t[i],e=r.length;--e>=0;)n[--a]=r[e];return n};var co=Math.abs;Za.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,i=[],u=a(co(n)),o=-1;if(t*=u,e*=u,n*=u,0>n)for(;(r=t+n*++o)>e;)i.push(r/u);else for(;(r=t+n*++o)=u.length)return r?r.call(i,a):n?a.sort(n):a;for(var c,l,h,f,p=-1,d=a.length,g=u[o++],y=new s;++p=u.length)return t;var r=[],i=a[n++];return t.forEach(function(t,i){r.push({key:t,values:e(i,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},u=[],a=[];return i.map=function(e,n){return t(n,e,0)},i.entries=function(n){return e(t(Za.map,n,0),0)},i.key=function(t){return u.push(t),i},i.sortKeys=function(t){return a[u.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},Za.set=function(t){var e=new y;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e},o(y,{has:h,add:function(t){return this._[c(t+="")]=!0,t},remove:f,values:p,size:d,empty:g,forEach:function(t){for(var e in this._)t.call(this,l(e))}}),Za.behavior={},Za.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},Za.event=null,Za.requote=function(t){return t.replace(po,"\\$&")};var po=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,go={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},yo=function(t,e){return e.querySelector(t)},mo=function(t,e){return e.querySelectorAll(t)},vo=Qa.matches||Qa[v(Qa,"matchesSelector")],bo=function(t,e){return vo.call(t,e)};"function"==typeof Sizzle&&(yo=function(t,e){return Sizzle(t,e)[0]||null},mo=Sizzle,bo=Sizzle.matchesSelector),Za.selection=function(){return Ao};var xo=Za.selection.prototype=[];xo.select=function(t){var e,n,r,i,u=[];t=D(t);for(var a=-1,o=this.length;++a=0&&(n=t.slice(0,e),t=t.slice(e+1)),_o.hasOwnProperty(n)?{space:_o[n],local:t}:t}},xo.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=Za.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(M(e,t[e]));return this}return this.each(M(t,e))},xo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=T(t)).length,i=-1;if(e=n.classList){for(;++ir){if("string"!=typeof t){2>r&&(e="");for(n in t)this.each(N(n,t[n],e));return this}if(2>r)return to.getComputedStyle(this.node(),null).getPropertyValue(t);n=""}return this.each(N(t,e,n))},xo.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(q(e,t[e]));return this}return this.each(q(t,e))},xo.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},xo.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},xo.append=function(t){return t=R(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},xo.insert=function(t,e){return t=R(t),e=D(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},xo.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},xo.data=function(t,e){function n(t,n){var r,i,u,a=t.length,h=n.length,f=Math.min(a,h),p=new Array(h),d=new Array(h),g=new Array(a);if(e){var y,m=new s,v=new Array(a);for(r=-1;++rr;++r)d[r]=O(n[r]);for(;a>r;++r)g[r]=t[r]}d.update=p,d.parentNode=p.parentNode=g.parentNode=t.parentNode,o.push(d),c.push(p),l.push(g)}var r,i,u=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++uu;u++){i.push(e=[]),e.parentNode=(n=this[u]).parentNode;for(var o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,u)&&e.push(r)}return k(i)},xo.order=function(){for(var t=-1,e=this.length;++t=0;)(n=r[i])&&(u&&u!==n.nextSibling&&u.parentNode.insertBefore(n,u),u=n);return this},xo.sort=function(t){t=P.apply(this,arguments);for(var e=-1,n=this.length;++et;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var u=n[r];if(u)return u}return null},xo.size=function(){var t=0;return j(this,function(){++t}),t};var wo=[];Za.selection.enter=U,Za.selection.enter.prototype=wo,wo.append=xo.append,wo.empty=xo.empty,wo.node=xo.node,wo.call=xo.call,wo.size=xo.size,wo.select=function(t){for(var e,n,r,i,u,a=[],o=-1,s=this.length;++or){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(H(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(H(t,e,n))};var Eo=Za.map({mouseenter:"mouseover",mouseleave:"mouseout"});Eo.forEach(function(t){"on"+t in Ja&&Eo.remove(t)});var ko="onselectstart"in Ja?null:v(Qa.style,"userSelect"),Do=0;Za.mouse=function(t){return W(t,A())};var Co=/WebKit/.test(to.navigator.userAgent)?-1:0;Za.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=A().changedTouches),e)for(var r,i=0,u=e.length;u>i;++i)if((r=e[i]).identifier===n)return W(t,r)},Za.behavior.drag=function(){function t(){this.on("mousedown.drag",i).on("touchstart.drag",u)}function e(t,e,i,u,a){return function(){function o(){var t,n,r=e(f,g);r&&(t=r[0]-b[0],n=r[1]-b[1],d|=t|n,b=r,p({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:t,dy:n}))}function s(){e(f,g)&&(m.on(u+y,null).on(a+y,null),v(d&&Za.event.target===h),p({type:"dragend"}))}var c,l=this,h=Za.event.target,f=l.parentNode,p=n.of(l,arguments),d=0,g=t(),y=".drag"+(null==g?"":"-"+g),m=Za.select(i()).on(u+y,o).on(a+y,s),v=G(),b=e(f,g);r?(c=r.apply(l,arguments),c=[c.x-b[0],c.y-b[1]]):c=[0,0],p({type:"dragstart"})}}var n=E(t,"drag","dragstart","dragend"),r=null,i=e(b,Za.mouse,K,"mousemove","mouseup"),u=e(Z,Za.touch,X,"touchmove","touchend");return t.origin=function(e){return arguments.length?(r=e,t):r},Za.rebind(t,n,"on")},Za.touches=function(t,e){return arguments.length<2&&(e=A().touches),e?Ka(e).map(function(e){var n=W(t,e);return n.identifier=e.identifier,n}):[]};var Mo=Math.PI,So=2*Mo,Fo=Mo/2,To=1e-6,Lo=To*To,Bo=Mo/180,No=180/Mo,qo=Math.SQRT2,Ro=2,Oo=4;Za.interpolateZoom=function(t,e){function n(t){var e=t*v;if(m){var n=re(g),a=u/(Ro*f)*(n*ie(qo*e+g)-ne(g));return[r+a*c,i+a*l,u*n/re(qo*e+g)]}return[r+t*c,i+t*l,u*Math.exp(qo*e)]}var r=t[0],i=t[1],u=t[2],a=e[0],o=e[1],s=e[2],c=a-r,l=o-i,h=c*c+l*l,f=Math.sqrt(h),p=(s*s-u*u+Oo*h)/(2*u*Ro*f),d=(s*s-u*u-Oo*h)/(2*s*Ro*f),g=Math.log(Math.sqrt(p*p+1)-p),y=Math.log(Math.sqrt(d*d+1)-d),m=y-g,v=(m||Math.log(s/u))/qo;return n.duration=1e3*v,n},Za.behavior.zoom=function(){function t(t){t.on(C,c).on(jo+".zoom",h).on("dblclick.zoom",f).on(F,l)}function e(t){return[(t[0]-A.x)/A.k,(t[1]-A.y)/A.k]}function n(t){return[t[0]*A.k+A.x,t[1]*A.k+A.y]}function r(t){A.k=Math.max(D[0],Math.min(D[1],t))}function i(t,e){e=n(e),A.x+=t[0]-e[0],A.y+=t[1]-e[1]}function u(){b&&b.domain(v.range().map(function(t){return(t-A.x)/A.k}).map(v.invert)),_&&_.domain(x.range().map(function(t){return(t-A.y)/A.k}).map(x.invert))}function a(t){t({type:"zoomstart"})}function o(t){u(),t({type:"zoom",scale:A.k,translate:[A.x,A.y]})}function s(t){t({type:"zoomend"})}function c(){function t(){l=1,i(Za.mouse(r),f),o(c)}function n(){h.on(M,null).on(S,null),p(l&&Za.event.target===u),s(c)}var r=this,u=Za.event.target,c=T.of(r,arguments),l=0,h=Za.select(to).on(M,t).on(S,n),f=e(Za.mouse(r)),p=G();z.call(r),a(c)}function l(){function t(){var t=Za.touches(p);return f=A.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function n(){var e=Za.event.target;Za.select(e).on(b,u).on(x,h),_.push(e);for(var n=Za.event.changedTouches,a=0,s=n.length;s>a;++a)g[n[a].identifier]=null;var c=t(),l=Date.now();if(1===c.length){if(500>l-m){var f=c[0],p=g[f.identifier];r(2*A.k),i(f,p),w(),o(d)}m=l}else if(c.length>1){var f=c[0],v=c[1],E=f[0]-v[0],k=f[1]-v[1];y=E*E+k*k}}function u(){for(var t,e,n,u,a=Za.touches(p),s=0,c=a.length;c>s;++s,u=null)if(n=a[s],u=g[n.identifier]){if(e)break;t=n,e=u}if(u){var l=(l=n[0]-t[0])*l+(l=n[1]-t[1])*l,h=y&&Math.sqrt(l/y);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+u[0])/2,(e[1]+u[1])/2],r(h*f)}m=null,i(t,e),o(d)}function h(){if(Za.event.touches.length){for(var e=Za.event.changedTouches,n=0,r=e.length;r>n;++n)delete g[e[n].identifier];for(var i in g)return void t()}Za.selectAll(_).on(v,null),E.on(C,c).on(F,l),k(),s(d)}var f,p=this,d=T.of(p,arguments),g={},y=0,v=".zoom-"+Za.event.changedTouches[0].identifier,b="touchmove"+v,x="touchend"+v,_=[],E=Za.select(p),k=G();z.call(p),n(),a(d),E.on(C,null).on(F,n)}function h(){var t=T.of(this,arguments);y?clearTimeout(y):(p=e(d=g||Za.mouse(this)),z.call(this),a(t)),y=setTimeout(function(){y=null,s(t)},50),w(),r(Math.pow(2,.002*Io())*A.k),i(d,p),o(t)}function f(){var t=T.of(this,arguments),n=Za.mouse(this),u=e(n),c=Math.log(A.k)/Math.LN2;a(t),r(Math.pow(2,Za.event.shiftKey?Math.ceil(c)-1:Math.floor(c)+1)),i(n,u),o(t),s(t)}var p,d,g,y,m,v,b,x,_,A={x:0,y:0,k:1},k=[960,500],D=Po,C="mousedown.zoom",M="mousemove.zoom",S="mouseup.zoom",F="touchstart.zoom",T=E(t,"zoomstart","zoom","zoomend");return t.event=function(t){t.each(function(){var t=T.of(this,arguments),e=A;Fc?Za.select(this).transition().each("start.zoom",function(){A=this.__chart__||{x:0,y:0,k:1},a(t)}).tween("zoom:zoom",function(){var n=k[0],r=k[1],i=n/2,u=r/2,a=Za.interpolateZoom([(i-A.x)/A.k,(u-A.y)/A.k,n/A.k],[(i-e.x)/e.k,(u-e.y)/e.k,n/e.k]);return function(e){var r=a(e),s=n/r[2];this.__chart__=A={x:i-r[0]*s,y:u-r[1]*s,k:s},o(t)}}).each("end.zoom",function(){s(t)}):(this.__chart__=A,a(t),o(t),s(t))})},t.translate=function(e){return arguments.length?(A={x:+e[0],y:+e[1],k:A.k},u(),t):[A.x,A.y]},t.scale=function(e){return arguments.length?(A={x:A.x,y:A.y,k:+e},u(),t):A.k},t.scaleExtent=function(e){return arguments.length?(D=null==e?Po:[+e[0],+e[1]],t):D},t.center=function(e){return arguments.length?(g=e&&[+e[0],+e[1]],t):g},t.size=function(e){return arguments.length?(k=e&&[+e[0],+e[1]],t):k},t.x=function(e){return arguments.length?(b=e,v=e.copy(),A={x:0,y:0,k:1},t):b},t.y=function(e){return arguments.length?(_=e,x=e.copy(),A={x:0,y:0,k:1},t):_},Za.rebind(t,T,"on")};var Io,Po=[0,1/0],jo="onwheel"in Ja?(Io=function(){return-Za.event.deltaY*(Za.event.deltaMode?120:1)},"wheel"):"onmousewheel"in Ja?(Io=function(){return Za.event.wheelDelta},"mousewheel"):(Io=function(){return-Za.event.detail},"MozMousePixelScroll");Za.color=ae,ae.prototype.toString=function(){return this.rgb()+""},Za.hsl=oe;var Uo=oe.prototype=new ae;Uo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new oe(this.h,this.s,this.l/t)},Uo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new oe(this.h,this.s,t*this.l)},Uo.rgb=function(){return se(this.h,this.s,this.l)},Za.hcl=ce;var Vo=ce.prototype=new ae;Vo.brighter=function(t){return new ce(this.h,this.c,Math.min(100,this.l+zo*(arguments.length?t:1)))},Vo.darker=function(t){return new ce(this.h,this.c,Math.max(0,this.l-zo*(arguments.length?t:1)))},Vo.rgb=function(){return le(this.h,this.c,this.l).rgb()},Za.lab=he;var zo=18,Ho=.95047,$o=1,Yo=1.08883,Go=he.prototype=new ae;Go.brighter=function(t){return new he(Math.min(100,this.l+zo*(arguments.length?t:1)),this.a,this.b)},Go.darker=function(t){return new he(Math.max(0,this.l-zo*(arguments.length?t:1)),this.a,this.b)},Go.rgb=function(){return fe(this.l,this.a,this.b)},Za.rgb=me;var Wo=me.prototype=new ae;Wo.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&i>e&&(e=i),n&&i>n&&(n=i),r&&i>r&&(r=i),new me(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))):new me(i,i,i)},Wo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new me(t*this.r,t*this.g,t*this.b)},Wo.hsl=function(){return we(this.r,this.g,this.b)},Wo.toString=function(){return"#"+xe(this.r)+xe(this.g)+xe(this.b)};var Zo=Za.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Zo.forEach(function(t,e){Zo.set(t,ve(e))}),Za.functor=De,Za.xhr=Me(Ce),Za.dsv=function(t,e){function n(t,n,u){arguments.length<3&&(u=n,n=null);var a=Se(t,e,null==n?r:i(n),u);return a.row=function(t){return arguments.length?a.response(null==(n=t)?r:i(t)):n},a}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function u(e){return e.map(a).join(t)}function a(t){return o.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var o=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})},n.parseRows=function(t,e){function n(){if(l>=c)return a;if(i)return i=!1,u;var e=l;if(34===t.charCodeAt(e)){for(var n=e;n++l;){var r=t.charCodeAt(l++),o=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(l)&&(++l,++o);else if(r!==s)continue;return t.slice(e,l-o)}return t.slice(e)}for(var r,i,u={},a={},o=[],c=t.length,l=0,h=0;(r=n())!==a;){for(var f=[];r!==u&&r!==a;)f.push(r),r=n();e&&null==(f=e(f,h++))||o.push(f)}return o},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new y,i=[];return e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))}),[i.map(a).join(t)].concat(e.map(function(e){return i.map(function(t){return a(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(u).join("\n")},n},Za.csv=Za.dsv(",","text/csv"),Za.tsv=Za.dsv(" ","text/tab-separated-values");var Xo,Ko,Jo,Qo,ts,es=to[v(to,"requestAnimationFrame")]||function(t){setTimeout(t,17)};Za.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0),3>r&&(n=Date.now());var i=n+e,u={c:t,t:i,f:!1,n:null};Ko?Ko.n=u:Xo=u,Ko=u,Jo||(Qo=clearTimeout(Qo),Jo=1,es(Le))},Za.timer.flush=function(){Be(),Ne()},Za.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ns=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Re);Za.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=Za.round(t,qe(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),ns[8+n/3]};var rs=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,is=Za.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=Za.round(t,qe(t,e))).toFixed(Math.max(0,Math.min(20,qe(t*(1+1e-15),e))))}}),us=Za.time={},as=Date;Pe.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){os.setUTCDate.apply(this._,arguments)},setDay:function(){os.setUTCDay.apply(this._,arguments)},setFullYear:function(){os.setUTCFullYear.apply(this._,arguments)},setHours:function(){os.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){os.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){os.setUTCMinutes.apply(this._,arguments)},setMonth:function(){os.setUTCMonth.apply(this._,arguments)},setSeconds:function(){os.setUTCSeconds.apply(this._,arguments)},setTime:function(){os.setTime.apply(this._,arguments)}};var os=Date.prototype;us.year=je(function(t){return t=us.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),us.years=us.year.range,us.years.utc=us.year.utc.range,us.day=je(function(t){var e=new as(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),us.days=us.day.range,us.days.utc=us.day.utc.range,us.dayOfYear=function(t){var e=us.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=us[t]=je(function(t){return(t=us.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=us.year(t).getDay();return Math.floor((us.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});us[t+"s"]=n.range,us[t+"s"].utc=n.utc.range,us[t+"OfYear"]=function(t){var n=us.year(t).getDay();return Math.floor((us.dayOfYear(t)+(n+e)%7)/7)}}),us.week=us.sunday,us.weeks=us.sunday.range,us.weeks.utc=us.sunday.utc.range,us.weekOfYear=us.sundayOfYear;var ss={"-":"",_:" ",0:"0"},cs=/^\s*\d+/,ls=/^%/;Za.locale=function(t){return{numberFormat:Oe(t),timeFormat:Ve(t)}};var hs=Za.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Za.format=hs.numberFormat,Za.geo={},ln.prototype={s:0,t:0,add:function(t){hn(t,this.t,fs),hn(fs.s,this.s,this),this.s?this.t+=fs.t:this.s=fs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var fs=new ln;Za.geo.stream=function(t,e){t&&ps.hasOwnProperty(t.type)?ps[t.type](t,e):fn(t,e)};var ps={Feature:function(t,e){fn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rt?4*Mo+t:t,ms.lineStart=ms.lineEnd=ms.point=b}};Za.geo.bounds=function(){function t(t,e){b.push(x=[l=t,f=t]),h>e&&(h=e),e>p&&(p=e)}function e(e,n){var r=yn([e*Bo,n*Bo]);if(m){var i=vn(m,r),u=[i[1],-i[0],0],a=vn(u,i);_n(a),a=wn(a);var s=e-d,c=s>0?1:-1,g=a[0]*No*c,y=co(s)>180;if(y^(g>c*d&&c*e>g)){var v=a[1]*No;v>p&&(p=v)}else if(g=(g+360)%360-180,y^(g>c*d&&c*e>g)){var v=-a[1]*No;h>v&&(h=v)}else h>n&&(h=n),n>p&&(p=n);y?d>e?o(l,e)>o(l,f)&&(f=e):o(e,f)>o(l,f)&&(l=e):f>=l?(l>e&&(l=e),e>f&&(f=e)):e>d?o(l,e)>o(l,f)&&(f=e):o(e,f)>o(l,f)&&(l=e)}else t(e,n);m=r,d=e}function n(){_.point=e}function r(){x[0]=l,x[1]=f,_.point=t,m=null}function i(t,n){if(m){var r=t-d;v+=co(r)>180?r+(r>0?360:-360):r}else g=t,y=n;ms.point(t,n),e(t,n)}function u(){ms.lineStart()}function a(){i(g,y),ms.lineEnd(),co(v)>To&&(l=-(f=180)),x[0]=l,x[1]=f,m=null +}function o(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tys?(l=-(f=180),h=-(p=90)):v>To?p=90:-To>v&&(h=-90),x[0]=l,x[1]=f}};return function(t){p=f=-(l=h=1/0),b=[],Za.geo.stream(t,_);var e=b.length;if(e){b.sort(s);for(var n,r=1,i=b[0],u=[i];e>r;++r)n=b[r],c(n[0],i)||c(n[1],i)?(o(i[0],n[1])>o(i[0],i[1])&&(i[1]=n[1]),o(n[0],i[1])>o(i[0],i[1])&&(i[0]=n[0])):u.push(i=n);for(var a,n,d=-1/0,e=u.length-1,r=0,i=u[e];e>=r;i=n,++r)n=u[r],(a=o(i[1],n[0]))>d&&(d=a,l=n[0],f=i[1])}return b=x=null,1/0===l||1/0===h?[[0/0,0/0],[0/0,0/0]]:[[l,h],[f,p]]}}(),Za.geo.centroid=function(t){vs=bs=xs=_s=ws=As=Es=ks=Ds=Cs=Ms=0,Za.geo.stream(t,Ss);var e=Ds,n=Cs,r=Ms,i=e*e+n*n+r*r;return Lo>i&&(e=As,n=Es,r=ks,To>bs&&(e=xs,n=_s,r=ws),i=e*e+n*n+r*r,Lo>i)?[0/0,0/0]:[Math.atan2(n,e)*No,ee(r/Math.sqrt(i))*No]};var vs,bs,xs,_s,ws,As,Es,ks,Ds,Cs,Ms,Ss={sphere:b,point:En,lineStart:Dn,lineEnd:Cn,polygonStart:function(){Ss.lineStart=Mn},polygonEnd:function(){Ss.lineStart=Dn}},Fs=Bn(Sn,On,Pn,[-Mo,-Mo/2]),Ts=1e9;Za.geo.clipExtent=function(){var t,e,n,r,i,u,a={stream:function(t){return i&&(i.valid=!1),i=u(t),i.valid=!0,i},extent:function(o){return arguments.length?(u=zn(t=+o[0][0],e=+o[0][1],n=+o[1][0],r=+o[1][1]),i&&(i.valid=!1,i=null),a):[[t,e],[n,r]]}};return a.extent([[0,0],[960,500]])},(Za.geo.conicEqualArea=function(){return $n(Yn)}).raw=Yn,Za.geo.albers=function(){return Za.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Za.geo.albersUsa=function(){function t(t){var u=t[0],a=t[1];return e=null,n(u,a),e||(r(u,a),e)||i(u,a),e}var e,n,r,i,u=Za.geo.albers(),a=Za.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=Za.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=u.scale(),n=u.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?a:i>=.166&&.234>i&&r>=-.214&&-.115>r?o:u).invert(t)},t.stream=function(t){var e=u.stream(t),n=a.stream(t),r=o.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(u.precision(e),a.precision(e),o.precision(e),t):u.precision()},t.scale=function(e){return arguments.length?(u.scale(e),a.scale(.35*e),o.scale(e),t.translate(u.translate())):u.scale()},t.translate=function(e){if(!arguments.length)return u.translate();var c=u.scale(),l=+e[0],h=+e[1];return n=u.translate(e).clipExtent([[l-.455*c,h-.238*c],[l+.455*c,h+.238*c]]).stream(s).point,r=a.translate([l-.307*c,h+.201*c]).clipExtent([[l-.425*c+To,h+.12*c+To],[l-.214*c-To,h+.234*c-To]]).stream(s).point,i=o.translate([l-.205*c,h+.212*c]).clipExtent([[l-.214*c+To,h+.166*c+To],[l-.115*c-To,h+.234*c-To]]).stream(s).point,t},t.scale(1070)};var Ls,Bs,Ns,qs,Rs,Os,Is={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Bs=0,Is.lineStart=Gn},polygonEnd:function(){Is.lineStart=Is.lineEnd=Is.point=b,Ls+=co(Bs/2)}},Ps={point:Wn,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},js={point:Kn,lineStart:Jn,lineEnd:Qn,polygonStart:function(){js.lineStart=tr},polygonEnd:function(){js.point=Kn,js.lineStart=Jn,js.lineEnd=Qn}};Za.geo.path=function(){function t(t){return t&&("function"==typeof o&&u.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=i(u)),Za.geo.stream(t,a)),u.result()}function e(){return a=null,t}var n,r,i,u,a,o=4.5;return t.area=function(t){return Ls=0,Za.geo.stream(t,i(Is)),Ls},t.centroid=function(t){return xs=_s=ws=As=Es=ks=Ds=Cs=Ms=0,Za.geo.stream(t,i(js)),Ms?[Ds/Ms,Cs/Ms]:ks?[As/ks,Es/ks]:ws?[xs/ws,_s/ws]:[0/0,0/0]},t.bounds=function(t){return Rs=Os=-(Ns=qs=1/0),Za.geo.stream(t,i(Ps)),[[Ns,qs],[Rs,Os]]},t.projection=function(t){return arguments.length?(i=(n=t)?t.stream||rr(t):Ce,e()):n},t.context=function(t){return arguments.length?(u=null==(r=t)?new Zn:new er(t),"function"!=typeof o&&u.pointRadius(o),e()):r},t.pointRadius=function(e){return arguments.length?(o="function"==typeof e?e:(u.pointRadius(+e),+e),t):o},t.projection(Za.geo.albersUsa()).context(null)},Za.geo.transform=function(t){return{stream:function(e){var n=new ir(e);for(var r in t)n[r]=t[r];return n}}},ir.prototype={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()}},Za.geo.projection=ar,Za.geo.projectionMutator=or,(Za.geo.equirectangular=function(){return ar(cr)}).raw=cr.invert=cr,Za.geo.rotation=function(t){function e(e){return e=t(e[0]*Bo,e[1]*Bo),e[0]*=No,e[1]*=No,e}return t=hr(t[0]%360*Bo,t[1]*Bo,t.length>2?t[2]*Bo:0),e.invert=function(e){return e=t.invert(e[0]*Bo,e[1]*Bo),e[0]*=No,e[1]*=No,e},e},lr.invert=cr,Za.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=hr(-t[0]*Bo,-t[1]*Bo,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=No,t[1]*=No}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=gr((e=+r)*Bo,i*Bo),t):e},t.precision=function(r){return arguments.length?(n=gr(e*Bo,(i=+r)*Bo),t):i},t.angle(90)},Za.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Bo,i=t[1]*Bo,u=e[1]*Bo,a=Math.sin(r),o=Math.cos(r),s=Math.sin(i),c=Math.cos(i),l=Math.sin(u),h=Math.cos(u);return Math.atan2(Math.sqrt((n=h*a)*n+(n=c*l-s*h*o)*n),s*l+c*h*o)},Za.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return Za.range(Math.ceil(u/y)*y,i,y).map(f).concat(Za.range(Math.ceil(c/m)*m,s,m).map(p)).concat(Za.range(Math.ceil(r/d)*d,n,d).filter(function(t){return co(t%y)>To}).map(l)).concat(Za.range(Math.ceil(o/g)*g,a,g).filter(function(t){return co(t%m)>To}).map(h))}var n,r,i,u,a,o,s,c,l,h,f,p,d=10,g=d,y=90,m=360,v=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(u).concat(p(s).slice(1),f(i).reverse().slice(1),p(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(u=+e[0][0],i=+e[1][0],c=+e[0][1],s=+e[1][1],u>i&&(e=u,u=i,i=e),c>s&&(e=c,c=s,s=e),t.precision(v)):[[u,c],[i,s]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],o=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),o>a&&(e=o,o=a,a=e),t.precision(v)):[[r,o],[n,a]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(y=+e[0],m=+e[1],t):[y,m]},t.minorStep=function(e){return arguments.length?(d=+e[0],g=+e[1],t):[d,g]},t.precision=function(e){return arguments.length?(v=+e,l=mr(o,a,90),h=vr(r,n,v),f=mr(c,s,90),p=vr(u,i,v),t):v},t.majorExtent([[-180,-90+To],[180,90-To]]).minorExtent([[-180,-80-To],[180,80+To]])},Za.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=br,i=xr;return t.distance=function(){return Za.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(i=e,n="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},Za.geo.interpolate=function(t,e){return _r(t[0]*Bo,t[1]*Bo,e[0]*Bo,e[1]*Bo)},Za.geo.length=function(t){return Us=0,Za.geo.stream(t,Vs),Us};var Us,Vs={sphere:b,point:b,lineStart:wr,lineEnd:b,polygonStart:b,polygonEnd:b},zs=Ar(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(Za.geo.azimuthalEqualArea=function(){return ar(zs)}).raw=zs;var Hs=Ar(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},Ce);(Za.geo.azimuthalEquidistant=function(){return ar(Hs)}).raw=Hs,(Za.geo.conicConformal=function(){return $n(Er)}).raw=Er,(Za.geo.conicEquidistant=function(){return $n(kr)}).raw=kr;var $s=Ar(function(t){return 1/t},Math.atan);(Za.geo.gnomonic=function(){return ar($s)}).raw=$s,Dr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Fo]},(Za.geo.mercator=function(){return Cr(Dr)}).raw=Dr;var Ys=Ar(function(){return 1},Math.asin);(Za.geo.orthographic=function(){return ar(Ys)}).raw=Ys;var Gs=Ar(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(Za.geo.stereographic=function(){return ar(Gs)}).raw=Gs,Mr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Fo]},(Za.geo.transverseMercator=function(){var t=Cr(Mr),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=Mr,Za.geom={},Za.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=De(n),u=De(r),a=t.length,o=[],s=[];for(e=0;a>e;e++)o.push([+i.call(this,t[e],e),+u.call(this,t[e],e),e]);for(o.sort(Lr),e=0;a>e;e++)s.push([o[e][0],-o[e][1]]);var c=Tr(o),l=Tr(s),h=l[0]===c[0],f=l[l.length-1]===c[c.length-1],p=[];for(e=c.length-1;e>=0;--e)p.push(t[o[c[e]][2]]);for(e=+h;e=r&&c.x<=u&&c.y>=i&&c.y<=a?[[r,a],[u,a],[u,i],[r,i]]:[];l.point=t[o]}),e}function n(t){return t.map(function(t,e){return{x:Math.round(u(t,e)/To)*To,y:Math.round(a(t,e)/To)*To,i:e}})}var r=Sr,i=Fr,u=r,a=i,o=nc;return t?e(t):(e.links=function(t){return oi(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return oi(n(t)).cells.forEach(function(n,r){for(var i,u,a=n.site,o=n.edges.sort($r),s=-1,c=o.length,l=o[c-1].edge,h=l.l===a?l.r:l.l;++s=c,f=r>=l,p=(f<<1)+h;t.leaf=!1,t=t.nodes[p]||(t.nodes[p]=fi()),h?i=c:o=c,f?a=l:s=l,u(t,e,n,r,i,a,o,s)}var l,h,f,p,d,g,y,m,v,b=De(o),x=De(s);if(null!=e)g=e,y=n,m=r,v=i;else if(m=v=-(g=y=1/0),h=[],f=[],d=t.length,a)for(p=0;d>p;++p)l=t[p],l.xm&&(m=l.x),l.y>v&&(v=l.y),h.push(l.x),f.push(l.y);else for(p=0;d>p;++p){var _=+b(l=t[p],p),w=+x(l,p);g>_&&(g=_),y>w&&(y=w),_>m&&(m=_),w>v&&(v=w),h.push(_),f.push(w)}var A=m-g,E=v-y;A>E?v=y+A:m=g+E;var k=fi();if(k.add=function(t){u(k,t,+b(t,++p),+x(t,p),g,y,m,v)},k.visit=function(t){pi(t,k,g,y,m,v)},p=-1,null==e){for(;++p=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=ac.get(n)||uc,r=oc.get(r)||Ce,xi(r(n.apply(null,Xa.call(arguments,1))))},Za.interpolateHcl=Bi,Za.interpolateHsl=Ni,Za.interpolateLab=qi,Za.interpolateRound=Ri,Za.transform=function(t){var e=Ja.createElementNS(Za.ns.prefix.svg,"g");return(Za.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Oi(n?n.matrix:sc)})(t)},Oi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var sc={a:1,b:0,c:0,d:1,e:0,f:0};Za.interpolateTransform=Ui,Za.layout={},Za.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++no*o/y){if(d>s){var c=e.charge/s;t.px-=u*c,t.py-=a*c}return!0}if(e.point&&s&&d>s){var c=e.pointCharge/s;t.px-=u*c,t.py-=a*c}}return!e.charge}}function e(t){t.px=Za.event.x,t.py=Za.event.y,o.resume()}var n,r,i,u,a,o={},s=Za.dispatch("start","tick","end"),c=[1,1],l=.9,h=cc,f=lc,p=-30,d=hc,g=.1,y=.64,m=[],v=[];return o.tick=function(){if((r*=.99)<.005)return s.end({type:"end",alpha:r=0}),!0;var e,n,o,h,f,d,y,b,x,_=m.length,w=v.length;for(n=0;w>n;++n)o=v[n],h=o.source,f=o.target,b=f.x-h.x,x=f.y-h.y,(d=b*b+x*x)&&(d=r*u[n]*((d=Math.sqrt(d))-i[n])/d,b*=d,x*=d,f.x-=b*(y=h.weight/(f.weight+h.weight)),f.y-=x*y,h.x+=b*(y=1-y),h.y+=x*y);if((y=r*g)&&(b=c[0]/2,x=c[1]/2,n=-1,y))for(;++n<_;)o=m[n],o.x+=(b-o.x)*y,o.y+=(x-o.y)*y;if(p)for(Ki(e=Za.geom.quadtree(m),r,a),n=-1;++n<_;)(o=m[n]).fixed||e.visit(t(o));for(n=-1;++n<_;)o=m[n],o.fixed?(o.x=o.px,o.y=o.py):(o.x-=(o.px-(o.px=o.x))*l,o.y-=(o.py-(o.py=o.y))*l);s.tick({type:"tick",alpha:r})},o.nodes=function(t){return arguments.length?(m=t,o):m},o.links=function(t){return arguments.length?(v=t,o):v},o.size=function(t){return arguments.length?(c=t,o):c},o.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,o):h},o.distance=o.linkDistance,o.linkStrength=function(t){return arguments.length?(f="function"==typeof t?t:+t,o):f},o.friction=function(t){return arguments.length?(l=+t,o):l},o.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,o):p},o.chargeDistance=function(t){return arguments.length?(d=t*t,o):Math.sqrt(d)},o.gravity=function(t){return arguments.length?(g=+t,o):g},o.theta=function(t){return arguments.length?(y=t*t,o):Math.sqrt(y)},o.alpha=function(t){return arguments.length?(t=+t,r?r=t>0?t:0:t>0&&(s.start({type:"start",alpha:r=t}),Za.timer(o.tick)),o):r},o.start=function(){function t(t,r){if(!n){for(n=new Array(s),o=0;s>o;++o)n[o]=[];for(o=0;c>o;++o){var i=v[o];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var u,a=n[e],o=-1,c=a.length;++oe;++e)(r=m[e]).index=e,r.weight=0;for(e=0;l>e;++e)r=v[e],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(e=0;s>e;++e)r=m[e],isNaN(r.x)&&(r.x=t("x",d)),isNaN(r.y)&&(r.y=t("y",g)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(e=0;l>e;++e)i[e]=+h.call(this,v[e],e);else for(e=0;l>e;++e)i[e]=h;if(u=[],"function"==typeof f)for(e=0;l>e;++e)u[e]=+f.call(this,v[e],e);else for(e=0;l>e;++e)u[e]=f;if(a=[],"function"==typeof p)for(e=0;s>e;++e)a[e]=+p.call(this,m[e],e);else for(e=0;s>e;++e)a[e]=p;return o.resume()},o.resume=function(){return o.alpha(.1)},o.stop=function(){return o.alpha(0)},o.drag=function(){return n||(n=Za.behavior.drag().origin(Ce).on("dragstart.force",Gi).on("drag.force",e).on("dragend.force",Wi)),arguments.length?void this.on("mouseover.force",Zi).on("mouseout.force",Xi).call(n):n},Za.rebind(o,s,"on")};var cc=20,lc=1,hc=1/0;Za.layout.hierarchy=function(){function t(i){var u,a=[i],o=[];for(i.depth=0;null!=(u=a.pop());)if(o.push(u),(c=n.call(t,u,u.depth))&&(s=c.length)){for(var s,c,l;--s>=0;)a.push(l=c[s]),l.parent=u,l.depth=u.depth+1;r&&(u.value=0),u.children=c}else r&&(u.value=+r.call(t,u,u.depth)||0),delete u.children;return tu(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)}),o}var e=ru,n=eu,r=nu;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(Qi(e,function(t){t.children&&(t.value=0)}),tu(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},Za.layout.partition=function(){function t(e,n,r,i){var u=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,u&&(a=u.length)){var a,o,s,c=-1;for(r=e.value?r/e.value:0;++cd;++d)for(i.call(t,c[0][d],g=y[d],l[0][d][1]),p=1;f>p;++p)i.call(t,c[p][d],g+=l[p-1][d][1],l[p][d][1]);return o}var e=Ce,n=su,r=cu,i=ou,u=uu,a=au;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:pc.get(e)||su,t):n},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:dc.get(e)||cu,t):r},t.x=function(e){return arguments.length?(u=e,t):u},t.y=function(e){return arguments.length?(a=e,t):a},t.out=function(e){return arguments.length?(i=e,t):i},t};var pc=Za.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(lu),u=t.map(hu),a=Za.range(r).sort(function(t,e){return i[t]-i[e]}),o=0,s=0,c=[],l=[];for(e=0;r>e;++e)n=a[e],s>o?(o+=u[n],c.push(n)):(s+=u[n],l.push(n));return l.reverse().concat(c)},reverse:function(t){return Za.range(t.length).reverse()},"default":su}),dc=Za.map({silhouette:function(t){var e,n,r,i=t.length,u=t[0].length,a=[],o=0,s=[];for(n=0;u>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>o&&(o=r),a.push(r)}for(n=0;u>n;++n)s[n]=(o-a[n])/2;return s},wiggle:function(t){var e,n,r,i,u,a,o,s,c,l=t.length,h=t[0],f=h.length,p=[];for(p[0]=s=c=0,n=1;f>n;++n){for(e=0,i=0;l>e;++e)i+=t[e][n][1];for(e=0,u=0,o=h[n][0]-h[n-1][0];l>e;++e){for(r=0,a=(t[e][n][1]-t[e][n-1][1])/(2*o);e>r;++r)a+=(t[r][n][1]-t[r][n-1][1])/o;u+=a*t[e][n][1]}p[n]=s-=i?u/i*o:0,c>s&&(c=s)}for(n=0;f>n;++n)p[n]-=c;return p},expand:function(t){var e,n,r,i=t.length,u=t[0].length,a=1/i,o=[];for(n=0;u>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=a}for(n=0;u>n;++n)o[n]=0;return o},zero:cu});Za.layout.histogram=function(){function t(t,u){for(var a,o,s=[],c=t.map(n,this),l=r.call(this,c,u),h=i.call(this,l,c,u),u=-1,f=c.length,p=h.length-1,d=e?1:1/f;++u0)for(u=-1;++u=l[0]&&o<=l[1]&&(a=s[Za.bisect(h,o,1,p)-1],a.y+=d,a.push(t[u]));return s}var e=!0,n=Number,r=gu,i=pu;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=De(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return du(t,e)}:De(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},Za.layout.pack=function(){function t(t,u){var a=n.call(this,t,u),o=a[0],s=i[0],c=i[1],l=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(o.x=o.y=0,tu(o,function(t){t.r=+l(t.value)}),tu(o,xu),r){var h=r*(e?1:Math.max(2*o.r/s,2*o.r/c))/2;tu(o,function(t){t.r+=h}),tu(o,xu),tu(o,function(t){t.r-=h})}return Au(o,s/2,c/2,e?1:1/Math.max(2*o.r/s,2*o.r/c)),a}var e,n=Za.layout.hierarchy().sort(yu),r=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},Ji(t,n)},Za.layout.tree=function(){function t(t,i){var l=a.call(this,t,i),h=l[0],f=e(h);if(tu(f,n),f.parent.m=-f.z,Qi(f,r),c)Qi(h,u);else{var p=h,d=h,g=h;Qi(h,function(t){t.xd.x&&(d=t),t.depth>g.depth&&(g=t)});var y=o(p,d)/2-p.x,m=s[0]/(d.x+o(d,p)/2+y),v=s[1]/(g.depth||1);Qi(h,function(t){t.x=(t.x+y)*m,t.y=t.depth*v})}return l}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,u=e.children,a=0,o=u.length;o>a;++a)r.push((u[a]=i={_:u[a],parent:e,children:(i=u[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){Su(t);var u=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+o(t._,r._),t.m=t.z-u):t.z=u}else r&&(t.z=r.z+o(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,u=t,a=e,s=i.parent.children[0],c=i.m,l=u.m,h=a.m,f=s.m;a=Cu(a),i=Du(i),a&&i;)s=Du(s),u=Cu(u),u.a=t,r=a.z+h-i.z-c+o(a._,i._),r>0&&(Mu(Fu(a,t,n),t,r),c+=r,l+=r),h+=a.m,c+=i.m,f+=s.m,l+=u.m;a&&!Cu(u)&&(u.t=a,u.m+=h-l),i&&!Du(s)&&(s.t=i,s.m+=c-f,n=t)}return n}function u(t){t.x*=s[0],t.y=t.depth*s[1]}var a=Za.layout.hierarchy().sort(null).value(null),o=ku,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(o=e,t):o},t.size=function(e){return arguments.length?(c=null==(s=e)?u:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:u,t):c?s:null},Ji(t,a)},Za.layout.cluster=function(){function t(t,u){var a,o=e.call(this,t,u),s=o[0],c=0;tu(s,function(t){var e=t.children;e&&e.length?(t.x=Lu(e),t.y=Tu(e)):(t.x=a?c+=n(t,a):0,t.y=0,a=t)});var l=Bu(s),h=Nu(s),f=l.x-n(l,h)/2,p=h.x+n(h,l)/2;return tu(s,i?function(t){t.x=(t.x-s.x)*r[0],t.y=(s.y-t.y)*r[1]}:function(t){t.x=(t.x-f)/(p-f)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),o}var e=Za.layout.hierarchy().sort(null).value(null),n=ku,r=[1,1],i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=null==(r=e),t):i?null:r},t.nodeSize=function(e){return arguments.length?(i=null!=(r=e),t):i?r:null},Ji(t,e)},Za.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,u=t.length;++ie?0:e),n.area=isNaN(r)||0>=r?0:r}function e(n){var u=n.children;if(u&&u.length){var a,o,s,c=h(n),l=[],f=u.slice(),d=1/0,g="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&n.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(f,c.dx*c.dy/n.value),l.area=0;(s=f.length)>0;)l.push(a=f[s-1]),l.area+=a.area,"squarify"!==p||(o=r(l,g))<=d?(f.pop(),d=o):(l.area-=l.pop().area,i(l,g,c,!1),g=Math.min(c.dx,c.dy),l.length=l.area=0,d=1/0);l.length&&(i(l,g,c,!0),l.length=l.area=0),u.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var u,a=h(e),o=r.slice(),s=[];for(t(o,a.dx*a.dy/e.value),s.area=0;u=o.pop();)s.push(u),s.area+=u.area,null!=u.z&&(i(s,u.z?a.dx:a.dy,a,!o.length),s.length=s.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,u=1/0,a=-1,o=t.length;++an&&(u=n),n>i&&(i=n));return r*=r,e*=e,r?Math.max(e*i*d/r,r/(e*u*d)):1/0}function i(t,e,n,r){var i,u=-1,a=t.length,o=n.x,c=n.y,l=e?s(t.area/e):0;if(e==n.dx){for((r||l>n.dy)&&(l=n.dy);++un.dx)&&(l=n.dx);++un&&(e=1),1>n&&(t=0),function(){var n,r,i;do n=2*Math.random()-1,r=2*Math.random()-1,i=n*n+r*r;while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=Za.random.normal.apply(Za,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=Za.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}},Za.scale={};var gc={floor:Ce,ceil:Ce};Za.scale.linear=function(){return zu([0,1],[0,1],vi,!1)};var yc={s:1,g:1,p:1,r:1,e:1};Za.scale.log=function(){return Ku(Za.scale.linear().domain([0,1]),10,!0,[1,10])};var mc=Za.format(".0e"),vc={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};Za.scale.pow=function(){return Ju(Za.scale.linear(),1,[0,1])},Za.scale.sqrt=function(){return Za.scale.pow().exponent(.5)},Za.scale.ordinal=function(){return ta([],{t:"range",a:[[]]})},Za.scale.category10=function(){return Za.scale.ordinal().range(bc)},Za.scale.category20=function(){return Za.scale.ordinal().range(xc)},Za.scale.category20b=function(){return Za.scale.ordinal().range(_c)},Za.scale.category20c=function(){return Za.scale.ordinal().range(wc)};var bc=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(be),xc=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(be),_c=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(be),wc=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(be); +Za.scale.quantile=function(){return ea([],[])},Za.scale.quantize=function(){return na(0,1,[0,1])},Za.scale.threshold=function(){return ra([.5],[0,1])},Za.scale.identity=function(){return ia([0,1])},Za.svg={},Za.svg.arc=function(){function t(){var t=e.apply(this,arguments),u=n.apply(this,arguments),a=r.apply(this,arguments)+Ac,o=i.apply(this,arguments)+Ac,s=(a>o&&(s=a,a=o,o=s),o-a),c=Mo>s?"0":"1",l=Math.cos(a),h=Math.sin(a),f=Math.cos(o),p=Math.sin(o);return s>=Ec?t?"M0,"+u+"A"+u+","+u+" 0 1,1 0,"+-u+"A"+u+","+u+" 0 1,1 0,"+u+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+u+"A"+u+","+u+" 0 1,1 0,"+-u+"A"+u+","+u+" 0 1,1 0,"+u+"Z":t?"M"+u*l+","+u*h+"A"+u+","+u+" 0 "+c+",1 "+u*f+","+u*p+"L"+t*f+","+t*p+"A"+t+","+t+" 0 "+c+",0 "+t*l+","+t*h+"Z":"M"+u*l+","+u*h+"A"+u+","+u+" 0 "+c+",1 "+u*f+","+u*p+"L0,0Z"}var e=ua,n=aa,r=oa,i=sa;return t.innerRadius=function(n){return arguments.length?(e=De(n),t):e},t.outerRadius=function(e){return arguments.length?(n=De(e),t):n},t.startAngle=function(e){return arguments.length?(r=De(e),t):r},t.endAngle=function(e){return arguments.length?(i=De(e),t):i},t.centroid=function(){var t=(e.apply(this,arguments)+n.apply(this,arguments))/2,u=(r.apply(this,arguments)+i.apply(this,arguments))/2+Ac;return[Math.cos(u)*t,Math.sin(u)*t]},t};var Ac=-Fo,Ec=So-To;Za.svg.line=function(){return ca(Ce)};var kc=Za.map({linear:la,"linear-closed":ha,step:fa,"step-before":pa,"step-after":da,basis:xa,"basis-open":_a,"basis-closed":wa,bundle:Aa,cardinal:ma,"cardinal-open":ga,"cardinal-closed":ya,monotone:Sa});kc.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Dc=[0,2/3,1/3,0],Cc=[0,1/3,2/3,0],Mc=[0,1/6,2/3,1/6];Za.svg.line.radial=function(){var t=ca(Fa);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},pa.reverse=da,da.reverse=pa,Za.svg.area=function(){return Ta(Ce)},Za.svg.area.radial=function(){var t=Ta(Fa);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},Za.svg.chord=function(){function t(t,o){var s=e(this,u,t,o),c=e(this,a,t,o);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(n(s,c)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,s.r,s.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),u=o.call(t,i,r),a=s.call(t,i,r)+Ac,l=c.call(t,i,r)+Ac;return{r:u,a0:a,a1:l,p0:[u*Math.cos(a),u*Math.sin(a)],p1:[u*Math.cos(l),u*Math.sin(l)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Mo)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var u=br,a=xr,o=La,s=oa,c=sa;return t.radius=function(e){return arguments.length?(o=De(e),t):o},t.source=function(e){return arguments.length?(u=De(e),t):u},t.target=function(e){return arguments.length?(a=De(e),t):a},t.startAngle=function(e){return arguments.length?(s=De(e),t):s},t.endAngle=function(e){return arguments.length?(c=De(e),t):c},t},Za.svg.diagonal=function(){function t(t,i){var u=e.call(this,t,i),a=n.call(this,t,i),o=(u.y+a.y)/2,s=[u,{x:u.x,y:o},{x:a.x,y:o},a];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=br,n=xr,r=Ba;return t.source=function(n){return arguments.length?(e=De(n),t):e},t.target=function(e){return arguments.length?(n=De(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},Za.svg.diagonal.radial=function(){var t=Za.svg.diagonal(),e=Ba,n=t.projection;return t.projection=function(t){return arguments.length?n(Na(e=t)):e},t},Za.svg.symbol=function(){function t(t,r){return(Sc.get(e.call(this,t,r))||Oa)(n.call(this,t,r))}var e=Ra,n=qa;return t.type=function(n){return arguments.length?(e=De(n),t):e},t.size=function(e){return arguments.length?(n=De(e),t):n},t};var Sc=Za.map({circle:Oa,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Bc)),n=e*Bc;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Lc),n=e*Lc/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Lc),n=e*Lc/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});Za.svg.symbolTypes=Sc.keys();var Fc,Tc,Lc=Math.sqrt(3),Bc=Math.tan(30*Bo),Nc=[],qc=0;Nc.call=xo.call,Nc.empty=xo.empty,Nc.node=xo.node,Nc.size=xo.size,Za.transition=function(t){return arguments.length?Fc?t.transition():t:Ao.transition()},Za.transition.prototype=Nc,Nc.select=function(t){var e,n,r,i=this.id,u=[];t=D(t);for(var a=-1,o=this.length;++au;u++){i.push(e=[]);for(var n=this[u],o=0,s=n.length;s>o;o++)(r=n[o])&&t.call(r,r.__data__,o,u)&&e.push(r)}return Ia(i,this.id)},Nc.tween=function(t,e){var n=this.id;return arguments.length<2?this.node().__transition__[n].tween.get(t):j(this,null==e?function(e){e.__transition__[n].tween.remove(t)}:function(r){r.__transition__[n].tween.set(t,e)})},Nc.attr=function(t,e){function n(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(o);return n!==t&&(e=a(n,t),function(t){this.setAttribute(o,e(t))})})}function u(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(o.space,o.local);return n!==t&&(e=a(n,t),function(t){this.setAttributeNS(o.space,o.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var a="transform"==t?Ui:vi,o=Za.ns.qualify(t);return Pa(this,"attr."+t,e,o.local?u:i)},Nc.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=Za.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)},Nc.style=function(t,e,n){function r(){this.style.removeProperty(t)}function i(e){return null==e?r:(e+="",function(){var r,i=to.getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(r=vi(i,e),function(e){this.style.setProperty(t,r(e),n)})})}var u=arguments.length;if(3>u){if("string"!=typeof t){2>u&&(e="");for(n in t)this.style(n,t[n],e);return this}n=""}return Pa(this,"style."+t,e,i)},Nc.styleTween=function(t,e,n){function r(r,i){var u=e.call(this,r,i,to.getComputedStyle(this,null).getPropertyValue(t));return u&&function(e){this.style.setProperty(t,u(e),n)}}return arguments.length<3&&(n=""),this.tween("style."+t,r)},Nc.text=function(t){return Pa(this,"text",t,ja)},Nc.remove=function(){return this.each("end.transition",function(){var t;this.__transition__.count<2&&(t=this.parentNode)&&t.removeChild(this)})},Nc.ease=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].ease:("function"!=typeof t&&(t=Za.ease.apply(Za,arguments)),j(this,function(n){n.__transition__[e].ease=t}))},Nc.delay=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].delay:j(this,"function"==typeof t?function(n,r,i){n.__transition__[e].delay=+t.call(n,n.__data__,r,i)}:(t=+t,function(n){n.__transition__[e].delay=t}))},Nc.duration=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].duration:j(this,"function"==typeof t?function(n,r,i){n.__transition__[e].duration=Math.max(1,t.call(n,n.__data__,r,i))}:(t=Math.max(1,t),function(n){n.__transition__[e].duration=t}))},Nc.each=function(t,e){var n=this.id;if(arguments.length<2){var r=Tc,i=Fc;Fc=n,j(this,function(e,r,i){Tc=e.__transition__[n],t.call(e,e.__data__,r,i)}),Tc=r,Fc=i}else j(this,function(r){var i=r.__transition__[n];(i.event||(i.event=Za.dispatch("start","end"))).on(t,e)});return this},Nc.transition=function(){for(var t,e,n,r,i=this.id,u=++qc,a=[],o=0,s=this.length;s>o;o++){a.push(t=[]);for(var e=this[o],c=0,l=e.length;l>c;c++)(n=e[c])&&(r=Object.create(n.__transition__[i]),r.delay+=r.duration,Ua(n,c,u,r)),t.push(n)}return Ia(a,u)},Za.svg.axis=function(){function t(t){t.each(function(){var t,c=Za.select(this),l=this.__chart__||n,h=this.__chart__=n.copy(),f=null==s?h.ticks?h.ticks.apply(h,o):h.domain():s,p=null==e?h.tickFormat?h.tickFormat.apply(h,o):Ce:e,d=c.selectAll(".tick").data(f,h),g=d.enter().insert("g",".domain").attr("class","tick").style("opacity",To),y=Za.transition(d.exit()).style("opacity",To).remove(),m=Za.transition(d.order()).style("opacity",1),v=Math.max(i,0)+a,b=Iu(h),x=c.selectAll(".domain").data([0]),_=(x.enter().append("path").attr("class","domain"),Za.transition(x));g.append("line"),g.append("text");var w,A,E,k,D=g.select("line"),C=m.select("line"),M=d.select("text").text(p),S=g.select("text"),F=m.select("text"),T="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=Va,w="x",E="y",A="x2",k="y2",M.attr("dy",0>T?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+b[0]+","+T*u+"V0H"+b[1]+"V"+T*u)):(t=za,w="y",E="x",A="y2",k="x2",M.attr("dy",".32em").style("text-anchor",0>T?"end":"start"),_.attr("d","M"+T*u+","+b[0]+"H0V"+b[1]+"H"+T*u)),D.attr(k,T*i),S.attr(E,T*v),C.attr(A,0).attr(k,T*i),F.attr(w,0).attr(E,T*v),h.rangeBand){var L=h,B=L.rangeBand()/2;l=h=function(t){return L(t)+B}}else l.rangeBand?l=h:y.call(t,h,l);g.call(t,l,h),m.call(t,h,h)})}var e,n=Za.scale.linear(),r=Rc,i=6,u=6,a=3,o=[10],s=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(r=e in Oc?e+"":Rc,t):r},t.ticks=function(){return arguments.length?(o=arguments,t):o},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(i=+e,u=+arguments[n-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(u=+e,t):u},t.tickPadding=function(e){return arguments.length?(a=+e,t):a},t.tickSubdivide=function(){return arguments.length&&t},t};var Rc="bottom",Oc={top:1,right:1,bottom:1,left:1};Za.svg.brush=function(){function t(u){u.each(function(){var u=Za.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),a=u.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),u.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=u.selectAll(".resize").data(d,Ce);o.exit().remove(),o.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ic[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",t.empty()?"none":null);var l,h=Za.transition(u),f=Za.transition(a);s&&(l=Iu(s),f.attr("x",l[0]).attr("width",l[1]-l[0]),n(h)),c&&(l=Iu(c),f.attr("y",l[0]).attr("height",l[1]-l[0]),r(h)),e(h)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+l[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function n(t){t.select(".extent").attr("x",l[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function r(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==Za.event.keyCode&&(M||(v=null,F[0]-=l[1],F[1]-=h[1],M=2),w())}function d(){32==Za.event.keyCode&&2==M&&(F[0]+=l[1],F[1]+=h[1],M=0,w())}function g(){var t=Za.mouse(x),i=!1;b&&(t[0]+=b[0],t[1]+=b[1]),M||(Za.event.altKey?(v||(v=[(l[0]+l[1])/2,(h[0]+h[1])/2]),F[0]=l[+(t[0]d?(i=r,r=d):i=d),g[0]!=r||g[1]!=i?(n?a=null:u=null,g[0]=r,g[1]=i,!0):void 0}function m(){g(),E.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),Za.select("body").style("cursor",null),T.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),S(),A({type:"brushend"})}var v,b,x=this,_=Za.select(Za.event.target),A=o.of(x,arguments),E=Za.select(x),k=_.datum(),D=!/^(n|s)$/.test(k)&&s,C=!/^(e|w)$/.test(k)&&c,M=_.classed("extent"),S=G(),F=Za.mouse(x),T=Za.select(to).on("keydown.brush",i).on("keyup.brush",d);if(Za.event.changedTouches?T.on("touchmove.brush",g).on("touchend.brush",m):T.on("mousemove.brush",g).on("mouseup.brush",m),E.interrupt().selectAll("*").interrupt(),M)F[0]=l[0]-F[0],F[1]=h[0]-F[1];else if(k){var L=+/w$/.test(k),B=+/^n/.test(k);b=[l[1-L]-F[0],h[1-B]-F[1]],F[0]=l[L],F[1]=h[B]}else Za.event.altKey&&(v=F.slice());E.style("pointer-events","none").selectAll(".resize").style("display",null),Za.select("body").style("cursor",_.style("cursor")),A({type:"brushstart"}),g()}var u,a,o=E(t,"brushstart","brush","brushend"),s=null,c=null,l=[0,0],h=[0,0],f=!0,p=!0,d=Pc[0];return t.event=function(t){t.each(function(){var t=o.of(this,arguments),e={x:l,y:h,i:u,j:a},n=this.__chart__||e;this.__chart__=e,Fc?Za.select(this).transition().each("start.brush",function(){u=n.i,a=n.j,l=n.x,h=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=bi(l,e.x),r=bi(h,e.y);return u=a=null,function(i){l=e.x=n(i),h=e.y=r(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){u=e.i,a=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(s=e,d=Pc[!s<<1|!c],t):s},t.y=function(e){return arguments.length?(c=e,d=Pc[!s<<1|!c],t):c},t.clamp=function(e){return arguments.length?(s&&c?(f=!!e[0],p=!!e[1]):s?f=!!e:c&&(p=!!e),t):s&&c?[f,p]:s?f:c?p:null},t.extent=function(e){var n,r,i,o,f;return arguments.length?(s&&(n=e[0],r=e[1],c&&(n=n[0],r=r[0]),u=[n,r],s.invert&&(n=s(n),r=s(r)),n>r&&(f=n,n=r,r=f),(n!=l[0]||r!=l[1])&&(l=[n,r])),c&&(i=e[0],o=e[1],s&&(i=i[1],o=o[1]),a=[i,o],c.invert&&(i=c(i),o=c(o)),i>o&&(f=i,i=o,o=f),(i!=h[0]||o!=h[1])&&(h=[i,o])),t):(s&&(u?(n=u[0],r=u[1]):(n=l[0],r=l[1],s.invert&&(n=s.invert(n),r=s.invert(r)),n>r&&(f=n,n=r,r=f))),c&&(a?(i=a[0],o=a[1]):(i=h[0],o=h[1],c.invert&&(i=c.invert(i),o=c.invert(o)),i>o&&(f=i,i=o,o=f))),s&&c?[[n,i],[r,o]]:s?[n,r]:c&&[i,o])},t.clear=function(){return t.empty()||(l=[0,0],h=[0,0],u=a=null),t},t.empty=function(){return!!s&&l[0]==l[1]||!!c&&h[0]==h[1]},Za.rebind(t,o,"on")};var Ic={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Pc=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],jc=us.format=hs.timeFormat,Uc=jc.utc,Vc=Uc("%Y-%m-%dT%H:%M:%S.%LZ");jc.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ha:Vc,Ha.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ha.toString=Vc.toString,us.second=je(function(t){return new as(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),us.seconds=us.second.range,us.seconds.utc=us.second.utc.range,us.minute=je(function(t){return new as(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),us.minutes=us.minute.range,us.minutes.utc=us.minute.utc.range,us.hour=je(function(t){var e=t.getTimezoneOffset()/60;return new as(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),us.hours=us.hour.range,us.hours.utc=us.hour.utc.range,us.month=je(function(t){return t=us.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),us.months=us.month.range,us.months.utc=us.month.utc.range;var zc=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Hc=[[us.second,1],[us.second,5],[us.second,15],[us.second,30],[us.minute,1],[us.minute,5],[us.minute,15],[us.minute,30],[us.hour,1],[us.hour,3],[us.hour,6],[us.hour,12],[us.day,1],[us.day,2],[us.week,1],[us.month,1],[us.month,3],[us.year,1]],$c=jc.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Sn]]),Yc={range:function(t,e,n){return Za.range(Math.ceil(t/n)*n,+e,n).map(Ya)},floor:Ce,ceil:Ce};Hc.year=us.year,us.scale=function(){return $a(Za.scale.linear(),Hc,$c)};var Gc=Hc.map(function(t){return[t[0].utc,t[1]]}),Wc=Uc.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Sn]]);Gc.year=us.year.utc,us.scale.utc=function(){return $a(Za.scale.linear(),Gc,Wc)},Za.text=Me(function(t){return t.responseText}),Za.json=function(t,e){return Se(t,"application/json",Ga,e)},Za.html=function(t,e){return Se(t,"text/html",Wa,e)},Za.xml=Me(function(t){return t.responseXML}),"function"==typeof define&&define.amd?define(Za):"object"==typeof e&&e.exports&&(e.exports=Za),this.d3=Za}()},{}],2:[function(t,e){e.exports={graphlib:t("./lib/graphlib"),dagre:t("./lib/dagre"),intersect:t("./lib/intersect"),render:t("./lib/render"),util:t("./lib/util"),version:t("./lib/version")}},{"./lib/dagre":9,"./lib/graphlib":10,"./lib/intersect":11,"./lib/render":24,"./lib/util":26,"./lib/version":27}],3:[function(t,e){function n(t,e,n,r){var u=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),a=u.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");i.applyStyle(a,n[r+"Style"])}function r(t,e,n,r){var u=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),a=u.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");i.applyStyle(a,n[r+"Style"])}var i=t("./util");e.exports={"default":n,normal:n,vee:r}},{"./util":26}],4:[function(t,e){function n(t,e){var n=e.nodes().filter(function(t){return r.isSubgraph(e,t)}),i=t.selectAll("g.cluster").data(n,function(t){return t});i.enter().append("g").attr("class","cluster").style("opacity",0).append("rect"),r.applyTransition(i.exit(),e).style("opacity",0).remove(),r.applyTransition(i,e).style("opacity",1),r.applyTransition(i.selectAll("rect"),e).attr("width",function(t){return e.node(t).width}).attr("height",function(t){return e.node(t).height}).attr("x",function(t){var n=e.node(t);return n.x-n.width/2}).attr("y",function(t){var n=e.node(t);return n.y-n.height/2})}var r=t("./util");e.exports=n},{"./util":26}],5:[function(t,e){"use strict";function n(t,e){var n=t.selectAll("g.edgeLabel").data(e.edges(),function(t){return u.edgeToId(t)}).classed("update",!0);return n.selectAll("*").remove(),n.enter().append("g").classed("edgeLabel",!0).style("opacity",0),n.each(function(t){var n=e.edge(t),u=i(a.select(this),e.edge(t),0,0).classed("label",!0),o=u.node().getBBox();n.labelId&&u.attr("id",n.labelId),r.has(n,"width")||(n.width=o.width),r.has(n,"height")||(n.height=o.height)}),u.applyTransition(n.exit(),e).style("opacity",0).remove(),n}var r=t("./lodash"),i=t("./label/add-label"),u=t("./util"),a=t("./d3");e.exports=n},{"./d3":8,"./label/add-label":19,"./lodash":21,"./util":26}],6:[function(t,e){"use strict";function n(t,e,n){var i=t.selectAll("g.edgePath").data(e.edges(),function(t){return l.edgeToId(t)}).classed("update",!0);return a(i,e),o(i,e),l.applyTransition(i,e).style("opacity",1),i.selectAll("path.path").each(function(t){var n=e.edge(t);n.arrowheadId=s.uniqueId("arrowhead");var i=h.select(this).attr("marker-end",function(){return"url(#"+n.arrowheadId+")"}).style("fill","none");l.applyTransition(i,e).attr("d",function(t){return r(e,t)}),n.id&&i.attr("id",n.id),l.applyStyle(i,n.style)}),i.selectAll("defs *").remove(),i.selectAll("defs").each(function(t){var r=e.edge(t),i=n[r.arrowhead];i(h.select(this),r.arrowheadId,r,"arrowhead")}),i}function r(t,e){var n=t.edge(e),r=t.node(e.v),u=t.node(e.w),a=n.points.slice(1,n.points.length-1);return a.unshift(c(r,a[0])),a.push(c(u,a[a.length-1])),i(n,a)}function i(t,e){var n=h.svg.line().x(function(t){return t.x}).y(function(t){return t.y});return s.has(t,"lineInterpolate")&&n.interpolate(t.lineInterpolate),s.has(t,"lineTension")&&n.tension(Number(t.lineTension)),n(e)}function u(t){var e=t.getBBox(),n=t.getTransformToElement(t.ownerSVGElement).translate(e.width/2,e.height/2);return{x:n.e,y:n.f}}function a(t,e){var n=t.enter().append("g").attr("class","edgePath").style("opacity",0);n.append("path").attr("class","path").attr("d",function(t){var n=e.edge(t),r=e.node(t.v).elem,a=s.range(n.points.length).map(function(){return u(r)});return i(n,a)}),n.append("defs")}function o(t,e){var n=t.exit();l.applyTransition(n,e).style("opacity",0).remove(),l.applyTransition(n.select("path.path"),e).attr("d",function(t){var n=e.node(t.v);if(n){var r=s.range(this.pathSegList.length).map(function(){return n});return i({},r)}return h.select(this).attr("d")})}var s=t("./lodash"),c=t("./intersect/intersect-node"),l=t("./util"),h=t("./d3");e.exports=n},{"./d3":8,"./intersect/intersect-node":15,"./lodash":21,"./util":26}],7:[function(t,e){"use strict";function n(t,e,n){var o=e.nodes().filter(function(t){return!u.isSubgraph(e,t)}),s=t.selectAll("g.node").data(o,function(t){return t}).classed("update",!0);return s.selectAll("*").remove(),s.enter().append("g").attr("class","node").style("opacity",0),s.each(function(t){var o=e.node(t),s=a.select(this),c=s.append("g").attr("class","label"),l=i(c,o),h=n[o.shape],f=l.node().getBBox();o.elem=this,o.id&&s.attr("id",o.id),o.labelId&&c.attr("id",o.labelId),u.applyClass(s,o.class,(s.classed("update")?"update ":"")+"node"),r.has(o,"width")&&(f.width=o.width),r.has(o,"height")&&(f.height=o.height),f.width+=o.paddingLeft+o.paddingRight,f.height+=o.paddingTop+o.paddingBottom,c.attr("transform","translate("+(o.paddingLeft-o.paddingRight)/2+","+(o.paddingTop-o.paddingBottom)/2+")");var p=h(a.select(this),f,o);u.applyStyle(p,o.style);var d=p.node().getBBox();o.width=d.width,o.height=d.height}),u.applyTransition(s.exit(),e).style("opacity",0).remove(),s}var r=t("./lodash"),i=t("./label/add-label"),u=t("./util"),a=t("./d3");e.exports=n},{"./d3":8,"./label/add-label":19,"./lodash":21,"./util":26}],8:[function(t,e){e.exports=window.d3},{}],9:[function(t,e){var n;if(t)try{n=t("dagre")}catch(r){}n||(n=window.dagre),e.exports=n},{dagre:28}],10:[function(t,e){var n;if(t)try{n=t("graphlib")}catch(r){}n||(n=window.graphlib),e.exports=n},{graphlib:78}],11:[function(t,e){e.exports={node:t("./intersect-node"),circle:t("./intersect-circle"),ellipse:t("./intersect-ellipse"),polygon:t("./intersect-polygon"),rect:t("./intersect-rect")}},{"./intersect-circle":12,"./intersect-ellipse":13,"./intersect-node":15,"./intersect-polygon":16,"./intersect-rect":17}],12:[function(t,e){function n(t,e,n){return r(t,e,e,n)}var r=t("./intersect-ellipse");e.exports=n},{"./intersect-ellipse":13}],13:[function(t,e){function n(t,e,n,r){var i=t.x,u=t.y,a=i-r.x,o=u-r.y,s=Math.sqrt(e*e*o*o+n*n*a*a),c=Math.abs(e*n*a/s);r.xm?(m-y)/g:(m+y)/g,m=a*c-u*l,b=0>m?(m-y)/g:(m+y)/g,{x:v,y:b})}function r(t,e){return t*e>0}e.exports=n},{}],15:[function(t,e){function n(t,e){return t.intersect(e)}e.exports=n},{}],16:[function(t,e){function n(t,e,n){var i=t.x,u=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;e.forEach(function(t){o=Math.min(o,t.x),s=Math.min(s,t.y)});for(var c=i-t.width/2-o,l=u-t.height/2-s,h=0;h1&&a.sort(function(t,e){var r=t.x-n.x,i=t.y-n.y,u=Math.sqrt(r*r+i*i),a=e.x-n.x,o=e.y-n.y,s=Math.sqrt(a*a+o*o);return s>u?-1:u===s?0:1}),a[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",t),t)}var r=t("./intersect-line");e.exports=n},{"./intersect-line":14}],17:[function(t,e){function n(t,e){var n,r,i=t.x,u=t.y,a=e.x-i,o=e.y-u,s=t.width/2,c=t.height/2;return Math.abs(o)*s>Math.abs(a)*c?(0>o&&(c=-c),n=0===o?0:c*a/o,r=c):(0>a&&(s=-s),n=s,r=0===a?0:s*o/a),{x:i+n,y:u+r}}e.exports=n},{}],18:[function(t,e){function n(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div"),u=e.label;switch(typeof u){case"function":i.insert(u);break;case"object":i.insert(function(){return u});break;default:i.html(u)}r.applyStyle(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var a,o;return i.each(function(){a=this.clientWidth,o=this.clientHeight}),n.attr("width",a).attr("height",o),n}var r=t("../util");e.exports=n},{"../util":26}],19:[function(t,e){function n(t,e){var n=e.label,u=t.append("g");"string"!=typeof n||"html"===e.labelType?i(u,e):r(u,e);var a=u.node().getBBox();return u.attr("transform","translate("+-a.width/2+","+-a.height/2+")"),u}var r=t("./add-text-label"),i=t("./add-html-label");e.exports=n},{"./add-html-label":18,"./add-text-label":20}],20:[function(t,e){function n(t,e){for(var n=t.append("text"),u=r(e.label).split("\n"),a=0;ao;++o)r(t,"borderLeft","_bl",n,a,o),r(t,"borderRight","_br",n,a,o)}}i.each(t.children(),e)}function r(t,e,n,r,i,a){var o={width:0,height:0,rank:a},s=i[e][a-1],c=u.addDummyNode(t,"border",o,n);i[e][a]=c,t.setParent(c,r),s&&t.setEdge(s,c,{weight:1})}var i=t("./lodash"),u=t("./util");e.exports=n},{"./lodash":37,"./util":56}],31:[function(t,e){"use strict";function n(t){var e=t.graph().rankdir.toLowerCase();("lr"===e||"rl"===e)&&i(t)}function r(t){var e=t.graph().rankdir.toLowerCase();("bt"===e||"rl"===e)&&a(t),("lr"===e||"rl"===e)&&(s(t),i(t))}function i(t){l.each(t.nodes(),function(e){u(t.node(e))}),l.each(t.edges(),function(e){u(t.edge(e))})}function u(t){var e=t.width;t.width=t.height,t.height=e}function a(t){l.each(t.nodes(),function(e){o(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,o),l.has(n,"y")&&o(n)})}function o(t){t.y=-t.y}function s(t){l.each(t.nodes(),function(e){c(t.node(e))}),l.each(t.edges(),function(e){var n=t.edge(e);l.each(n.points,c),l.has(n,"x")&&c(n)})}function c(t){var e=t.x;t.x=t.y,t.y=e}var l=t("./lodash");e.exports={adjust:n,undo:r}},{"./lodash":37}],32:[function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){return"_next"!==t&&"_prev"!==t?e:void 0}e.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;return e!==t?(r(e),e):void 0},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},{}],33:[function(t,e){function n(t){var e=i.buildLayerMatrix(t),n=new u({compound:!0,multigraph:!0}).setGraph({});return r.each(t.nodes(),function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)}),r.each(t.edges(),function(t){n.setEdge(t.v,t.w,{},t.name)}),r.each(e,function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,function(t,e){return n.setEdge(t,e,{style:"invis"}),e})}),n}var r=t("./lodash"),i=t("./util"),u=t("./graphlib").Graph;e.exports={debugOrdering:n}},{"./graphlib":34,"./lodash":37,"./util":56}],34:[function(t,e){e.exports=t(10)},{graphlib:58}],35:[function(t,e){function n(t,e){if(t.nodeCount()<=1)return[];var n=u(t,e||l),i=r(n.graph,n.buckets,n.zeroIdx);return o.flatten(o.map(i,function(e){return t.outEdges(e.v,e.w)}),!0)}function r(t,e,n){for(var r,u=[],a=e[e.length-1],o=e[0];t.nodeCount();){for(;r=o.dequeue();)i(t,e,n,r);for(;r=a.dequeue();)i(t,e,n,r);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(r=e[s].dequeue()){u=u.concat(i(t,e,n,r,!0));break}}return u}function i(t,e,n,r,i){var u=i?[]:void 0;return o.each(t.inEdges(r.v),function(r){var o=t.edge(r),s=t.node(r.v);i&&u.push({v:r.v,w:r.w}),s.out-=o,a(e,n,s)}),o.each(t.outEdges(r.v),function(r){var i=t.edge(r),u=r.w,o=t.node(u);o.in-=i,a(e,n,o)}),t.removeNode(r.v),u}function u(t,e){var n=new s,r=0,i=0;o.each(t.nodes(),function(t){n.setNode(t,{v:t,"in":0,out:0})}),o.each(t.edges(),function(t){var u=n.edge(t.v,t.w)||0,a=e(t),o=u+a;n.setEdge(t.v,t.w,o),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)});var u=o.range(i+r+3).map(function(){return new c}),l=r+1;return o.each(n.nodes(),function(t){a(u,l,n.node(t))}),{graph:n,buckets:u,zeroIdx:l}}function a(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var o=t("./lodash"),s=t("./graphlib").Graph,c=t("./data/list");e.exports=n;var l=o.constant(1)},{"./data/list":32,"./graphlib":34,"./lodash":37}],36:[function(t,e){"use strict";function n(t,e){var n=e&&e.debugTiming?L.time:L.notime;n("layout",function(){var e=n(" buildLayoutGraph",function(){return u(t)});n(" runLayout",function(){r(e,n)}),n(" updateInputGraph",function(){i(t,e)})})}function r(t,e){e(" makeSpaceForEdgeLabels",function(){a(t)}),e(" removeSelfEdges",function(){g(t)}),e(" acyclic",function(){_.run(t)}),e(" nestingGraph.run",function(){C.run(t)}),e(" rank",function(){A(L.asNonCompoundGraph(t))}),e(" injectEdgeLabelProxies",function(){o(t)}),e(" removeEmptyRanks",function(){D(t)}),e(" nestingGraph.cleanup",function(){C.cleanup(t)}),e(" normalizeRanks",function(){E(t)}),e(" assignRankMinMax",function(){s(t)}),e(" removeEdgeLabelProxies",function(){c(t)}),e(" normalize.run",function(){w.run(t)}),e(" parentDummyChains",function(){k(t)}),e(" addBorderSegments",function(){M(t)}),e(" order",function(){F(t)}),e(" insertSelfEdges",function(){y(t)}),e(" adjustCoordinateSystem",function(){S.adjust(t)}),e(" position",function(){T(t)}),e(" positionSelfEdges",function(){m(t)}),e(" removeBorderNodes",function(){d(t)}),e(" normalize.undo",function(){w.undo(t)}),e(" fixupEdgeLabelCoords",function(){f(t)}),e(" undoCoordinateSystem",function(){S.undo(t)}),e(" translateGraph",function(){l(t)}),e(" assignNodeIntersects",function(){h(t)}),e(" reversePoints",function(){p(t)}),e(" acyclic.undo",function(){_.undo(t)})}function i(t,e){x.each(t.nodes(),function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))}),x.each(t.edges(),function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,x.has(i,"x")&&(r.x=i.x,r.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}function u(t){var e=new B({multigraph:!0,compound:!0}),n=b(t.graph());return e.setGraph(x.merge({},q,v(n,N),x.pick(n,R))),x.each(t.nodes(),function(n){var r=b(t.node(n));e.setNode(n,x.defaults(v(r,O),I)),e.setParent(n,t.parent(n))}),x.each(t.edges(),function(n){var r=b(t.edge(n));e.setEdge(n,x.merge({},j,v(r,P),x.pick(r,U)))}),e}function a(t){var e=t.graph();e.ranksep/=2,x.each(t.edges(),function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function o(t){x.each(t.edges(),function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i=t.node(e.w),u={rank:(i.rank-r.rank)/2+r.rank,e:e};L.addDummyNode(t,"edge-proxy",u,"_ep")}})}function s(t){var e=0;x.each(t.nodes(),function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=x.max(e,r.maxRank))}),t.graph().maxRank=e}function c(t){x.each(t.nodes(),function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}function l(t){function e(t){var e=t.x,a=t.y,o=t.width,s=t.height;n=Math.min(n,e-o/2),r=Math.max(r,e+o/2),i=Math.min(i,a-s/2),u=Math.max(u,a+s/2)}var n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,u=0,a=t.graph(),o=a.marginx||0,s=a.marginy||0;x.each(t.nodes(),function(n){e(t.node(n))}),x.each(t.edges(),function(n){var r=t.edge(n);x.has(r,"x")&&e(r)}),n-=o,i-=s,x.each(t.nodes(),function(e){var r=t.node(e);r.x-=n,r.y-=i}),x.each(t.edges(),function(e){var r=t.edge(e);x.each(r.points,function(t){t.x-=n,t.y-=i}),x.has(r,"x")&&(r.x-=n),x.has(r,"y")&&(r.y-=i)}),a.width=r-n+o,a.height=u-i+s}function h(t){x.each(t.edges(),function(e){var n,r,i=t.edge(e),u=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=u),i.points.unshift(L.intersectRect(u,n)),i.points.push(L.intersectRect(a,r))})}function f(t){x.each(t.edges(),function(e){var n=t.edge(e);if(x.has(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function p(t){x.each(t.edges(),function(e){var n=t.edge(e);n.reversed&&n.points.reverse()})}function d(t){x.each(t.nodes(),function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),u=t.node(x.last(n.borderLeft)),a=t.node(x.last(n.borderRight));n.width=Math.abs(a.x-u.x),n.height=Math.abs(i.y-r.y),n.x=u.x+n.width/2,n.y=r.y+n.height/2}}),x.each(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function g(t){x.each(t.edges(),function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function y(t){var e=L.buildLayerMatrix(t);x.each(e,function(e){var n=0;x.each(e,function(e,r){var i=t.node(e);i.order=r+n,x.each(i.selfEdges,function(e){L.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}function m(t){x.each(t.nodes(),function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,u=r.y,a=n.x-i,o=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:u-o},{x:i+5*a/6,y:u-o},{x:i+a,y:u},{x:i+5*a/6,y:u+o},{x:i+2*a/3,y:u+o}],n.label.x=n.x,n.label.y=n.y}})}function v(t,e){return x.mapValues(x.pick(t,e),Number)}function b(t){var e={};return x.each(t,function(t,n){e[n.toLowerCase()]=t}),e}var x=t("./lodash"),_=t("./acyclic"),w=t("./normalize"),A=t("./rank"),E=t("./util").normalizeRanks,k=t("./parent-dummy-chains"),D=t("./util").removeEmptyRanks,C=t("./nesting-graph"),M=t("./add-border-segments"),S=t("./coordinate-system"),F=t("./order"),T=t("./position"),L=t("./util"),B=t("./graphlib").Graph;e.exports=n;var N=["nodesep","edgesep","ranksep","marginx","marginy"],q={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},R=["acyclicer","ranker","rankdir","align"],O=["width","height"],I={width:0,height:0},P=["minlen","weight","width","height","labeloffset"],j={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"]},{"./acyclic":29,"./add-border-segments":30,"./coordinate-system":31,"./graphlib":34,"./lodash":37,"./nesting-graph":38,"./normalize":39,"./order":44,"./parent-dummy-chains":49,"./position":51,"./rank":53,"./util":56}],37:[function(t,e){e.exports=t(21)},{lodash:102}],38:[function(t,e){function n(t){var e=s.addDummyNode(t,"root",{},"_root"),n=i(t),a=o.max(n)-1,c=2*a+1;t.graph().nestingRoot=e,o.each(t.edges(),function(e){t.edge(e).minlen*=c});var l=u(t)+1;o.each(t.children(),function(i){r(t,e,c,l,a,n,i)}),t.graph().nodeRankFactor=c}function r(t,e,n,i,u,a,c){var l=t.children(c);if(!l.length)return void(c!==e&&t.setEdge(e,c,{weight:0,minlen:n}));var h=s.addBorderNode(t,"_bt"),f=s.addBorderNode(t,"_bb"),p=t.node(c);t.setParent(h,c),p.borderTop=h,t.setParent(f,c),p.borderBottom=f,o.each(l,function(o){r(t,e,n,i,u,a,o);var s=t.node(o),l=s.borderTop?s.borderTop:o,p=s.borderBottom?s.borderBottom:o,d=s.borderTop?i:2*i,g=l!==p?1:u-a[c]+1;t.setEdge(h,l,{weight:d,minlen:g,nestingEdge:!0}),t.setEdge(p,f,{weight:d,minlen:g,nestingEdge:!0})}),t.parent(c)||t.setEdge(e,h,{weight:0,minlen:u+a[c]})}function i(t){function e(r,i){var u=t.children(r);u&&u.length&&o.each(u,function(t){e(t,i+1)}),n[r]=i}var n={};return o.each(t.children(),function(t){e(t,1)}),n}function u(t){return o.reduce(t.edges(),function(e,n){return e+t.edge(n).weight},0)}function a(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,o.each(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}var o=t("./lodash"),s=t("./util");e.exports={run:n,cleanup:a}},{"./lodash":37,"./util":56}],39:[function(t,e){"use strict";function n(t){t.graph().dummyChains=[],u.each(t.edges(),function(e){r(t,e)})}function r(t,e){var n=e.v,r=t.node(n).rank,i=e.w,u=t.node(i).rank,o=e.name,s=t.edge(e),c=s.labelRank;if(u!==r+1){t.removeEdge(e);var l,h,f;for(f=0,++r;u>r;++f,++r)s.points=[],h={width:0,height:0,edgeLabel:s,edgeObj:e,rank:r},l=a.addDummyNode(t,"edge",h,"_d"),r===c&&(h.width=s.width,h.height=s.height,h.dummy="edge-label",h.labelpos=s.labelpos),t.setEdge(n,l,{weight:s.weight},o),0===f&&t.graph().dummyChains.push(l),n=l;t.setEdge(n,i,{weight:s.weight},o)}}function i(t){u.each(t.graph().dummyChains,function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)})}var u=t("./lodash"),a=t("./util");e.exports={run:n,undo:i}},{"./lodash":37,"./util":56}],40:[function(t,e){function n(t,e,n){var i,u={};r.each(n,function(n){for(var r,a,o=t.parent(n);o;){if(r=t.parent(o),r?(a=u[r],u[r]=o):(a=i,i=o),a&&a!==o)return void e.setEdge(a,o);o=r}})}var r=t("../lodash");e.exports=n},{"../lodash":37}],41:[function(t,e){function n(t,e){return r.map(e,function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})}var r=t("../lodash");e.exports=n},{"../lodash":37}],42:[function(t,e){function n(t,e,n){var a=r(t),o=new u({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(e){return t.node(e)});return i.each(t.nodes(),function(r){var u=t.node(r),s=t.parent(r);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(o.setNode(r),o.setParent(r,s||a),i.each(t[n](r),function(e){var n=e.v===r?e.w:e.v,u=o.edge(n,r),a=i.isUndefined(u)?0:u.weight;o.setEdge(n,r,{weight:t.edge(e).weight+a})}),i.has(u,"minRank")&&o.setNode(r,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))}),o}function r(t){for(var e;t.hasNode(e=i.uniqueId("_root")););return e}var i=t("../lodash"),u=t("../graphlib").Graph;e.exports=n},{"../graphlib":34,"../lodash":37}],43:[function(t,e){"use strict";function n(t,e){for(var n=0,i=1;i0;)e%2&&(n+=s[e+1]),e=e-1>>1,s[e]+=t.weight;c+=t.weight*n})),c}var i=t("../lodash");e.exports=n},{"../lodash":37}],44:[function(t,e){"use strict";function n(t){var e=p.maxRank(t),n=r(t,a.range(1,e+1),"inEdges"),c=r(t,a.range(e-1,-1,-1),"outEdges"),l=o(t);u(t,l);for(var h,f=Number.POSITIVE_INFINITY,d=0,g=0;4>g;++d,++g){i(d%2?n:c,d%4>=2),l=p.buildLayerMatrix(t);var y=s(t,l);f>y&&(g=0,h=a.cloneDeep(l),f=y)}u(t,h)}function r(t,e,n){return a.map(e,function(e){return l(t,e,n)})}function i(t,e){var n=new f;a.each(t,function(t){var r=t.graph().root,i=c(t,r,n,e);a.each(i.vs,function(e,n){t.node(e).order=n}),h(t,n,i.vs)})}function u(t,e){a.each(e,function(e){a.each(e,function(e,n){t.node(e).order=n})})}var a=t("../lodash"),o=t("./init-order"),s=t("./cross-count"),c=t("./sort-subgraph"),l=t("./build-layer-graph"),h=t("./add-subgraph-constraints"),f=t("../graphlib").Graph,p=t("../util");e.exports=n},{"../graphlib":34,"../lodash":37,"../util":56,"./add-subgraph-constraints":40,"./build-layer-graph":42,"./cross-count":43,"./init-order":45,"./sort-subgraph":47}],45:[function(t,e){"use strict";function n(t){function e(i){if(!r.has(n,i)){n[i]=!0;var u=t.node(i);a[u.rank].push(i),r.each(t.successors(i),e)}}var n={},i=r.filter(t.nodes(),function(e){return!t.children(e).length}),u=r.max(r.map(i,function(e){return t.node(e).rank})),a=r.map(r.range(u+1),function(){return[]}),o=r.sortBy(i,function(e){return t.node(e).rank});return r.each(o,e),a}var r=t("../lodash");e.exports=n},{"../lodash":37}],46:[function(t,e){"use strict";function n(t,e){var n={};u.each(t,function(t,e){var r=n[t.v]={indegree:0,"in":[],out:[],vs:[t.v],i:e};u.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)}),u.each(e.edges(),function(t){var e=n[t.v],r=n[t.w];u.isUndefined(e)||u.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))});var i=u.filter(n,function(t){return!t.indegree});return r(i)}function r(t){function e(t){return function(e){e.merged||(u.isUndefined(e.barycenter)||u.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&i(t,e)}}function n(e){return function(n){n.in.push(e),0===--n.indegree&&t.push(n)}}for(var r=[];t.length;){var a=t.pop();r.push(a),u.each(a.in.reverse(),e(a)),u.each(a.out,n(a))}return u.chain(r).filter(function(t){return!t.merged}).map(function(t){return u.pick(t,["vs","i","barycenter","weight"])}).value()}function i(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}var u=t("../lodash");e.exports=n},{"../lodash":37}],47:[function(t,e){function n(t,e,c,l){var h=t.children(e),f=t.node(e),p=f?f.borderLeft:void 0,d=f?f.borderRight:void 0,g={};p&&(h=u.filter(h,function(t){return t!==p&&t!==d}));var y=a(t,h);u.each(y,function(e){if(t.children(e.v).length){var r=n(t,e.v,c,l);g[e.v]=r,u.has(r,"barycenter")&&i(e,r)}});var m=o(y,c);r(m,g);var v=s(m,l);if(p&&(v.vs=u.flatten([p,v.vs,d],!0),t.predecessors(p).length)){var b=t.node(t.predecessors(p)[0]),x=t.node(t.predecessors(d)[0]);u.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+b.order+x.order)/(v.weight+2),v.weight+=2}return v}function r(t,e){u.each(t,function(t){t.vs=u.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}function i(t,e){u.isUndefined(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}var u=t("../lodash"),a=t("./barycenter"),o=t("./resolve-conflicts"),s=t("./sort");e.exports=n},{"../lodash":37,"./barycenter":41,"./resolve-conflicts":46,"./sort":48}],48:[function(t,e){function n(t,e){var n=a.partition(t,function(t){return u.has(t,"barycenter")}),o=n.lhs,s=u.sortBy(n.rhs,function(t){return-t.i}),c=[],l=0,h=0,f=0;o.sort(i(!!e)),f=r(c,s,f),u.each(o,function(t){f+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,f=r(c,s,f)});var p={vs:u.flatten(c,!0)};return h&&(p.barycenter=l/h,p.weight=h),p}function r(t,e,n){for(var r;e.length&&(r=u.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}function i(t){return function(e,n){return e.barycentern.barycenter?1:t?n.i-e.i:e.i-n.i}}var u=t("../lodash"),a=t("../util");e.exports=n},{"../lodash":37,"../util":56}],49:[function(t,e){function n(t){var e=i(t);u.each(t.graph().dummyChains,function(n){for(var i=t.node(n),u=i.edgeObj,a=r(t,e,u.v,u.w),o=a.path,s=a.lca,c=0,l=o[c],h=!0;n!==u.w;){if(i=t.node(n),h){for(;(l=o[c])!==s&&t.node(l).maxRanks||c>e[i].lim));for(u=i,i=r;(i=t.parent(i))!==u;)o.push(i);return{path:a.concat(o.reverse()),lca:u}}function i(t){function e(i){var a=r;u.each(t.children(i),e),n[i]={low:a,lim:r++}}var n={},r=0;return u.each(t.children(),e),n}var u=t("./lodash");e.exports=n},{"./lodash":37}],50:[function(t,e){"use strict";function n(t,e){function n(e,n){var a=0,o=0,s=e.length,c=y.last(n);return y.each(n,function(e,l){var h=i(t,e),f=h?t.node(h).order:s;(h||e===c)&&(y.each(n.slice(o,l+1),function(e){y.each(t.predecessors(e),function(n){var i=t.node(n),o=i.order;!(a>o||o>f)||i.dummy&&t.node(e).dummy||u(r,n,e)})}),o=l+1,a=f)}),n}var r={};return y.reduce(e,n),r}function r(t,e){function n(e,n,r,a,o){var s;y.each(y.range(n,r),function(n){s=e[n],t.node(s).dummy&&y.each(t.predecessors(s),function(e){var n=t.node(e);n.dummy&&(n.ordero)&&u(i,e,s)})})}function r(e,r){var i,u=-1,a=0;return y.each(r,function(o,s){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,n(r,a,s,u,i),a=s,u=i)}n(r,a,r.length,i,e.length)}),r}var i={};return y.reduce(e,r),i}function i(t,e){return t.node(e).dummy?y.find(t.predecessors(e),function(e){return t.node(e).dummy}):void 0}function u(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function a(t,e,n){if(e>n){var r=e;e=n,n=r}return y.has(t[e],n)}function o(t,e,n,r){var i={},u={},o={};return y.each(e,function(t){y.each(t,function(t,e){i[t]=t,u[t]=t,o[t]=e})}),y.each(e,function(t){var e=-1;y.each(t,function(t){var s=r(t);if(s.length){s=y.sortBy(s,function(t){return o[t]});for(var c=(s.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var f=s[l];u[t]===t&&ea.lim&&(o=a,s=!0);var c=d.filter(e.edges(),function(e){return s===p(t,t.node(e.v),o)&&s!==p(t,t.node(e.w),o)});return d.min(c,function(t){return y(e,t)})}function l(t,e,n,i){var u=n.v,o=n.w;t.removeEdge(u,o),t.setEdge(i.v,i.w,{}),a(t),r(t,e),h(t,e)}function h(t,e){var n=d.find(t.nodes(),function(t){return!e.node(t).parent}),r=v(t,n);r=r.slice(1),d.each(r,function(n){var r=t.node(n).parent,i=e.edge(n,r),u=!1;i||(i=e.edge(r,n),u=!0),e.node(n).rank=e.node(r).rank+(u?i.minlen:-i.minlen)})}function f(t,e,n){return t.hasEdge(e,n)}function p(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}var d=t("../lodash"),g=t("./feasible-tree"),y=t("./util").slack,m=t("./util").longestPath,v=t("../graphlib").alg.preorder,b=t("../graphlib").alg.postorder,x=t("../util").simplify;e.exports=n,n.initLowLimValues=a,n.initCutValues=r,n.calcCutValue=u,n.leaveEdge=s,n.enterEdge=c,n.exchangeEdges=l},{"../graphlib":34,"../lodash":37,"../util":56,"./feasible-tree":52,"./util":55}],55:[function(t,e){"use strict";function n(t){function e(r){var u=t.node(r);if(i.has(n,r))return u.rank;n[r]=!0;var a=i.min(i.map(t.outEdges(r),function(n){return e(n.w)-t.edge(n).minlen}));return a===Number.POSITIVE_INFINITY&&(a=0),u.rank=a}var n={};i.each(t.sources(),e)}function r(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}var i=t("../lodash");e.exports={longestPath:n,slack:r}},{"../lodash":37}],56:[function(t,e){"use strict";function n(t,e,n,r){var i;do i=y.uniqueId(r);while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}function r(t){var e=(new m).setGraph(t.graph());return y.each(t.nodes(),function(n){e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e}function i(t){var e=new m({multigraph:t.isMultigraph()}).setGraph(t.graph());return y.each(t.nodes(),function(n){t.children(n).length||e.setNode(n,t.node(n))}),y.each(t.edges(),function(n){e.setEdge(n,t.edge(n))}),e}function u(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.outEdges(e),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function a(t){var e=y.map(t.nodes(),function(e){var n={};return y.each(t.inEdges(e),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return y.zipObject(t.nodes(),e)}function o(t,e){var n=t.x,r=t.y,i=e.x-n,u=e.y-r,a=t.width/2,o=t.height/2;if(!i&&!u)throw new Error("Not possible to find intersection inside of the rectangle");var s,c;return Math.abs(u)*a>Math.abs(i)*o?(0>u&&(o=-o),s=o*i/u,c=o):(0>i&&(a=-a),s=a,c=a*u/i),{x:n+s,y:r+c}}function s(t){var e=y.map(y.range(f(t)+1),function(){return[]});return y.each(t.nodes(),function(n){var r=t.node(n),i=r.rank;y.isUndefined(i)||(e[i][r.order]=n)}),e}function c(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank}));y.each(t.nodes(),function(n){var r=t.node(n);y.has(r,"rank")&&(r.rank-=e)})}function l(t){var e=y.min(y.map(t.nodes(),function(e){return t.node(e).rank})),n=[];y.each(t.nodes(),function(r){var i=t.node(r).rank-e;y.has(n,i)||(n[i]=[]),n[i].push(r)});var r=0,i=t.graph().nodeRankFactor;y.each(n,function(e,n){y.isUndefined(e)&&n%i!==0?--r:r&&y.each(e,function(e){t.node(e).rank+=r})})}function h(t,e,r,i){var u={width:0,height:0};return arguments.length>=4&&(u.rank=r,u.order=i),n(t,"border",u,e)}function f(t){return y.max(y.map(t.nodes(),function(e){var n=t.node(e).rank;return y.isUndefined(n)?void 0:n}))}function p(t,e){var n={lhs:[],rhs:[]};return y.each(t,function(t){e(t)?n.lhs.push(t):n.rhs.push(t)}),n}function d(t,e){var n=y.now();try{return e()}finally{console.log(t+" time: "+(y.now()-n)+"ms")}}function g(t,e){return e()}var y=t("./lodash"),m=t("./graphlib").Graph;e.exports={addDummyNode:n,simplify:r,asNonCompoundGraph:i,successorWeights:u,predecessorWeights:a,intersectRect:o,buildLayerMatrix:s,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:h,maxRank:f,partition:p,time:d,notime:g}},{"./graphlib":34,"./lodash":37}],57:[function(t,e){e.exports="0.6.4"},{}],58:[function(t,e){var n=t("./lib");e.exports={Graph:n.Graph,json:t("./lib/json"),alg:t("./lib/alg"),version:n.version}},{"./lib":74,"./lib/alg":65,"./lib/json":75}],59:[function(t,e){function n(t){function e(u){r.has(i,u)||(i[u]=!0,n.push(u),r.each(t.successors(u),e),r.each(t.predecessors(u),e))}var n,i={},u=[];return r.each(t.nodes(),function(t){n=[],e(t),n.length&&u.push(n)}),u}var r=t("../lodash");e.exports=n},{"../lodash":76}],60:[function(t,e){function n(t,e,n){i.isArray(e)||(e=[e]);var u=[],a={};return i.each(e,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);r(t,e,"post"===n,a,u)}),u}function r(t,e,n,u,a){i.has(u,e)||(u[e]=!0,n||a.push(e),i.each(t.neighbors(e),function(e){r(t,e,n,u,a)}),n&&a.push(e))}var i=t("../lodash");e.exports=n},{"../lodash":76}],61:[function(t,e){function n(t,e,n){return i.transform(t.nodes(),function(i,u){i[u]=r(t,u,e,n)},{})}var r=t("./dijkstra"),i=t("../lodash");e.exports=n},{"../lodash":76,"./dijkstra":62}],62:[function(t,e){function n(t,e,n,i){return r(t,String(e),n||a,i||function(e){return t.outEdges(e)})}function r(t,e,n,r){var i,a,o={},s=new u,c=function(t){var e=t.v!==i?t.v:t.w,r=o[e],u=n(t),c=a.distance+u;if(0>u)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+u);c0&&(i=s.removeMin(),a=o[i],a.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return o}var i=t("../lodash"),u=t("../data/priority-queue");e.exports=n;var a=i.constant(1)},{"../data/priority-queue":72,"../lodash":76}],63:[function(t,e){function n(t){return r.filter(i(t),function(t){return t.length>1 +})}var r=t("../lodash"),i=t("./tarjan");e.exports=n},{"../lodash":76,"./tarjan":70}],64:[function(t,e){function n(t,e,n){return r(t,e||u,n||function(e){return t.outEdges(e)})}function r(t,e,n){var r={},i=t.nodes();return i.forEach(function(t){r[t]={},r[t][t]={distance:0},i.forEach(function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})}),n(t).forEach(function(n){var i=n.v===t?n.w:n.v,u=e(n);r[t][i]={distance:u,predecessor:t}})}),i.forEach(function(t){var e=r[t];i.forEach(function(n){var u=r[n];i.forEach(function(n){var r=u[t],i=e[n],a=u[n],o=r.distance+i.distance;oi&&(s[n]=a,c.decrease(n,i))}}var a,o=new i,s={},c=new u;if(0===t.nodeCount())return o;r.each(t.nodes(),function(t){c.add(t,Number.POSITIVE_INFINITY),o.setNode(t)}),c.decrease(t.nodes()[0],0);for(var l=!1;c.size()>0;){if(a=c.removeMin(),r.has(s,a))o.setEdge(a,s[a]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(a).forEach(n)}return o}var r=t("../lodash"),i=t("../graph"),u=t("../data/priority-queue");e.exports=n},{"../data/priority-queue":72,"../graph":73,"../lodash":76}],70:[function(t,e){function n(t){function e(o){var s=u[o]={onStack:!0,lowlink:n,index:n++};if(i.push(o),t.successors(o).forEach(function(t){r.has(u,t)?u[t].onStack&&(s.lowlink=Math.min(s.lowlink,u[t].index)):(e(t),s.lowlink=Math.min(s.lowlink,u[t].lowlink))}),s.lowlink===s.index){var c,l=[];do c=i.pop(),u[c].onStack=!1,l.push(c);while(o!==c);a.push(l)}}var n=0,i=[],u={},a=[];return t.nodes().forEach(function(t){r.has(u,t)||e(t)}),a}var r=t("../lodash");e.exports=n},{"../lodash":76}],71:[function(t,e){function n(t){function e(o){if(i.has(u,o))throw new r;i.has(n,o)||(u[o]=!0,n[o]=!0,i.each(t.predecessors(o),e),delete u[o],a.push(o))}var n={},u={},a=[];if(i.each(t.sinks(),e),i.size(n)!==t.nodeCount())throw new r;return a}function r(){}var i=t("../lodash");e.exports=n,n.CycleException=r},{"../lodash":76}],72:[function(t,e){function n(){this._arr=[],this._keyIndices={}}var r=t("../lodash");e.exports=n,n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(t){return t.key})},n.prototype.has=function(t){return r.has(this._keyIndices,t)},n.prototype.priority=function(t){var e=this._keyIndices[t];return void 0!==e?this._arr[e].priority:void 0},n.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,u=i.length;return n[t]=u,i.push({key:t,priority:e}),this._decrease(u),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},n.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},n.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1,!(n[e].priorityn){var i=e;e=n,n=i}return e+h+n+h+(s.isUndefined(r)?c:r)}function a(t,e,n,r){if(!t&&e>n){var i=e;e=n,n=i}var u={v:e,w:n};return r&&(u.name=r),u}function o(t,e){return u(t,e.v,e.w,e.name)}var s=t("./lodash");e.exports=n;var c="\x00",l="\x00",h="";n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(t){return this._label=t,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultNodeLabelFn=t,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return s.keys(this._nodes)},n.prototype.sources=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._in[t])},this)},n.prototype.sinks=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._out[t])},this)},n.prototype.setNodes=function(t,e){var n=arguments;return s.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},n.prototype.setNode=function(t,e){return s.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},n.prototype.node=function(t){return this._nodes[t]},n.prototype.hasNode=function(t){return s.has(this._nodes,t)},n.prototype.removeNode=function(t){var e=this;if(s.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],s.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),s.each(s.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],s.each(s.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},n.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(s.isUndefined(e))e=l;else{for(var n=e;!s.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},n.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},n.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},n.prototype.children=function(t){if(s.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return s.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},n.prototype.predecessors=function(t){var e=this._preds[t];return e?s.keys(e):void 0},n.prototype.successors=function(t){var e=this._sucs[t];return e?s.keys(e):void 0},n.prototype.neighbors=function(t){var e=this.predecessors(t);return e?s.union(e,this.successors(t)):void 0},n.prototype.setDefaultEdgeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultEdgeLabelFn=t,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return s.values(this._edgeObjs)},n.prototype.setPath=function(t,e){var n=this,r=arguments;return s.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},n.prototype.setEdge=function(){var t,e,n,i,o=!1;s.isPlainObject(arguments[0])?(t=arguments[0].v,e=arguments[0].w,n=arguments[0].name,2===arguments.length&&(i=arguments[1],o=!0)):(t=arguments[0],e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,s.isUndefined(n)||(n=""+n);var c=u(this._isDirected,t,e,n);if(s.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=i),this;if(!s.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[c]=o?i:this._defaultEdgeLabelFn(t,e,n);var l=a(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[c]=l,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][c]=l,this._out[t][c]=l,this._edgeCount++,this},n.prototype.edge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return this._edgeLabels[r]},n.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return s.has(this._edgeLabels,r)},n.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):u(this._isDirected,t,e,n),a=this._edgeObjs[r];return a&&(t=a.v,e=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},n.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.v===e}):r}},n.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.w===e}):r}},n.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);return n?n.concat(this.outEdges(t,e)):void 0}},{"./lodash":76}],74:[function(t,e){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":73,"./version":77}],75:[function(t,e){function n(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:r(t),edges:i(t)};return a.isUndefined(t.graph())||(e.value=a.clone(t.graph())),e}function r(t){return a.map(t.nodes(),function(e){var n=t.node(e),r=t.parent(e),i={v:e};return a.isUndefined(n)||(i.value=n),a.isUndefined(r)||(i.parent=r),i})}function i(t){return a.map(t.edges(),function(e){var n=t.edge(e),r={v:e.v,w:e.w};return a.isUndefined(e.name)||(r.name=e.name),a.isUndefined(n)||(r.value=n),r})}function u(t){var e=new o(t.options).setGraph(t.value);return a.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),a.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}var a=t("./lodash"),o=t("./graph");e.exports={write:n,read:u}},{"./graph":73,"./lodash":76}],76:[function(t,e){e.exports=t(21)},{lodash:102}],77:[function(t,e){e.exports="1.0.1"},{}],78:[function(t,e,n){arguments[4][58][0].apply(n,arguments)},{"./lib":94,"./lib/alg":85,"./lib/json":95}],79:[function(t,e){e.exports=t(59)},{"../lodash":96}],80:[function(t,e){e.exports=t(60)},{"../lodash":96}],81:[function(t,e){e.exports=t(61)},{"../lodash":96,"./dijkstra":82}],82:[function(t,e){e.exports=t(62)},{"../data/priority-queue":92,"../lodash":96}],83:[function(t,e){e.exports=t(63)},{"../lodash":96,"./tarjan":90}],84:[function(t,e){e.exports=t(64)},{"../lodash":96}],85:[function(t,e,n){arguments[4][65][0].apply(n,arguments)},{"./components":79,"./dijkstra":82,"./dijkstra-all":81,"./find-cycles":83,"./floyd-warshall":84,"./is-acyclic":86,"./postorder":87,"./preorder":88,"./prim":89,"./tarjan":90,"./topsort":91}],86:[function(t,e){e.exports=t(66)},{"./topsort":91}],87:[function(t,e){e.exports=t(67)},{"./dfs":80}],88:[function(t,e){e.exports=t(68)},{"./dfs":80}],89:[function(t,e,n){arguments[4][69][0].apply(n,arguments)},{"../data/priority-queue":92,"../graph":93,"../lodash":96}],90:[function(t,e){e.exports=t(70)},{"../lodash":96}],91:[function(t,e){e.exports=t(71)},{"../lodash":96}],92:[function(t,e){e.exports=t(72)},{"../lodash":96}],93:[function(t,e){"use strict";function n(t){this._isDirected=s.has(t,"directed")?t.directed:!0,this._isMultigraph=s.has(t,"multigraph")?t.multigraph:!1,this._isCompound=s.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=s.constant(void 0),this._defaultEdgeLabelFn=s.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[l]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function r(t,e){s.has(t,e)?t[e]++:t[e]=1}function i(t,e){--t[e]||delete t[e]}function u(t,e,n,r){if(!t&&e>n){var i=e;e=n,n=i}return e+h+n+h+(s.isUndefined(r)?c:r)}function a(t,e,n,r){if(!t&&e>n){var i=e;e=n,n=i}var u={v:e,w:n};return r&&(u.name=r),u}function o(t,e){return u(t,e.v,e.w,e.name)}var s=t("./lodash");e.exports=n;var c="\x00",l="\x00",h="";n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(t){return this._label=t,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultNodeLabelFn=t,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return s.keys(this._nodes)},n.prototype.sources=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._in[t])},this)},n.prototype.sinks=function(){return s.filter(this.nodes(),function(t){return s.isEmpty(this._out[t])},this)},n.prototype.setNodes=function(t,e){var n=arguments;return s.each(t,function(t){n.length>1?this.setNode(t,e):this.setNode(t)},this),this},n.prototype.setNode=function(t,e){return s.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=l,this._children[t]={},this._children[l][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},n.prototype.node=function(t){return this._nodes[t]},n.prototype.hasNode=function(t){return s.has(this._nodes,t)},n.prototype.removeNode=function(t){var e=this;if(s.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],s.each(this.children(t),function(t){this.setParent(t)},this),delete this._children[t]),s.each(s.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],s.each(s.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},n.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(s.isUndefined(e))e=l;else{for(var n=e;!s.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},n.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},n.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==l)return e}},n.prototype.children=function(t){if(s.isUndefined(t)&&(t=l),this._isCompound){var e=this._children[t];if(e)return s.keys(e)}else{if(t===l)return this.nodes();if(this.hasNode(t))return[]}},n.prototype.predecessors=function(t){var e=this._preds[t];return e?s.keys(e):void 0},n.prototype.successors=function(t){var e=this._sucs[t];return e?s.keys(e):void 0},n.prototype.neighbors=function(t){var e=this.predecessors(t);return e?s.union(e,this.successors(t)):void 0},n.prototype.setDefaultEdgeLabel=function(t){return s.isFunction(t)||(t=s.constant(t)),this._defaultEdgeLabelFn=t,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return s.values(this._edgeObjs)},n.prototype.setPath=function(t,e){var n=this,r=arguments;return s.reduce(t,function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i}),this},n.prototype.setEdge=function(t,e,n,i){var o=arguments.length>2;t=String(t),e=String(e),s.isUndefined(i)||(i=String(i)),s.isPlainObject(arguments[0])&&(t=arguments[0].v,e=arguments[0].w,i=arguments[0].name,2===arguments.length&&(n=arguments[1],o=!0));var c=u(this._isDirected,t,e,i);if(s.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=n),this;if(!s.isUndefined(i)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[c]=o?n:this._defaultEdgeLabelFn(t,e,i);var l=a(this._isDirected,t,e,i);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[c]=l,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][c]=l,this._out[t][c]=l,this._edgeCount++,this},n.prototype.edge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return this._edgeLabels[r]},n.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return s.has(this._edgeLabels,r)},n.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?o(this._isDirected,arguments[0]):u(this._isDirected,t,e,n),a=this._edgeObjs[r];return a&&(t=a.v,e=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[e],t),i(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},n.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.v===e}):r}},n.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=s.values(n);return e?s.filter(r,function(t){return t.w===e}):r}},n.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);return n?n.concat(this.outEdges(t,e)):void 0}},{"./lodash":96}],94:[function(t,e,n){arguments[4][74][0].apply(n,arguments)},{"./graph":93,"./version":97}],95:[function(t,e,n){arguments[4][75][0].apply(n,arguments)},{"./graph":93,"./lodash":96}],96:[function(t,e){e.exports=t(21)},{lodash:102}],97:[function(t,e){e.exports="0.9.1"},{}],98:[function(){},{}],99:[function(t,e,n){(function(t){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;u--){var a=u>=0?arguments[u]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,i="/"===a.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),u="/"===a(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&u&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),u=r(e.split("/")),a=Math.min(i.length,u.length),o=a,s=0;a>s;s++)if(i[s]!==u[s]){o=s;break}for(var c=[],s=o;se&&(e=t.length+e),t.substr(e,n)}}).call(this,t("1YiZ5S"))},{"1YiZ5S":100}],100:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],101:[function(t,e,n){(function(t){!function(r){var i="object"==typeof n&&n,u="object"==typeof e&&e&&e.exports==i&&e,a="object"==typeof t&&t;(a.global===a||a.window===a)&&(r=a);var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,h={"Á":"Aacute","á":"aacute","Ă":"Abreve","ă":"abreve","∾":"ac","∿":"acd","∾̳":"acE","Â":"Acirc","â":"acirc","´":"acute","А":"Acy","а":"acy","Æ":"AElig","æ":"aelig","⁡":"af","𝔄":"Afr","𝔞":"afr","À":"Agrave","à":"agrave","ℵ":"aleph","Α":"Alpha","α":"alpha","Ā":"Amacr","ā":"amacr","⨿":"amalg","&":"amp","⩕":"andand","⩓":"And","∧":"and","⩜":"andd","⩘":"andslope","⩚":"andv","∠":"ang","⦤":"ange","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","∡":"angmsd","∟":"angrt","⊾":"angrtvb","⦝":"angrtvbd","∢":"angsph","Å":"angst","⍼":"angzarr","Ą":"Aogon","ą":"aogon","𝔸":"Aopf","𝕒":"aopf","⩯":"apacir","≈":"ap","⩰":"apE","≊":"ape","≋":"apid","'":"apos","å":"aring","𝒜":"Ascr","𝒶":"ascr","≔":"colone","*":"ast","≍":"CupCap","Ã":"Atilde","ã":"atilde","Ä":"Auml","ä":"auml","∳":"awconint","⨑":"awint","≌":"bcong","϶":"bepsi","‵":"bprime","∽":"bsim","⋍":"bsime","∖":"setmn","⫧":"Barv","⊽":"barvee","⌅":"barwed","⌆":"Barwed","⎵":"bbrk","⎶":"bbrktbrk","Б":"Bcy","б":"bcy","„":"bdquo","∵":"becaus","⦰":"bemptyv","ℬ":"Bscr","Β":"Beta","β":"beta","ℶ":"beth","≬":"twixt","𝔅":"Bfr","𝔟":"bfr","⋂":"xcap","◯":"xcirc","⋃":"xcup","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨆":"xsqcup","★":"starf","▽":"xdtri","△":"xutri","⨄":"xuplus","⋁":"Vee","⋀":"Wedge","⤍":"rbarr","⧫":"lozf","▪":"squf","▴":"utrif","▾":"dtrif","◂":"ltrif","▸":"rtrif","␣":"blank","▒":"blk12","░":"blk14","▓":"blk34","█":"block","=⃥":"bne","≡⃥":"bnequiv","⫭":"bNot","⌐":"bnot","𝔹":"Bopf","𝕓":"bopf","⊥":"bot","⋈":"bowtie","⧉":"boxbox","┐":"boxdl","╕":"boxdL","╖":"boxDl","╗":"boxDL","┌":"boxdr","╒":"boxdR","╓":"boxDr","╔":"boxDR","─":"boxh","═":"boxH","┬":"boxhd","╤":"boxHd","╥":"boxhD","╦":"boxHD","┴":"boxhu","╧":"boxHu","╨":"boxhU","╩":"boxHU","⊟":"minusb","⊞":"plusb","⊠":"timesb","┘":"boxul","╛":"boxuL","╜":"boxUl","╝":"boxUL","└":"boxur","╘":"boxuR","╙":"boxUr","╚":"boxUR","│":"boxv","║":"boxV","┼":"boxvh","╪":"boxvH","╫":"boxVh","╬":"boxVH","┤":"boxvl","╡":"boxvL","╢":"boxVl","╣":"boxVL","├":"boxvr","╞":"boxvR","╟":"boxVr","╠":"boxVR","˘":"breve","¦":"brvbar","𝒷":"bscr","⁏":"bsemi","⧅":"bsolb","\\":"bsol","⟈":"bsolhsub","•":"bull","≎":"bump","⪮":"bumpE","≏":"bumpe","Ć":"Cacute","ć":"cacute","⩄":"capand","⩉":"capbrcup","⩋":"capcap","∩":"cap","⋒":"Cap","⩇":"capcup","⩀":"capdot","ⅅ":"DD","∩︀":"caps","⁁":"caret","ˇ":"caron","ℭ":"Cfr","⩍":"ccaps","Č":"Ccaron","č":"ccaron","Ç":"Ccedil","ç":"ccedil","Ĉ":"Ccirc","ĉ":"ccirc","∰":"Cconint","⩌":"ccups","⩐":"ccupssm","Ċ":"Cdot","ċ":"cdot","¸":"cedil","⦲":"cemptyv","¢":"cent","·":"middot","𝔠":"cfr","Ч":"CHcy","ч":"chcy","✓":"check","Χ":"Chi","χ":"chi","ˆ":"circ","≗":"cire","↺":"olarr","↻":"orarr","⊛":"oast","⊚":"ocir","⊝":"odash","⊙":"odot","®":"reg","Ⓢ":"oS","⊖":"ominus","⊕":"oplus","⊗":"otimes","○":"cir","⧃":"cirE","⨐":"cirfnint","⫯":"cirmid","⧂":"cirscir","∲":"cwconint","”":"rdquo","’":"rsquo","♣":"clubs",":":"colon","∷":"Colon","⩴":"Colone",",":"comma","@":"commat","∁":"comp","∘":"compfn","ℂ":"Copf","≅":"cong","⩭":"congdot","≡":"equiv","∮":"oint","∯":"Conint","𝕔":"copf","∐":"coprod","©":"copy","℗":"copysr","↵":"crarr","✗":"cross","⨯":"Cross","𝒞":"Cscr","𝒸":"cscr","⫏":"csub","⫑":"csube","⫐":"csup","⫒":"csupe","⋯":"ctdot","⤸":"cudarrl","⤵":"cudarrr","⋞":"cuepr","⋟":"cuesc","↶":"cularr","⤽":"cularrp","⩈":"cupbrcap","⩆":"cupcap","∪":"cup","⋓":"Cup","⩊":"cupcup","⊍":"cupdot","⩅":"cupor","∪︀":"cups","↷":"curarr","⤼":"curarrm","⋎":"cuvee","⋏":"cuwed","¤":"curren","∱":"cwint","⌭":"cylcty","†":"dagger","‡":"Dagger","ℸ":"daleth","↓":"darr","↡":"Darr","⇓":"dArr","‐":"dash","⫤":"Dashv","⊣":"dashv","⤏":"rBarr","˝":"dblac","Ď":"Dcaron","ď":"dcaron","Д":"Dcy","д":"dcy","⇊":"ddarr","ⅆ":"dd","⤑":"DDotrahd","⩷":"eDDot","°":"deg","∇":"Del","Δ":"Delta","δ":"delta","⦱":"demptyv","⥿":"dfisht","𝔇":"Dfr","𝔡":"dfr","⥥":"dHar","⇃":"dharl","⇂":"dharr","˙":"dot","`":"grave","˜":"tilde","⋄":"diam","♦":"diams","¨":"die","ϝ":"gammad","⋲":"disin","÷":"div","⋇":"divonx","Ђ":"DJcy","ђ":"djcy","⌞":"dlcorn","⌍":"dlcrop",$:"dollar","𝔻":"Dopf","𝕕":"dopf","⃜":"DotDot","≐":"doteq","≑":"eDot","∸":"minusd","∔":"plusdo","⊡":"sdotb","⇐":"lArr","⇔":"iff","⟸":"xlArr","⟺":"xhArr","⟹":"xrArr","⇒":"rArr","⊨":"vDash","⇑":"uArr","⇕":"vArr","∥":"par","⤓":"DownArrowBar","⇵":"duarr","̑":"DownBreve","⥐":"DownLeftRightVector","⥞":"DownLeftTeeVector","⥖":"DownLeftVectorBar","↽":"lhard","⥟":"DownRightTeeVector","⥗":"DownRightVectorBar","⇁":"rhard","↧":"mapstodown","⊤":"top","⤐":"RBarr","⌟":"drcorn","⌌":"drcrop","𝒟":"Dscr","𝒹":"dscr","Ѕ":"DScy","ѕ":"dscy","⧶":"dsol","Đ":"Dstrok","đ":"dstrok","⋱":"dtdot","▿":"dtri","⥯":"duhar","⦦":"dwangle","Џ":"DZcy","џ":"dzcy","⟿":"dzigrarr","É":"Eacute","é":"eacute","⩮":"easter","Ě":"Ecaron","ě":"ecaron","Ê":"Ecirc","ê":"ecirc","≖":"ecir","≕":"ecolon","Э":"Ecy","э":"ecy","Ė":"Edot","ė":"edot","ⅇ":"ee","≒":"efDot","𝔈":"Efr","𝔢":"efr","⪚":"eg","È":"Egrave","è":"egrave","⪖":"egs","⪘":"egsdot","⪙":"el","∈":"in","⏧":"elinters","ℓ":"ell","⪕":"els","⪗":"elsdot","Ē":"Emacr","ē":"emacr","∅":"empty","◻":"EmptySmallSquare","▫":"EmptyVerySmallSquare"," ":"emsp13"," ":"emsp14"," ":"emsp","Ŋ":"ENG","ŋ":"eng"," ":"ensp","Ę":"Eogon","ę":"eogon","𝔼":"Eopf","𝕖":"eopf","⋕":"epar","⧣":"eparsl","⩱":"eplus","ε":"epsi","Ε":"Epsilon","ϵ":"epsiv","≂":"esim","⩵":"Equal","=":"equals","≟":"equest","⇌":"rlhar","⩸":"equivDD","⧥":"eqvparsl","⥱":"erarr","≓":"erDot","ℯ":"escr","ℰ":"Escr","⩳":"Esim","Η":"Eta","η":"eta","Ð":"ETH","ð":"eth","Ë":"Euml","ë":"euml","€":"euro","!":"excl","∃":"exist","Ф":"Fcy","ф":"fcy","♀":"female","ffi":"ffilig","ff":"fflig","ffl":"ffllig","𝔉":"Ffr","𝔣":"ffr","fi":"filig","◼":"FilledSmallSquare",fj:"fjlig","♭":"flat","fl":"fllig","▱":"fltns","ƒ":"fnof","𝔽":"Fopf","𝕗":"fopf","∀":"forall","⋔":"fork","⫙":"forkv","ℱ":"Fscr","⨍":"fpartint","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","⅔":"frac23","⅖":"frac25","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","⁄":"frasl","⌢":"frown","𝒻":"fscr","ǵ":"gacute","Γ":"Gamma","γ":"gamma","Ϝ":"Gammad","⪆":"gap","Ğ":"Gbreve","ğ":"gbreve","Ģ":"Gcedil","Ĝ":"Gcirc","ĝ":"gcirc","Г":"Gcy","г":"gcy","Ġ":"Gdot","ġ":"gdot","≥":"ge","≧":"gE","⪌":"gEl","⋛":"gel","⩾":"ges","⪩":"gescc","⪀":"gesdot","⪂":"gesdoto","⪄":"gesdotol","⋛︀":"gesl","⪔":"gesles","𝔊":"Gfr","𝔤":"gfr","≫":"gg","⋙":"Gg","ℷ":"gimel","Ѓ":"GJcy","ѓ":"gjcy","⪥":"gla","≷":"gl","⪒":"glE","⪤":"glj","⪊":"gnap","⪈":"gne","≩":"gnE","⋧":"gnsim","𝔾":"Gopf","𝕘":"gopf","⪢":"GreaterGreater","≳":"gsim","𝒢":"Gscr","ℊ":"gscr","⪎":"gsime","⪐":"gsiml","⪧":"gtcc","⩺":"gtcir",">":"gt","⋗":"gtdot","⦕":"gtlPar","⩼":"gtquest","⥸":"gtrarr","≩︀":"gvnE"," ":"hairsp","ℋ":"Hscr","Ъ":"HARDcy","ъ":"hardcy","⥈":"harrcir","↔":"harr","↭":"harrw","^":"Hat","ℏ":"hbar","Ĥ":"Hcirc","ĥ":"hcirc","♥":"hearts","…":"mldr","⊹":"hercon","𝔥":"hfr","ℌ":"Hfr","⤥":"searhk","⤦":"swarhk","⇿":"hoarr","∻":"homtht","↩":"larrhk","↪":"rarrhk","𝕙":"hopf","ℍ":"Hopf","―":"horbar","𝒽":"hscr","Ħ":"Hstrok","ħ":"hstrok","⁃":"hybull","Í":"Iacute","í":"iacute","⁣":"ic","Î":"Icirc","î":"icirc","И":"Icy","и":"icy","İ":"Idot","Е":"IEcy","е":"iecy","¡":"iexcl","𝔦":"ifr","ℑ":"Im","Ì":"Igrave","ì":"igrave","ⅈ":"ii","⨌":"qint","∭":"tint","⧜":"iinfin","℩":"iiota","IJ":"IJlig","ij":"ijlig","Ī":"Imacr","ī":"imacr","ℐ":"Iscr","ı":"imath","⊷":"imof","Ƶ":"imped","℅":"incare","∞":"infin","⧝":"infintie","⊺":"intcal","∫":"int","∬":"Int","ℤ":"Zopf","⨗":"intlarhk","⨼":"iprod","⁢":"it","Ё":"IOcy","ё":"iocy","Į":"Iogon","į":"iogon","𝕀":"Iopf","𝕚":"iopf","Ι":"Iota","ι":"iota","¿":"iquest","𝒾":"iscr","⋵":"isindot","⋹":"isinE","⋴":"isins","⋳":"isinsv","Ĩ":"Itilde","ĩ":"itilde","І":"Iukcy","і":"iukcy","Ï":"Iuml","ï":"iuml","Ĵ":"Jcirc","ĵ":"jcirc","Й":"Jcy","й":"jcy","𝔍":"Jfr","𝔧":"jfr","ȷ":"jmath","𝕁":"Jopf","𝕛":"jopf","𝒥":"Jscr","𝒿":"jscr","Ј":"Jsercy","ј":"jsercy","Є":"Jukcy","є":"jukcy","Κ":"Kappa","κ":"kappa","ϰ":"kappav","Ķ":"Kcedil","ķ":"kcedil","К":"Kcy","к":"kcy","𝔎":"Kfr","𝔨":"kfr","ĸ":"kgreen","Х":"KHcy","х":"khcy","Ќ":"KJcy","ќ":"kjcy","𝕂":"Kopf","𝕜":"kopf","𝒦":"Kscr","𝓀":"kscr","⇚":"lAarr","Ĺ":"Lacute","ĺ":"lacute","⦴":"laemptyv","ℒ":"Lscr","Λ":"Lambda","λ":"lambda","⟨":"lang","⟪":"Lang","⦑":"langd","⪅":"lap","«":"laquo","⇤":"larrb","⤟":"larrbfs","←":"larr","↞":"Larr","⤝":"larrfs","↫":"larrlp","⤹":"larrpl","⥳":"larrsim","↢":"larrtl","⤙":"latail","⤛":"lAtail","⪫":"lat","⪭":"late","⪭︀":"lates","⤌":"lbarr","⤎":"lBarr","❲":"lbbrk","{":"lcub","[":"lsqb","⦋":"lbrke","⦏":"lbrksld","⦍":"lbrkslu","Ľ":"Lcaron","ľ":"lcaron","Ļ":"Lcedil","ļ":"lcedil","⌈":"lceil","Л":"Lcy","л":"lcy","⤶":"ldca","“":"ldquo","⥧":"ldrdhar","⥋":"ldrushar","↲":"ldsh","≤":"le","≦":"lE","⇆":"lrarr","⟦":"lobrk","⥡":"LeftDownTeeVector","⥙":"LeftDownVectorBar","⌊":"lfloor","↼":"lharu","⇇":"llarr","⇋":"lrhar","⥎":"LeftRightVector","↤":"mapstoleft","⥚":"LeftTeeVector","⋋":"lthree","⧏":"LeftTriangleBar","⊲":"vltri","⊴":"ltrie","⥑":"LeftUpDownVector","⥠":"LeftUpTeeVector","⥘":"LeftUpVectorBar","↿":"uharl","⥒":"LeftVectorBar","⪋":"lEg","⋚":"leg","⩽":"les","⪨":"lescc","⩿":"lesdot","⪁":"lesdoto","⪃":"lesdotor","⋚︀":"lesg","⪓":"lesges","⋖":"ltdot","≶":"lg","⪡":"LessLess","≲":"lsim","⥼":"lfisht","𝔏":"Lfr","𝔩":"lfr","⪑":"lgE","⥢":"lHar","⥪":"lharul","▄":"lhblk","Љ":"LJcy","љ":"ljcy","≪":"ll","⋘":"Ll","⥫":"llhard","◺":"lltri","Ŀ":"Lmidot","ŀ":"lmidot","⎰":"lmoust","⪉":"lnap","⪇":"lne","≨":"lnE","⋦":"lnsim","⟬":"loang","⇽":"loarr","⟵":"xlarr","⟷":"xharr","⟼":"xmap","⟶":"xrarr","↬":"rarrlp","⦅":"lopar","𝕃":"Lopf","𝕝":"lopf","⨭":"loplus","⨴":"lotimes","∗":"lowast",_:"lowbar","↙":"swarr","↘":"searr","◊":"loz","(":"lpar","⦓":"lparlt","⥭":"lrhard","‎":"lrm","⊿":"lrtri","‹":"lsaquo","𝓁":"lscr","↰":"lsh","⪍":"lsime","⪏":"lsimg","‘":"lsquo","‚":"sbquo","Ł":"Lstrok","ł":"lstrok","⪦":"ltcc","⩹":"ltcir","<":"lt","⋉":"ltimes","⥶":"ltlarr","⩻":"ltquest","◃":"ltri","⦖":"ltrPar","⥊":"lurdshar","⥦":"luruhar","≨︀":"lvnE","¯":"macr","♂":"male","✠":"malt","⤅":"Map","↦":"map","↥":"mapstoup","▮":"marker","⨩":"mcomma","М":"Mcy","м":"mcy","—":"mdash","∺":"mDDot"," ":"MediumSpace","ℳ":"Mscr","𝔐":"Mfr","𝔪":"mfr","℧":"mho","µ":"micro","⫰":"midcir","∣":"mid","−":"minus","⨪":"minusdu","∓":"mp","⫛":"mlcp","⊧":"models","𝕄":"Mopf","𝕞":"mopf","𝓂":"mscr","Μ":"Mu","μ":"mu","⊸":"mumap","Ń":"Nacute","ń":"nacute","∠⃒":"nang","≉":"nap","⩰̸":"napE","≋̸":"napid","ʼn":"napos","♮":"natur","ℕ":"Nopf"," ":"nbsp","≎̸":"nbump","≏̸":"nbumpe","⩃":"ncap","Ň":"Ncaron","ň":"ncaron","Ņ":"Ncedil","ņ":"ncedil","≇":"ncong","⩭̸":"ncongdot","⩂":"ncup","Н":"Ncy","н":"ncy","–":"ndash","⤤":"nearhk","↗":"nearr","⇗":"neArr","≠":"ne","≐̸":"nedot","​":"ZeroWidthSpace","≢":"nequiv","⤨":"toea","≂̸":"nesim","\n":"NewLine","∄":"nexist","𝔑":"Nfr","𝔫":"nfr","≧̸":"ngE","≱":"nge","⩾̸":"nges","⋙̸":"nGg","≵":"ngsim","≫⃒":"nGt","≯":"ngt","≫̸":"nGtv","↮":"nharr","⇎":"nhArr","⫲":"nhpar","∋":"ni","⋼":"nis","⋺":"nisd","Њ":"NJcy","њ":"njcy","↚":"nlarr","⇍":"nlArr","‥":"nldr","≦̸":"nlE","≰":"nle","⩽̸":"nles","≮":"nlt","⋘̸":"nLl","≴":"nlsim","≪⃒":"nLt","⋪":"nltri","⋬":"nltrie","≪̸":"nLtv","∤":"nmid","⁠":"NoBreak","𝕟":"nopf","⫬":"Not","¬":"not","≭":"NotCupCap","∦":"npar","∉":"notin","≹":"ntgl","⋵̸":"notindot","⋹̸":"notinE","⋷":"notinvb","⋶":"notinvc","⧏̸":"NotLeftTriangleBar","≸":"ntlg","⪢̸":"NotNestedGreaterGreater","⪡̸":"NotNestedLessLess","∌":"notni","⋾":"notnivb","⋽":"notnivc","⊀":"npr","⪯̸":"npre","⋠":"nprcue","⧐̸":"NotRightTriangleBar","⋫":"nrtri","⋭":"nrtrie","⊏̸":"NotSquareSubset","⋢":"nsqsube","⊐̸":"NotSquareSuperset","⋣":"nsqsupe","⊂⃒":"vnsub","⊈":"nsube","⊁":"nsc","⪰̸":"nsce","⋡":"nsccue","≿̸":"NotSucceedsTilde","⊃⃒":"vnsup","⊉":"nsupe","≁":"nsim","≄":"nsime","⫽⃥":"nparsl","∂̸":"npart","⨔":"npolint","⤳̸":"nrarrc","↛":"nrarr","⇏":"nrArr","↝̸":"nrarrw","𝒩":"Nscr","𝓃":"nscr","⊄":"nsub","⫅̸":"nsubE","⊅":"nsup","⫆̸":"nsupE","Ñ":"Ntilde","ñ":"ntilde","Ν":"Nu","ν":"nu","#":"num","№":"numero"," ":"numsp","≍⃒":"nvap","⊬":"nvdash","⊭":"nvDash","⊮":"nVdash","⊯":"nVDash","≥⃒":"nvge",">⃒":"nvgt","⤄":"nvHarr","⧞":"nvinfin","⤂":"nvlArr","≤⃒":"nvle","<⃒":"nvlt","⊴⃒":"nvltrie","⤃":"nvrArr","⊵⃒":"nvrtrie","∼⃒":"nvsim","⤣":"nwarhk","↖":"nwarr","⇖":"nwArr","⤧":"nwnear","Ó":"Oacute","ó":"oacute","Ô":"Ocirc","ô":"ocirc","О":"Ocy","о":"ocy","Ő":"Odblac","ő":"odblac","⨸":"odiv","⦼":"odsold","Œ":"OElig","œ":"oelig","⦿":"ofcir","𝔒":"Ofr","𝔬":"ofr","˛":"ogon","Ò":"Ograve","ò":"ograve","⧁":"ogt","⦵":"ohbar","Ω":"ohm","⦾":"olcir","⦻":"olcross","‾":"oline","⧀":"olt","Ō":"Omacr","ō":"omacr","ω":"omega","Ο":"Omicron","ο":"omicron","⦶":"omid","𝕆":"Oopf","𝕠":"oopf","⦷":"opar","⦹":"operp","⩔":"Or","∨":"or","⩝":"ord","ℴ":"oscr","ª":"ordf","º":"ordm","⊶":"origof","⩖":"oror","⩗":"orslope","⩛":"orv","𝒪":"Oscr","Ø":"Oslash","ø":"oslash","⊘":"osol","Õ":"Otilde","õ":"otilde","⨶":"otimesas","⨷":"Otimes","Ö":"Ouml","ö":"ouml","⌽":"ovbar","⏞":"OverBrace","⎴":"tbrk","⏜":"OverParenthesis","¶":"para","⫳":"parsim","⫽":"parsl","∂":"part","П":"Pcy","п":"pcy","%":"percnt",".":"period","‰":"permil","‱":"pertenk","𝔓":"Pfr","𝔭":"pfr","Φ":"Phi","φ":"phi","ϕ":"phiv","☎":"phone","Π":"Pi","π":"pi","ϖ":"piv","ℎ":"planckh","⨣":"plusacir","⨢":"pluscir","+":"plus","⨥":"plusdu","⩲":"pluse","±":"pm","⨦":"plussim","⨧":"plustwo","⨕":"pointint","𝕡":"popf","ℙ":"Popf","£":"pound","⪷":"prap","⪻":"Pr","≺":"pr","≼":"prcue","⪯":"pre","≾":"prsim","⪹":"prnap","⪵":"prnE","⋨":"prnsim","⪳":"prE","′":"prime","″":"Prime","∏":"prod","⌮":"profalar","⌒":"profline","⌓":"profsurf","∝":"prop","⊰":"prurel","𝒫":"Pscr","𝓅":"pscr","Ψ":"Psi","ψ":"psi"," ":"puncsp","𝔔":"Qfr","𝔮":"qfr","𝕢":"qopf","ℚ":"Qopf","⁗":"qprime","𝒬":"Qscr","𝓆":"qscr","⨖":"quatint","?":"quest",'"':"quot","⇛":"rAarr","∽̱":"race","Ŕ":"Racute","ŕ":"racute","√":"Sqrt","⦳":"raemptyv","⟩":"rang","⟫":"Rang","⦒":"rangd","⦥":"range","»":"raquo","⥵":"rarrap","⇥":"rarrb","⤠":"rarrbfs","⤳":"rarrc","→":"rarr","↠":"Rarr","⤞":"rarrfs","⥅":"rarrpl","⥴":"rarrsim","⤖":"Rarrtl","↣":"rarrtl","↝":"rarrw","⤚":"ratail","⤜":"rAtail","∶":"ratio","❳":"rbbrk","}":"rcub","]":"rsqb","⦌":"rbrke","⦎":"rbrksld","⦐":"rbrkslu","Ř":"Rcaron","ř":"rcaron","Ŗ":"Rcedil","ŗ":"rcedil","⌉":"rceil","Р":"Rcy","р":"rcy","⤷":"rdca","⥩":"rdldhar","↳":"rdsh","ℜ":"Re","ℛ":"Rscr","ℝ":"Ropf","▭":"rect","⥽":"rfisht","⌋":"rfloor","𝔯":"rfr","⥤":"rHar","⇀":"rharu","⥬":"rharul","Ρ":"Rho","ρ":"rho","ϱ":"rhov","⇄":"rlarr","⟧":"robrk","⥝":"RightDownTeeVector","⥕":"RightDownVectorBar","⇉":"rrarr","⊢":"vdash","⥛":"RightTeeVector","⋌":"rthree","⧐":"RightTriangleBar","⊳":"vrtri","⊵":"rtrie","⥏":"RightUpDownVector","⥜":"RightUpTeeVector","⥔":"RightUpVectorBar","↾":"uharr","⥓":"RightVectorBar","˚":"ring","‏":"rlm","⎱":"rmoust","⫮":"rnmid","⟭":"roang","⇾":"roarr","⦆":"ropar","𝕣":"ropf","⨮":"roplus","⨵":"rotimes","⥰":"RoundImplies",")":"rpar","⦔":"rpargt","⨒":"rppolint","›":"rsaquo","𝓇":"rscr","↱":"rsh","⋊":"rtimes","▹":"rtri","⧎":"rtriltri","⧴":"RuleDelayed","⥨":"ruluhar","℞":"rx","Ś":"Sacute","ś":"sacute","⪸":"scap","Š":"Scaron","š":"scaron","⪼":"Sc","≻":"sc","≽":"sccue","⪰":"sce","⪴":"scE","Ş":"Scedil","ş":"scedil","Ŝ":"Scirc","ŝ":"scirc","⪺":"scnap","⪶":"scnE","⋩":"scnsim","⨓":"scpolint","≿":"scsim","С":"Scy","с":"scy","⋅":"sdot","⩦":"sdote","⇘":"seArr","§":"sect",";":"semi","⤩":"tosa","✶":"sext","𝔖":"Sfr","𝔰":"sfr","♯":"sharp","Щ":"SHCHcy","щ":"shchcy","Ш":"SHcy","ш":"shcy","↑":"uarr","­":"shy","Σ":"Sigma","σ":"sigma","ς":"sigmaf","∼":"sim","⩪":"simdot","≃":"sime","⪞":"simg","⪠":"simgE","⪝":"siml","⪟":"simlE","≆":"simne","⨤":"simplus","⥲":"simrarr","⨳":"smashp","⧤":"smeparsl","⌣":"smile","⪪":"smt","⪬":"smte","⪬︀":"smtes","Ь":"SOFTcy","ь":"softcy","⌿":"solbar","⧄":"solb","/":"sol","𝕊":"Sopf","𝕤":"sopf","♠":"spades","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊏":"sqsub","⊑":"sqsube","⊐":"sqsup","⊒":"sqsupe","□":"squ","𝒮":"Sscr","𝓈":"sscr","⋆":"Star","☆":"star","⊂":"sub","⋐":"Sub","⪽":"subdot","⫅":"subE","⊆":"sube","⫃":"subedot","⫁":"submult","⫋":"subnE","⊊":"subne","⪿":"subplus","⥹":"subrarr","⫇":"subsim","⫕":"subsub","⫓":"subsup","∑":"sum","♪":"sung","¹":"sup1","²":"sup2","³":"sup3","⊃":"sup","⋑":"Sup","⪾":"supdot","⫘":"supdsub","⫆":"supE","⊇":"supe","⫄":"supedot","⟉":"suphsol","⫗":"suphsub","⥻":"suplarr","⫂":"supmult","⫌":"supnE","⊋":"supne","⫀":"supplus","⫈":"supsim","⫔":"supsub","⫖":"supsup","⇙":"swArr","⤪":"swnwar","ß":"szlig"," ":"Tab","⌖":"target","Τ":"Tau","τ":"tau","Ť":"Tcaron","ť":"tcaron","Ţ":"Tcedil","ţ":"tcedil","Т":"Tcy","т":"tcy","⃛":"tdot","⌕":"telrec","𝔗":"Tfr","𝔱":"tfr","∴":"there4","Θ":"Theta","θ":"theta","ϑ":"thetav","  ":"ThickSpace"," ":"thinsp","Þ":"THORN","þ":"thorn","⨱":"timesbar","×":"times","⨰":"timesd","⌶":"topbot","⫱":"topcir","𝕋":"Topf","𝕥":"topf","⫚":"topfork","‴":"tprime","™":"trade","▵":"utri","≜":"trie","◬":"tridot","⨺":"triminus","⨹":"triplus","⧍":"trisb","⨻":"tritime","⏢":"trpezium","𝒯":"Tscr","𝓉":"tscr","Ц":"TScy","ц":"tscy","Ћ":"TSHcy","ћ":"tshcy","Ŧ":"Tstrok","ŧ":"tstrok","Ú":"Uacute","ú":"uacute","↟":"Uarr","⥉":"Uarrocir","Ў":"Ubrcy","ў":"ubrcy","Ŭ":"Ubreve","ŭ":"ubreve","Û":"Ucirc","û":"ucirc","У":"Ucy","у":"ucy","⇅":"udarr","Ű":"Udblac","ű":"udblac","⥮":"udhar","⥾":"ufisht","𝔘":"Ufr","𝔲":"ufr","Ù":"Ugrave","ù":"ugrave","⥣":"uHar","▀":"uhblk","⌜":"ulcorn","⌏":"ulcrop","◸":"ultri","Ū":"Umacr","ū":"umacr","⏟":"UnderBrace","⏝":"UnderParenthesis","⊎":"uplus","Ų":"Uogon","ų":"uogon","𝕌":"Uopf","𝕦":"uopf","⤒":"UpArrowBar","↕":"varr","υ":"upsi","ϒ":"Upsi","Υ":"Upsilon","⇈":"uuarr","⌝":"urcorn","⌎":"urcrop","Ů":"Uring","ů":"uring","◹":"urtri","𝒰":"Uscr","𝓊":"uscr","⋰":"utdot","Ũ":"Utilde","ũ":"utilde","Ü":"Uuml","ü":"uuml","⦧":"uwangle","⦜":"vangrt","⊊︀":"vsubne","⫋︀":"vsubnE","⊋︀":"vsupne","⫌︀":"vsupnE","⫨":"vBar","⫫":"Vbar","⫩":"vBarv","В":"Vcy","в":"vcy","⊩":"Vdash","⊫":"VDash","⫦":"Vdashl","⊻":"veebar","≚":"veeeq","⋮":"vellip","|":"vert","‖":"Vert","❘":"VerticalSeparator","≀":"wr","𝔙":"Vfr","𝔳":"vfr","𝕍":"Vopf","𝕧":"vopf","𝒱":"Vscr","𝓋":"vscr","⊪":"Vvdash","⦚":"vzigzag","Ŵ":"Wcirc","ŵ":"wcirc","⩟":"wedbar","≙":"wedgeq","℘":"wp","𝔚":"Wfr","𝔴":"wfr","𝕎":"Wopf","𝕨":"wopf","𝒲":"Wscr","𝓌":"wscr","𝔛":"Xfr","𝔵":"xfr","Ξ":"Xi","ξ":"xi","⋻":"xnis","𝕏":"Xopf","𝕩":"xopf","𝒳":"Xscr","𝓍":"xscr","Ý":"Yacute","ý":"yacute","Я":"YAcy","я":"yacy","Ŷ":"Ycirc","ŷ":"ycirc","Ы":"Ycy","ы":"ycy","¥":"yen","𝔜":"Yfr","𝔶":"yfr","Ї":"YIcy","ї":"yicy","𝕐":"Yopf","𝕪":"yopf","𝒴":"Yscr","𝓎":"yscr","Ю":"YUcy","ю":"yucy","ÿ":"yuml","Ÿ":"Yuml","Ź":"Zacute","ź":"zacute","Ž":"Zcaron","ž":"zcaron","З":"Zcy","з":"zcy","Ż":"Zdot","ż":"zdot","ℨ":"Zfr","Ζ":"Zeta","ζ":"zeta","𝔷":"zfr","Ж":"ZHcy","ж":"zhcy","⇝":"zigrarr","𝕫":"zopf","𝒵":"Zscr","𝓏":"zscr","‍":"zwj","‌":"zwnj"},f=/["&'<>`]/g,p={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},d=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g,m={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅","in":"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺","int":"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},v={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},x=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],_=String.fromCharCode,w={},A=w.hasOwnProperty,E=function(t,e){return A.call(t,e) +},k=function(t,e){for(var n=-1,r=t.length;++n=55296&&57343>=t||t>1114111?(e&&S("character reference outside the permissible Unicode range"),"�"):E(b,t)?(e&&S("disallowed character reference"),b[t]):(e&&k(x,t)&&S("disallowed character reference"),t>65535&&(t-=65536,n+=_(t>>>10&1023|55296),t=56320|1023&t),n+=_(t))},M=function(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperCase()+";"},S=function(t){throw Error("Parse error: "+t)},F=function(t,e){e=D(e,F.options);var n=e.strict;n&&g.test(t)&&S("forbidden code point");var r=e.encodeEverything,i=e.useNamedReferences,u=e.allowUnsafeSymbols;return r?(t=t.replace(s,function(t){return i&&E(h,t)?"&"+h[t]+";":M(t)}),i&&(t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),i&&(t=t.replace(l,function(t){return"&"+h[t]+";"}))):i?(u||(t=t.replace(f,function(t){return"&"+h[t]+";"})),t=t.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),t=t.replace(l,function(t){return"&"+h[t]+";"})):u||(t=t.replace(f,M)),t.replace(o,function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),r=1024*(e-55296)+n-56320+65536;return"&#x"+r.toString(16).toUpperCase()+";"}).replace(c,M)};F.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var T=function(t,e){e=D(e,T.options);var n=e.strict;return n&&d.test(t)&&S("malformed character reference"),t.replace(y,function(t,r,i,u,a,o,s,c){var l,h,f,p,d;return r?(l=r,h=i,n&&!h&&S("character reference was not terminated by a semicolon"),C(l,n)):u?(f=u,h=a,n&&!h&&S("character reference was not terminated by a semicolon"),l=parseInt(f,16),C(l,n)):o?(p=o,E(m,p)?m[p]:(n&&S("named character reference was not terminated by a semicolon"),t)):(p=s,d=c,d&&e.isAttributeValue?(n&&"="==d&&S("`&` did not start a character reference"),t):(n&&S("named character reference was not terminated by a semicolon"),v[p]+(d||"")))})};T.options={isAttributeValue:!1,strict:!1};var L=function(t){return t.replace(f,function(t){return p[t]})},B={version:"0.5.0",encode:F,decode:T,escape:L,unescape:T};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return B});else if(i&&!i.nodeType)if(u)u.exports=B;else for(var N in B)E(B,N)&&(i[N]=B[N]);else r.he=B}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],102:[function(t,e,n){(function(t){(function(){function r(t,e,n){for(var r=(n||0)-1,i=t?t.length:0;++r-1?0:-1:t?0:-1}function u(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:x+t,i=e[n]||(e[n]={});"object"==n?(i[r]||(i[r]=[])).push(t):i[r]=!0}}function a(t){return t.charCodeAt(0)}function o(t,e){for(var n=t.criteria,r=e.criteria,i=-1,u=n.length;++io||"undefined"==typeof a)return 1;if(o>a||"undefined"==typeof o)return-1}}return t.index-e.index}function s(t){var e=-1,n=t.length,r=t[0],i=t[n/2|0],a=t[n-1];if(r&&"object"==typeof r&&i&&"object"==typeof i&&a&&"object"==typeof a)return!1;var o=h();o["false"]=o["null"]=o["true"]=o.undefined=!1;var s=h();for(s.array=t,s.cache=o,s.push=u;++ei?0:i);++r=_&&u===r,c=[];if(o){var l=s(e);l?(u=i,e=l):o=!1}for(;++n-1:void 0});return i.pop(),u.pop(),v&&(f(i),f(u)),a}function ee(t,e,n,r,i){(Jr(e)?Xe:si)(e,function(e,u){var a,o,s=e,c=t[u];if(e&&((o=Jr(e))||ci(e))){for(var l=r.length;l--;)if(a=r[l]==e){c=i[l];break}if(!a){var h;n&&(s=n(c,e),(h="undefined"!=typeof s)&&(c=s)),h||(c=o?Jr(c)?c:[]:ci(c)?c:{}),r.push(e),i.push(c),h||ee(c,e,n,r,i)}}else n&&(s=n(c,e),"undefined"==typeof s&&(s=e)),"undefined"!=typeof s&&(c=s);t[u]=c})}function re(t,e){return t+Tr(Wr()*(e-t+1))}function ie(t,e,n){var u=-1,a=se(),o=t?t.length:0,c=[],h=!e&&o>=_&&a===r,d=n||h?l():c;if(h){var g=s(d);a=i,d=g}for(;++u3&&"function"==typeof e[n-2])var r=w(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(r=e[--n]);for(var i=d(arguments,1,n),u=-1,a=l(),o=l();++un?$r(0,u+n):n)||0,Jr(t)?a=i(t,e,n)>-1:"number"==typeof u?a=(qe(t)?t.indexOf(e,n):i(t,e,n))>-1:si(t,function(t){return++r>=n?!(a=t===e):void 0}),a}function Ye(t,n,r){var i=!0;n=e.createCallback(n,r,3);var u=-1,a=t?t.length:0;if("number"==typeof a)for(;++uu&&(u=c)}else n=null==n&&qe(t)?a:e.createCallback(n,r,3),Xe(t,function(t,e,r){var a=n(t,e,r);a>i&&(i=a,u=t)});return u}function en(t,n,r){var i=1/0,u=i;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&Jr(t))for(var o=-1,s=t.length;++oc&&(u=c)}else n=null==n&&qe(t)?a:e.createCallback(n,r,3),Xe(t,function(t,e,r){var a=n(t,e,r);i>a&&(i=a,u=t)});return u}function nn(t,n,r,i){if(!t)return r;var u=arguments.length<3;n=e.createCallback(n,i,4);var a=-1,o=t.length;if("number"==typeof o)for(u&&(r=t[++a]);++an?$r(0,i+n):n||0}else if(n){var u=Cn(t,e);return t[u]===e?u:-1}return r(t,e,n)}function bn(t,n,r){var i=0,u=t?t.length:0;if("number"!=typeof n&&null!=n){var a=u;for(n=e.createCallback(n,r,3);a--&&n(t[a],a,t);)i++}else i=null==n||r?1:n||i;return d(t,0,Yr($r(0,u-i),u))}function xn(){for(var t=[],e=-1,n=arguments.length,u=l(),a=se(),o=a===r,c=l();++e=_&&s(e?t[e]:c)))}var d=t[0],g=-1,y=d?d.length:0,m=[];t:for(;++gn?$r(0,r+n):Yr(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function An(t){for(var e=arguments,n=0,r=e.length,i=t?t.length:0;++nu;){var o=u+a>>>1;r(t[o])1?arguments:arguments[0],e=-1,n=t?tn(pi(t,"length")):0,r=dr(0>n?0:n);++e2?ae(t,17,d(arguments,2),null,e):ae(t,1,null,null,e)}function Rn(t){for(var e=arguments.length>1?Q(arguments,!0,!1,1):xe(t),n=-1,r=e.length;++n2?ae(e,19,d(arguments,2),null,t):ae(e,3,null,null,t)}function In(){for(var t=arguments,e=t.length;e--;)if(!Se(t[e]))throw new Ar;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function Pn(t,e){return e="number"==typeof e?e:+e||t.length,ae(t,4,null,null,null,e)}function jn(t,e,n){var r,i,u,a,o,s,c,l=0,h=!1,f=!0;if(!Se(t))throw new Ar;if(e=$r(0,e)||0,n===!0){var p=!0;f=!1}else Fe(n)&&(p=n.leading,h="maxWait"in n&&($r(e,n.maxWait)||0),f="trailing"in n?n.trailing:f);var d=function(){var n=e-(gi()-a);if(0>=n){i&&Fr(i);var h=c;i=s=c=y,h&&(l=gi(),u=t.apply(o,r),s||i||(r=o=null))}else s=Rr(d,n)},g=function(){s&&Fr(s),i=s=c=y,(f||h!==e)&&(l=gi(),u=t.apply(o,r),s||i||(r=o=null))};return function(){if(r=arguments,a=gi(),o=this,c=f&&(s||!p),h===!1)var n=p&&!s;else{i||p||(l=a);var y=h-(a-l),m=0>=y;m?(i&&(i=Fr(i)),l=a,u=t.apply(o,r)):i||(i=Rr(g,y))}return m&&s?s=Fr(s):s||e===h||(s=Rr(d,e)),n&&(m=!0,u=t.apply(o,r)),!m||s||i||(r=o=null),u}}function Un(t){if(!Se(t))throw new Ar;var e=d(arguments,1);return Rr(function(){t.apply(y,e)},1)}function Vn(t,e){if(!Se(t))throw new Ar;var n=d(arguments,2);return Rr(function(){t.apply(y,n)},e)}function zn(t,e){if(!Se(t))throw new Ar;var n=function(){var r=n.cache,i=e?e.apply(this,arguments):x+arguments[0];return Nr.call(r,i)?r[i]:r[i]=t.apply(this,arguments)};return n.cache={},n}function Hn(t){var e,n;if(!Se(t))throw new Ar;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function $n(t){return ae(t,16,d(arguments,1))}function Yn(t){return ae(t,32,null,d(arguments,1))}function Gn(t,e,n){var r=!0,i=!0;if(!Se(t))throw new Ar;return n===!1?r=!1:Fe(n)&&(r="leading"in n?n.leading:r,i="trailing"in n?n.trailing:i),G.leading=r,G.maxWait=e,G.trailing=i,jn(t,e,G)}function Wn(t,e){return ae(e,16,[t])}function Zn(t){return function(){return t}}function Xn(t,e,n){var r=typeof t;if(null==t||"function"==r)return w(t,e,n);if("object"!=r)return nr(t);var i=ti(t),u=i[0],a=t[u];return 1!=i.length||a!==a||Fe(a)?function(e){for(var n=i.length,r=!1;n--&&(r=te(e[i[n]],t[i[n]],null,!0)););return r}:function(t){var e=t[u];return a===e&&(0!==a||1/a==1/e)}}function Kn(t){return null==t?"":wr(t).replace(ii,oe)}function Jn(t){return t}function Qn(t,r,i){var u=!0,a=r&&xe(r);r&&(i||a.length)||(null==i&&(i=r),o=n,r=t,t=e,a=xe(r)),i===!1?u=!1:Fe(i)&&"chain"in i&&(u=i.chain);var o=t,s=Se(o);Xe(a,function(e){var n=t[e]=r[e];s&&(o.prototype[e]=function(){var e=this.__chain__,r=this.__wrapped__,i=[r];qr.apply(i,arguments);var a=n.apply(t,i);if(u||e){if(r===a&&Fe(a))return this;a=new o(a),a.__chain__=e}return a})})}function tr(){return t._=Dr,this}function er(){}function nr(t){return function(e){return e[t]}}function rr(t,e,n){var r=null==t,i=null==e;if(null==n&&("boolean"==typeof t&&i?(n=t,t=1):i||"boolean"!=typeof e||(n=e,i=!0)),r&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0,n||t%1||e%1){var u=Wr();return Yr(t+u*(e-t+parseFloat("1e-"+((u+"").length-1))),e)}return re(t,e)}function ir(t,e){if(t){var n=t[e];return Se(n)?t[e]():n}}function ur(t,n,r){var i=e.templateSettings;t=wr(t||""),r=ai({},r,i);var u,a=ai({},r.imports,i.imports),o=ti(a),s=ze(a),l=0,h=r.interpolate||L,f="__p += '",p=_r((r.escape||L).source+"|"+h.source+"|"+(h===F?C:L).source+"|"+(r.evaluate||L).source+"|$","g");t.replace(p,function(e,n,r,i,a,o){return r||(r=i),f+=t.slice(l,o).replace(N,c),n&&(f+="' +\n__e("+n+") +\n'"),a&&(u=!0,f+="';\n"+a+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=o+e.length,e}),f+="';\n";var d=r.variable,g=d;g||(d="obj",f="with ("+d+") {\n"+f+"\n}\n"),f=(u?f.replace(E,""):f).replace(k,"$1").replace(D,"$1;"),f="function("+d+") {\n"+(g?"":d+" || ("+d+" = {});\n")+"var __t, __p = '', __e = _.escape"+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var m="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+R++ +"]")+"\n*/";try{var v=mr(o,"return "+f+m).apply(y,s)}catch(b){throw b.source=f,b}return n?v(n):(v.source=f,v)}function ar(t,e,n){t=(t=+t)>-1?t:0;var r=-1,i=dr(t);for(e=w(e,n,1);++r/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:F,variable:"",imports:{_:e}},jr||(v=function(){function e(){}return function(n){if(Fe(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}());var Kr=Pr?function(t,e){W.value=e,Pr(t,"__bindData__",W)}:er,Jr=Ur||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Cr.call(t)==I||!1},Qr=function(t){var e,n=t,r=[];if(!n)return r;if(!Z[typeof t])return r;for(e in n)Nr.call(n,e)&&r.push(e);return r},ti=Hr?function(t){return Fe(t)?Hr(t):[]}:Qr,ei={"&":"&","<":"<",">":">",'"':""","'":"'"},ni=we(ei),ri=_r("("+ti(ni).join("|")+")","g"),ii=_r("["+ti(ei).join("")+"]","g"),ui=function(t,e,n){var r,i=t,u=i;if(!i)return u;var a=arguments,o=0,s="number"==typeof n?2:a.length;if(s>3&&"function"==typeof a[s-2])var c=w(a[--s-1],a[s--],2);else s>2&&"function"==typeof a[s-1]&&(c=a[--s]);for(;++o/g,T=RegExp("^["+A+"]*0+(?=.$)"),L=/($^)/,B=/\bthis\b/,N=/['\n\r\t\u2028\u2029\\]/g,q=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],R=0,O="[object Arguments]",I="[object Array]",P="[object Boolean]",j="[object Date]",U="[object Function]",V="[object Number]",z="[object Object]",H="[object RegExp]",$="[object String]",Y={};Y[U]=!1,Y[O]=Y[I]=Y[P]=Y[j]=Y[V]=Y[z]=Y[H]=Y[$]=!0;var G={leading:!1,maxWait:0,trailing:!1},W={configurable:!1,enumerable:!1,value:null,writable:!1},Z={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},X={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},K=Z[typeof window]&&window||this,J=Z[typeof n]&&n&&!n.nodeType&&n,Q=Z[typeof e]&&e&&!e.nodeType&&e,te=Q&&Q.exports===J&&J,ee=Z[typeof t]&&t;!ee||ee.global!==ee&&ee.window!==ee||(K=ee);var ne=g();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(K._=ne,define(function(){return ne})):J&&Q?te?(Q.exports=ne)._=ne:J._=ne:K._=ne}).call(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],103:[function(t,e){e.exports={name:"mermaid",version:"0.3.2",description:"Markdownish syntax for generating flowcharts",main:"src/main.js",bin:{mermaid:"./bin/mermaid.js"},scripts:{test:"gulp test"},repository:{type:"git",url:"https://github.com/knsv/mermaid"},author:"",license:"MIT",dependencies:{chalk:"^0.5.1",d3:"~3.4.13","dagre-d3":"~0.3.2",he:"^0.5.0",minimist:"^1.1.0",mkdirp:"^0.5.0",semver:"^4.1.1",which:"^1.0.8"},devDependencies:{async:"^0.9.0",browserify:"~6.2.0",clone:"^0.2.0","codeclimate-test-reporter":"0.0.4",d3:"~3.4.13","dagre-d3":"~0.3.2","event-stream":"^3.2.0",foundation:"^4.2.1-1","front-matter":"^0.2.0",gulp:"~3.8.9","gulp-browserify":"^0.5.0","gulp-bump":"^0.1.11","gulp-concat":"~2.4.1","gulp-data":"^1.1.1","gulp-ext-replace":"~0.1.0","gulp-hogan":"^1.1.0","gulp-istanbul":"^0.4.0","gulp-jasmine":"~1.0.1","gulp-jison":"~1.0.0","gulp-jshint":"^1.9.0","gulp-less":"^1.3.6","gulp-rename":"~1.2.0","gulp-shell":"^0.2.10","gulp-tag-version":"^1.2.1","gulp-uglify":"~1.0.1",he:"^0.5.0","hogan.js":"^3.0.2",jasmine:"~2.0.1",jison:"~0.4.15","jshint-stylish":"^1.0.0",karma:"~0.12.20","karma-chrome-launcher":"~0.1.5","karma-jasmine":"~0.2.1","karma-requirejs":"~0.2.2",lodash:"^2.4.1","lodash._escapestringchar":"^2.4.1","lodash._objecttypes":"^2.4.1","lodash._reinterpolate":"^2.4.1","lodash._reunescapedhtml":"^2.4.1","lodash.defaults":"^2.4.1","lodash.templatesettings":"^2.4.1","lodash.values":"^2.4.1",marked:"^0.3.2","mock-browser":"^0.90.27",path:"^0.4.9",phantomjs:"^1.9.12",proxyquire:"^1.3.1",rewire:"^2.1.3",rimraf:"^2.2.8","semantic-ui":"^1.4.1",tape:"^3.0.3"}} +},{}],104:[function(t,e,n){var r="",i=!1;n.setMessage=function(t){r=t},n.getMessage=function(){return r},n.setInfo=function(t){i=t},n.getInfo=function(){return i}},{}],105:[function(t,e,n){var r=t("./exampleDb"),i=t("./parser/example.js");n.draw=function(t,e,n){var u;u=i.parser,u.yy=r,u.parse(t);var a=d3.select("#"+e),o=a.append("g");o.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("mermaid "+n),a.attr("height",100),a.attr("width",400)}},{"./exampleDb":104,"./parser/example.js":106}],106:[function(t,e,n){(function(r){var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[6,9,10,12],r={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,message:11,say:12,TXT:13,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],performAction:function(t,e,n,r,i,u){var a=u.length-1;switch(i){case 1:return r;case 4:break;case 6:r.setInfo(!0);break;case 7:r.setMessage(u[a]);break;case 8:this.$=u[a-1].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],11:9,12:[1,10]},{1:[2,1]},e(n,[2,3]),e(n,[2,4]),e(n,[2,5]),e(n,[2,6]),e(n,[2,7]),{13:[1,11]},e(n,[2,8])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=d.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],u=[],a=this.table,o="",s=0,c=0,l=0,h=2,f=1,p=u.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);d.setInput(t,g.yy),g.yy.lexer=d,g.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;u.push(m);var v=d.options&&d.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,x,_,w,A,E,k,D,C,M={};;){if(_=r[r.length-1],this.defaultActions[_]?w=this.defaultActions[_]:((null===b||"undefined"==typeof b)&&(b=e()),w=a[_]&&a[_][b]),"undefined"==typeof w||!w.length||!w[0]){var S="";C=[];for(E in a[_])this.terminals_[E]&&E>h&&C.push("'"+this.terminals_[E]+"'");S=d.showPosition?"Parse error on line "+(s+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(s+1)+": Unexpected "+(b==f?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:m,expected:C})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(w[0]){case 1:r.push(b),i.push(d.yytext),u.push(d.yylloc),r.push(w[1]),b=null,x?(b=x,x=null):(c=d.yyleng,o=d.yytext,s=d.yylineno,m=d.yylloc,l>0&&l--);break;case 2:if(k=this.productions_[w[1]][1],M.$=i[i.length-k],M._$={first_line:u[u.length-(k||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(k||1)].first_column,last_column:u[u.length-1].last_column},v&&(M._$.range=[u[u.length-(k||1)].range[0],u[u.length-1].range[1]]),A=this.performAction.apply(M,[o,c,s,g.yy,w[1],i,u].concat(p)),"undefined"!=typeof A)return A;k&&(r=r.slice(0,-1*k*2),i=i.slice(0,-1*k),u=u.slice(0,-1*k)),r.push(this.productions_[w[1]][0]),i.push(M.$),u.push(M._$),D=a[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0}},i=function(){var t={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];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(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),r&&(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 u in i)this[u]=i[u];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),u=0;ue[0].length)){if(e=n,r=u,this.options.backtrack_lexer){if(t=this.test_match(n,i[u]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===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(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>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),t>=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 9;case 1:return 10;case 2:return 4;case 3:return 12;case 4:return 13;case 5:return 6;case 6:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return t}();return r.lexer=i,t.prototype=r,r.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":100,fs:98,path:99}],107:[function(t,e){var n;if(t)try{n=t("dagre-d3")}catch(r){}n||(n=window.dagreD3),e.exports=n},{"dagre-d3":2}],108:[function(t,e,n){(function(e){var r=t("./graphDb"),i=t("./parser/flow"),u=t("./parser/dot"),a=t("./dagre-d3");n.addVertices=function(t,n){var r=Object.keys(t),i=function(t,e){var n;for(n=0;n0&&(o=a.classes.join(" "));var s="";s=i(s,a.styles),u="undefined"==typeof a.text?a.id:a.text;var c="";e.mermaid.htmlLabels?c="html":(u=u.replace(/
/g,"\n"),c="text");var l=0,h="";switch(a.type){case"round":l=5,h="rect";break;case"square":h="rect";break;case"diamond":h="question";break;case"odd":h="rect_left_inv_arrow";break;case"odd_right":h="rect_left_inv_arrow";break;case"circle":h="circle";break;default:h="rect"}n.setNode(a.id,{labelType:c,shape:h,label:u,rx:l,ry:l,"class":o,style:s,id:a.id})})},n.addEdges=function(t,n){var r,i=0;t.forEach(function(t){i++,r="arrow_open"===t.type?"none":"normal";var u="";if("undefined"!=typeof t.style)t.style.forEach(function(t){u=u+t+";"});else switch(t.stroke){case"normal":u="stroke: #333; stroke-width: 1.5px;fill:none";break;case"dotted":u="stroke: #333; fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":u="stroke: #333; stroke-width: 3.5px;fill:none"}if("undefined"==typeof t.text)"undefined"==typeof t.style?n.setEdge(t.start,t.end,{style:u,arrowhead:r},i):n.setEdge(t.start,t.end,{style:u,arrowheadStyle:"fill: #333",arrowhead:r},i);else{var a=t.text.replace(/
/g,"\n");"undefined"==typeof t.style?e.mermaid.htmlLabels?n.setEdge(t.start,t.end,{labelType:"html",style:u,labelpos:"c",label:''+t.text+"",arrowheadStyle:"fill: #333",arrowhead:r},i):n.setEdge(t.start,t.end,{labelType:"text",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:a,arrowheadStyle:"fill: #333",arrowhead:r},i):n.setEdge(t.start,t.end,{labelType:"text",style:u,arrowheadStyle:"fill: #333",label:a,arrowhead:r},i)}})},n.getClasses=function(t,e){var n;r.clear(),n=e?u.parser:i.parser,n.yy=r,n.parse(t);var a=r.getClasses();return"undefined"==typeof a.default&&(a.default={id:"default"},a.default.styles=["fill:#ffa","stroke:#666","stroke-width:3px"],a.default.nodeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"],a.default.edgeLabelStyles=["fill:#000","stroke:none","font-weight:300",'font-family:"Helvetica Neue",Helvetica,Arial,sans-serf',"font-size:14px"]),a},n.draw=function(t,e,o){var s;r.clear(),s=o?u.parser:i.parser,s.yy=r,s.parse(t);var c;c=r.getDirection(),"undefined"==typeof c&&(c="TD");var l=new a.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:c,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),h=r.getSubGraphs(),f=0;h.forEach(function(){f+=1;var t="subG"+f;r.addVertex(t,void 0,void 0,void 0)});var p=r.getVertices(),d=r.getEdges();f=0,h.forEach(function(t){f+=1;var e="subG"+f;d3.selectAll("cluster").append("text"),t.nodes.forEach(function(t){l.setParent(t,e)})}),n.addVertices(p,l),n.addEdges(d,l);var g=new a.render;g.shapes().question=function(t,e,n){var r=e.width,i=e.height,u=.8*(r+i),o=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}],s=t.insert("polygon",":first-child").attr("points",o.map(function(t){return t.x+","+t.y}).join(" ")).attr("rx",5).attr("ry",5).attr("transform","translate("+-u/2+","+2*u/4+")");return n.intersect=function(t){return a.intersect.polygon(n,o,t)},s},g.shapes().rect_left_inv_arrow=function(t,e,n){var r=e.width,i=e.height,u=[{x:-i/2,y:0},{x:r,y:0},{x:r,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}],o=t.insert("polygon",":first-child").attr("points",u.map(function(t){return t.x+","+t.y}).join(" ")).attr("transform","translate("+-r/2+","+2*i/4+")");return n.intersect=function(t){return a.intersect.polygon(n,u,t)},o},g.shapes().rect_right_inv_arrow=function(t,e,n){var r=e.width,i=e.height,u=[{x:0,y:0},{x:r+i/2,y:0},{x:r,y:-i/2},{x:r+i/2,y:-i},{x:0,y:-i}],o=t.insert("polygon",":first-child").attr("points",u.map(function(t){return t.x+","+t.y}).join(" ")).attr("transform","translate("+-r/2+","+2*i/4+")");return n.intersect=function(t){return a.intersect.polygon(n,u,t)},o},g.arrows().none=function(t,e,n,r){var i=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=i.append("path").attr("d","M 0 0 L 0 0 L 0 0 z");a.util.applyStyle(u,n[r+"Style"])};var y=d3.select("#"+e);svgGroup=d3.select("#"+e+" g"),g(d3.select("#"+e+" g"),l);var m=document.querySelector("#mermaidChart0");y.attr("height",l.graph().height),y.attr("width",l.graph().width),y.attr("viewBox",m.getBBox().x+" 0 "+l.graph().width+" "+l.graph().height),setTimeout(function(){var t=0;h.forEach(function(n){var r=document.querySelectorAll("#"+e+" .clusters rect"),i=document.querySelectorAll("#"+e+" .cluster");if("undefined"!==n.title){var u=r[t].x.baseVal.value,a=r[t].y.baseVal.value,o=r[t].width.baseVal.value,s=d3.select(i[t]),c=s.append("text");c.attr("x",u+o/2),c.attr("y",a+14),c.attr("fill","black"),c.attr("stroke","none"),c.attr("id",e+"Text"),c.style("text-anchor","middle"),c.text(n.title)}t+=1})},200)}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./dagre-d3":107,"./graphDb":109,"./parser/dot":110,"./parser/flow":111}],109:[function(require,module,exports){var vertices={},edges=[],classes=[],subGraphs=[],direction,funs=[];exports.addVertex=function(t,e,n,r){"undefined"!=typeof t&&0!==t.trim().length&&("undefined"==typeof vertices[t]&&(vertices[t]={id:t,styles:[],classes:[]}),"undefined"!=typeof e&&(vertices[t].text=e),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof r&&null!==r&&r.forEach(function(e){vertices[t].styles.push(e)}))},exports.addLink=function(t,e,n,r){var i={start:t,end:e,type:void 0,text:""};r=n.text,"undefined"!=typeof r&&(i.text=r),"undefined"!=typeof n&&(i.type=n.type,i.stroke=n.stroke),edges.push(i)},exports.updateLink=function(t,e){t.substr(1);edges[t].style=e},exports.addClass=function(t,e){"undefined"==typeof classes[t]&&(classes[t]={id:t,styles:[]}),"undefined"!=typeof e&&null!==e&&e.forEach(function(e){classes[t].styles.push(e)})},exports.setDirection=function(t){direction=t},exports.setClass=function(t,e){t.indexOf(",")>0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)},exports.setClickEvent=function(id,functionName){id.indexOf(",")>0?id.split(",").forEach(function(id2){"undefined"!=typeof vertices[id2]&&funs.push(function(){var elem=document.getElementById(id2);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id2+"')")})})}):"undefined"!=typeof vertices[id]&&funs.push(function(){var elem=document.getElementById(id);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id+"')")})})},exports.bindFunctions=function(){funs.forEach(function(t){t()})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes},exports.clear=function(){vertices={},classes={},edges=[],funs=[],subGraphs=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},exports.addSubGraph=function(t,e){function n(t){var e={"boolean":{},number:{},string:{}},n=[];return t.filter(function(t){var r=typeof t;return r in e?e[r].hasOwnProperty(t)?!1:e[r][t]=!0:n.indexOf(t)>=0?!1:n.push(t)})}var r=[];r=n(r.concat.apply(r,t)),subGraphs.push({nodes:r,title:e})},exports.getSubGraphs=function(){return subGraphs}},{}],110:[function(t,e,n){(function(r){var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,5],r=[1,6],i=[1,12],u=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,17],l=[1,18],h=[1,19],f=[1,20],p=[1,21],d=[1,22],g=[8,16,17,18,19,20,21,22,23,24,25,26],y=[1,37],m=[1,33],v=[1,34],b=[1,35],x=[1,36],_=[8,10,16,17,18,19,20,21,22,23,24,25,26,28,32,37,39,40,45,57,58],w=[10,28],A=[10,28,37,57,58],E=[2,49],k=[1,45],D=[1,48],C=[1,49],M=[1,52],S=[2,65],F=[1,65],T=[1,66],L=[1,67],B=[1,68],N=[1,69],q=[1,70],R=[1,71],O=[1,72],I=[1,73],P=[8,16,17,18,19,20,21,22,23,24,25,26,47],j=[10,28,37],U={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graph:4,EOF:5,graphStatement:6,idStatement:7,"{":8,stmt_list:9,"}":10,strict:11,GRAPH:12,DIGRAPH:13,textNoTags:14,textNoTagsToken:15,ALPHA:16,NUM:17,COLON:18,PLUS:19,EQUALS:20,MULT:21,DOT:22,BRKT:23,SPACE:24,MINUS:25,keywords:26,stmt:27,";":28,node_stmt:29,edge_stmt:30,attr_stmt:31,"=":32,subgraph:33,attr_list:34,NODE:35,EDGE:36,"[":37,a_list:38,"]":39,",":40,edgeRHS:41,node_id:42,edgeop:43,port:44,":":45,compass_pt:46,SUBGRAPH:47,n:48,ne:49,e:50,se:51,s:52,sw:53,w:54,nw:55,c:56,ARROW_POINT:57,ARROW_OPEN:58,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"{",10:"}",11:"strict",12:"GRAPH",13:"DIGRAPH",16:"ALPHA",17:"NUM",18:"COLON",19:"PLUS",20:"EQUALS",21:"MULT",22:"DOT",23:"BRKT",24:"SPACE",25:"MINUS",26:"keywords",28:";",32:"=",35:"NODE",36:"EDGE",37:"[",39:"]",40:",",45:":",47:"SUBGRAPH",48:"n",49:"ne",50:"e",51:"se",52:"s",53:"sw",54:"w",55:"nw",56:"c",57:"ARROW_POINT",58:"ARROW_OPEN"},productions_:[0,[3,2],[4,5],[4,6],[4,4],[6,1],[6,1],[7,1],[14,1],[14,2],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[15,1],[9,1],[9,3],[27,1],[27,1],[27,1],[27,3],[27,1],[31,2],[31,2],[31,2],[34,4],[34,3],[34,3],[34,2],[38,5],[38,5],[38,3],[30,3],[30,3],[30,2],[30,2],[41,3],[41,3],[41,2],[41,2],[29,2],[29,1],[42,2],[42,1],[44,4],[44,2],[44,2],[33,5],[33,4],[33,3],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,1],[46,0],[43,1],[43,1]],performAction:function(t,e,n,r,i,u){var a=u.length-1;switch(i){case 1:this.$=u[a-1];break;case 2:this.$=u[a-4];break;case 3:this.$=u[a-5];break;case 4:this.$=u[a-3];break;case 8:case 10:case 11:this.$=u[a];break;case 9:this.$=u[a-1]+""+u[a];break;case 12:case 13:case 14:case 15:case 16:case 18:case 19:case 20:this.$=u[a];break;case 17:this.$="
";break;case 39:this.$="oy";break;case 40:r.addLink(u[a-1],u[a].id,u[a].op),this.$="oy";break;case 42:r.addLink(u[a-1],u[a].id,u[a].op),this.$={op:u[a-2],id:u[a-1]};break;case 44:this.$={op:u[a-1],id:u[a]};break;case 48:r.addVertex(u[a-1]),this.$=u[a-1];break;case 49:r.addVertex(u[a]),this.$=u[a];break;case 66:this.$="arrow";break;case 67:this.$="arrow_open"}},table:[{3:1,4:2,6:3,11:[1,4],12:n,13:r},{1:[3]},{5:[1,7]},{7:8,8:[1,9],14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d},{6:23,12:n,13:r},e(g,[2,5]),e(g,[2,6]),{1:[2,1]},{8:[1,24]},{7:30,8:y,9:25,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},e([8,10,28,32,37,39,40,45,57,58],[2,7],{15:38,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d}),e(_,[2,8]),e(_,[2,10]),e(_,[2,11]),e(_,[2,12]),e(_,[2,13]),e(_,[2,14]),e(_,[2,15]),e(_,[2,16]),e(_,[2,17]),e(_,[2,18]),e(_,[2,19]),e(_,[2,20]),{7:39,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d},{7:30,8:y,9:40,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},{10:[1,41]},{10:[2,21],28:[1,42]},e(w,[2,23]),e(w,[2,24]),e(w,[2,25]),e(A,E,{44:44,32:[1,43],45:k}),e(w,[2,27],{41:46,43:47,57:D,58:C}),e(w,[2,47],{43:47,34:50,41:51,37:M,57:D,58:C}),{34:53,37:M},{34:54,37:M},{34:55,37:M},{7:56,8:[1,57],14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d},{7:30,8:y,9:58,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},e(_,[2,9]),{8:[1,59]},{10:[1,60]},{5:[2,4]},{7:30,8:y,9:61,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},{7:62,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d},e(A,[2,48]),e(A,S,{14:10,15:11,7:63,46:64,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,48:F,49:T,50:L,51:B,52:N,53:q,54:R,55:O,56:I}),e(w,[2,41],{34:74,37:M}),{7:77,8:y,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,33:76,42:75,47:x},e(P,[2,66]),e(P,[2,67]),e(w,[2,46]),e(w,[2,40],{34:78,37:M}),{7:81,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,38:79,39:[1,80]},e(w,[2,28]),e(w,[2,29]),e(w,[2,30]),{8:[1,82]},{7:30,8:y,9:83,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},{10:[1,84]},{7:30,8:y,9:85,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},{5:[2,2]},{10:[2,22]},e(w,[2,26]),e(A,[2,51],{45:[1,86]}),e(A,[2,52]),e(A,[2,56]),e(A,[2,57]),e(A,[2,58]),e(A,[2,59]),e(A,[2,60]),e(A,[2,61]),e(A,[2,62]),e(A,[2,63]),e(A,[2,64]),e(w,[2,38]),e(j,[2,44],{43:47,41:87,57:D,58:C}),e(j,[2,45],{43:47,41:88,57:D,58:C}),e(A,E,{44:44,45:k}),e(w,[2,39]),{39:[1,89]},e(w,[2,34],{34:90,37:M}),{32:[1,91]},{7:30,8:y,9:92,12:m,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,27:26,29:27,30:28,31:29,33:31,35:v,36:b,42:32,47:x},{10:[1,93]},e(A,[2,55]),{10:[1,94]},e(A,S,{46:95,48:F,49:T,50:L,51:B,52:N,53:q,54:R,55:O,56:I}),e(j,[2,42]),e(j,[2,43]),e(w,[2,33],{34:96,37:M}),e(w,[2,32]),{7:97,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d},{10:[1,98]},e(A,[2,54]),{5:[2,3]},e(A,[2,50]),e(w,[2,31]),{28:[1,99],39:[2,37],40:[1,100]},e(A,[2,53]),{7:81,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,38:101},{7:81,14:10,15:11,16:i,17:u,18:a,19:o,20:s,21:c,22:l,23:h,24:f,25:p,26:d,38:102},{39:[2,35]},{39:[2,36]}],defaultActions:{7:[2,1],41:[2,4],60:[2,2],61:[2,22],94:[2,3],101:[2,35],102:[2,36]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=d.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],u=[],a=this.table,o="",s=0,c=0,l=0,h=2,f=1,p=u.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);d.setInput(t,g.yy),g.yy.lexer=d,g.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;u.push(m);var v=d.options&&d.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,x,_,w,A,E,k,D,C,M={};;){if(_=r[r.length-1],this.defaultActions[_]?w=this.defaultActions[_]:((null===b||"undefined"==typeof b)&&(b=e()),w=a[_]&&a[_][b]),"undefined"==typeof w||!w.length||!w[0]){var S="";C=[];for(E in a[_])this.terminals_[E]&&E>h&&C.push("'"+this.terminals_[E]+"'");S=d.showPosition?"Parse error on line "+(s+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(s+1)+": Unexpected "+(b==f?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:m,expected:C})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(w[0]){case 1:r.push(b),i.push(d.yytext),u.push(d.yylloc),r.push(w[1]),b=null,x?(b=x,x=null):(c=d.yyleng,o=d.yytext,s=d.yylineno,m=d.yylloc,l>0&&l--);break;case 2:if(k=this.productions_[w[1]][1],M.$=i[i.length-k],M._$={first_line:u[u.length-(k||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(k||1)].first_column,last_column:u[u.length-1].last_column},v&&(M._$.range=[u[u.length-(k||1)].range[0],u[u.length-1].range[1]]),A=this.performAction.apply(M,[o,c,s,g.yy,w[1],i,u].concat(p)),"undefined"!=typeof A)return A;k&&(r=r.slice(0,-1*k*2),i=i.slice(0,-1*k),u=u.slice(0,-1*k)),r.push(this.productions_[w[1]][0]),i.push(M.$),u.push(M._$),D=a[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0}},V=function(){var t={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];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(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),r&&(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 u in i)this[u]=i[u];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),u=0;ue[0].length)){if(e=n,r=u,this.options.backtrack_lexer){if(t=this.test_match(n,i[u]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===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(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>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),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"STYLE";case 1:return"LINKSTYLE";case 2:return"CLASSDEF";case 3:return"CLASS";case 4:return"CLICK";case 5:return 12;case 6:return 13;case 7:return 47;case 8:return 35;case 9:return 36;case 10:return"DIR";case 11:return"DIR";case 12:return"DIR";case 13:return"DIR";case 14:return"DIR";case 15:return"DIR";case 16:return 17;case 17:return 23;case 18:return 18;case 19:return 28;case 20:return 40;case 21:return 32;case 22:return 21;case 23:return 22;case 24:return"ARROW_CROSS";case 25:return 57;case 26:return"ARROW_CIRCLE";case 27:return 58;case 28:return 25;case 29:return 19;case 30:return 20;case 31:return 16;case 32:return"PIPE";case 33:return"PS";case 34:return"PE";case 35:return 37;case 36:return 39;case 37:return 8;case 38:return 10;case 39:return"QUOTE";case 40:return 24;case 41:return"NEWLINE";case 42:return 5}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:digraph\b)/,/^(?:subgraph\b)/,/^(?:node\b)/,/^(?:edge\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:--[x])/,/^(?:->)/,/^(?:--[o])/,/^(?:--)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!0}}}; +return t}();return U.lexer=V,t.prototype=U,U.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":100,fs:98,path:99}],111:[function(t,e,n){(function(r){var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,9,10,12,19,29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],r=[2,2],i=[1,9],u=[1,10],a=[1,11],o=[1,12],s=[1,20],c=[1,23],l=[1,24],h=[1,25],f=[1,26],p=[1,27],d=[1,32],g=[1,21],y=[1,34],m=[1,31],v=[1,33],b=[1,39],x=[1,38],_=[1,35],w=[1,36],A=[1,37],E=[1,9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],k=[29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],D=[2,19],C=[1,51],M=[1,52],S=[1,50],F=[1,75],T=[1,67],L=[1,76],B=[1,63],N=[1,62],q=[1,77],R=[1,78],O=[1,68],I=[1,65],P=[1,64],j=[1,70],U=[1,71],V=[1,72],z=[1,73],H=[1,74],$=[9,10,19],Y=[1,85],G=[1,86],W=[1,87],Z=[1,88],X=[1,89],K=[1,90],J=[1,91],Q=[1,92],te=[1,93],ee=[1,94],ne=[1,95],re=[1,96],ie=[9,10,19,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61],ue=[9,10,12,15,19,36,38,40,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,76,79,81,82,84,85,87,88,89],ae=[9,10,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],oe=[1,110],se=[1,113],ce=[1,111],le=[9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],he=[9,10,11,12,13,15,16,19,29,32,37,39,41,44,47,49,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89],fe=[9,10,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],pe=[2,122],de=[1,139],ge=[1,128],ye=[1,129],me=[1,126],ve=[1,127],be=[1,130],xe=[1,131],_e=[1,135],we=[1,136],Ae=[1,134],Ee=[1,137],ke=[1,125],De=[1,132],Ce=[1,133],Me=[1,138],Se=[76,79,81,82,84,85,87,88,89],Fe=[12,62,76,79,81,82,84,85,87,88,89],Te=[1,164],Le=[1,163],Be=[9,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],Ne=[1,197],qe=[1,194],Re=[1,201],Oe=[1,198],Ie=[1,195],Pe=[1,202],je=[1,192],Ue=[1,193],Ve=[1,196],ze=[1,199],He=[1,200],$e=[11,12,13,15,16,29,32,44,47,49,67,68,69,70,71,76,79,81,82,84,85,87,88,89],Ye=[1,217],Ge=[9,10,19,79],We=[9,10,12,19,44,67,75,76,77,79,81,82,83,84,85],Ze={trace:function(){},yy:{},symbols_:{error:2,mermaidDoc:3,graphConfig:4,document:5,line:6,spaceListNewline:7,statement:8,SEMI:9,EOF:10,GRAPH:11,SPACE:12,DIR:13,FirstStmtSeperator:14,TAGEND:15,TAGSTART:16,UP:17,DOWN:18,NEWLINE:19,spaceList:20,commentStatement:21,verticeStatement:22,separator:23,styleStatement:24,linkStyleStatement:25,classDefStatement:26,classStatement:27,clickStatement:28,subgraph:29,text:30,endStatement:31,end:32,vertex:33,link:34,alphaNum:35,SQS:36,SQE:37,PS:38,PE:39,DIAMOND_START:40,DIAMOND_STOP:41,alphaNumStatement:42,alphaNumToken:43,MINUS:44,linkStatement:45,arrowText:46,"--":47,"-.":48,"==":49,ARROW_POINT:50,ARROW_CIRCLE:51,ARROW_CROSS:52,ARROW_OPEN:53,DOTTED_ARROW_POINT:54,DOTTED_ARROW_CIRCLE:55,DOTTED_ARROW_CROSS:56,DOTTED_ARROW_OPEN:57,THICK_ARROW_POINT:58,THICK_ARROW_CIRCLE:59,THICK_ARROW_CROSS:60,THICK_ARROW_OPEN:61,PIPE:62,textToken:63,commentText:64,commentToken:65,keywords:66,STYLE:67,LINKSTYLE:68,CLASSDEF:69,CLASS:70,CLICK:71,textNoTags:72,textNoTagsToken:73,stylesOpt:74,HEX:75,NUM:76,PCT:77,style:78,COMMA:79,styleComponent:80,ALPHA:81,COLON:82,UNIT:83,BRKT:84,DOT:85,graphCodeTokens:86,PLUS:87,EQUALS:88,MULT:89,TAG_START:90,TAG_END:91,QUOTE:92,$accept:0,$end:1},terminals_:{2:"error",9:"SEMI",10:"EOF",11:"GRAPH",12:"SPACE",13:"DIR",15:"TAGEND",16:"TAGSTART",17:"UP",18:"DOWN",19:"NEWLINE",29:"subgraph",32:"end",36:"SQS",37:"SQE",38:"PS",39:"PE",40:"DIAMOND_START",41:"DIAMOND_STOP",44:"MINUS",47:"--",48:"-.",49:"==",50:"ARROW_POINT",51:"ARROW_CIRCLE",52:"ARROW_CROSS",53:"ARROW_OPEN",54:"DOTTED_ARROW_POINT",55:"DOTTED_ARROW_CIRCLE",56:"DOTTED_ARROW_CROSS",57:"DOTTED_ARROW_OPEN",58:"THICK_ARROW_POINT",59:"THICK_ARROW_CIRCLE",60:"THICK_ARROW_CROSS",61:"THICK_ARROW_OPEN",62:"PIPE",67:"STYLE",68:"LINKSTYLE",69:"CLASSDEF",70:"CLASS",71:"CLICK",75:"HEX",76:"NUM",77:"PCT",79:"COMMA",81:"ALPHA",82:"COLON",83:"UNIT",84:"BRKT",85:"DOT",87:"PLUS",88:"EQUALS",89:"MULT",90:"TAG_START",91:"TAG_END",92:"QUOTE"},productions_:[0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[6,1],[4,4],[4,4],[4,4],[4,4],[4,4],[14,1],[14,1],[14,2],[7,2],[7,2],[7,1],[7,1],[20,2],[20,1],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,6],[8,5],[31,1],[31,2],[23,1],[23,1],[23,1],[22,3],[22,1],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,1],[33,2],[35,1],[35,2],[42,1],[42,3],[34,2],[34,3],[34,1],[34,2],[34,5],[34,6],[34,5],[34,6],[34,5],[34,6],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[46,3],[30,1],[30,2],[64,1],[64,2],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[72,1],[72,2],[26,5],[27,5],[28,5],[24,5],[24,5],[25,5],[21,3],[74,1],[74,3],[78,1],[78,2],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[65,1],[65,1],[63,1],[63,1],[63,1],[63,1],[63,1],[73,1],[73,1],[73,1],[73,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1]],performAction:function(t,e,n,r,i,u){var a=u.length-1;switch(i){case 2:this.$=[];break;case 3:u[a]!==[]&&u[a-1].push(u[a]),this.$=u[a-1];break;case 4:case 5:case 50:case 52:case 77:case 79:case 90:this.$=u[a];break;case 8:r.setDirection(u[a-1]),this.$=u[a-1];break;case 9:r.setDirection("LR"),this.$=u[a-1];break;case 10:r.setDirection("RL"),this.$=u[a-1];break;case 11:r.setDirection("BT"),this.$=u[a-1];break;case 12:r.setDirection("TB"),this.$=u[a-1];break;case 22:case 24:case 25:case 26:case 27:case 28:this.$=[];break;case 23:this.$=u[a-1];break;case 29:r.addSubGraph(u[a-2],u[a-4]);break;case 30:r.addSubGraph(u[a-2],void 0);break;case 36:r.addLink(u[a-2],u[a],u[a-1]),this.$=[u[a-2],u[a]];break;case 37:this.$=[u[a]];break;case 38:this.$=u[a-3],r.addVertex(u[a-3],u[a-1],"square");break;case 39:this.$=u[a-4],r.addVertex(u[a-4],u[a-2],"square");break;case 40:this.$=u[a-5],r.addVertex(u[a-5],u[a-2],"circle");break;case 41:this.$=u[a-6],r.addVertex(u[a-6],u[a-3],"circle");break;case 42:this.$=u[a-3],r.addVertex(u[a-3],u[a-1],"round");break;case 43:this.$=u[a-4],r.addVertex(u[a-4],u[a-2],"round");break;case 44:this.$=u[a-3],r.addVertex(u[a-3],u[a-1],"diamond");break;case 45:this.$=u[a-4],r.addVertex(u[a-4],u[a-2],"diamond");break;case 46:this.$=u[a-3],r.addVertex(u[a-3],u[a-1],"odd");break;case 47:this.$=u[a-4],r.addVertex(u[a-4],u[a-2],"odd");break;case 48:this.$=u[a],r.addVertex(u[a]);break;case 49:this.$=u[a-1],r.addVertex(u[a-1]);break;case 51:case 78:case 80:case 91:this.$=u[a-1]+""+u[a];break;case 53:this.$=u[a-2]+"-"+u[a];break;case 54:u[a-1].text=u[a],this.$=u[a-1];break;case 55:u[a-2].text=u[a-1],this.$=u[a-2];break;case 56:this.$=u[a];break;case 57:case 76:this.$=u[a-1];break;case 58:case 60:case 62:u[a].text=u[a-2],this.$=u[a];break;case 59:case 61:case 63:u[a-1].text=u[a-3],this.$=u[a-1];break;case 64:this.$={type:"arrow",stroke:"normal"};break;case 65:this.$={type:"arrow_circle",stroke:"normal"};break;case 66:this.$={type:"arrow_cross",stroke:"normal"};break;case 67:this.$={type:"arrow_open",stroke:"normal"};break;case 68:this.$={type:"arrow",stroke:"dotted"};break;case 69:this.$={type:"arrow_circle",stroke:"dotted"};break;case 70:this.$={type:"arrow_cross",stroke:"dotted"};break;case 71:this.$={type:"arrow_open",stroke:"dotted"};break;case 72:this.$={type:"arrow",stroke:"thick"};break;case 73:this.$={type:"arrow_circle",stroke:"thick"};break;case 74:this.$={type:"arrow_cross",stroke:"thick"};break;case 75:this.$={type:"arrow_open",stroke:"thick"};break;case 92:this.$=u[a-4],r.addClass(u[a-2],u[a]);break;case 93:this.$=u[a-4],r.setClass(u[a-2],u[a]);break;case 94:this.$=u[a-4],r.setClickEvent(u[a-2],u[a]);break;case 95:this.$=u[a-4],r.addVertex(u[a-2],void 0,void 0,u[a]);break;case 96:case 97:this.$=u[a-4],r.updateLink(u[a-2],u[a]);break;case 99:this.$=[u[a]];break;case 100:u[a-2].push(u[a]),this.$=u[a-2];break;case 102:this.$=u[a-1]+u[a]}},table:[{3:1,4:2,11:[1,3]},{1:[3]},e(n,r,{5:4}),{12:[1,5]},{1:[2,1],6:6,7:7,8:8,9:i,10:u,12:a,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:f,71:p,76:d,77:g,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{13:[1,40],15:[1,41],16:[1,42],17:[1,43],18:[1,44]},e(E,[2,3]),{8:45,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:f,71:p,76:d,77:g,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},e(E,[2,5]),e(E,[2,6]),e(E,[2,7]),e(k,D,{7:46,12:a,19:o}),e(k,[2,18],{7:47,12:a,19:o}),{19:[1,48]},{9:C,10:M,19:S,23:49},{9:C,10:M,19:S,23:53},{9:C,10:M,19:S,23:54},{9:C,10:M,19:S,23:55},{9:C,10:M,19:S,23:56},{9:C,10:M,19:S,23:57},{9:C,10:M,11:F,12:T,13:L,15:B,16:N,19:S,23:59,29:q,30:58,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{77:[1,79]},e($,[2,37],{34:80,45:81,47:[1,82],48:[1,83],49:[1,84],50:Y,51:G,52:W,53:Z,54:X,55:K,56:J,57:Q,58:te,59:ee,60:ne,61:re}),{12:[1,97]},{12:[1,98]},{12:[1,99]},{12:[1,100]},{12:[1,101]},e(ie,[2,48],{43:30,42:107,12:[1,106],15:[1,105],36:[1,102],38:[1,103],40:[1,104],76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A}),e(ue,[2,50]),e(ue,[2,52],{44:[1,108]}),e(ae,[2,125]),e(ae,[2,126]),e(ae,[2,127]),e(ae,[2,128]),e(ae,[2,129]),e(ae,[2,130]),e(ae,[2,131]),e(ae,[2,132]),e(ae,[2,133]),{9:oe,12:se,14:109,19:ce,20:112},{9:oe,12:se,14:114,19:ce,20:112},{9:oe,12:se,14:115,19:ce,20:112},{9:oe,12:se,14:116,19:ce,20:112},{9:oe,12:se,14:117,19:ce,20:112},e(E,[2,4]),e(k,[2,16]),e(k,[2,17]),e(E,[2,22]),e(E,[2,23]),e(E,[2,33]),e(E,[2,34]),e(E,[2,35]),e(E,[2,24]),e(E,[2,25]),e(E,[2,26]),e(E,[2,27]),e(E,[2,28]),{9:C,10:M,11:F,12:T,13:L,15:B,16:N,19:S,23:118,29:q,32:R,43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},e(le,r,{5:120}),e(he,[2,77]),e(fe,[2,116]),e(fe,[2,117]),e(fe,[2,118]),e(fe,[2,119]),e(fe,[2,120]),e(fe,[2,121]),e(fe,pe),e(fe,[2,123]),e(fe,[2,124]),e(fe,[2,81]),e(fe,[2,82]),e(fe,[2,83]),e(fe,[2,84]),e(fe,[2,85]),e(fe,[2,86]),e(fe,[2,87]),e(fe,[2,88]),e(fe,[2,89]),{9:de,11:F,12:T,13:L,15:B,16:N,29:q,32:R,36:ge,37:ye,38:me,39:ve,40:be,41:xe,43:66,44:O,47:I,49:P,50:_e,51:we,52:Ae,53:Ee,62:ke,63:123,64:121,65:122,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,86:124,87:_,88:w,89:A,90:De,91:Ce,92:Me},{33:140,35:28,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},e(Se,[2,56],{46:141,12:[1,142],62:[1,143]}),{12:[1,144]},{12:[1,145]},{12:[1,146]},e(Fe,[2,64]),e(Fe,[2,65]),e(Fe,[2,66]),e(Fe,[2,67]),e(Fe,[2,68]),e(Fe,[2,69]),e(Fe,[2,70]),e(Fe,[2,71]),e(Fe,[2,72]),e(Fe,[2,73]),e(Fe,[2,74]),e(Fe,[2,75]),{35:147,42:29,43:30,75:[1,148],76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{76:[1,149]},{35:150,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{35:151,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{35:152,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,30:153,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,30:155,32:R,38:[1,154],43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,30:156,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,30:157,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},e(ie,[2,49]),e(ue,[2,51]),{43:158,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},e(n,[2,8]),e(n,[2,13]),e(n,[2,14]),{19:[1,159]},{12:se,19:[2,21],20:160},e(n,[2,9]),e(n,[2,10]),e(n,[2,11]),e(n,[2,12]),e(le,r,{5:161}),e(he,[2,78]),{6:6,7:7,8:8,9:i,10:u,12:Te,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,31:162,32:Le,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:f,71:p,76:d,77:g,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{9:de,11:F,12:T,13:L,15:B,16:N,19:[2,98],29:q,32:R,36:ge,37:ye,38:me,39:ve,40:be,41:xe,43:66,44:O,47:I,49:P,50:_e,51:we,52:Ae,53:Ee,62:ke,63:123,65:165,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,86:124,87:_,88:w,89:A,90:De,91:Ce,92:Me},e(Be,[2,79]),e(Be,[2,114]),e(Be,[2,115]),e(Be,[2,134]),e(Be,[2,135]),e(Be,[2,136]),e(Be,[2,137]),e(Be,[2,138]),e(Be,[2,139]),e(Be,[2,140]),e(Be,[2,141]),e(Be,[2,142]),e(Be,[2,143]),e(Be,[2,144]),e(Be,[2,145]),e(Be,[2,146]),e(Be,[2,147]),e(Be,[2,148]),e($,[2,36]),e(Se,[2,54],{12:[1,166]}),e(Se,[2,57]),{11:F,12:T,13:L,15:B,16:N,29:q,30:167,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,30:168,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,30:169,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,30:170,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{12:[1,171],42:107,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{12:[1,172]},{12:[1,173]},{12:[1,174],42:107,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{12:[1,175],42:107,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{12:[1,176],42:107,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,32:R,37:[1,177],43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,30:178,32:R,43:66,44:O,47:I,49:P,63:60,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,32:R,39:[1,179],43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,32:R,41:[1,180],43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:T,13:L,15:B,16:N,29:q,32:R,37:[1,181],43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},e(ue,[2,53]),e(n,[2,15]),{19:[2,20]},{6:6,7:7,8:8,9:i,10:u,12:Te,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,31:182,32:Le,33:22,35:28,42:29,43:30,67:c,68:l,69:h,70:f,71:p,76:d,77:g,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{9:C,10:M,19:S,23:183},e($,[2,31]),e(k,D,{7:46,31:184,12:Te,19:o,32:Le}),e(Be,[2,80]),e(Se,[2,55]),{11:F,12:T,13:L,15:B,16:N,29:q,32:R,43:66,44:O,47:I,49:P,62:[1,185],63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:[1,186],13:L,15:B,16:N,29:q,32:R,43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:[1,187],13:L,15:B,16:N,29:q,32:R,43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{11:F,12:[1,188],13:L,15:B,16:N,29:q,32:R,43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{12:Ne,44:qe,67:Re,74:189,75:Oe,76:Ie,77:Pe,78:190,80:191,81:je,82:Ue,83:Ve,84:ze,85:He},{12:Ne,44:qe,67:Re,74:203,75:Oe,76:Ie,77:Pe,78:190,80:191,81:je,82:Ue,83:Ve,84:ze,85:He},{12:Ne,44:qe,67:Re,74:204,75:Oe,76:Ie,77:Pe,78:190,80:191,81:je,82:Ue,83:Ve,84:ze,85:He},{12:Ne,44:qe,67:Re,74:205,75:Oe,76:Ie,77:Pe,78:190,80:191,81:je,82:Ue,83:Ve,84:ze,85:He},{35:206,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},{35:207,42:29,43:30,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},e(ie,[2,38],{12:[1,208]}),{11:F,12:T,13:L,15:B,16:N,29:q,32:R,39:[1,209],43:66,44:O,47:I,49:P,63:119,66:69,67:j,68:U,69:V,70:z,71:H,73:61,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A},e(ie,[2,42],{12:[1,210]}),e(ie,[2,44],{12:[1,211]}),e(ie,[2,46],{12:[1,212]}),{9:C,10:M,19:S,23:213},e(E,[2,30]),e($,[2,32]),e([12,76,79,81,82,84,85,87,88,89],[2,76]),e($e,pe,{45:214,50:Y,51:G,52:W,53:Z,54:X,55:K,56:J,57:Q,58:te,59:ee,60:ne,61:re}),e($e,pe,{45:215,50:Y,51:G,52:W,53:Z,54:X,55:K,56:J,57:Q,58:te,59:ee,60:ne,61:re}),e($e,pe,{45:216,50:Y,51:G,52:W,53:Z,54:X,55:K,56:J,57:Q,58:te,59:ee,60:ne,61:re}),e($,[2,95],{79:Ye}),e(Ge,[2,99],{80:218,12:Ne,44:qe,67:Re,75:Oe,76:Ie,77:Pe,81:je,82:Ue,83:Ve,84:ze,85:He}),e(We,[2,101]),e(We,[2,103]),e(We,[2,104]),e(We,[2,105]),e(We,[2,106]),e(We,[2,107]),e(We,[2,108]),e(We,[2,109]),e(We,[2,110]),e(We,[2,111]),e(We,[2,112]),e(We,[2,113]),e($,[2,96],{79:Ye}),e($,[2,97],{79:Ye}),e($,[2,92],{79:Ye}),e($,[2,93],{43:30,42:107,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A}),e($,[2,94],{43:30,42:107,76:d,79:y,81:m,82:v,84:b,85:x,87:_,88:w,89:A}),e(ie,[2,39]),{39:[1,219]},e(ie,[2,43]),e(ie,[2,45]),e(ie,[2,47]),e(E,[2,29]),e(Se,[2,58],{12:[1,220]}),e(Se,[2,60],{12:[1,221]}),e(Se,[2,62],{12:[1,222]}),{12:Ne,44:qe,67:Re,75:Oe,76:Ie,77:Pe,78:223,80:191,81:je,82:Ue,83:Ve,84:ze,85:He},e(We,[2,102]),e(ie,[2,40],{12:[1,224]}),e(Se,[2,59]),e(Se,[2,61]),e(Se,[2,63]),e(Ge,[2,100],{80:218,12:Ne,44:qe,67:Re,75:Oe,76:Ie,77:Pe,81:je,82:Ue,83:Ve,84:ze,85:He}),e(ie,[2,41])],defaultActions:{160:[2,20]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=d.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],u=[],a=this.table,o="",s=0,c=0,l=0,h=2,f=1,p=u.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);d.setInput(t,g.yy),g.yy.lexer=d,g.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;u.push(m);var v=d.options&&d.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,x,_,w,A,E,k,D,C,M={};;){if(_=r[r.length-1],this.defaultActions[_]?w=this.defaultActions[_]:((null===b||"undefined"==typeof b)&&(b=e()),w=a[_]&&a[_][b]),"undefined"==typeof w||!w.length||!w[0]){var S="";C=[];for(E in a[_])this.terminals_[E]&&E>h&&C.push("'"+this.terminals_[E]+"'");S=d.showPosition?"Parse error on line "+(s+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(s+1)+": Unexpected "+(b==f?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:m,expected:C})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(w[0]){case 1:r.push(b),i.push(d.yytext),u.push(d.yylloc),r.push(w[1]),b=null,x?(b=x,x=null):(c=d.yyleng,o=d.yytext,s=d.yylineno,m=d.yylloc,l>0&&l--);break;case 2:if(k=this.productions_[w[1]][1],M.$=i[i.length-k],M._$={first_line:u[u.length-(k||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(k||1)].first_column,last_column:u[u.length-1].last_column},v&&(M._$.range=[u[u.length-(k||1)].range[0],u[u.length-1].range[1]]),A=this.performAction.apply(M,[o,c,s,g.yy,w[1],i,u].concat(p)),"undefined"!=typeof A)return A;k&&(r=r.slice(0,-1*k*2),i=i.slice(0,-1*k),u=u.slice(0,-1*k)),r.push(this.productions_[w[1]][0]),i.push(M.$),u.push(M._$),D=a[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0}},Xe=function(){var t={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];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(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),r&&(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 u in i)this[u]=i[u];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),u=0;ue[0].length)){if(e=n,r=u,this.options.backtrack_lexer){if(t=this.test_match(n,i[u]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===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(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>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),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return 67;case 1:return 68;case 2:return 69;case 3:return 70;case 4:return 71;case 5:return 11;case 6:return 29;case 7:return 32;case 8:return 13;case 9:return 13;case 10:return 13;case 11:return 13;case 12:return 13;case 13:return 13;case 14:return 76;case 15:return 84;case 16:return 82;case 17:return 9;case 18:return 79;case 19:return 89;case 20:return 16;case 21:return 15;case 22:return 17;case 23:return 18;case 24:return 52;case 25:return 50;case 26:return 51;case 27:return 53;case 28:return 56;case 29:return 54;case 30:return 55;case 31:return 57;case 32:return 56;case 33:return 54;case 34:return 55;case 35:return 57;case 36:return 60;case 37:return 58;case 38:return 59;case 39:return 61;case 40:return 47;case 41:return 48;case 42:return 49;case 43:return 44;case 44:return 85;case 45:return 87;case 46:return 77;case 47:return 88;case 48:return 88;case 49:return 81;case 50:return 62;case 51:return 38;case 52:return 39;case 53:return 36;case 54:return 37;case 55:return 40;case 56:return 41;case 57:return 92;case 58:return 19;case 59:return 12;case 60:return 10}},rules:[/^(?:style\b)/,/^(?:linkStyle\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:subgraph\b)/,/^(?:end\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:v\b)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-\.-[x])/,/^(?:-\.->)/,/^(?:-\.-[o])/,/^(?:-\.-)/,/^(?:.-[x])/,/^(?:\.->)/,/^(?:\.-[o])/,/^(?:\.-)/,/^(?:==[x])/,/^(?:==>)/,/^(?:==[o])/,/^(?:==[\=])/,/^(?:--)/,/^(?:-\.)/,/^(?:==)/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:[\u0021-\u0027\u002A-\u002E\u003F\u0041-\u005A\u005C\u005F-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC_\/])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\n)/,/^(?:\s)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60],inclusive:!0}}};return t}();return Ze.lexer=Xe,t.prototype=Ze,Ze.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":100,fs:98,path:99}],112:[function(t,e){var n;if(t)try{n=t("d3")}catch(r){}n||(n=window.d3),e.exports=n},{d3:1}],113:[function(t,e,n){(function(r){var i=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[6,8,10,11,15,17,19,20,22,33],r=[2,2],i=[1,6],u=[1,8],a=[1,9],o=[1,12],s=[1,13],c=[1,14],l=[1,15],h=[1,17],f=[1,18],p=[2,7],d=[6,8,10,11,15,17,18,19,20,21,22,33],g=[6,8,10,11,15,17,18,19,20,22,33],y=[1,46],m=[1,49],v=[1,53],b={trace:function(){},yy:{},symbols_:{error:2,start:3,SD:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,participant:11,actor:12,signal:13,note_statement:14,title:15,text:16,loop:17,end:18,opt:19,alt:20,"else":21,note:22,placement:23,text2:24,over:25,spaceList:26,actor_pair:27,",":28,left_of:29,right_of:30,signaltype:31,actors:32,ACTOR:33,SOLID_OPEN_ARROW:34,DOTTED_OPEN_ARROW:35,SOLID_ARROW:36,DOTTED_ARROW:37,SOLID_CROSS:38,DOTTED_CROSS:39,TXT:40,$accept:0,$end:1},terminals_:{2:"error",4:"SD",6:"EOF",8:"SPACE",10:"NL",11:"participant",15:"title",16:"text",17:"loop",18:"end",19:"opt",20:"alt",21:"else",22:"note",25:"over",28:",",29:"left_of",30:"right_of",33:"ACTOR",34:"SOLID_OPEN_ARROW",35:"DOTTED_OPEN_ARROW",36:"SOLID_ARROW",37:"DOTTED_ARROW",38:"SOLID_CROSS",39:"DOTTED_CROSS",40:"TXT"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,3],[9,2],[9,2],[9,4],[9,4],[9,4],[9,7],[14,4],[14,5],[26,2],[26,1],[27,1],[27,3],[23,1],[23,1],[13,4],[32,2],[32,1],[12,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,1],[24,1]],performAction:function(t,e,n,r,i,u){var a=u.length-1; +switch(i){case 1:return r.apply(u[a-1]),u[a-1];case 2:this.$=[];break;case 3:u[a-1].push(u[a]),this.$=u[a-1];break;case 4:case 5:this.$=u[a];break;case 6:case 7:this.$=[];break;case 8:this.$=u[a-1];break;case 12:u[a-1].unshift({type:"loopStart",loopText:u[a-2].actor,signalType:r.LINETYPE.LOOP_START}),u[a-1].push({type:"loopEnd",loopText:u[a-2],signalType:r.LINETYPE.LOOP_END}),this.$=u[a-1];break;case 13:u[a-1].unshift({type:"optStart",optText:u[a-2].actor,signalType:r.LINETYPE.OPT_START}),u[a-1].push({type:"optEnd",optText:u[a-2].actor,signalType:r.LINETYPE.OPT_END}),this.$=u[a-1];break;case 14:u[a-4].unshift({type:"altStart",altText:u[a-5].actor,signalType:r.LINETYPE.ALT_START}),u[a-4].push({type:"else",altText:u[a-2].actor,signalType:r.LINETYPE.ALT_ELSE}),u[a-4]=u[a-4].concat(u[a-1]),u[a-4].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=u[a-4];break;case 15:this.$=[u[a-1],{type:"addNote",placement:u[a-2],actor:u[a-1].actor,text:u[a]}];break;case 19:this.$=u[a];break;case 20:this.$=[u[a-2],u[a]];break;case 21:this.$=r.PLACEMENT.LEFTOF;break;case 22:this.$=r.PLACEMENT.RIGHTOF;break;case 23:this.$=[u[a-3],u[a-1],{type:"addMessage",from:u[a-3].actor,to:u[a-1].actor,signalType:u[a-2],msg:u[a]}];break;case 26:this.$={type:"addActor",actor:u[a]};break;case 27:this.$=r.LINETYPE.SOLID_OPEN;break;case 28:this.$=r.LINETYPE.DOTTED_OPEN;break;case 29:this.$=r.LINETYPE.SOLID;break;case 30:this.$=r.LINETYPE.DOTTED;break;case 31:this.$=r.LINETYPE.SOLID_CROSS;break;case 32:this.$=r.LINETYPE.DOTTED_CROSS;break;case 33:this.$=u[a].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:[1,2]},{1:[3]},e(n,r,{5:3}),{6:[1,4],7:5,8:i,9:7,10:u,11:a,12:16,13:10,14:11,15:o,17:s,19:c,20:l,22:h,33:f},e(n,p,{1:[2,1]}),e(d,[2,3]),{9:19,11:a,12:16,13:10,14:11,15:o,17:s,19:c,20:l,22:h,33:f},e(d,[2,5]),e(d,[2,6]),{12:20,33:f},{10:[1,21]},{10:[1,22]},{8:[1,23]},{12:24,33:f},{12:25,33:f},{12:26,33:f},{31:27,34:[1,28],35:[1,29],36:[1,30],37:[1,31],38:[1,32],39:[1,33]},{23:34,25:[1,35],29:[1,36],30:[1,37]},e([6,8,10,11,15,17,18,19,20,21,22,28,33,34,35,36,37,38,39,40],[2,26]),e(d,[2,4]),{10:[1,38]},e(d,[2,9]),e(d,[2,10]),{16:[1,39]},e(g,r,{5:40}),e(g,r,{5:41}),e([6,8,10,11,15,17,19,20,21,22,33],r,{5:42}),{12:43,33:f},{33:[2,27]},{33:[2,28]},{33:[2,29]},{33:[2,30]},{33:[2,31]},{33:[2,32]},{12:44,33:f},{8:y,26:45},{33:[2,21]},{33:[2,22]},e(d,[2,8]),{10:[1,47]},{6:m,7:5,8:i,9:7,10:u,11:a,12:16,13:10,14:11,15:o,17:s,18:[1,48],19:c,20:l,22:h,33:f},{6:m,7:5,8:i,9:7,10:u,11:a,12:16,13:10,14:11,15:o,17:s,18:[1,50],19:c,20:l,22:h,33:f},{6:m,7:5,8:i,9:7,10:u,11:a,12:16,13:10,14:11,15:o,17:s,19:c,20:l,21:[1,51],22:h,33:f},{24:52,40:v},{24:54,40:v},{12:56,27:55,33:f},{8:y,26:57,33:[2,18]},e(d,[2,11]),e(d,[2,12]),e(d,p),e(d,[2,13]),{12:58,33:f},{10:[2,23]},{10:[2,33]},{10:[2,15]},{12:59,33:f},{28:[1,60],33:[2,19]},{33:[2,17]},e(g,r,{5:61}),{10:[2,16]},{12:62,33:f},{6:m,7:5,8:i,9:7,10:u,11:a,12:16,13:10,14:11,15:o,17:s,18:[1,63],19:c,20:l,22:h,33:f},{33:[2,20]},e(d,[2,14])],defaultActions:{28:[2,27],29:[2,28],30:[2,29],31:[2,30],32:[2,31],33:[2,32],36:[2,21],37:[2,22],52:[2,23],53:[2,33],54:[2,15],57:[2,17],59:[2,16],62:[2,20]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=d.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],u=[],a=this.table,o="",s=0,c=0,l=0,h=2,f=1,p=u.slice.call(arguments,1),d=Object.create(this.lexer),g={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(g.yy[y]=this.yy[y]);d.setInput(t,g.yy),g.yy.lexer=d,g.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;u.push(m);var v=d.options&&d.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,x,_,w,A,E,k,D,C,M={};;){if(_=r[r.length-1],this.defaultActions[_]?w=this.defaultActions[_]:((null===b||"undefined"==typeof b)&&(b=e()),w=a[_]&&a[_][b]),"undefined"==typeof w||!w.length||!w[0]){var S="";C=[];for(E in a[_])this.terminals_[E]&&E>h&&C.push("'"+this.terminals_[E]+"'");S=d.showPosition?"Parse error on line "+(s+1)+":\n"+d.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(s+1)+": Unexpected "+(b==f?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(S,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:m,expected:C})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(w[0]){case 1:r.push(b),i.push(d.yytext),u.push(d.yylloc),r.push(w[1]),b=null,x?(b=x,x=null):(c=d.yyleng,o=d.yytext,s=d.yylineno,m=d.yylloc,l>0&&l--);break;case 2:if(k=this.productions_[w[1]][1],M.$=i[i.length-k],M._$={first_line:u[u.length-(k||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(k||1)].first_column,last_column:u[u.length-1].last_column},v&&(M._$.range=[u[u.length-(k||1)].range[0],u[u.length-1].range[1]]),A=this.performAction.apply(M,[o,c,s,g.yy,w[1],i,u].concat(p)),"undefined"!=typeof A)return A;k&&(r=r.slice(0,-1*k*2),i=i.slice(0,-1*k),u=u.slice(0,-1*k)),r.push(this.productions_[w[1]][0]),i.push(M.$),u.push(M._$),D=a[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0}},x=function(){var t={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];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(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),r&&(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 u in i)this[u]=i[u];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),u=0;ue[0].length)){if(e=n,r=u,this.options.backtrack_lexer){if(t=this.test_match(n,i[u]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===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(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>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),t>=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 10;case 1:return 38;case 2:return 39;case 3:return 36;case 4:return 37;case 5:break;case 6:break;case 7:break;case 8:return 11;case 9:return 19;case 10:return 17;case 11:return 20;case 12:return 21;case 13:return 18;case 14:return 29;case 15:return 30;case 16:return 25;case 17:return 22;case 18:return 15;case 19:return 4;case 20:return 28;case 21:return 10;case 22:return 33;case 23:return 34;case 24:return 35;case 25:return 36;case 26:return 37;case 27:return 40;case 28:return 6;case 29:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:[\-][x])/i,/^(?:[\-][\-][x])/i,/^(?:[\-][>][>])/i,/^(?:[\-][\-][>][>])/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:participant\b)/i,/^(?:opt\b)/i,/^(?:loop\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\->:\n,;]+)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],inclusive:!0}}};return t}();return b.lexer=x,t.prototype=b,b.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":100,fs:98,path:99}],114:[function(t,e,n){var r={},i=[],u=[],a=[];n.addActor=function(t,e,n){r[t]={name:e,description:n},i.push(t)},n.addMessage=function(t,e,n,r){u.push({from:t,to:e,message:n,answer:r})},n.addSignal=function(t,e,n,r){u.push({from:t,to:e,message:n,type:r})},n.getMessages=function(){return u},n.getActors=function(){return r},n.getActor=function(t){return r[t]},n.getActorKeys=function(){return Object.keys(r)},n.clear=function(){r={},u=[]},n.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16},n.ARROWTYPE={FILLED:0,OPEN:1},n.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},n.addNote=function(t,e,r){var i={actor:t,placement:e,message:r};a.push(i),u.push({from:t,to:t,message:r,type:n.LINETYPE.NOTE,placement:e})},n.parseError=function(t){console.log("Syntax error:"+t)},n.apply=function(t){if(t instanceof Array)t.forEach(function(t){n.apply(t)});else switch(t.type){case"addActor":n.addActor(t.actor,t.actor,t.actor);break;case"addNote":n.addNote(t.actor,t.placement,t.text);break;case"addMessage":n.addSignal(t.from,t.to,t.msg,t.signalType);break;case"loopStart":n.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":n.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":n.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":n.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":n.addSignal(void 0,void 0,void 0,t.signalType)}}},{}],115:[function(t,e,n){var r=t("./parser/sequenceDiagram").parser;r.yy=t("./sequenceDb");var i=t("./svgDraw"),u=t("./d3"),a={diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35};n.bounds={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,list:[],init:function(){this.list=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,r){t[e]="undefined"==typeof t[e]?n:r(n,t[e])},updateLoops:function(t,e,r,i){var u=this,o=0;this.list.forEach(function(s){o++;var c=u.list.length-o+1;u.updateVal(s,"startx",t-c*a.boxMargin,Math.min),u.updateVal(s,"starty",e-c*a.boxMargin,Math.min),u.updateVal(s,"stopx",r+c*a.boxMargin,Math.max),u.updateVal(s,"stopy",i+c*a.boxMargin,Math.max),u.updateVal(n.bounds.data,"startx",t-c*a.boxMargin,Math.min),u.updateVal(n.bounds.data,"starty",e-c*a.boxMargin,Math.min),u.updateVal(n.bounds.data,"stopx",r+c*a.boxMargin,Math.max),u.updateVal(n.bounds.data,"stopy",i+c*a.boxMargin,Math.max)})},insert:function(t,e,r,i){var u,a,o,s;u=Math.min(t,r),o=Math.max(t,r),a=Math.min(e,i),s=Math.max(e,i),this.updateVal(n.bounds.data,"startx",u,Math.min),this.updateVal(n.bounds.data,"starty",a,Math.min),this.updateVal(n.bounds.data,"stopx",o,Math.max),this.updateVal(n.bounds.data,"stopy",s,Math.max),this.updateLoops(u,a,o,s)},newLoop:function(t){this.list.push({startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t})},endLoop:function(){var t=this.list.pop();return t},addElseToLoop:function(t){var e=this.list.pop();e.elsey=n.bounds.getVerticalPos(),e.elseText=t,this.list.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}};var o=function(t,e,r,u){var o=i.getNoteRect();o.x=e,o.y=r,o.width=a.width,o.class="note";var s=t.append("g"),c=i.drawRect(s,o),l=i.getTextObj();l.x=e,l.y=r+a.noteMargin,l.textMargin=a.noteMargin,l.dy="1em",l.text=u.message,l.class="noteText";var h=i.drawText(s,l),f=h[0][0].getBBox().height;n.bounds.insert(e,r,e+a.width,r+2*a.noteMargin+f),c.attr("height",f+2*a.noteMargin),n.bounds.bumpVerticalPos(f+2*a.noteMargin)},s=function(t,e,i,u,a){var o,s=t.append("g"),c=e+(i-e)/2,l=s.append("text").attr("x",c).attr("y",u-7).style("text-anchor","middle").attr("class","messageText").text(a.message),h=l[0][0].getBBox().width;if(e===i){o=s.append("path").attr("d","M "+e+","+u+" C "+(e+60)+","+(u-10)+" "+(e+60)+","+(u+30)+" "+e+","+(u+20)),n.bounds.bumpVerticalPos(30);var f=Math.max(h/2,100);n.bounds.insert(e-f,n.bounds.getVerticalPos()-10,i+f,n.bounds.getVerticalPos())}else o=s.append("line"),o.attr("x1",e),o.attr("y1",u),o.attr("x2",i),o.attr("y2",u),n.bounds.insert(e,n.bounds.getVerticalPos()-10,i,n.bounds.getVerticalPos());a.type===r.yy.LINETYPE.DOTTED||a.type===r.yy.LINETYPE.DOTTED_CROSS||a.type===r.yy.LINETYPE.DOTTED_OPEN?(o.style("stroke-dasharray","3, 3"),o.attr("class","messageLine1")):o.attr("class","messageLine0"),o.attr("stroke-width",2),o.attr("stroke","black"),o.style("fill","none"),(a.type===r.yy.LINETYPE.SOLID||a.type===r.yy.LINETYPE.DOTTED)&&o.attr("marker-end","url(#arrowhead)"),(a.type===r.yy.LINETYPE.SOLID_CROSS||a.type===r.yy.LINETYPE.DOTTED_CROSS)&&o.attr("marker-end","url(#crosshead)")};e.exports.drawActors=function(t,e,r){var u;for(u=0;u/gi).forEach(function(t){var r=n.append("tspan");r.attr("x",e.x+e.textMargin),r.attr("dy",e.dy),r.text(t)}),"undefined"!=typeof e.class&&n.attr("class",e.class),n},n.drawLabel=function(t,e){var r=n.getNoteRect();r.x=e.x,r.y=e.y,r.width=50,r.height=20,r.fill="#526e52",r.stroke="none",r.class="labelBox",n.drawRect(t,r),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,e.fill="white",n.drawText(t,e)},n.drawActor=function(t,e,r,i){var u=e+i.width/2,a=t.append("g");a.append("line").attr("x1",u).attr("y1",5).attr("x2",u).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999");var o=n.getNoteRect();o.x=e,o.fill="#eaeaea",o.width=i.width,o.height=i.height,o.class="actor",o.rx=3,o.ry=3,n.drawRect(a,o),a.append("text").attr("x",u).attr("y",i.height/2+5).attr("class","actor").style("text-anchor","middle").text(r)},n.drawLoop=function(t,e,r,i){var u=t.append("g"),a=function(t,e,n,r){u.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",r).attr("stroke-width",2).attr("stroke","#526e52").attr("class","loopLine")};a(e.startx,e.starty,e.stopx,e.starty),a(e.stopx,e.starty,e.stopx,e.stopy),a(e.startx,e.stopy,e.stopx,e.stopy),a(e.startx,e.starty,e.startx,e.stopy),"undefined"!=typeof e.elsey&&a(e.startx,e.elsey,e.stopx,e.elsey);var o=n.getTextObj();o.text=r,o.x=e.startx,o.y=e.starty,o.labelMargin=1.5*i.boxMargin,o.class="labelText",o.fill="white",n.drawLabel(u,o),o=n.getTextObj(),o.text="[ "+e.title+" ]",o.x=e.startx+(e.stopx-e.startx)/2,o.y=e.starty+1.5*i.boxMargin,o.anchor="middle",o.class="loopText",n.drawText(u,o),"undefined"!=typeof e.elseText&&(o.text="[ "+e.elseText+" ]",o.y=e.elsey+1.5*i.boxMargin,n.drawText(u,o))},n.insertArrowHead=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},n.insertArrowCrossHead=function(t){var e=t.append("defs"),n=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},n.getTextObj=function(){var t={x:0,y:0,fill:"black","text-anchor":"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0};return t},n.getNoteRect=function(){var t={x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0};return t}},{}],117:[function(t,e,n){(function(e){var r=t("./diagrams/flowchart/graphDb"),i=t("./diagrams/flowchart/parser/flow"),u=t("./utils"),a=t("./diagrams/flowchart/flowRenderer"),o=t("./diagrams/sequenceDiagram/sequenceRenderer"),s=t("./diagrams/example/exampleRenderer"),c=t("he"),l=function(t){var e,i=document.querySelectorAll(".mermaid");"undefined"!==t&&"undefined"!=typeof t&&o.setConf(JSON.parse(t));var l=0;for(e=0;e/g,">"),p=p.replace(/';var d=u.detectType(p),g={};switch(d){case"graph":g=a.getClasses(p,!1),a.draw(p,f,!1),u.cloneCssStyles(h.firstChild,g),r.bindFunctions();break;case"dotGraph":g=a.getClasses(p,!0),a.draw(p,f,!0),u.cloneCssStyles(h.firstChild,g);break;case"sequenceDiagram":o.draw(p,f),u.cloneCssStyles(h.firstChild,[]);break;case"info":s.draw(p,f,n.version()),u.cloneCssStyles(h.firstChild,[])}}}};n.tester=function(){},n.version=function(){return t("../package.json").version};var h=function(t,e){return"undefined"==typeof e?!1:t===e};e.mermaid={startOnLoad:!0,htmlLabels:!0,init:function(t){l(t)},version:function(){return n.version()},getParser:function(){return i.parser}},n.contentLoaded=function(){"undefined"!=typeof mermaid_config&&h(!1,mermaid_config.htmlLabels)&&(e.mermaid.htmlLabels=!1),e.mermaid.startOnLoad&&("undefined"!=typeof mermaid_config?h(!0,mermaid_config.startOnLoad)&&e.mermaid.init():e.mermaid.init())},"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",function(){n.contentLoaded()},!1)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../package.json":103,"./diagrams/example/exampleRenderer":105,"./diagrams/flowchart/flowRenderer":108,"./diagrams/flowchart/graphDb":109,"./diagrams/flowchart/parser/flow":111,"./diagrams/sequenceDiagram/sequenceRenderer":115,"./utils":118,he:101}],118:[function(t,e){e.exports.detectType=function(t){return t.match(/^\s*sequenceDiagram/)?"sequenceDiagram":t.match(/^\s*sequence/)?"sequence":t.match(/^\s*digraph/)?(console.log("Detected dot syntax"),"dotGraph"):t.match(/^\s*info/)?"info":"graph"},e.exports.cloneCssStyles=function(t,e){for(var n="",r=document.styleSheets,i=0;i0&&(n+=o.selectorText+" { "+o.style.cssText+" }\n")}}}var c="",l="";for(var h in e)e.hasOwnProperty(h)&&"undefined"!=typeof h&&("default"===h?(e.default.styles instanceof Array&&(c+="#"+t.id.trim()+" .node { "+e[h].styles.join("; ")+"; }\n"),e.default.nodeLabelStyles instanceof Array&&(c+="#"+t.id.trim()+" .node text { "+e[h].nodeLabelStyles.join("; ")+"; }\n"),e.default.edgeLabelStyles instanceof Array&&(c+="#"+t.id.trim()+" .edgeLabel text { "+e[h].edgeLabelStyles.join("; ")+"; }\n")):e[h].styles instanceof Array&&(l+="#"+t.id.trim()+" ."+h+" { "+e[h].styles.join("; ")+"; }\n"));if(""!==n||""!==c||""!==l){var f=document.createElement("style");f.setAttribute("type","text/css"),f.setAttribute("title","mermaid-svg-internal-css"),f.innerHTML="/* */\n",t.insertBefore(f,t.firstChild)}}},{}]},{},[117]); \ No newline at end of file diff --git a/package.json b/package.json index d91564986..25f24b34b 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "license": "MIT", "dependencies": { "chalk": "^0.5.1", + "d3": "~3.4.13", "dagre-d3": "~0.3.2", "he": "^0.5.0", "minimist": "^1.1.0", @@ -71,6 +72,7 @@ "mock-browser": "^0.90.27", "path": "^0.4.9", "phantomjs": "^1.9.12", + "proxyquire": "^1.3.1", "rewire": "^2.1.3", "rimraf": "^2.2.8", "semantic-ui": "^1.4.1", diff --git a/src/diagrams/sequenceDiagram/d3.js b/src/diagrams/sequenceDiagram/d3.js new file mode 100644 index 000000000..1d2bbf774 --- /dev/null +++ b/src/diagrams/sequenceDiagram/d3.js @@ -0,0 +1,15 @@ +/* global window */ + +var d3; + +if (require) { + try { + d3 = require("d3"); + } catch (e) {} +} + +if (!d3) { + d3 = window.d3; +} + +module.exports = d3; diff --git a/src/diagrams/sequenceDiagram/sequenceDiagram.spec.js b/src/diagrams/sequenceDiagram/sequenceDiagram.spec.js index 85847dffe..fabadaf5a 100644 --- a/src/diagrams/sequenceDiagram/sequenceDiagram.spec.js +++ b/src/diagrams/sequenceDiagram/sequenceDiagram.spec.js @@ -1,8 +1,16 @@ /** * Created by knut on 14-11-18. */ +var proxyquire = require('proxyquire'); + +var newD3; +var d3 = { + select:function(){ + return new newD3(); + } +}; var sq = require('./parser/sequenceDiagram').parser; -var sd = require('./sequenceRenderer'); +var sd = proxyquire('./sequenceRenderer', { './d3': d3 }); var str; describe('when parsing a sequenceDiagram',function() { @@ -480,7 +488,7 @@ describe('when rendering a sequenceDiagram',function() { }; sq.yy.parseError = parseError; - function newD3() { + newD3 = function() { var o = { append: function (type) { return newD3(); @@ -508,16 +516,8 @@ describe('when rendering a sequenceDiagram',function() { }; return o; - } - - var _d3 = { - select:function(){ - return new newD3(); - } }; - d3 = _d3; - conf = { diagramMarginX:50, diagramMarginY:10, diff --git a/src/diagrams/sequenceDiagram/sequenceRenderer.js b/src/diagrams/sequenceDiagram/sequenceRenderer.js index c991358db..9d8a551e1 100644 --- a/src/diagrams/sequenceDiagram/sequenceRenderer.js +++ b/src/diagrams/sequenceDiagram/sequenceRenderer.js @@ -1,4 +1,3 @@ -/* globals d3 */ /** * Created by knut on 14-11-23. */ @@ -6,6 +5,7 @@ var sq = require('./parser/sequenceDiagram').parser; sq.yy = require('./sequenceDb'); var svgDraw = require('./svgDraw'); +var d3 = require('./d3'); var conf = { diagramMarginX:50,