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ASqzB,EAAgBwE,EAAMC,GAClC,IAAIC,EAAQF,EAAK7hB,SAASlD,YAAY,GAAGhH,KAAI,SAAUnI,GAAK,OAAOA,EAAE,EAAI,IAAIq0B,EAAQH,EAAK7hB,SAASlD,YAAY,GAAGhH,KAAI,SAAUnI,GAAK,OAAOA,EAAE,EAAI,IAAIs0B,EAAQH,EAAK9hB,SAASlD,YAAY,GAAGhH,KAAI,SAAUnI,GAAK,OAAOA,EAAE,EAAI,IAAIu0B,EAAQJ,EAAK9hB,SAASlD,YAAY,GAAGhH,KAAI,SAAUnI,GAAK,OAAOA,EAAE,EAAI,IACpS,OAAQrC,KAAKC,IAAI2J,MAAM,KAAM6sB,KAAWz2B,KAAKC,IAAI2J,MAAM,KAAM+sB,IACzD32B,KAAKC,IAAI2J,MAAM,KAAM8sB,KAAW12B,KAAKC,IAAI2J,MAAM,KAAMgtB,IACrD52B,KAAKwF,IAAIoE,MAAM,KAAM6sB,KAAWz2B,KAAKwF,IAAIoE,MAAM,KAAM+sB,IACrD32B,KAAKwF,IAAIoE,MAAM,KAAM8sB,KAAW12B,KAAKwF,IAAIoE,MAAM,KAAMgtB,EAC7D,CAYO,SAAS5E,EAAiB3P,EAAMwU,GACnC,OAAOA,EAAIniB,SAASlD,YAAY,GAAGslB,OAAM,SAAUz0B,GAC/C,OAAOkwB,EAAAA,EAAAA,IAAsBxmB,EAAAA,EAAAA,IAAM1J,GAAIggB,EAC3C,GACJ,CAQO,SAASgQ,EAAiB0E,EAAQC,GACrC,OAAOD,EAAO,KAAOC,EAAO,IAAMD,EAAO,KAAOC,EAAO,EAC3D,C","sources":["webpack://app/./node_modules/@turf/tesselate/node_modules/earcut/src/earcut.js","webpack://app/./node_modules/call-bind/callBound.js","webpack://app/./node_modules/concaveman/node_modules/rbush/rbush.min.js","webpack://app/./node_modules/d3-array/src/array.js","webpack://app/./node_modules/d3-array/src/ascending.js","webpack://app/./node_modules/d3-array/src/bisect.js","webpack://app/./node_modules/d3-array/src/bisector.js","webpack://app/./node_modules/d3-array/src/merge.js","webpack://app/./node_modules/d3-array/src/ticks.js","webpack://app/./node_modules/d3-geo/src/adder.js","webpack://app/./node_modules/d3-geo/src/area.js","webpack://app/./node_modules/d3-geo/src/bounds.js","webpack://app/./node_modules/d3-geo/src/cartesian.js","webpack://app/./node_modules/d3-geo/src/centroid.js","webpack://app/./node_modules/d3-geo/src/clip/antimeridian.js","webpack://app/./node_modules/d3-geo/src/clip/buffer.js","webpack://app/./node_modules/d3-geo/src/clip/polygon.js","webpack://app/./node_modules/d3-geo/src/distance.js","webpack://app/./node_modules/d3-geo/src/length.js","webpack://app/./node_modules/d3-geo/src/math.js","webpack://app/./node_modules/d3-geo/src/noop.js","webpack://app/./node_modules/d3-geo/src/path/area.js","webpack://app/./node_modules/d3-geo/src/path/bounds.js","webpack://app/./node_modules/d3-geo/src/path/context.js","webpack://app/./node_modules/d3-geo/src/path/measure.js","webpack://app/./node_modules/d3-geo/src/path/string.js","webpack://app/./node_modules/d3-geo/src/pointEqual.js","webpack://app/./node_modules/d3-geo/src/polygonContains.js","webpack://app/./node_modules/d3-geo/src/projection/azimuthal.js","webpack://app/./node_modules/d3-geo/src/projection/azimuthalEqualArea.js","webpack://app/./node_modules/d3-geo/src/projection/azimuthalEquidistant.js","webpack://app/./node_modules/d3-geo/src/projection/equirectangular.js","webpack://app/./node_modules/d3-geo/src/projection/gnomonic.js","webpack://app/./node_modules/d3-geo/src/projection/mercator.js","webpack://app/./node_modules/d3-geo/src/projection/naturalEarth1.js","webpack://app/./node_modules/d3-geo/src/projection/orthographic.js","webpack://app/./node_modules/d3-geo/src/projection/resample.js","webpack://app/./node_modules/d3-geo/src/projection/stereographic.js","webpack://app/./node_modules/d3-geo/src/projection/transverseMercator.js","webpack://app/./node_modules/d3-geo/src/rotation.js","webpack://app/./node_modules/d3-geo/src/stream.js","webpack://app/./node_modules/d3-geo/src/transform.js","webpack://app/./node_modules/d3-voronoi/src/RedBlackTree.js","webpack://app/./node_modules/d3-voronoi/src/Edge.js","webpack://app/./node_modules/d3-voronoi/src/Cell.js","webpack://app/./node_modules/d3-voronoi/src/Circle.js","webpack://app/./node_modules/d3-voronoi/src/Beach.js","webpack://app/./node_modules/d3-voronoi/src/Diagram.js","webpack://app/./node_modules/density-clustering/lib/DBSCAN.js","webpack://app/./node_modules/density-clustering/lib/KMEANS.js","webpack://app/./node_modules/density-clustering/lib/OPTICS.js","webpack://app/./node_modules/density-clustering/lib/PriorityQueue.js","webpack://app/./node_modules/function-bind/implementation.js","webpack://app/./node_modules/geojson-rbush/node_modules/rbush/rbush.min.js","webpack://app/./node_modules/has-symbols/shams.js","webpack://app/./node_modules/has-tostringtag/shams.js","webpack://app/./node_modules/object-is/implementation.js","webpack://app/./node_modules/object-is/polyfill.js","webpack://app/./node_modules/object-is/shim.js","webpack://app/./node_modules/object-keys/implementation.js","webpack://app/./node_modules/object-keys/isArguments.js","webpack://app/./node_modules/point-in-polygon/flat.js","webpack://app/./node_modules/point-in-polygon/nested.js","webpack://app/./node_modules/rbush/node_modules/quickselect/quickselect.js","webpack://app/./node_modules/regexp.prototype.flags/implementation.js","webpack://app/./node_modules/regexp.prototype.flags/polyfill.js","webpack://app/./node_modules/regexp.prototype.flags/shim.js","webpack://app/./node_modules/robust-predicates/umd/orient2d.min.js","webpack://app/../../distance.js","webpack://app/../../kinit.js","webpack://app/../../main.js","webpack://app/./node_modules/topojson-server/src/object.js","webpack://app/./node_modules/topojson-server/src/hash/point-hash.js","webpack://app/./node_modules/@turf/bezier-spline/dist/es/lib/spline.js","webpack://app/./node_modules/@turf/polygonize/dist/es/lib/EdgeRing.js","webpack://app/./node_modules/@turf/polygonize/dist/es/lib/Node.js","webpack://app/./node_modules/@turf/polygonize/dist/es/lib/Edge.js","webpack://app/./node_modules/@turf/polygonize/dist/es/lib/Graph.js","webpack://app/./node_modules/@turf/polygonize/dist/es/lib/util.js"],"sourcesContent":["'use strict';\n\nmodule.exports = earcut;\nmodule.exports.default = earcut;\n\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 32767 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim | 0);\n triangles.push(ear.i / dim | 0);\n triangles.push(next.i / dim | 0);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n var p = c.next;\n while (p !== a) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(x0, y0, minX, minY, invSize),\n maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim | 0);\n triangles.push(p.i / dim | 0);\n triangles.push(b.i / dim | 0);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n outerNode = eliminateHole(queue[i], outerNode);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n var bridge = findHoleBridge(hole, outerNode);\n if (!bridge) {\n return outerNode;\n }\n\n var bridgeReverse = splitPolygon(bridge, hole);\n\n // filter collinear points around the cuts\n filterPoints(bridgeReverse, bridgeReverse.next);\n return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n m = p.x < p.next.x ? p : p.next;\n if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = (x - minX) * invSize | 0;\n y = (y - minY) * invSize | 0;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = 0;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","!function(t,i){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=i():\"function\"==typeof define&&define.amd?define(i):(t=t||self).RBush=i()}(this,function(){\"use strict\";function t(t,r,e,a,h){!function t(n,r,e,a,h){for(;a>e;){if(a-e>600){var o=a-e+1,s=r-e+1,l=Math.log(o),f=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*f*(o-f)/o)*(s-o/2<0?-1:1),m=Math.max(e,Math.floor(r-s*f/o+u)),c=Math.min(a,Math.floor(r+(o-s)*f/o+u));t(n,r,m,c,h)}var p=n[r],d=e,x=a;for(i(n,e,r),h(n[a],p)>0&&i(n,e,a);d0;)x--}0===h(n[e],p)?i(n,e,x):i(n,++x,a),x<=r&&(e=x+1),r<=x&&(a=x-1)}}(t,r,e||0,a||t.length-1,h||n)}function i(t,i,n){var r=t[i];t[i]=t[n],t[n]=r}function n(t,i){return ti?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,i,n){if(!n)return i.indexOf(t);for(var r=0;r=t.minX&&i.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,r,e,a){for(var h=[n,r];h.length;)if(!((r=h.pop())-(n=h.pop())<=e)){var o=n+Math.ceil((r-n)/e/2)*e;t(i,o,n,r,a),h.push(n,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var i=this.data,n=[];if(!c(t,i))return n;for(var r=this.toBBox,e=[];i;){for(var a=0;a=0&&e[i].children.length>this._maxEntries;)this._split(e,i),i--;this._adjustParentBBoxes(r,e,i)},r.prototype._split=function(t,i){var n=t[i],r=n.children.length,e=this._minEntries;this._chooseSplitAxis(n,e,r);var h=this._chooseSplitIndex(n,e,r),o=p(n.children.splice(h,n.children.length-h));o.height=n.height,o.leaf=n.leaf,a(n,this.toBBox),a(o,this.toBBox),i?t[i-1].children.push(o):this._splitRoot(n,o)},r.prototype._splitRoot=function(t,i){this.data=p([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,i,n){for(var r,e,a,o,s,l,u,m=1/0,c=1/0,p=i;p<=n-i;p++){var d=h(t,0,p,this.toBBox),x=h(t,p,n,this.toBBox),v=(e=d,a=x,o=void 0,s=void 0,l=void 0,u=void 0,o=Math.max(e.minX,a.minX),s=Math.max(e.minY,a.minY),l=Math.min(e.maxX,a.maxX),u=Math.min(e.maxY,a.maxY),Math.max(0,l-o)*Math.max(0,u-s)),M=f(d)+f(x);v=i;c--){var p=t.children[c];o(s,t.leaf?e(p):p),l+=u(s)}return l},r.prototype._adjustParentBBoxes=function(t,i,n){for(var r=n;r>=0;r--)o(i[r],t)},r.prototype._condense=function(t){for(var i=t.length-1,n=void 0;i>=0;i--)0===t[i].children.length?i>0?(n=t[i-1].children).splice(n.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},r});\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","export default function(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import ascending from \"./ascending\";\nimport bisector from \"./bisector\";\n\nvar ascendingBisect = bisector(ascending);\nexport var bisectRight = ascendingBisect.right;\nexport var bisectLeft = ascendingBisect.left;\nexport default bisectRight;\n","import ascending from \"./ascending\";\n\nexport default function(compare) {\n if (compare.length === 1) compare = ascendingComparator(compare);\n return {\n left: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n },\n right: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) > 0) hi = mid;\n else lo = mid + 1;\n }\n return lo;\n }\n };\n}\n\nfunction ascendingComparator(f) {\n return function(d, x) {\n return ascending(f(d), x);\n };\n}\n","export default function(arrays) {\n var n = arrays.length,\n m,\n i = -1,\n j = 0,\n merged,\n array;\n\n while (++i < n) j += arrays[i].length;\n merged = new Array(j);\n\n while (--n >= 0) {\n array = arrays[n];\n m = array.length;\n while (--m >= 0) {\n merged[--j] = array[m];\n }\n }\n\n return merged;\n}\n","var e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nexport default function(start, stop, count) {\n var reverse,\n i = -1,\n n,\n ticks,\n step;\n\n stop = +stop, start = +start, count = +count;\n if (start === stop && count > 0) return [start];\n if (reverse = stop < start) n = start, start = stop, stop = n;\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array(n = Math.ceil(stop - start + 1));\n while (++i < n) ticks[i] = (start + i) * step;\n } else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array(n = Math.ceil(start - stop + 1));\n while (++i < n) ticks[i] = (start - i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nexport function tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n","// Adds floating point numbers with twice the normal precision.\n// Reference: J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and\n// Fast Robust Geometric Predicates, Discrete & Computational Geometry 18(3)\n// 305–363 (1997).\n// Code adapted from GeographicLib by Charles F. F. Karney,\n// http://geographiclib.sourceforge.net/\n\nexport default function() {\n return new Adder;\n}\n\nfunction Adder() {\n this.reset();\n}\n\nAdder.prototype = {\n constructor: Adder,\n reset: function() {\n this.s = // rounded value\n this.t = 0; // exact error\n },\n add: function(y) {\n add(temp, y, this.t);\n add(this, temp.s, this.s);\n if (this.s) this.t += temp.t;\n else this.s = temp.t;\n },\n valueOf: function() {\n return this.s;\n }\n};\n\nvar temp = new Adder;\n\nfunction add(adder, a, b) {\n var x = adder.s = a + b,\n bv = x - a,\n av = x - bv;\n adder.t = (a - av) + (b - bv);\n}\n","import adder from \"./adder\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math\";\nimport noop from \"./noop\";\nimport stream from \"./stream\";\n\nexport var areaRingSum = adder();\n\nvar areaSum = adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum.reset();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum.reset();\n stream(object, areaStream);\n return areaSum * 2;\n}\n","import adder from \"./adder\";\nimport {areaStream, areaRingSum} from \"./area\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian\";\nimport {abs, degrees, epsilon, radians} from \"./math\";\nimport stream from \"./stream\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum = adder(),\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum.reset();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n 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]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","import {asin, atan2, cos, degrees, epsilon, epsilon2, radians, sin, sqrt} from \"./math\";\nimport noop from \"./noop\";\nimport stream from \"./stream\";\n\nvar W0, W1,\n X0, Y0, Z0,\n X1, Y1, Z1,\n X2, Y2, Z2,\n lambda00, phi00, // first point\n x0, y0, z0; // previous point\n\nvar centroidStream = {\n sphere: noop,\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n }\n};\n\n// Arithmetic mean of Cartesian vectors.\nfunction centroidPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi));\n}\n\nfunction centroidPointCartesian(x, y, z) {\n ++W0;\n X0 += (x - X0) / W0;\n Y0 += (y - Y0) / W0;\n Z0 += (z - Z0) / W0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidLinePointFirst;\n}\n\nfunction centroidLinePointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidStream.point = centroidLinePoint;\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLinePoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n w = atan2(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);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\n// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,\n// J. Applied Mechanics 42, 239 (1975).\nfunction centroidRingStart() {\n centroidStream.point = centroidRingPointFirst;\n}\n\nfunction centroidRingEnd() {\n centroidRingPoint(lambda00, phi00);\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingPointFirst(lambda, phi) {\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n centroidStream.point = centroidRingPoint;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidRingPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n cx = y0 * z - z0 * y,\n cy = z0 * x - x0 * z,\n cz = x0 * y - y0 * x,\n m = sqrt(cx * cx + cy * cy + cz * cz),\n w = asin(m), // line weight = angle\n v = m && -w / m; // area weight multiplier\n X2 += v * cx;\n Y2 += v * cy;\n Z2 += v * cz;\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nexport default function(object) {\n W0 = W1 =\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n stream(object, centroidStream);\n\n var x = X2,\n y = Y2,\n z = Z2,\n m = x * x + y * y + z * z;\n\n // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.\n if (m < epsilon2) {\n x = X1, y = Y1, z = Z1;\n // If the feature has zero length, fall back to arithmetic mean of point vectors.\n if (W1 < epsilon) x = X0, y = Y0, z = Z0;\n m = x * x + y * y + z * z;\n // If the feature still has an undefined ccentroid, then return.\n if (m < epsilon2) return [NaN, NaN];\n }\n\n return [atan2(y, x) * degrees, asin(z / sqrt(m)) * degrees];\n}\n","import clip from \"./index\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","import noop from \"../noop\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y) {\n line.push([x, y]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import pointEqual from \"../pointEqual\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n // If the first and last points of a segment are coincident, then treat as a\n // closed ring. TODO if all rings are closed, then the winding order of the\n // exterior ring should be checked.\n if (pointEqual(p0, p1)) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","import length from \"./length\";\n\nvar coordinates = [null, null],\n object = {type: \"LineString\", coordinates: coordinates};\n\nexport default function(a, b) {\n coordinates[0] = a;\n coordinates[1] = b;\n return length(object);\n}\n","import adder from \"./adder\";\nimport {abs, atan2, cos, radians, sin, sqrt} from \"./math\";\nimport noop from \"./noop\";\nimport stream from \"./stream\";\n\nvar lengthSum = adder(),\n lambda0,\n sinPhi0,\n cosPhi0;\n\nvar lengthStream = {\n sphere: noop,\n point: noop,\n lineStart: lengthLineStart,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop\n};\n\nfunction lengthLineStart() {\n lengthStream.point = lengthPointFirst;\n lengthStream.lineEnd = lengthLineEnd;\n}\n\nfunction lengthLineEnd() {\n lengthStream.point = lengthStream.lineEnd = noop;\n}\n\nfunction lengthPointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n lambda0 = lambda, sinPhi0 = sin(phi), cosPhi0 = cos(phi);\n lengthStream.point = lengthPoint;\n}\n\nfunction lengthPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var sinPhi = sin(phi),\n cosPhi = cos(phi),\n delta = abs(lambda - lambda0),\n cosDelta = cos(delta),\n sinDelta = sin(delta),\n x = cosPhi * sinDelta,\n y = cosPhi0 * sinPhi - sinPhi0 * cosPhi * cosDelta,\n z = sinPhi0 * sinPhi + cosPhi0 * cosPhi * cosDelta;\n lengthSum.add(atan2(sqrt(x * x + y * y), z));\n lambda0 = lambda, sinPhi0 = sinPhi, cosPhi0 = cosPhi;\n}\n\nexport default function(object) {\n lengthSum.reset();\n stream(object, lengthStream);\n return +lengthSum;\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","import adder from \"../adder\";\nimport {abs} from \"../math\";\nimport noop from \"../noop\";\n\nvar areaSum = adder(),\n areaRingSum = adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum.reset();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum.reset();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import noop from \"../noop\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {tau} from \"../math\";\nimport noop from \"../noop\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import adder from \"../adder\";\nimport {sqrt} from \"../math\";\nimport noop from \"../noop\";\n\nvar lengthSum = adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum.reset();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","export default function PathString() {\n this._string = [];\n}\n\nPathString.prototype = {\n _radius: 4.5,\n _circle: circle(4.5),\n pointRadius: function(_) {\n if ((_ = +_) !== this._radius) this._radius = _, this._circle = null;\n return this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._string.push(\"Z\");\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._string.push(\"M\", x, \",\", y);\n this._point = 1;\n break;\n }\n case 1: {\n this._string.push(\"L\", x, \",\", y);\n break;\n }\n default: {\n if (this._circle == null) this._circle = circle(this._radius);\n this._string.push(\"M\", x, \",\", y, this._circle);\n break;\n }\n }\n },\n result: function() {\n if (this._string.length) {\n var result = this._string.join(\"\");\n this._string = [];\n return result;\n } else {\n return null;\n }\n }\n};\n\nfunction circle(radius) {\n return \"m0,\" + radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + -2 * radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + 2 * radius\n + \"z\";\n}\n","import {abs, epsilon} from \"./math\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import adder from \"./adder\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian\";\nimport {asin, atan2, cos, epsilon, pi, quarterPi, sin, tau} from \"./math\";\n\nvar sum = adder();\n\nexport default function(polygon, point) {\n var lambda = point[0],\n phi = point[1],\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n sum.reset();\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = point0[0],\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = point1[0],\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon) ^ (winding & 1);\n}\n","import {asin, atan2, cos, sin, sqrt} from \"../math\";\n\nexport function azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nexport function azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n","import {asin, sqrt} from \"../math\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal\";\nimport projection from \"./index\";\n\nexport var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {\n return sqrt(2 / (1 + cxcy));\n});\n\nazimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {\n return 2 * asin(z / 2);\n});\n\nexport default function() {\n return projection(azimuthalEqualAreaRaw)\n .scale(124.75)\n .clipAngle(180 - 1e-3);\n}\n","import {acos, sin} from \"../math\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal\";\nimport projection from \"./index\";\n\nexport var azimuthalEquidistantRaw = azimuthalRaw(function(c) {\n return (c = acos(c)) && c / sin(c);\n});\n\nazimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {\n return z;\n});\n\nexport default function() {\n return projection(azimuthalEquidistantRaw)\n .scale(79.4188)\n .clipAngle(180 - 1e-3);\n}\n","import projection from \"./index\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {atan, cos, sin} from \"../math\";\nimport {azimuthalInvert} from \"./azimuthal\";\nimport projection from \"./index\";\n\nexport function gnomonicRaw(x, y) {\n var cy = cos(y), k = cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\ngnomonicRaw.invert = azimuthalInvert(atan);\n\nexport default function() {\n return projection(gnomonicRaw)\n .scale(144.049)\n .clipAngle(60);\n}\n","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math\";\nimport rotation from \"../rotation\";\nimport projection from \"./index\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","import projection from \"./index\";\nimport {abs, epsilon} from \"../math\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","import {asin, cos, epsilon, sin} from \"../math\";\nimport {azimuthalInvert} from \"./azimuthal\";\nimport projection from \"./index\";\n\nexport function orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nexport default function() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n","import {cartesian} from \"../cartesian\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math\";\nimport {transformer} from \"../transform\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import {atan, cos, sin} from \"../math\";\nimport {azimuthalInvert} from \"./azimuthal\";\nimport projection from \"./index\";\n\nexport function stereographicRaw(x, y) {\n var cy = cos(y), k = 1 + cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\nstereographicRaw.invert = azimuthalInvert(function(z) {\n return 2 * atan(z);\n});\n\nexport default function() {\n return projection(stereographicRaw)\n .scale(250)\n .clipAngle(142);\n}\n","import {atan, exp, halfPi, log, tan} from \"../math\";\nimport {mercatorProjection} from \"./mercator\";\n\nexport function transverseMercatorRaw(lambda, phi) {\n return [log(tan((halfPi + phi) / 2)), -lambda];\n}\n\ntransverseMercatorRaw.invert = function(x, y) {\n return [-y, 2 * atan(exp(x)) - halfPi];\n};\n\nexport default function() {\n var m = mercatorProjection(transverseMercatorRaw),\n center = m.center,\n rotate = m.rotate;\n\n m.center = function(_) {\n return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]);\n };\n\n m.rotate = function(_) {\n return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]);\n };\n\n return rotate([0, 0, 90])\n .scale(159.155);\n}\n","import compose from \"./compose\";\nimport {asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math\";\n\nfunction rotationIdentity(lambda, phi) {\n return [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","function RedBlackTree() {\n this._ = null; // root node\n}\n\nexport function RedBlackNode(node) {\n node.U = // parent node\n node.C = // color - true for red, false for black\n node.L = // left node\n node.R = // right node\n node.P = // previous node\n node.N = null; // next node\n}\n\nRedBlackTree.prototype = {\n constructor: RedBlackTree,\n\n insert: function(after, node) {\n var parent, grandpa, uncle;\n\n if (after) {\n node.P = after;\n node.N = after.N;\n if (after.N) after.N.P = node;\n after.N = node;\n if (after.R) {\n after = after.R;\n while (after.L) after = after.L;\n after.L = node;\n } else {\n after.R = node;\n }\n parent = after;\n } else if (this._) {\n after = RedBlackFirst(this._);\n node.P = null;\n node.N = after;\n after.P = after.L = node;\n parent = after;\n } else {\n node.P = node.N = null;\n this._ = node;\n parent = null;\n }\n node.L = node.R = null;\n node.U = parent;\n node.C = true;\n\n after = node;\n while (parent && parent.C) {\n grandpa = parent.U;\n if (parent === grandpa.L) {\n uncle = grandpa.R;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.R) {\n RedBlackRotateLeft(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n RedBlackRotateRight(this, grandpa);\n }\n } else {\n uncle = grandpa.L;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.L) {\n RedBlackRotateRight(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n RedBlackRotateLeft(this, grandpa);\n }\n }\n parent = after.U;\n }\n this._.C = false;\n },\n\n remove: function(node) {\n if (node.N) node.N.P = node.P;\n if (node.P) node.P.N = node.N;\n node.N = node.P = null;\n\n var parent = node.U,\n sibling,\n left = node.L,\n right = node.R,\n next,\n red;\n\n if (!left) next = right;\n else if (!right) next = left;\n else next = RedBlackFirst(right);\n\n if (parent) {\n if (parent.L === node) parent.L = next;\n else parent.R = next;\n } else {\n this._ = next;\n }\n\n if (left && right) {\n red = next.C;\n next.C = node.C;\n next.L = left;\n left.U = next;\n if (next !== right) {\n parent = next.U;\n next.U = node.U;\n node = next.R;\n parent.L = node;\n next.R = right;\n right.U = next;\n } else {\n next.U = parent;\n parent = next;\n node = next.R;\n }\n } else {\n red = node.C;\n node = next;\n }\n\n if (node) node.U = parent;\n if (red) return;\n if (node && node.C) { node.C = false; return; }\n\n do {\n if (node === this._) break;\n if (node === parent.L) {\n sibling = parent.R;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n RedBlackRotateLeft(this, parent);\n sibling = parent.R;\n }\n if ((sibling.L && sibling.L.C)\n || (sibling.R && sibling.R.C)) {\n if (!sibling.R || !sibling.R.C) {\n sibling.L.C = false;\n sibling.C = true;\n RedBlackRotateRight(this, sibling);\n sibling = parent.R;\n }\n sibling.C = parent.C;\n parent.C = sibling.R.C = false;\n RedBlackRotateLeft(this, parent);\n node = this._;\n break;\n }\n } else {\n sibling = parent.L;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n RedBlackRotateRight(this, parent);\n sibling = parent.L;\n }\n if ((sibling.L && sibling.L.C)\n || (sibling.R && sibling.R.C)) {\n if (!sibling.L || !sibling.L.C) {\n sibling.R.C = false;\n sibling.C = true;\n RedBlackRotateLeft(this, sibling);\n sibling = parent.L;\n }\n sibling.C = parent.C;\n parent.C = sibling.L.C = false;\n RedBlackRotateRight(this, parent);\n node = this._;\n break;\n }\n }\n sibling.C = true;\n node = parent;\n parent = parent.U;\n } while (!node.C);\n\n if (node) node.C = false;\n }\n};\n\nfunction RedBlackRotateLeft(tree, node) {\n var p = node,\n q = node.R,\n parent = p.U;\n\n if (parent) {\n if (parent.L === p) parent.L = q;\n else parent.R = q;\n } else {\n tree._ = q;\n }\n\n q.U = parent;\n p.U = q;\n p.R = q.L;\n if (p.R) p.R.U = p;\n q.L = p;\n}\n\nfunction RedBlackRotateRight(tree, node) {\n var p = node,\n q = node.L,\n parent = p.U;\n\n if (parent) {\n if (parent.L === p) parent.L = q;\n else parent.R = q;\n } else {\n tree._ = q;\n }\n\n q.U = parent;\n p.U = q;\n p.L = q.R;\n if (p.L) p.L.U = p;\n q.R = p;\n}\n\nfunction RedBlackFirst(node) {\n while (node.L) node = node.L;\n return node;\n}\n\nexport default RedBlackTree;\n","import {cells, edges, epsilon} from \"./Diagram\";\n\nexport function createEdge(left, right, v0, v1) {\n var edge = [null, null],\n index = edges.push(edge) - 1;\n edge.left = left;\n edge.right = right;\n if (v0) setEdgeEnd(edge, left, right, v0);\n if (v1) setEdgeEnd(edge, right, left, v1);\n cells[left.index].halfedges.push(index);\n cells[right.index].halfedges.push(index);\n return edge;\n}\n\nexport function createBorderEdge(left, v0, v1) {\n var edge = [v0, v1];\n edge.left = left;\n return edge;\n}\n\nexport function setEdgeEnd(edge, left, right, vertex) {\n if (!edge[0] && !edge[1]) {\n edge[0] = vertex;\n edge.left = left;\n edge.right = right;\n } else if (edge.left === right) {\n edge[1] = vertex;\n } else {\n edge[0] = vertex;\n }\n}\n\n// Liang–Barsky line clipping.\nfunction clipEdge(edge, x0, y0, x1, y1) {\n var a = edge[0],\n b = edge[1],\n ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (!(t0 > 0) && !(t1 < 1)) return true; // TODO Better check?\n\n if (t0 > 0) edge[0] = [ax + t0 * dx, ay + t0 * dy];\n if (t1 < 1) edge[1] = [ax + t1 * dx, ay + t1 * dy];\n return true;\n}\n\nfunction connectEdge(edge, x0, y0, x1, y1) {\n var v1 = edge[1];\n if (v1) return true;\n\n var v0 = edge[0],\n left = edge.left,\n right = edge.right,\n lx = left[0],\n ly = left[1],\n rx = right[0],\n ry = right[1],\n fx = (lx + rx) / 2,\n fy = (ly + ry) / 2,\n fm,\n fb;\n\n if (ry === ly) {\n if (fx < x0 || fx >= x1) return;\n if (lx > rx) {\n if (!v0) v0 = [fx, y0];\n else if (v0[1] >= y1) return;\n v1 = [fx, y1];\n } else {\n if (!v0) v0 = [fx, y1];\n else if (v0[1] < y0) return;\n v1 = [fx, y0];\n }\n } else {\n fm = (lx - rx) / (ry - ly);\n fb = fy - fm * fx;\n if (fm < -1 || fm > 1) {\n if (lx > rx) {\n if (!v0) v0 = [(y0 - fb) / fm, y0];\n else if (v0[1] >= y1) return;\n v1 = [(y1 - fb) / fm, y1];\n } else {\n if (!v0) v0 = [(y1 - fb) / fm, y1];\n else if (v0[1] < y0) return;\n v1 = [(y0 - fb) / fm, y0];\n }\n } else {\n if (ly < ry) {\n if (!v0) v0 = [x0, fm * x0 + fb];\n else if (v0[0] >= x1) return;\n v1 = [x1, fm * x1 + fb];\n } else {\n if (!v0) v0 = [x1, fm * x1 + fb];\n else if (v0[0] < x0) return;\n v1 = [x0, fm * x0 + fb];\n }\n }\n }\n\n edge[0] = v0;\n edge[1] = v1;\n return true;\n}\n\nexport function clipEdges(x0, y0, x1, y1) {\n var i = edges.length,\n edge;\n\n while (i--) {\n if (!connectEdge(edge = edges[i], x0, y0, x1, y1)\n || !clipEdge(edge, x0, y0, x1, y1)\n || !(Math.abs(edge[0][0] - edge[1][0]) > epsilon\n || Math.abs(edge[0][1] - edge[1][1]) > epsilon)) {\n delete edges[i];\n }\n }\n}\n","import {createBorderEdge} from \"./Edge\";\nimport {cells, edges, epsilon} from \"./Diagram\";\n\nexport function createCell(site) {\n return cells[site.index] = {\n site: site,\n halfedges: []\n };\n}\n\nfunction cellHalfedgeAngle(cell, edge) {\n var site = cell.site,\n va = edge.left,\n vb = edge.right;\n if (site === vb) vb = va, va = site;\n if (vb) return Math.atan2(vb[1] - va[1], vb[0] - va[0]);\n if (site === va) va = edge[1], vb = edge[0];\n else va = edge[0], vb = edge[1];\n return Math.atan2(va[0] - vb[0], vb[1] - va[1]);\n}\n\nexport function cellHalfedgeStart(cell, edge) {\n return edge[+(edge.left !== cell.site)];\n}\n\nexport function cellHalfedgeEnd(cell, edge) {\n return edge[+(edge.left === cell.site)];\n}\n\nexport function sortCellHalfedges() {\n for (var i = 0, n = cells.length, cell, halfedges, j, m; i < n; ++i) {\n if ((cell = cells[i]) && (m = (halfedges = cell.halfedges).length)) {\n var index = new Array(m),\n array = new Array(m);\n for (j = 0; j < m; ++j) index[j] = j, array[j] = cellHalfedgeAngle(cell, edges[halfedges[j]]);\n index.sort(function(i, j) { return array[j] - array[i]; });\n for (j = 0; j < m; ++j) array[j] = halfedges[index[j]];\n for (j = 0; j < m; ++j) halfedges[j] = array[j];\n }\n }\n}\n\nexport function clipCells(x0, y0, x1, y1) {\n var nCells = cells.length,\n iCell,\n cell,\n site,\n iHalfedge,\n halfedges,\n nHalfedges,\n start,\n startX,\n startY,\n end,\n endX,\n endY,\n cover = true;\n\n for (iCell = 0; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n site = cell.site;\n halfedges = cell.halfedges;\n iHalfedge = halfedges.length;\n\n // Remove any dangling clipped edges.\n while (iHalfedge--) {\n if (!edges[halfedges[iHalfedge]]) {\n halfedges.splice(iHalfedge, 1);\n }\n }\n\n // Insert any border edges as necessary.\n iHalfedge = 0, nHalfedges = halfedges.length;\n while (iHalfedge < nHalfedges) {\n end = cellHalfedgeEnd(cell, edges[halfedges[iHalfedge]]), endX = end[0], endY = end[1];\n start = cellHalfedgeStart(cell, edges[halfedges[++iHalfedge % nHalfedges]]), startX = start[0], startY = start[1];\n if (Math.abs(endX - startX) > epsilon || Math.abs(endY - startY) > epsilon) {\n halfedges.splice(iHalfedge, 0, edges.push(createBorderEdge(site, end,\n Math.abs(endX - x0) < epsilon && y1 - endY > epsilon ? [x0, Math.abs(startX - x0) < epsilon ? startY : y1]\n : Math.abs(endY - y1) < epsilon && x1 - endX > epsilon ? [Math.abs(startY - y1) < epsilon ? startX : x1, y1]\n : Math.abs(endX - x1) < epsilon && endY - y0 > epsilon ? [x1, Math.abs(startX - x1) < epsilon ? startY : y0]\n : Math.abs(endY - y0) < epsilon && endX - x0 > epsilon ? [Math.abs(startY - y0) < epsilon ? startX : x0, y0]\n : null)) - 1);\n ++nHalfedges;\n }\n }\n\n if (nHalfedges) cover = false;\n }\n }\n\n // If there weren’t any edges, have the closest site cover the extent.\n // It doesn’t matter which corner of the extent we measure!\n if (cover) {\n var dx, dy, d2, dc = Infinity;\n\n for (iCell = 0, cover = null; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n site = cell.site;\n dx = site[0] - x0;\n dy = site[1] - y0;\n d2 = dx * dx + dy * dy;\n if (d2 < dc) dc = d2, cover = cell;\n }\n }\n\n if (cover) {\n var v00 = [x0, y0], v01 = [x0, y1], v11 = [x1, y1], v10 = [x1, y0];\n cover.halfedges.push(\n edges.push(createBorderEdge(site = cover.site, v00, v01)) - 1,\n edges.push(createBorderEdge(site, v01, v11)) - 1,\n edges.push(createBorderEdge(site, v11, v10)) - 1,\n edges.push(createBorderEdge(site, v10, v00)) - 1\n );\n }\n }\n\n // Lastly delete any cells with no edges; these were entirely clipped.\n for (iCell = 0; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n if (!cell.halfedges.length) {\n delete cells[iCell];\n }\n }\n }\n}\n","import {RedBlackNode} from \"./RedBlackTree\";\nimport {circles, epsilon2} from \"./Diagram\";\n\nvar circlePool = [];\n\nexport var firstCircle;\n\nfunction Circle() {\n RedBlackNode(this);\n this.x =\n this.y =\n this.arc =\n this.site =\n this.cy = null;\n}\n\nexport function attachCircle(arc) {\n var lArc = arc.P,\n rArc = arc.N;\n\n if (!lArc || !rArc) return;\n\n var lSite = lArc.site,\n cSite = arc.site,\n rSite = rArc.site;\n\n if (lSite === rSite) return;\n\n var bx = cSite[0],\n by = cSite[1],\n ax = lSite[0] - bx,\n ay = lSite[1] - by,\n cx = rSite[0] - bx,\n cy = rSite[1] - by;\n\n var d = 2 * (ax * cy - ay * cx);\n if (d >= -epsilon2) return;\n\n var ha = ax * ax + ay * ay,\n hc = cx * cx + cy * cy,\n x = (cy * ha - ay * hc) / d,\n y = (ax * hc - cx * ha) / d;\n\n var circle = circlePool.pop() || new Circle;\n circle.arc = arc;\n circle.site = cSite;\n circle.x = x + bx;\n circle.y = (circle.cy = y + by) + Math.sqrt(x * x + y * y); // y bottom\n\n arc.circle = circle;\n\n var before = null,\n node = circles._;\n\n while (node) {\n if (circle.y < node.y || (circle.y === node.y && circle.x <= node.x)) {\n if (node.L) node = node.L;\n else { before = node.P; break; }\n } else {\n if (node.R) node = node.R;\n else { before = node; break; }\n }\n }\n\n circles.insert(before, circle);\n if (!before) firstCircle = circle;\n}\n\nexport function detachCircle(arc) {\n var circle = arc.circle;\n if (circle) {\n if (!circle.P) firstCircle = circle.N;\n circles.remove(circle);\n circlePool.push(circle);\n RedBlackNode(circle);\n arc.circle = null;\n }\n}\n","import {RedBlackNode} from \"./RedBlackTree\";\nimport {createCell} from \"./Cell\";\nimport {attachCircle, detachCircle} from \"./Circle\";\nimport {createEdge, setEdgeEnd} from \"./Edge\";\nimport {beaches, epsilon} from \"./Diagram\";\n\nvar beachPool = [];\n\nfunction Beach() {\n RedBlackNode(this);\n this.edge =\n this.site =\n this.circle = null;\n}\n\nfunction createBeach(site) {\n var beach = beachPool.pop() || new Beach;\n beach.site = site;\n return beach;\n}\n\nfunction detachBeach(beach) {\n detachCircle(beach);\n beaches.remove(beach);\n beachPool.push(beach);\n RedBlackNode(beach);\n}\n\nexport function removeBeach(beach) {\n var circle = beach.circle,\n x = circle.x,\n y = circle.cy,\n vertex = [x, y],\n previous = beach.P,\n next = beach.N,\n disappearing = [beach];\n\n detachBeach(beach);\n\n var lArc = previous;\n while (lArc.circle\n && Math.abs(x - lArc.circle.x) < epsilon\n && Math.abs(y - lArc.circle.cy) < epsilon) {\n previous = lArc.P;\n disappearing.unshift(lArc);\n detachBeach(lArc);\n lArc = previous;\n }\n\n disappearing.unshift(lArc);\n detachCircle(lArc);\n\n var rArc = next;\n while (rArc.circle\n && Math.abs(x - rArc.circle.x) < epsilon\n && Math.abs(y - rArc.circle.cy) < epsilon) {\n next = rArc.N;\n disappearing.push(rArc);\n detachBeach(rArc);\n rArc = next;\n }\n\n disappearing.push(rArc);\n detachCircle(rArc);\n\n var nArcs = disappearing.length,\n iArc;\n for (iArc = 1; iArc < nArcs; ++iArc) {\n rArc = disappearing[iArc];\n lArc = disappearing[iArc - 1];\n setEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);\n }\n\n lArc = disappearing[0];\n rArc = disappearing[nArcs - 1];\n rArc.edge = createEdge(lArc.site, rArc.site, null, vertex);\n\n attachCircle(lArc);\n attachCircle(rArc);\n}\n\nexport function addBeach(site) {\n var x = site[0],\n directrix = site[1],\n lArc,\n rArc,\n dxl,\n dxr,\n node = beaches._;\n\n while (node) {\n dxl = leftBreakPoint(node, directrix) - x;\n if (dxl > epsilon) node = node.L; else {\n dxr = x - rightBreakPoint(node, directrix);\n if (dxr > epsilon) {\n if (!node.R) {\n lArc = node;\n break;\n }\n node = node.R;\n } else {\n if (dxl > -epsilon) {\n lArc = node.P;\n rArc = node;\n } else if (dxr > -epsilon) {\n lArc = node;\n rArc = node.N;\n } else {\n lArc = rArc = node;\n }\n break;\n }\n }\n }\n\n createCell(site);\n var newArc = createBeach(site);\n beaches.insert(lArc, newArc);\n\n if (!lArc && !rArc) return;\n\n if (lArc === rArc) {\n detachCircle(lArc);\n rArc = createBeach(lArc.site);\n beaches.insert(newArc, rArc);\n newArc.edge = rArc.edge = createEdge(lArc.site, newArc.site);\n attachCircle(lArc);\n attachCircle(rArc);\n return;\n }\n\n if (!rArc) { // && lArc\n newArc.edge = createEdge(lArc.site, newArc.site);\n return;\n }\n\n // else lArc !== rArc\n detachCircle(lArc);\n detachCircle(rArc);\n\n var lSite = lArc.site,\n ax = lSite[0],\n ay = lSite[1],\n bx = site[0] - ax,\n by = site[1] - ay,\n rSite = rArc.site,\n cx = rSite[0] - ax,\n cy = rSite[1] - ay,\n d = 2 * (bx * cy - by * cx),\n hb = bx * bx + by * by,\n hc = cx * cx + cy * cy,\n vertex = [(cy * hb - by * hc) / d + ax, (bx * hc - cx * hb) / d + ay];\n\n setEdgeEnd(rArc.edge, lSite, rSite, vertex);\n newArc.edge = createEdge(lSite, site, null, vertex);\n rArc.edge = createEdge(site, rSite, null, vertex);\n attachCircle(lArc);\n attachCircle(rArc);\n}\n\nfunction leftBreakPoint(arc, directrix) {\n var site = arc.site,\n rfocx = site[0],\n rfocy = site[1],\n pby2 = rfocy - directrix;\n\n if (!pby2) return rfocx;\n\n var lArc = arc.P;\n if (!lArc) return -Infinity;\n\n site = lArc.site;\n var lfocx = site[0],\n lfocy = site[1],\n plby2 = lfocy - directrix;\n\n if (!plby2) return lfocx;\n\n var hl = lfocx - rfocx,\n aby2 = 1 / pby2 - 1 / plby2,\n b = hl / plby2;\n\n if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;\n\n return (rfocx + lfocx) / 2;\n}\n\nfunction rightBreakPoint(arc, directrix) {\n var rArc = arc.N;\n if (rArc) return leftBreakPoint(rArc, directrix);\n var site = arc.site;\n return site[1] === directrix ? site[0] : Infinity;\n}\n","import {addBeach, removeBeach} from \"./Beach\";\nimport {sortCellHalfedges, cellHalfedgeStart, clipCells} from \"./Cell\";\nimport {firstCircle} from \"./Circle\";\nimport {clipEdges} from \"./Edge\";\nimport RedBlackTree from \"./RedBlackTree\";\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var beaches;\nexport var cells;\nexport var circles;\nexport var edges;\n\nfunction triangleArea(a, b, c) {\n return (a[0] - c[0]) * (b[1] - a[1]) - (a[0] - b[0]) * (c[1] - a[1]);\n}\n\nfunction lexicographic(a, b) {\n return b[1] - a[1]\n || b[0] - a[0];\n}\n\nexport default function Diagram(sites, extent) {\n var site = sites.sort(lexicographic).pop(),\n x,\n y,\n circle;\n\n edges = [];\n cells = new Array(sites.length);\n beaches = new RedBlackTree;\n circles = new RedBlackTree;\n\n while (true) {\n circle = firstCircle;\n if (site && (!circle || site[1] < circle.y || (site[1] === circle.y && site[0] < circle.x))) {\n if (site[0] !== x || site[1] !== y) {\n addBeach(site);\n x = site[0], y = site[1];\n }\n site = sites.pop();\n } else if (circle) {\n removeBeach(circle.arc);\n } else {\n break;\n }\n }\n\n sortCellHalfedges();\n\n if (extent) {\n var x0 = +extent[0][0],\n y0 = +extent[0][1],\n x1 = +extent[1][0],\n y1 = +extent[1][1];\n clipEdges(x0, y0, x1, y1);\n clipCells(x0, y0, x1, y1);\n }\n\n this.edges = edges;\n this.cells = cells;\n\n beaches =\n circles =\n edges =\n cells = null;\n}\n\nDiagram.prototype = {\n constructor: Diagram,\n\n polygons: function() {\n var edges = this.edges;\n\n return this.cells.map(function(cell) {\n var polygon = cell.halfedges.map(function(i) { return cellHalfedgeStart(cell, edges[i]); });\n polygon.data = cell.site.data;\n return polygon;\n });\n },\n\n triangles: function() {\n var triangles = [],\n edges = this.edges;\n\n this.cells.forEach(function(cell, i) {\n if (!(m = (halfedges = cell.halfedges).length)) return;\n var site = cell.site,\n halfedges,\n j = -1,\n m,\n s0,\n e1 = edges[halfedges[m - 1]],\n s1 = e1.left === site ? e1.right : e1.left;\n\n while (++j < m) {\n s0 = s1;\n e1 = edges[halfedges[j]];\n s1 = e1.left === site ? e1.right : e1.left;\n if (s0 && s1 && i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) {\n triangles.push([site.data, s0.data, s1.data]);\n }\n }\n });\n\n return triangles;\n },\n\n links: function() {\n return this.edges.filter(function(edge) {\n return edge.right;\n }).map(function(edge) {\n return {\n source: edge.left.data,\n target: edge.right.data\n };\n });\n },\n\n find: function(x, y, radius) {\n var that = this, i0, i1 = that._found || 0, n = that.cells.length, cell;\n\n // Use the previously-found cell, or start with an arbitrary one.\n while (!(cell = that.cells[i1])) if (++i1 >= n) return null;\n var dx = x - cell.site[0], dy = y - cell.site[1], d2 = dx * dx + dy * dy;\n\n // Traverse the half-edges to find a closer cell, if any.\n do {\n cell = that.cells[i0 = i1], i1 = null;\n cell.halfedges.forEach(function(e) {\n var edge = that.edges[e], v = edge.left;\n if ((v === cell.site || !v) && !(v = edge.right)) return;\n var vx = x - v[0], vy = y - v[1], v2 = vx * vx + vy * vy;\n if (v2 < d2) d2 = v2, i1 = v.index;\n });\n } while (i1 !== null);\n\n that._found = i0;\n\n return radius == null || d2 <= radius * radius ? cell.site : null;\n }\n}\n","/**\r\n * DBSCAN - Density based clustering\r\n *\r\n * @author Lukasz Krawczyk \r\n * @copyright MIT\r\n */\r\n\r\n/**\r\n * DBSCAN class construcotr\r\n * @constructor\r\n *\r\n * @param {Array} dataset\r\n * @param {number} epsilon\r\n * @param {number} minPts\r\n * @param {function} distanceFunction\r\n * @returns {DBSCAN}\r\n */\r\nfunction DBSCAN(dataset, epsilon, minPts, distanceFunction) {\r\n /** @type {Array} */\r\n this.dataset = [];\r\n /** @type {number} */\r\n this.epsilon = 1;\r\n /** @type {number} */\r\n this.minPts = 2;\r\n /** @type {function} */\r\n this.distance = this._euclideanDistance;\r\n /** @type {Array} */\r\n this.clusters = [];\r\n /** @type {Array} */\r\n this.noise = [];\r\n\r\n // temporary variables used during computation\r\n\r\n /** @type {Array} */\r\n this._visited = [];\r\n /** @type {Array} */\r\n this._assigned = [];\r\n /** @type {number} */\r\n this._datasetLength = 0;\r\n\r\n this._init(dataset, epsilon, minPts, distanceFunction);\r\n};\r\n\r\n/******************************************************************************/\r\n// public functions\r\n\r\n/**\r\n * Start clustering\r\n *\r\n * @param {Array} dataset\r\n * @param {number} epsilon\r\n * @param {number} minPts\r\n * @param {function} distanceFunction\r\n * @returns {undefined}\r\n * @access public\r\n */\r\nDBSCAN.prototype.run = function(dataset, epsilon, minPts, distanceFunction) {\r\n this._init(dataset, epsilon, minPts, distanceFunction);\r\n\r\n for (var pointId = 0; pointId < this._datasetLength; pointId++) {\r\n // if point is not visited, check if it forms a cluster\r\n if (this._visited[pointId] !== 1) {\r\n this._visited[pointId] = 1;\r\n\r\n // if closest neighborhood is too small to form a cluster, mark as noise\r\n var neighbors = this._regionQuery(pointId);\r\n\r\n if (neighbors.length < this.minPts) {\r\n this.noise.push(pointId);\r\n } else {\r\n // create new cluster and add point\r\n var clusterId = this.clusters.length;\r\n this.clusters.push([]);\r\n this._addToCluster(pointId, clusterId);\r\n\r\n this._expandCluster(clusterId, neighbors);\r\n }\r\n }\r\n }\r\n\r\n return this.clusters;\r\n};\r\n\r\n/******************************************************************************/\r\n// protected functions\r\n\r\n/**\r\n * Set object properties\r\n *\r\n * @param {Array} dataset\r\n * @param {number} epsilon\r\n * @param {number} minPts\r\n * @param {function} distance\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nDBSCAN.prototype._init = function(dataset, epsilon, minPts, distance) {\r\n\r\n if (dataset) {\r\n\r\n if (!(dataset instanceof Array)) {\r\n throw Error('Dataset must be of type array, ' +\r\n typeof dataset + ' given');\r\n }\r\n\r\n this.dataset = dataset;\r\n this.clusters = [];\r\n this.noise = [];\r\n\r\n this._datasetLength = dataset.length;\r\n this._visited = new Array(this._datasetLength);\r\n this._assigned = new Array(this._datasetLength);\r\n }\r\n\r\n if (epsilon) {\r\n this.epsilon = epsilon;\r\n }\r\n\r\n if (minPts) {\r\n this.minPts = minPts;\r\n }\r\n\r\n if (distance) {\r\n this.distance = distance;\r\n }\r\n};\r\n\r\n/**\r\n * Expand cluster to closest points of given neighborhood\r\n *\r\n * @param {number} clusterId\r\n * @param {Array} neighbors\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nDBSCAN.prototype._expandCluster = function(clusterId, neighbors) {\r\n\r\n /**\r\n * It's very important to calculate length of neighbors array each time,\r\n * as the number of elements changes over time\r\n */\r\n for (var i = 0; i < neighbors.length; i++) {\r\n var pointId2 = neighbors[i];\r\n\r\n if (this._visited[pointId2] !== 1) {\r\n this._visited[pointId2] = 1;\r\n var neighbors2 = this._regionQuery(pointId2);\r\n\r\n if (neighbors2.length >= this.minPts) {\r\n neighbors = this._mergeArrays(neighbors, neighbors2);\r\n }\r\n }\r\n\r\n // add to cluster\r\n if (this._assigned[pointId2] !== 1) {\r\n this._addToCluster(pointId2, clusterId);\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Add new point to cluster\r\n *\r\n * @param {number} pointId\r\n * @param {number} clusterId\r\n */\r\nDBSCAN.prototype._addToCluster = function(pointId, clusterId) {\r\n this.clusters[clusterId].push(pointId);\r\n this._assigned[pointId] = 1;\r\n};\r\n\r\n/**\r\n * Find all neighbors around given point\r\n *\r\n * @param {number} pointId,\r\n * @param {number} epsilon\r\n * @returns {Array}\r\n * @access protected\r\n */\r\nDBSCAN.prototype._regionQuery = function(pointId) {\r\n var neighbors = [];\r\n\r\n for (var id = 0; id < this._datasetLength; id++) {\r\n var dist = this.distance(this.dataset[pointId], this.dataset[id]);\r\n if (dist < this.epsilon) {\r\n neighbors.push(id);\r\n }\r\n }\r\n\r\n return neighbors;\r\n};\r\n\r\n/******************************************************************************/\r\n// helpers\r\n\r\n/**\r\n * @param {Array} a\r\n * @param {Array} b\r\n * @returns {Array}\r\n * @access protected\r\n */\r\nDBSCAN.prototype._mergeArrays = function(a, b) {\r\n var len = b.length;\r\n\r\n for (var i = 0; i < len; i++) {\r\n var P = b[i];\r\n if (a.indexOf(P) < 0) {\r\n a.push(P);\r\n }\r\n }\r\n\r\n return a;\r\n};\r\n\r\n/**\r\n * Calculate euclidean distance in multidimensional space\r\n *\r\n * @param {Array} p\r\n * @param {Array} q\r\n * @returns {number}\r\n * @access protected\r\n */\r\nDBSCAN.prototype._euclideanDistance = function(p, q) {\r\n var sum = 0;\r\n var i = Math.min(p.length, q.length);\r\n\r\n while (i--) {\r\n sum += (p[i] - q[i]) * (p[i] - q[i]);\r\n }\r\n\r\n return Math.sqrt(sum);\r\n};\r\n\r\nif (typeof module !== 'undefined' && module.exports) {\r\n module.exports = DBSCAN;\r\n}\r\n","/**\r\n * KMEANS clustering\r\n *\r\n * @author Lukasz Krawczyk \r\n * @copyright MIT\r\n */\r\n\r\n/**\r\n * KMEANS class constructor\r\n * @constructor\r\n *\r\n * @param {Array} dataset\r\n * @param {number} k - number of clusters\r\n * @param {function} distance - distance function\r\n * @returns {KMEANS}\r\n */\r\n function KMEANS(dataset, k, distance) {\r\n this.k = 3; // number of clusters\r\n this.dataset = []; // set of feature vectors\r\n this.assignments = []; // set of associated clusters for each feature vector\r\n this.centroids = []; // vectors for our clusters\r\n\r\n this.init(dataset, k, distance);\r\n}\r\n\r\n/**\r\n * @returns {undefined}\r\n */\r\nKMEANS.prototype.init = function(dataset, k, distance) {\r\n this.assignments = [];\r\n this.centroids = [];\r\n\r\n if (typeof dataset !== 'undefined') {\r\n this.dataset = dataset;\r\n }\r\n\r\n if (typeof k !== 'undefined') {\r\n this.k = k;\r\n }\r\n\r\n if (typeof distance !== 'undefined') {\r\n this.distance = distance;\r\n }\r\n};\r\n\r\n/**\r\n * @returns {undefined}\r\n */\r\nKMEANS.prototype.run = function(dataset, k) {\r\n this.init(dataset, k);\r\n\r\n var len = this.dataset.length;\r\n\r\n // initialize centroids\r\n for (var i = 0; i < this.k; i++) {\r\n this.centroids[i] = this.randomCentroid();\r\n\t}\r\n\r\n var change = true;\r\n while(change) {\r\n\r\n // assign feature vectors to clusters\r\n change = this.assign();\r\n\r\n // adjust location of centroids\r\n for (var centroidId = 0; centroidId < this.k; centroidId++) {\r\n var mean = new Array(maxDim);\r\n var count = 0;\r\n\r\n // init mean vector\r\n for (var dim = 0; dim < maxDim; dim++) {\r\n mean[dim] = 0;\r\n }\r\n\r\n for (var j = 0; j < len; j++) {\r\n var maxDim = this.dataset[j].length;\r\n\r\n // if current cluster id is assigned to point\r\n if (centroidId === this.assignments[j]) {\r\n for (var dim = 0; dim < maxDim; dim++) {\r\n mean[dim] += this.dataset[j][dim];\r\n }\r\n count++;\r\n }\r\n }\r\n\r\n if (count > 0) {\r\n // if cluster contain points, adjust centroid position\r\n for (var dim = 0; dim < maxDim; dim++) {\r\n mean[dim] /= count;\r\n }\r\n this.centroids[centroidId] = mean;\r\n } else {\r\n // if cluster is empty, generate new random centroid\r\n this.centroids[centroidId] = this.randomCentroid();\r\n change = true;\r\n }\r\n }\r\n }\r\n\r\n return this.getClusters();\r\n};\r\n\r\n/**\r\n * Generate random centroid\r\n *\r\n * @returns {Array}\r\n */\r\nKMEANS.prototype.randomCentroid = function() {\r\n var maxId = this.dataset.length -1;\r\n var centroid;\r\n var id;\r\n\r\n do {\r\n id = Math.round(Math.random() * maxId);\r\n centroid = this.dataset[id];\r\n } while (this.centroids.indexOf(centroid) >= 0);\r\n\r\n return centroid;\r\n}\r\n\r\n/**\r\n * Assign points to clusters\r\n *\r\n * @returns {boolean}\r\n */\r\nKMEANS.prototype.assign = function() {\r\n var change = false;\r\n var len = this.dataset.length;\r\n var closestCentroid;\r\n\r\n for (var i = 0; i < len; i++) {\r\n closestCentroid = this.argmin(this.dataset[i], this.centroids, this.distance);\r\n\r\n if (closestCentroid != this.assignments[i]) {\r\n this.assignments[i] = closestCentroid;\r\n change = true;\r\n }\r\n }\r\n\r\n return change;\r\n}\r\n\r\n/**\r\n * Extract information about clusters\r\n *\r\n * @returns {undefined}\r\n */\r\nKMEANS.prototype.getClusters = function() {\r\n var clusters = new Array(this.k);\r\n var centroidId;\r\n\r\n for (var pointId = 0; pointId < this.assignments.length; pointId++) {\r\n centroidId = this.assignments[pointId];\r\n\r\n // init empty cluster\r\n if (typeof clusters[centroidId] === 'undefined') {\r\n clusters[centroidId] = [];\r\n }\r\n\r\n clusters[centroidId].push(pointId);\r\n }\r\n\r\n return clusters;\r\n};\r\n\r\n// utils\r\n\r\n/**\r\n * @params {Array} point\r\n * @params {Array.} set\r\n * @params {Function} f\r\n * @returns {number}\r\n */\r\nKMEANS.prototype.argmin = function(point, set, f) {\r\n var min = Number.MAX_VALUE;\r\n var arg = 0;\r\n var len = set.length;\r\n var d;\r\n\r\n for (var i = 0; i < len; i++) {\r\n d = f(point, set[i]);\r\n if (d < min) {\r\n min = d;\r\n arg = i;\r\n }\r\n }\r\n\r\n return arg;\r\n};\r\n\r\n/**\r\n * Euclidean distance\r\n *\r\n * @params {number} p\r\n * @params {number} q\r\n * @returns {number}\r\n */\r\nKMEANS.prototype.distance = function(p, q) {\r\n var sum = 0;\r\n var i = Math.min(p.length, q.length);\r\n\r\n while (i--) {\r\n var diff = p[i] - q[i];\r\n sum += diff * diff;\r\n }\r\n\r\n return Math.sqrt(sum);\r\n};\r\n\r\nif (typeof module !== 'undefined' && module.exports) {\r\n module.exports = KMEANS;\r\n}\r\n","\r\n/**\r\n * @requires ./PriorityQueue.js\r\n */\r\n\r\nif (typeof module !== 'undefined' && module.exports) {\r\n var PriorityQueue = require('./PriorityQueue.js');\r\n}\r\n\r\n/**\r\n * OPTICS - Ordering points to identify the clustering structure\r\n *\r\n * @author Lukasz Krawczyk \r\n * @copyright MIT\r\n */\r\n\r\n/**\r\n * OPTICS class constructor\r\n * @constructor\r\n *\r\n * @param {Array} dataset\r\n * @param {number} epsilon\r\n * @param {number} minPts\r\n * @param {function} distanceFunction\r\n * @returns {OPTICS}\r\n */\r\nfunction OPTICS(dataset, epsilon, minPts, distanceFunction) {\r\n /** @type {number} */\r\n this.epsilon = 1;\r\n /** @type {number} */\r\n this.minPts = 1;\r\n /** @type {function} */\r\n this.distance = this._euclideanDistance;\r\n\r\n // temporary variables used during computation\r\n\r\n /** @type {Array} */\r\n this._reachability = [];\r\n /** @type {Array} */\r\n this._processed = [];\r\n /** @type {number} */\r\n this._coreDistance = 0;\r\n /** @type {Array} */\r\n this._orderedList = [];\r\n\r\n this._init(dataset, epsilon, minPts, distanceFunction);\r\n}\r\n\r\n/******************************************************************************/\r\n// pulic functions\r\n\r\n/**\r\n * Start clustering\r\n *\r\n * @param {Array} dataset\r\n * @returns {undefined}\r\n * @access public\r\n */\r\nOPTICS.prototype.run = function(dataset, epsilon, minPts, distanceFunction) {\r\n this._init(dataset, epsilon, minPts, distanceFunction);\r\n\r\n for (var pointId = 0, l = this.dataset.length; pointId < l; pointId++) {\r\n if (this._processed[pointId] !== 1) {\r\n this._processed[pointId] = 1;\r\n this.clusters.push([pointId]);\r\n var clusterId = this.clusters.length - 1;\r\n\r\n this._orderedList.push(pointId);\r\n var priorityQueue = new PriorityQueue(null, null, 'asc');\r\n var neighbors = this._regionQuery(pointId);\r\n\r\n // using priority queue assign elements to new cluster\r\n if (this._distanceToCore(pointId) !== undefined) {\r\n this._updateQueue(pointId, neighbors, priorityQueue);\r\n this._expandCluster(clusterId, priorityQueue);\r\n }\r\n }\r\n }\r\n\r\n return this.clusters;\r\n};\r\n\r\n/**\r\n * Generate reachability plot for all points\r\n *\r\n * @returns {array}\r\n * @access public\r\n */\r\nOPTICS.prototype.getReachabilityPlot = function() {\r\n var reachabilityPlot = [];\r\n\r\n for (var i = 0, l = this._orderedList.length; i < l; i++) {\r\n var pointId = this._orderedList[i];\r\n var distance = this._reachability[pointId];\r\n\r\n reachabilityPlot.push([pointId, distance]);\r\n }\r\n\r\n return reachabilityPlot;\r\n};\r\n\r\n/******************************************************************************/\r\n// protected functions\r\n\r\n/**\r\n * Set object properties\r\n *\r\n * @param {Array} dataset\r\n * @param {number} epsilon\r\n * @param {number} minPts\r\n * @param {function} distance\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nOPTICS.prototype._init = function(dataset, epsilon, minPts, distance) {\r\n\r\n if (dataset) {\r\n\r\n if (!(dataset instanceof Array)) {\r\n throw Error('Dataset must be of type array, ' +\r\n typeof dataset + ' given');\r\n }\r\n\r\n this.dataset = dataset;\r\n this.clusters = [];\r\n this._reachability = new Array(this.dataset.length);\r\n this._processed = new Array(this.dataset.length);\r\n this._coreDistance = 0;\r\n this._orderedList = [];\r\n }\r\n\r\n if (epsilon) {\r\n this.epsilon = epsilon;\r\n }\r\n\r\n if (minPts) {\r\n this.minPts = minPts;\r\n }\r\n\r\n if (distance) {\r\n this.distance = distance;\r\n }\r\n};\r\n\r\n/**\r\n * Update information in queue\r\n *\r\n * @param {number} pointId\r\n * @param {Array} neighbors\r\n * @param {PriorityQueue} queue\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nOPTICS.prototype._updateQueue = function(pointId, neighbors, queue) {\r\n var self = this;\r\n\r\n this._coreDistance = this._distanceToCore(pointId);\r\n neighbors.forEach(function(pointId2) {\r\n if (self._processed[pointId2] === undefined) {\r\n var dist = self.distance(self.dataset[pointId], self.dataset[pointId2]);\r\n var newReachableDistance = Math.max(self._coreDistance, dist);\r\n\r\n if (self._reachability[pointId2] === undefined) {\r\n self._reachability[pointId2] = newReachableDistance;\r\n queue.insert(pointId2, newReachableDistance);\r\n } else {\r\n if (newReachableDistance < self._reachability[pointId2]) {\r\n self._reachability[pointId2] = newReachableDistance;\r\n queue.remove(pointId2);\r\n queue.insert(pointId2, newReachableDistance);\r\n }\r\n }\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Expand cluster\r\n *\r\n * @param {number} clusterId\r\n * @param {PriorityQueue} queue\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nOPTICS.prototype._expandCluster = function(clusterId, queue) {\r\n var queueElements = queue.getElements();\r\n\r\n for (var p = 0, l = queueElements.length; p < l; p++) {\r\n var pointId = queueElements[p];\r\n if (this._processed[pointId] === undefined) {\r\n var neighbors = this._regionQuery(pointId);\r\n this._processed[pointId] = 1;\r\n\r\n this.clusters[clusterId].push(pointId);\r\n this._orderedList.push(pointId);\r\n\r\n if (this._distanceToCore(pointId) !== undefined) {\r\n this._updateQueue(pointId, neighbors, queue);\r\n this._expandCluster(clusterId, queue);\r\n }\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Calculating distance to cluster core\r\n *\r\n * @param {number} pointId\r\n * @returns {number}\r\n * @access protected\r\n */\r\nOPTICS.prototype._distanceToCore = function(pointId) {\r\n var l = this.epsilon;\r\n for (var coreDistCand = 0; coreDistCand < l; coreDistCand++) {\r\n var neighbors = this._regionQuery(pointId, coreDistCand);\r\n if (neighbors.length >= this.minPts) {\r\n return coreDistCand;\r\n }\r\n }\r\n\r\n return;\r\n};\r\n\r\n/**\r\n * Find all neighbors around given point\r\n *\r\n * @param {number} pointId\r\n * @param {number} epsilon\r\n * @returns {Array}\r\n * @access protected\r\n */\r\nOPTICS.prototype._regionQuery = function(pointId, epsilon) {\r\n epsilon = epsilon || this.epsilon;\r\n var neighbors = [];\r\n\r\n for (var id = 0, l = this.dataset.length; id < l; id++) {\r\n if (this.distance(this.dataset[pointId], this.dataset[id]) < epsilon) {\r\n neighbors.push(id);\r\n }\r\n }\r\n\r\n return neighbors;\r\n};\r\n\r\n/******************************************************************************/\r\n// helpers\r\n\r\n/**\r\n * Calculate euclidean distance in multidimensional space\r\n *\r\n * @param {Array} p\r\n * @param {Array} q\r\n * @returns {number}\r\n * @access protected\r\n */\r\nOPTICS.prototype._euclideanDistance = function(p, q) {\r\n var sum = 0;\r\n var i = Math.min(p.length, q.length);\r\n\r\n while (i--) {\r\n sum += (p[i] - q[i]) * (p[i] - q[i]);\r\n }\r\n\r\n return Math.sqrt(sum);\r\n};\r\n\r\nif (typeof module !== 'undefined' && module.exports) {\r\n module.exports = OPTICS;\r\n}\r\n","/**\r\n * PriorityQueue\r\n * Elements in this queue are sorted according to their value\r\n *\r\n * @author Lukasz Krawczyk \r\n * @copyright MIT\r\n */\r\n\r\n/**\r\n * PriorityQueue class construcotr\r\n * @constructor\r\n *\r\n * @example\r\n * queue: [1,2,3,4]\r\n * priorities: [4,1,2,3]\r\n * > result = [1,4,2,3]\r\n *\r\n * @param {Array} elements\r\n * @param {Array} priorities\r\n * @param {string} sorting - asc / desc\r\n * @returns {PriorityQueue}\r\n */\r\nfunction PriorityQueue(elements, priorities, sorting) {\r\n /** @type {Array} */\r\n this._queue = [];\r\n /** @type {Array} */\r\n this._priorities = [];\r\n /** @type {string} */\r\n this._sorting = 'desc';\r\n\r\n this._init(elements, priorities, sorting);\r\n};\r\n\r\n/**\r\n * Insert element\r\n *\r\n * @param {Object} ele\r\n * @param {Object} priority\r\n * @returns {undefined}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.insert = function(ele, priority) {\r\n var indexToInsert = this._queue.length;\r\n var index = indexToInsert;\r\n\r\n while (index--) {\r\n var priority2 = this._priorities[index];\r\n if (this._sorting === 'desc') {\r\n if (priority > priority2) {\r\n indexToInsert = index;\r\n }\r\n } else {\r\n if (priority < priority2) {\r\n indexToInsert = index;\r\n }\r\n }\r\n }\r\n\r\n this._insertAt(ele, priority, indexToInsert);\r\n};\r\n\r\n/**\r\n * Remove element\r\n *\r\n * @param {Object} ele\r\n * @returns {undefined}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.remove = function(ele) {\r\n var index = this._queue.length;\r\n\r\n while (index--) {\r\n var ele2 = this._queue[index];\r\n if (ele === ele2) {\r\n this._queue.splice(index, 1);\r\n this._priorities.splice(index, 1);\r\n break;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * For each loop wrapper\r\n *\r\n * @param {function} func\r\n * @returs {undefined}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.forEach = function(func) {\r\n this._queue.forEach(func);\r\n};\r\n\r\n/**\r\n * @returns {Array}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.getElements = function() {\r\n return this._queue;\r\n};\r\n\r\n/**\r\n * @param {number} index\r\n * @returns {Object}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.getElementPriority = function(index) {\r\n return this._priorities[index];\r\n};\r\n\r\n/**\r\n * @returns {Array}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.getPriorities = function() {\r\n return this._priorities;\r\n};\r\n\r\n/**\r\n * @returns {Array}\r\n * @access public\r\n */\r\nPriorityQueue.prototype.getElementsWithPriorities = function() {\r\n var result = [];\r\n\r\n for (var i = 0, l = this._queue.length; i < l; i++) {\r\n result.push([this._queue[i], this._priorities[i]]);\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Set object properties\r\n *\r\n * @param {Array} elements\r\n * @param {Array} priorities\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nPriorityQueue.prototype._init = function(elements, priorities, sorting) {\r\n\r\n if (elements && priorities) {\r\n this._queue = [];\r\n this._priorities = [];\r\n\r\n if (elements.length !== priorities.length) {\r\n throw new Error('Arrays must have the same length');\r\n }\r\n\r\n for (var i = 0; i < elements.length; i++) {\r\n this.insert(elements[i], priorities[i]);\r\n }\r\n }\r\n\r\n if (sorting) {\r\n this._sorting = sorting;\r\n }\r\n};\r\n\r\n/**\r\n * Insert element at given position\r\n *\r\n * @param {Object} ele\r\n * @param {number} index\r\n * @returns {undefined}\r\n * @access protected\r\n */\r\nPriorityQueue.prototype._insertAt = function(ele, priority, index) {\r\n if (this._queue.length === index) {\r\n this._queue.push(ele);\r\n this._priorities.push(priority);\r\n } else {\r\n this._queue.splice(index, 0, ele);\r\n this._priorities.splice(index, 0, priority);\r\n }\r\n};\r\n\r\nif (typeof module !== 'undefined' && module.exports) {\r\n module.exports = PriorityQueue;\r\n}\r\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","!function(t,i){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=i():\"function\"==typeof define&&define.amd?define(i):(t=t||self).RBush=i()}(this,function(){\"use strict\";function t(t,r,e,a,h){!function t(n,r,e,a,h){for(;a>e;){if(a-e>600){var o=a-e+1,s=r-e+1,l=Math.log(o),f=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*f*(o-f)/o)*(s-o/2<0?-1:1),m=Math.max(e,Math.floor(r-s*f/o+u)),c=Math.min(a,Math.floor(r+(o-s)*f/o+u));t(n,r,m,c,h)}var p=n[r],d=e,x=a;for(i(n,e,r),h(n[a],p)>0&&i(n,e,a);d0;)x--}0===h(n[e],p)?i(n,e,x):i(n,++x,a),x<=r&&(e=x+1),r<=x&&(a=x-1)}}(t,r,e||0,a||t.length-1,h||n)}function i(t,i,n){var r=t[i];t[i]=t[n],t[n]=r}function n(t,i){return ti?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,i,n){if(!n)return i.indexOf(t);for(var r=0;r=t.minX&&i.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,r,e,a){for(var h=[n,r];h.length;)if(!((r=h.pop())-(n=h.pop())<=e)){var o=n+Math.ceil((r-n)/e/2)*e;t(i,o,n,r,a),h.push(n,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var i=this.data,n=[];if(!c(t,i))return n;for(var r=this.toBBox,e=[];i;){for(var a=0;a=0&&e[i].children.length>this._maxEntries;)this._split(e,i),i--;this._adjustParentBBoxes(r,e,i)},r.prototype._split=function(t,i){var n=t[i],r=n.children.length,e=this._minEntries;this._chooseSplitAxis(n,e,r);var h=this._chooseSplitIndex(n,e,r),o=p(n.children.splice(h,n.children.length-h));o.height=n.height,o.leaf=n.leaf,a(n,this.toBBox),a(o,this.toBBox),i?t[i-1].children.push(o):this._splitRoot(n,o)},r.prototype._splitRoot=function(t,i){this.data=p([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,i,n){for(var r,e,a,o,s,l,u,m=1/0,c=1/0,p=i;p<=n-i;p++){var d=h(t,0,p,this.toBBox),x=h(t,p,n,this.toBBox),v=(e=d,a=x,o=void 0,s=void 0,l=void 0,u=void 0,o=Math.max(e.minX,a.minX),s=Math.max(e.minY,a.minY),l=Math.min(e.maxX,a.maxX),u=Math.min(e.maxY,a.maxY),Math.max(0,l-o)*Math.max(0,u-s)),M=f(d)+f(x);v=i;c--){var p=t.children[c];o(s,t.leaf?e(p):p),l+=u(s)}return l},r.prototype._adjustParentBBoxes=function(t,i,n){for(var r=n;r>=0;r--)o(i[r],t)},r.prototype._condense=function(t){for(var i=t.length-1,n=void 0;i>=0;i--)0===t[i].children.length?i>0?(n=t[i-1].children).splice(n.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},r});\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar numberIsNaN = function (value) {\n\treturn value !== value;\n};\n\nmodule.exports = function is(a, b) {\n\tif (a === 0 && b === 0) {\n\t\treturn 1 / a === 1 / b;\n\t}\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (numberIsNaN(a) && numberIsNaN(b)) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\treturn typeof Object.is === 'function' ? Object.is : implementation;\n};\n","'use strict';\n\nvar getPolyfill = require('./polyfill');\nvar define = require('define-properties');\n\nmodule.exports = function shimObjectIs() {\n\tvar polyfill = getPolyfill();\n\tdefine(Object, { is: polyfill }, {\n\t\tis: function testObjectIs() {\n\t\t\treturn Object.is !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","module.exports = function pointInPolygonFlat (point, vs, start, end) {\n var x = point[0], y = point[1];\n var inside = false;\n if (start === undefined) start = 0;\n if (end === undefined) end = vs.length;\n var len = (end-start)/2;\n for (var i = 0, j = len - 1; i < len; j = i++) {\n var xi = vs[start+i*2+0], yi = vs[start+i*2+1];\n var xj = vs[start+j*2+0], yj = vs[start+j*2+1];\n var intersect = ((yi > y) !== (yj > y))\n && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n return inside;\n};\n","// ray-casting algorithm based on\n// https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html\n\nmodule.exports = function pointInPolygonNested (point, vs, start, end) {\n var x = point[0], y = point[1];\n var inside = false;\n if (start === undefined) start = 0;\n if (end === undefined) end = vs.length;\n var len = end - start;\n for (var i = 0, j = len - 1; i < len; j = i++) {\n var xi = vs[i+start][0], yi = vs[i+start][1];\n var xj = vs[j+start][0], yj = vs[j+start][1];\n var intersect = ((yi > y) !== (yj > y))\n && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n return inside;\n};\n","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.quickselect = factory());\n}(this, (function () { 'use strict';\n\nfunction quickselect(arr, k, left, right, compare) {\n quickselectStep(arr, k, left || 0, right || (arr.length - 1), compare || defaultCompare);\n}\n\nfunction quickselectStep(arr, k, left, right, compare) {\n\n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselectStep(arr, k, newLeft, newRight, compare);\n }\n\n var t = arr[k];\n var i = left;\n var j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n\n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}\n\nfunction swap(arr, i, j) {\n var tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nreturn quickselect;\n\n})));\n","'use strict';\n\nvar functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.hasIndices) {\n\t\tresult += 'd';\n\t}\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.unicodeSets) {\n\t\tresult += 'v';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n};\n\nif (functionsHaveConfigurableNames && Object.defineProperty) {\n\tObject.defineProperty(module.exports, 'name', { value: 'get flags' });\n}\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function getPolyfill() {\n\tif (supportsDescriptors && (/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (\n\t\t\tdescriptor\n\t\t\t&& typeof descriptor.get === 'function'\n\t\t\t&& typeof RegExp.prototype.dotAll === 'boolean'\n\t\t\t&& typeof RegExp.prototype.hasIndices === 'boolean'\n\t\t) {\n\t\t\t/* eslint getter-return: 0 */\n\t\t\tvar calls = '';\n\t\t\tvar o = {};\n\t\t\tObject.defineProperty(o, 'hasIndices', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'd';\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.defineProperty(o, 'sticky', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'y';\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (calls === 'dy') {\n\t\t\t\treturn descriptor.get;\n\t\t\t}\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],e):e((t=t||self).predicates={})}(this,function(t){\"use strict\";const e=134217729,n=33306690738754706e-32;function r(t,e,n,r,o){let f,i,u,c,s=e[0],a=r[0],d=0,l=0;a>s==a>-s?(f=s,s=e[++d]):(f=a,a=r[++l]);let p=0;if(ds==a>-s?(u=f-((i=s+f)-s),s=e[++d]):(u=f-((i=a+f)-a),a=r[++l]),f=i,0!==u&&(o[p++]=u);ds==a>-s?(u=f-((i=f+s)-(c=i-f))+(s-c),s=e[++d]):(u=f-((i=f+a)-(c=i-f))+(a-c),a=r[++l]),f=i,0!==u&&(o[p++]=u);for(;d0!=x>0)return j;const m=Math.abs(M+x);return Math.abs(j)>=f*m?j:-function(t,o,f,p,b,y,h){let M,x,j,m,_,v,w,A,F,O,P,g,k,q,z,B,C,D;const E=t-b,G=f-b,H=o-y,I=p-y;_=(z=(A=E-(w=(v=e*E)-(v-E)))*(O=I-(F=(v=e*I)-(v-I)))-((q=E*I)-w*F-A*F-w*O))-(P=z-(C=(A=H-(w=(v=e*H)-(v-H)))*(O=G-(F=(v=e*G)-(v-G)))-((B=H*G)-w*F-A*F-w*O))),c[0]=z-(P+_)+(_-C),_=(k=q-((g=q+P)-(_=g-q))+(P-_))-(P=k-B),c[1]=k-(P+_)+(_-B),_=(D=g+P)-g,c[2]=g-(D-_)+(P-_),c[3]=D;let J=function(t,e){let n=e[0];for(let r=1;r=K||-J>=K)return J;if(M=t-(E+(_=t-E))+(_-b),j=f-(G+(_=f-G))+(_-b),x=o-(H+(_=o-H))+(_-y),m=p-(I+(_=p-I))+(_-y),0===M&&0===x&&0===j&&0===m)return J;if(K=u*h+n*Math.abs(J),(J+=E*m+I*M-(H*j+G*x))>=K||-J>=K)return J;_=(z=(A=M-(w=(v=e*M)-(v-M)))*(O=I-(F=(v=e*I)-(v-I)))-((q=M*I)-w*F-A*F-w*O))-(P=z-(C=(A=x-(w=(v=e*x)-(v-x)))*(O=G-(F=(v=e*G)-(v-G)))-((B=x*G)-w*F-A*F-w*O))),l[0]=z-(P+_)+(_-C),_=(k=q-((g=q+P)-(_=g-q))+(P-_))-(P=k-B),l[1]=k-(P+_)+(_-B),_=(D=g+P)-g,l[2]=g-(D-_)+(P-_),l[3]=D;const L=r(4,c,4,l,s);_=(z=(A=E-(w=(v=e*E)-(v-E)))*(O=m-(F=(v=e*m)-(v-m)))-((q=E*m)-w*F-A*F-w*O))-(P=z-(C=(A=H-(w=(v=e*H)-(v-H)))*(O=j-(F=(v=e*j)-(v-j)))-((B=H*j)-w*F-A*F-w*O))),l[0]=z-(P+_)+(_-C),_=(k=q-((g=q+P)-(_=g-q))+(P-_))-(P=k-B),l[1]=k-(P+_)+(_-B),_=(D=g+P)-g,l[2]=g-(D-_)+(P-_),l[3]=D;const N=r(L,s,4,l,a);_=(z=(A=M-(w=(v=e*M)-(v-M)))*(O=m-(F=(v=e*m)-(v-m)))-((q=M*m)-w*F-A*F-w*O))-(P=z-(C=(A=x-(w=(v=e*x)-(v-x)))*(O=j-(F=(v=e*j)-(v-j)))-((B=x*j)-w*F-A*F-w*O))),l[0]=z-(P+_)+(_-C),_=(k=q-((g=q+P)-(_=g-q))+(P-_))-(P=k-B),l[1]=k-(P+_)+(_-B),_=(D=g+P)-g,l[2]=g-(D-_)+(P-_),l[3]=D;const Q=r(N,a,4,l,d);return d[Q-1]}(t,o,p,b,y,h,m)},t.orient2dfast=function(t,e,n,r,o,f){return(e-f)*(n-o)-(t-o)*(r-f)},Object.defineProperty(t,\"__esModule\",{value:!0})});\n","module.exports = {\n\t/**\n\t * Euclidean distance\n\t */\n\teudist(v1,v2,sqrt) {\n\t\tvar len = v1.length;\n\t\tvar sum = 0;\n\n\t\tfor(let i=0;i0;\n\n\t\twhile(ks.length0) {\n\t\t\tlet d = data[Math.floor(Math.random()*len)];\n\t\t\tlet key = multi? d.join(\"_\") : `${d}`;\n\t\t\tif(!map[key]) {\n\t\t\t\tmap[key] = true;\n\t\t\t\tks.push(d);\n\t\t\t}\n\t\t}\n\n\t\tif(ks.length0;\n\t\tvar map = {};\n\n\t\t// First random centroid\n\t\tvar c = data[Math.floor(Math.random()*len)];\n\t\tvar key = multi? c.join(\"_\") : `${c}`;\n\t\tks.push(c);\n\t\tmap[key] = true;\n\n\t\t// Retrieve next centroids\n\t\twhile(ks.lengtha.pr-b.pr);\n\n\t\t\t// Cummulative Probabilities\n\t\t\tprs[0].cs = prs[0].pr;\n\t\t\tfor(let i=1;i= rnd\n\t\t\tlet idx = 0;\n\t\t\twhile(idx0;\n\tvar count = [];\n\n\tif(!initial) {\n\t\tlet idxs = {};\n\t\twhile(ks.length> 7 ^ uints[2] ^ uints[3];\n return hash & 0x7fffffff;\n}\n","/**\n * BezierSpline\n * https://github.com/leszekr/bezier-spline-js\n *\n * @private\n * @copyright\n * Copyright (c) 2013 Leszek Rybicki\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nvar Spline = /** @class */ (function () {\n function Spline(options) {\n this.points = options.points || [];\n this.duration = options.duration || 10000;\n this.sharpness = options.sharpness || 0.85;\n this.centers = [];\n this.controls = [];\n this.stepLength = options.stepLength || 60;\n this.length = this.points.length;\n this.delay = 0;\n // this is to ensure compatibility with the 2d version\n for (var i = 0; i < this.length; i++) {\n this.points[i].z = this.points[i].z || 0;\n }\n for (var i = 0; i < this.length - 1; i++) {\n var p1 = this.points[i];\n var p2 = this.points[i + 1];\n this.centers.push({\n x: (p1.x + p2.x) / 2,\n y: (p1.y + p2.y) / 2,\n z: (p1.z + p2.z) / 2,\n });\n }\n this.controls.push([this.points[0], this.points[0]]);\n for (var i = 0; i < this.centers.length - 1; i++) {\n var dx = this.points[i + 1].x - (this.centers[i].x + this.centers[i + 1].x) / 2;\n var dy = this.points[i + 1].y - (this.centers[i].y + this.centers[i + 1].y) / 2;\n var dz = this.points[i + 1].z - (this.centers[i].y + this.centers[i + 1].z) / 2;\n this.controls.push([\n {\n x: (1.0 - this.sharpness) * this.points[i + 1].x +\n this.sharpness * (this.centers[i].x + dx),\n y: (1.0 - this.sharpness) * this.points[i + 1].y +\n this.sharpness * (this.centers[i].y + dy),\n z: (1.0 - this.sharpness) * this.points[i + 1].z +\n this.sharpness * (this.centers[i].z + dz),\n },\n {\n x: (1.0 - this.sharpness) * this.points[i + 1].x +\n this.sharpness * (this.centers[i + 1].x + dx),\n y: (1.0 - this.sharpness) * this.points[i + 1].y +\n this.sharpness * (this.centers[i + 1].y + dy),\n z: (1.0 - this.sharpness) * this.points[i + 1].z +\n this.sharpness * (this.centers[i + 1].z + dz),\n },\n ]);\n }\n this.controls.push([\n this.points[this.length - 1],\n this.points[this.length - 1],\n ]);\n this.steps = this.cacheSteps(this.stepLength);\n return this;\n }\n /**\n * Caches an array of equidistant (more or less) points on the curve.\n */\n Spline.prototype.cacheSteps = function (mindist) {\n var steps = [];\n var laststep = this.pos(0);\n steps.push(0);\n for (var t = 0; t < this.duration; t += 10) {\n var step = this.pos(t);\n var dist = Math.sqrt((step.x - laststep.x) * (step.x - laststep.x) +\n (step.y - laststep.y) * (step.y - laststep.y) +\n (step.z - laststep.z) * (step.z - laststep.z));\n if (dist > mindist) {\n steps.push(t);\n laststep = step;\n }\n }\n return steps;\n };\n /**\n * returns angle and speed in the given point in the curve\n */\n Spline.prototype.vector = function (t) {\n var p1 = this.pos(t + 10);\n var p2 = this.pos(t - 10);\n return {\n angle: (180 * Math.atan2(p1.y - p2.y, p1.x - p2.x)) / 3.14,\n speed: Math.sqrt((p2.x - p1.x) * (p2.x - p1.x) +\n (p2.y - p1.y) * (p2.y - p1.y) +\n (p2.z - p1.z) * (p2.z - p1.z)),\n };\n };\n /**\n * Gets the position of the point, given time.\n *\n * WARNING: The speed is not constant. The time it takes between control points is constant.\n *\n * For constant speed, use Spline.steps[i];\n */\n Spline.prototype.pos = function (time) {\n var t = time - this.delay;\n if (t < 0) {\n t = 0;\n }\n if (t > this.duration) {\n t = this.duration - 1;\n }\n // t = t-this.delay;\n var t2 = t / this.duration;\n if (t2 >= 1) {\n return this.points[this.length - 1];\n }\n var n = Math.floor((this.points.length - 1) * t2);\n var t1 = (this.length - 1) * t2 - n;\n return bezier(t1, this.points[n], this.controls[n][1], this.controls[n + 1][0], this.points[n + 1]);\n };\n return Spline;\n}());\nexport default Spline;\nfunction bezier(t, p1, c1, c2, p2) {\n var b = B(t);\n var pos = {\n x: p2.x * b[0] + c2.x * b[1] + c1.x * b[2] + p1.x * b[3],\n y: p2.y * b[0] + c2.y * b[1] + c1.y * b[2] + p1.y * b[3],\n z: p2.z * b[0] + c2.z * b[1] + c1.z * b[2] + p1.z * b[3],\n };\n return pos;\n}\nfunction B(t) {\n var t2 = t * t;\n var t3 = t2 * t;\n return [\n t3,\n 3 * t2 * (1 - t),\n 3 * t * (1 - t) * (1 - t),\n (1 - t) * (1 - t) * (1 - t),\n ];\n}\n","import { orientationIndex, envelopeIsEqual, envelopeContains, coordinatesEqual, } from \"./util.js\";\nimport { multiPoint, polygon, point, } from \"@turf/helpers\";\nimport envelope from \"@turf/envelope\";\nimport booleanPointInPolygon from \"@turf/boolean-point-in-polygon\";\n/**\n * Ring of edges which form a polygon.\n *\n * The ring may be either an outer shell or a hole.\n *\n * This class is inspired in GEOS's geos::operation::polygonize::EdgeRing\n */\nvar EdgeRing = /** @class */ (function () {\n function EdgeRing() {\n this.edges = [];\n this.polygon = undefined; //< Caches Polygon representation\n this.envelope = undefined; //< Caches Envelope representation\n }\n /**\n * Add an edge to the ring, inserting it in the last position.\n *\n * @memberof EdgeRing\n * @param {Edge} edge - Edge to be inserted\n */\n EdgeRing.prototype.push = function (edge) {\n this.edges.push(edge);\n this.polygon = this.envelope = undefined;\n };\n /**\n * Get Edge.\n *\n * @memberof EdgeRing\n * @param {number} i - Index\n * @returns {Edge} - Edge in the i position\n */\n EdgeRing.prototype.get = function (i) {\n return this.edges[i];\n };\n Object.defineProperty(EdgeRing.prototype, \"length\", {\n /**\n * Getter of length property.\n *\n * @memberof EdgeRing\n * @returns {number} - Length of the edge ring.\n */\n get: function () {\n return this.edges.length;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Similar to Array.prototype.forEach for the list of Edges in the EdgeRing.\n *\n * @memberof EdgeRing\n * @param {Function} f - The same function to be passed to Array.prototype.forEach\n */\n EdgeRing.prototype.forEach = function (f) {\n this.edges.forEach(f);\n };\n /**\n * Similar to Array.prototype.map for the list of Edges in the EdgeRing.\n *\n * @memberof EdgeRing\n * @param {Function} f - The same function to be passed to Array.prototype.map\n * @returns {Array} - The mapped values in the function\n */\n EdgeRing.prototype.map = function (f) {\n return this.edges.map(f);\n };\n /**\n * Similar to Array.prototype.some for the list of Edges in the EdgeRing.\n *\n * @memberof EdgeRing\n * @param {Function} f - The same function to be passed to Array.prototype.some\n * @returns {boolean} - True if an Edge check the condition\n */\n EdgeRing.prototype.some = function (f) {\n return this.edges.some(f);\n };\n /**\n * Check if the ring is valid in geomtry terms.\n *\n * A ring must have either 0 or 4 or more points. The first and the last must be\n * equal (in 2D)\n * geos::geom::LinearRing::validateConstruction\n *\n * @memberof EdgeRing\n * @returns {boolean} - Validity of the EdgeRing\n */\n EdgeRing.prototype.isValid = function () {\n // TODO: stub\n return true;\n };\n /**\n * Tests whether this ring is a hole.\n *\n * A ring is a hole if it is oriented counter-clockwise.\n * Similar implementation of geos::algorithm::CGAlgorithms::isCCW\n *\n * @memberof EdgeRing\n * @returns {boolean} - true: if it is a hole\n */\n EdgeRing.prototype.isHole = function () {\n var _this = this;\n // XXX: Assuming Ring is valid\n // Find highest point\n var hiIndex = this.edges.reduce(function (high, edge, i) {\n if (edge.from.coordinates[1] > _this.edges[high].from.coordinates[1])\n high = i;\n return high;\n }, 0), iPrev = (hiIndex === 0 ? this.length : hiIndex) - 1, iNext = (hiIndex + 1) % this.length, disc = orientationIndex(this.edges[iPrev].from.coordinates, this.edges[hiIndex].from.coordinates, this.edges[iNext].from.coordinates);\n if (disc === 0)\n return (this.edges[iPrev].from.coordinates[0] >\n this.edges[iNext].from.coordinates[0]);\n return disc > 0;\n };\n /**\n * Creates a MultiPoint representing the EdgeRing (discarts edges directions).\n *\n * @memberof EdgeRing\n * @returns {Feature} - Multipoint representation of the EdgeRing\n */\n EdgeRing.prototype.toMultiPoint = function () {\n return multiPoint(this.edges.map(function (edge) { return edge.from.coordinates; }));\n };\n /**\n * Creates a Polygon representing the EdgeRing.\n *\n * @memberof EdgeRing\n * @returns {Feature} - Polygon representation of the Edge Ring\n */\n EdgeRing.prototype.toPolygon = function () {\n if (this.polygon)\n return this.polygon;\n var coordinates = this.edges.map(function (edge) { return edge.from.coordinates; });\n coordinates.push(this.edges[0].from.coordinates);\n return (this.polygon = polygon([coordinates]));\n };\n /**\n * Calculates the envelope of the EdgeRing.\n *\n * @memberof EdgeRing\n * @returns {Feature} - envelope\n */\n EdgeRing.prototype.getEnvelope = function () {\n if (this.envelope)\n return this.envelope;\n return (this.envelope = envelope(this.toPolygon()));\n };\n /**\n * `geos::operation::polygonize::EdgeRing::findEdgeRingContaining`\n *\n * @param {EdgeRing} testEdgeRing - EdgeRing to look in the list\n * @param {EdgeRing[]} shellList - List of EdgeRing in which to search\n *\n * @returns {EdgeRing} - EdgeRing which contains the testEdgeRing\n */\n EdgeRing.findEdgeRingContaining = function (testEdgeRing, shellList) {\n var testEnvelope = testEdgeRing.getEnvelope();\n var minEnvelope, minShell;\n shellList.forEach(function (shell) {\n var tryEnvelope = shell.getEnvelope();\n if (minShell)\n minEnvelope = minShell.getEnvelope();\n // the hole envelope cannot equal the shell envelope\n if (envelopeIsEqual(tryEnvelope, testEnvelope))\n return;\n if (envelopeContains(tryEnvelope, testEnvelope)) {\n var testEdgeRingCoordinates = testEdgeRing.map(function (edge) { return edge.from.coordinates; });\n var testPoint = void 0;\n var _loop_1 = function (pt) {\n if (!shell.some(function (edge) { return coordinatesEqual(pt, edge.from.coordinates); })) {\n testPoint = pt;\n }\n };\n for (var _i = 0, testEdgeRingCoordinates_1 = testEdgeRingCoordinates; _i < testEdgeRingCoordinates_1.length; _i++) {\n var pt = testEdgeRingCoordinates_1[_i];\n _loop_1(pt);\n }\n if (testPoint && shell.inside(point(testPoint))) {\n if (!minShell || envelopeContains(minEnvelope, tryEnvelope))\n minShell = shell;\n }\n }\n });\n return minShell;\n };\n /**\n * Checks if the point is inside the edgeRing\n *\n * @param {Feature} pt - Point to check if it is inside the edgeRing\n * @returns {boolean} - True if it is inside, False otherwise\n */\n EdgeRing.prototype.inside = function (pt) {\n return booleanPointInPolygon(pt, this.toPolygon());\n };\n return EdgeRing;\n}());\nexport default EdgeRing;\n","import { orientationIndex } from \"./util.js\";\n/**\n * Node\n */\nvar Node = /** @class */ (function () {\n function Node(coordinates) {\n this.id = Node.buildId(coordinates);\n this.coordinates = coordinates; //< {Number[]}\n this.innerEdges = []; //< {Edge[]}\n // We wil store to (out) edges in an CCW order as geos::planargraph::DirectedEdgeStar does\n this.outerEdges = []; //< {Edge[]}\n this.outerEdgesSorted = false; //< {Boolean} flag that stores if the outer Edges had been sorted\n }\n Node.buildId = function (coordinates) {\n return coordinates.join(\",\");\n };\n Node.prototype.removeInnerEdge = function (edge) {\n this.innerEdges = this.innerEdges.filter(function (e) { return e.from.id !== edge.from.id; });\n };\n Node.prototype.removeOuterEdge = function (edge) {\n this.outerEdges = this.outerEdges.filter(function (e) { return e.to.id !== edge.to.id; });\n };\n /**\n * Outer edges are stored CCW order.\n *\n * @memberof Node\n * @param {Edge} edge - Edge to add as an outerEdge.\n */\n Node.prototype.addOuterEdge = function (edge) {\n this.outerEdges.push(edge);\n this.outerEdgesSorted = false;\n };\n /**\n * Sorts outer edges in CCW way.\n *\n * @memberof Node\n * @private\n */\n Node.prototype.sortOuterEdges = function () {\n var _this = this;\n if (!this.outerEdgesSorted) {\n //this.outerEdges.sort((a, b) => a.compareTo(b));\n // Using this comparator in order to be deterministic\n this.outerEdges.sort(function (a, b) {\n var aNode = a.to, bNode = b.to;\n if (aNode.coordinates[0] - _this.coordinates[0] >= 0 &&\n bNode.coordinates[0] - _this.coordinates[0] < 0)\n return 1;\n if (aNode.coordinates[0] - _this.coordinates[0] < 0 &&\n bNode.coordinates[0] - _this.coordinates[0] >= 0)\n return -1;\n if (aNode.coordinates[0] - _this.coordinates[0] === 0 &&\n bNode.coordinates[0] - _this.coordinates[0] === 0) {\n if (aNode.coordinates[1] - _this.coordinates[1] >= 0 ||\n bNode.coordinates[1] - _this.coordinates[1] >= 0)\n return aNode.coordinates[1] - bNode.coordinates[1];\n return bNode.coordinates[1] - aNode.coordinates[1];\n }\n var det = orientationIndex(_this.coordinates, aNode.coordinates, bNode.coordinates);\n if (det < 0)\n return 1;\n if (det > 0)\n return -1;\n var d1 = Math.pow(aNode.coordinates[0] - _this.coordinates[0], 2) +\n Math.pow(aNode.coordinates[1] - _this.coordinates[1], 2), d2 = Math.pow(bNode.coordinates[0] - _this.coordinates[0], 2) +\n Math.pow(bNode.coordinates[1] - _this.coordinates[1], 2);\n return d1 - d2;\n });\n this.outerEdgesSorted = true;\n }\n };\n /**\n * Retrieves outer edges.\n *\n * They are sorted if they aren't in the CCW order.\n *\n * @memberof Node\n * @returns {Edge[]} - List of outer edges sorted in a CCW order.\n */\n Node.prototype.getOuterEdges = function () {\n this.sortOuterEdges();\n return this.outerEdges;\n };\n Node.prototype.getOuterEdge = function (i) {\n this.sortOuterEdges();\n return this.outerEdges[i];\n };\n Node.prototype.addInnerEdge = function (edge) {\n this.innerEdges.push(edge);\n };\n return Node;\n}());\nexport default Node;\n","import { lineString } from \"@turf/helpers\";\nimport { orientationIndex } from \"./util.js\";\n/**\n * This class is inspired by GEOS's geos::operation::polygonize::PolygonizeDirectedEdge\n */\nvar Edge = /** @class */ (function () {\n /**\n * @param {Node} from - start node of the Edge\n * @param {Node} to - end node of the edge\n */\n function Edge(from, to) {\n this.from = from; //< start\n this.to = to; //< End\n this.next = undefined; //< The edge to be computed after\n this.label = undefined; //< Used in order to detect Cut Edges (Bridges)\n this.symetric = undefined; //< The symetric edge of this\n this.ring = undefined; //< EdgeRing in which the Edge is\n this.from.addOuterEdge(this);\n this.to.addInnerEdge(this);\n }\n /**\n * Creates or get the symetric Edge.\n *\n * @returns {Edge} - Symetric Edge.\n */\n Edge.prototype.getSymetric = function () {\n if (!this.symetric) {\n this.symetric = new Edge(this.to, this.from);\n this.symetric.symetric = this;\n }\n return this.symetric;\n };\n /**\n * Removes edge from from and to nodes.\n */\n Edge.prototype.deleteEdge = function () {\n this.from.removeOuterEdge(this);\n this.to.removeInnerEdge(this);\n };\n /**\n * Compares Edge equallity.\n *\n * An edge is equal to another, if the from and to nodes are the same.\n *\n * @param {Edge} edge - Another Edge\n * @returns {boolean} - True if Edges are equal, False otherwise\n */\n Edge.prototype.isEqual = function (edge) {\n return this.from.id === edge.from.id && this.to.id === edge.to.id;\n };\n Edge.prototype.toString = function () {\n return \"Edge { \" + this.from.id + \" -> \" + this.to.id + \" }\";\n };\n /**\n * Returns a LineString representation of the Edge\n *\n * @returns {Feature} - LineString representation of the Edge\n */\n Edge.prototype.toLineString = function () {\n return lineString([this.from.coordinates, this.to.coordinates]);\n };\n /**\n * Comparator of two edges.\n *\n * Implementation of geos::planargraph::DirectedEdge::compareTo.\n *\n * @param {Edge} edge - Another edge to compare with this one\n * @returns {number} -1 if this Edge has a greater angle with the positive x-axis than b,\n * 0 if the Edges are colinear,\n * 1 otherwise\n */\n Edge.prototype.compareTo = function (edge) {\n return orientationIndex(edge.from.coordinates, edge.to.coordinates, this.to.coordinates);\n };\n return Edge;\n}());\nexport default Edge;\n","import Node from \"./Node.js\";\nimport Edge from \"./Edge.js\";\nimport EdgeRing from \"./EdgeRing.js\";\nimport { flattenEach, coordReduce } from \"@turf/meta\";\nimport { featureOf } from \"@turf/invariant\";\n/**\n * Validates the geoJson.\n *\n * @param {GeoJSON} geoJson - input geoJson.\n * @throws {Error} if geoJson is invalid.\n */\nfunction validateGeoJson(geoJson) {\n if (!geoJson)\n throw new Error(\"No geojson passed\");\n if (geoJson.type !== \"FeatureCollection\" &&\n geoJson.type !== \"GeometryCollection\" &&\n geoJson.type !== \"MultiLineString\" &&\n geoJson.type !== \"LineString\" &&\n geoJson.type !== \"Feature\")\n throw new Error(\"Invalid input type '\" + geoJson.type + \"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature\");\n}\n/**\n * Represents a planar graph of edges and nodes that can be used to compute a polygonization.\n *\n * Although, this class is inspired by GEOS's `geos::operation::polygonize::PolygonizeGraph`,\n * it isn't a rewrite. As regards algorithm, this class implements the same logic, but it\n * isn't a javascript transcription of the C++ source.\n *\n * This graph is directed (both directions are created)\n */\nvar Graph = /** @class */ (function () {\n function Graph() {\n this.edges = []; //< {Edge[]} dirEdges\n // The key is the `id` of the Node (ie: coordinates.join(','))\n this.nodes = {};\n }\n /**\n * Creates a graph from a GeoJSON.\n *\n * @param {FeatureCollection} geoJson - it must comply with the restrictions detailed in the index\n * @returns {Graph} - The newly created graph\n * @throws {Error} if geoJson is invalid.\n */\n Graph.fromGeoJson = function (geoJson) {\n validateGeoJson(geoJson);\n var graph = new Graph();\n flattenEach(geoJson, function (feature) {\n featureOf(feature, \"LineString\", \"Graph::fromGeoJson\");\n // When a LineString if formed by many segments, split them\n coordReduce(feature, function (prev, cur) {\n if (prev) {\n var start = graph.getNode(prev), end = graph.getNode(cur);\n graph.addEdge(start, end);\n }\n return cur;\n });\n });\n return graph;\n };\n /**\n * Creates or get a Node.\n *\n * @param {number[]} coordinates - Coordinates of the node\n * @returns {Node} - The created or stored node\n */\n Graph.prototype.getNode = function (coordinates) {\n var id = Node.buildId(coordinates);\n var node = this.nodes[id];\n if (!node)\n node = this.nodes[id] = new Node(coordinates);\n return node;\n };\n /**\n * Adds an Edge and its symetricall.\n *\n * Edges are added symetrically, i.e.: we also add its symetric\n *\n * @param {Node} from - Node which starts the Edge\n * @param {Node} to - Node which ends the Edge\n */\n Graph.prototype.addEdge = function (from, to) {\n var edge = new Edge(from, to), symetricEdge = edge.getSymetric();\n this.edges.push(edge);\n this.edges.push(symetricEdge);\n };\n /**\n * Removes Dangle Nodes (nodes with grade 1).\n */\n Graph.prototype.deleteDangles = function () {\n var _this = this;\n Object.keys(this.nodes)\n .map(function (id) { return _this.nodes[id]; })\n .forEach(function (node) { return _this._removeIfDangle(node); });\n };\n /**\n * Check if node is dangle, if so, remove it.\n *\n * It calls itself recursively, removing a dangling node might cause another dangling node\n *\n * @param {Node} node - Node to check if it's a dangle\n */\n Graph.prototype._removeIfDangle = function (node) {\n var _this = this;\n // As edges are directed and symetrical, we count only innerEdges\n if (node.innerEdges.length <= 1) {\n var outerNodes = node.getOuterEdges().map(function (e) { return e.to; });\n this.removeNode(node);\n outerNodes.forEach(function (n) { return _this._removeIfDangle(n); });\n }\n };\n /**\n * Delete cut-edges (bridge edges).\n *\n * The graph will be traversed, all the edges will be labeled according the ring\n * in which they are. (The label is a number incremented by 1). Edges with the same\n * label are cut-edges.\n */\n Graph.prototype.deleteCutEdges = function () {\n var _this = this;\n this._computeNextCWEdges();\n this._findLabeledEdgeRings();\n // Cut-edges (bridges) are edges where both edges have the same label\n this.edges.forEach(function (edge) {\n if (edge.label === edge.symetric.label) {\n _this.removeEdge(edge.symetric);\n _this.removeEdge(edge);\n }\n });\n };\n /**\n * Set the `next` property of each Edge.\n *\n * The graph will be transversed in a CW form, so, we set the next of the symetrical edge as the previous one.\n * OuterEdges are sorted CCW.\n *\n * @param {Node} [node] - If no node is passed, the function calls itself for every node in the Graph\n */\n Graph.prototype._computeNextCWEdges = function (node) {\n var _this = this;\n if (typeof node === \"undefined\") {\n Object.keys(this.nodes).forEach(function (id) {\n return _this._computeNextCWEdges(_this.nodes[id]);\n });\n }\n else {\n node.getOuterEdges().forEach(function (edge, i) {\n node.getOuterEdge((i === 0 ? node.getOuterEdges().length : i) - 1).symetric.next = edge;\n });\n }\n };\n /**\n * Computes the next edge pointers going CCW around the given node, for the given edgering label.\n *\n * This algorithm has the effect of converting maximal edgerings into minimal edgerings\n *\n * XXX: method literally transcribed from `geos::operation::polygonize::PolygonizeGraph::computeNextCCWEdges`,\n * could be written in a more javascript way.\n *\n * @param {Node} node - Node\n * @param {number} label - Ring's label\n */\n Graph.prototype._computeNextCCWEdges = function (node, label) {\n var edges = node.getOuterEdges();\n var firstOutDE, prevInDE;\n for (var i = edges.length - 1; i >= 0; --i) {\n var de = edges[i], sym = de.symetric, outDE = void 0, inDE = void 0;\n if (de.label === label)\n outDE = de;\n if (sym.label === label)\n inDE = sym;\n if (!outDE || !inDE)\n // This edge is not in edgering\n continue;\n if (inDE)\n prevInDE = inDE;\n if (outDE) {\n if (prevInDE) {\n prevInDE.next = outDE;\n prevInDE = undefined;\n }\n if (!firstOutDE)\n firstOutDE = outDE;\n }\n }\n if (prevInDE)\n prevInDE.next = firstOutDE;\n };\n /**\n * Finds rings and labels edges according to which rings are.\n *\n * The label is a number which is increased for each ring.\n *\n * @returns {Edge[]} edges that start rings\n */\n Graph.prototype._findLabeledEdgeRings = function () {\n var edgeRingStarts = [];\n var label = 0;\n this.edges.forEach(function (edge) {\n if (edge.label >= 0)\n return;\n edgeRingStarts.push(edge);\n var e = edge;\n do {\n e.label = label;\n e = e.next;\n } while (!edge.isEqual(e));\n label++;\n });\n return edgeRingStarts;\n };\n /**\n * Computes the EdgeRings formed by the edges in this graph.\n *\n * @returns {EdgeRing[]} - A list of all the EdgeRings in the graph.\n */\n Graph.prototype.getEdgeRings = function () {\n var _this = this;\n this._computeNextCWEdges();\n // Clear labels\n this.edges.forEach(function (edge) {\n edge.label = undefined;\n });\n this._findLabeledEdgeRings().forEach(function (edge) {\n // convertMaximalToMinimalEdgeRings\n _this._findIntersectionNodes(edge).forEach(function (node) {\n _this._computeNextCCWEdges(node, edge.label);\n });\n });\n var edgeRingList = [];\n // find all edgerings\n this.edges.forEach(function (edge) {\n if (edge.ring)\n return;\n edgeRingList.push(_this._findEdgeRing(edge));\n });\n return edgeRingList;\n };\n /**\n * Find all nodes in a Maxima EdgeRing which are self-intersection nodes.\n *\n * @param {Node} startEdge - Start Edge of the Ring\n * @returns {Node[]} - intersection nodes\n */\n Graph.prototype._findIntersectionNodes = function (startEdge) {\n var intersectionNodes = [];\n var edge = startEdge;\n var _loop_1 = function () {\n // getDegree\n var degree = 0;\n edge.from.getOuterEdges().forEach(function (e) {\n if (e.label === startEdge.label)\n ++degree;\n });\n if (degree > 1)\n intersectionNodes.push(edge.from);\n edge = edge.next;\n };\n do {\n _loop_1();\n } while (!startEdge.isEqual(edge));\n return intersectionNodes;\n };\n /**\n * Get the edge-ring which starts from the provided Edge.\n *\n * @param {Edge} startEdge - starting edge of the edge ring\n * @returns {EdgeRing} - EdgeRing which start Edge is the provided one.\n */\n Graph.prototype._findEdgeRing = function (startEdge) {\n var edge = startEdge;\n var edgeRing = new EdgeRing();\n do {\n edgeRing.push(edge);\n edge.ring = edgeRing;\n edge = edge.next;\n } while (!startEdge.isEqual(edge));\n return edgeRing;\n };\n /**\n * Removes a node from the Graph.\n *\n * It also removes edges asociated to that node\n * @param {Node} node - Node to be removed\n */\n Graph.prototype.removeNode = function (node) {\n var _this = this;\n node.getOuterEdges().forEach(function (edge) { return _this.removeEdge(edge); });\n node.innerEdges.forEach(function (edge) { return _this.removeEdge(edge); });\n delete this.nodes[node.id];\n };\n /**\n * Remove edge from the graph and deletes the edge.\n *\n * @param {Edge} edge - Edge to be removed\n */\n Graph.prototype.removeEdge = function (edge) {\n this.edges = this.edges.filter(function (e) { return !e.isEqual(edge); });\n edge.deleteEdge();\n };\n return Graph;\n}());\nexport default Graph;\n","import booleanPointInPolygon from \"@turf/boolean-point-in-polygon\";\nimport { point } from \"@turf/helpers\";\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign#Polyfill\nfunction mathSign(x) {\n return ((x > 0) - (x < 0) || +x);\n}\n/**\n * Returns the direction of the point q relative to the vector p1 -> p2.\n *\n * Implementation of geos::algorithm::CGAlgorithm::orientationIndex()\n * (same as geos::algorithm::CGAlgorithm::computeOrientation())\n *\n * @param {number[]} p1 - the origin point of the vector\n * @param {number[]} p2 - the final point of the vector\n * @param {number[]} q - the point to compute the direction to\n *\n * @returns {number} - 1 if q is ccw (left) from p1->p2,\n * -1 if q is cw (right) from p1->p2,\n * 0 if q is colinear with p1->p2\n */\nexport function orientationIndex(p1, p2, q) {\n var dx1 = p2[0] - p1[0], dy1 = p2[1] - p1[1], dx2 = q[0] - p2[0], dy2 = q[1] - p2[1];\n return mathSign(dx1 * dy2 - dx2 * dy1);\n}\n/**\n * Checks if two envelopes are equal.\n *\n * The function assumes that the arguments are envelopes, i.e.: Rectangular polygon\n *\n * @param {Feature} env1 - Envelope\n * @param {Feature} env2 - Envelope\n * @returns {boolean} - True if the envelopes are equal\n */\nexport function envelopeIsEqual(env1, env2) {\n var envX1 = env1.geometry.coordinates[0].map(function (c) { return c[0]; }), envY1 = env1.geometry.coordinates[0].map(function (c) { return c[1]; }), envX2 = env2.geometry.coordinates[0].map(function (c) { return c[0]; }), envY2 = env2.geometry.coordinates[0].map(function (c) { return c[1]; });\n return (Math.max.apply(null, envX1) === Math.max.apply(null, envX2) &&\n Math.max.apply(null, envY1) === Math.max.apply(null, envY2) &&\n Math.min.apply(null, envX1) === Math.min.apply(null, envX2) &&\n Math.min.apply(null, envY1) === Math.min.apply(null, envY2));\n}\n/**\n * Check if a envelope is contained in other one.\n *\n * The function assumes that the arguments are envelopes, i.e.: Convex polygon\n * XXX: Envelopes are rectangular, checking if a point is inside a rectangule is something easy,\n * this could be further improved.\n *\n * @param {Feature} self - Envelope\n * @param {Feature} env - Envelope\n * @returns {boolean} - True if env is contained in self\n */\nexport function envelopeContains(self, env) {\n return env.geometry.coordinates[0].every(function (c) {\n return booleanPointInPolygon(point(c), self);\n });\n}\n/**\n * Checks if two coordinates are equal.\n *\n * @param {number[]} coord1 - First coordinate\n * @param {number[]} coord2 - Second coordinate\n * @returns {boolean} - True if coordinates are equal\n */\nexport function coordinatesEqual(coord1, coord2) {\n return coord1[0] === coord2[0] && coord1[1] === coord2[1];\n}\n"],"names":["earcut","data","holeIndices","dim","minX","minY","maxX","maxY","x","y","invSize","hasHoles","length","outerLen","outerNode","linkedList","triangles","next","prev","i","len","list","queue","steiner","push","getLeftmost","sort","compareX","eliminateHole","eliminateHoles","Math","max","earcutLinked","start","end","clockwise","last","signedArea","insertNode","equals","removeNode","filterPoints","again","p","area","ear","pass","z","zOrder","prevZ","nextZ","q","e","tail","numMerges","pSize","qSize","inSize","sortLinked","indexCurve","stop","isEarHashed","isEar","cureLocalIntersections","splitEarcut","a","b","c","ax","bx","cx","ay","by","cy","x0","y0","x1","y1","pointInTriangle","minZ","maxZ","n","intersects","locallyInside","isValidDiagonal","splitPolygon","hole","bridge","m","hx","hy","qx","Infinity","tan","mx","my","tanMin","abs","sectorContainsSector","findHoleBridge","bridgeReverse","leftmost","px","py","intersectsPolygon","inside","middleInside","r","p1","p2","q1","q2","o1","sign","o2","o3","o4","onSegment","min","num","a2","Node","b2","an","bp","this","sum","j","module","exports","deviation","polygonArea","trianglesArea","flatten","result","vertices","holes","dimensions","holeIndex","d","GetIntrinsic","require","callBind","$indexOf","name","allowMissing","intrinsic","t","h","o","s","l","log","f","exp","u","sqrt","floor","_maxEntries","_minEntries","ceil","clear","indexOf","children","leaf","height","pop","prototype","all","_all","search","toBBox","collides","load","insert","_build","slice","_splitRoot","_insert","remove","splice","_condense","compareMinX","compareMinY","toJSON","fromJSON","apply","pow","_chooseSubtree","_split","_adjustParentBBoxes","_chooseSplitAxis","_chooseSplitIndex","v","M","_allDistMargin","array","Array","map","NaN","compare","ascending","arrays","merged","Adder","reset","constructor","add","temp","valueOf","adder","bv","av","lambda00","phi00","lambda0","cosPhi0","sinPhi0","areaRingSum","areaSum","areaStream","point","noop","lineStart","lineEnd","polygonStart","areaRingStart","areaRingEnd","polygonEnd","areaRing","tau","sphere","areaPointFirst","areaPoint","lambda","phi","radians","cos","quarterPi","sin","dLambda","sdLambda","adLambda","cosPhi","sinPhi","k","atan2","spherical","cartesian","asin","cartesianCross","cartesianNormalizeInPlace","W0","X0","Y0","Z0","z0","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroidPointCartesian","centroidLinePointFirst","centroidLinePoint","w","centroidRingPointFirst","centroidRingPoint","cz","clip","stream","clean","phi0","sign0","lambda1","phi1","sign1","pi","delta","epsilon","halfPi","cosPhi1","sinLambda0Lambda1","atan","clipAntimeridianIntersect","from","to","direction","line","lines","rejoin","concat","shift","Intersection","points","other","entry","segments","compareIntersection","startInside","interpolate","subject","forEach","segment","p0","pointEqual","link","current","isSubject","coordinates","object","type","lengthSum","lengthStream","lengthPointFirst","lengthLineEnd","lengthPoint","cosDelta","PI","degrees","acos","x00","y00","lengthRing","circle","radius","polygon","normal","angle","winding","ring","point0","sinPhi1","point1","absDelta","antimeridian","arc","intersection","phiArc","azimuthalRaw","scale","azimuthalInvert","sc","cc","azimuthalEqualAreaRaw","cxcy","invert","azimuthalEquidistantRaw","equirectangularRaw","gnomonicRaw","mercatorRaw","naturalEarth1Raw","phi2","phi4","orthographicRaw","stereographicRaw","transverseMercatorRaw","rotationIdentity","streamGeometry","geometry","streamGeometryType","hasOwnProperty","streamObjectType","Feature","FeatureCollection","features","Sphere","Point","MultiPoint","LineString","streamLine","MultiLineString","Polygon","streamPolygon","MultiPolygon","GeometryCollection","geometries","closed","coordinate","transformer","methods","TransformStream","key","RedBlackTree","_","RedBlackNode","node","U","C","L","R","P","N","RedBlackRotateLeft","tree","parent","RedBlackRotateRight","RedBlackFirst","after","grandpa","uncle","sibling","red","left","right","createEdge","v0","v1","edge","index","edges","setEdgeEnd","cells","halfedges","createBorderEdge","vertex","clipEdge","t0","t1","dx","dy","connectEdge","fm","fb","lx","ly","rx","ry","fx","fy","cellHalfedgeAngle","cell","site","va","vb","cellHalfedgeStart","cellHalfedgeEnd","firstCircle","circlePool","Circle","attachCircle","lArc","rArc","lSite","cSite","rSite","epsilon2","ha","hc","before","circles","detachCircle","beachPool","Beach","createBeach","beach","detachBeach","beaches","removeBeach","previous","disappearing","unshift","iArc","nArcs","addBeach","dxl","dxr","directrix","leftBreakPoint","rightBreakPoint","createCell","newArc","hb","rfocx","rfocy","pby2","lfocx","lfocy","plby2","hl","aby2","lexicographic","Diagram","sites","extent","sortCellHalfedges","clipEdges","iCell","iHalfedge","nHalfedges","startX","startY","endX","endY","nCells","cover","d2","dc","v00","v01","v11","v10","clipCells","polygons","s0","e1","s1","links","filter","source","target","find","i0","that","i1","_found","vx","vy","v2","DBSCAN","dataset","minPts","distanceFunction","distance","_euclideanDistance","clusters","noise","_visited","_assigned","_datasetLength","_init","run","pointId","neighbors","_regionQuery","clusterId","_addToCluster","_expandCluster","Error","pointId2","neighbors2","_mergeArrays","id","KMEANS","assignments","centroids","init","randomCentroid","change","assign","centroidId","mean","maxDim","count","getClusters","centroid","maxId","round","random","closestCentroid","argmin","set","Number","MAX_VALUE","arg","diff","PriorityQueue","OPTICS","_reachability","_processed","_coreDistance","_orderedList","priorityQueue","undefined","_distanceToCore","_updateQueue","getReachabilityPlot","reachabilityPlot","self","dist","newReachableDistance","queueElements","getElements","coreDistCand","elements","priorities","sorting","_queue","_priorities","_sorting","ele","priority","indexToInsert","priority2","_insertAt","func","getElementPriority","getPriorities","getElementsWithPriorities","toStr","Object","toString","call","TypeError","bound","args","arguments","boundLength","boundArgs","Function","join","Empty","Symbol","getOwnPropertySymbols","iterator","obj","sym","symObj","keys","getOwnPropertyNames","syms","propertyIsEnumerable","getOwnPropertyDescriptor","descriptor","value","enumerable","hasSymbols","toStringTag","numberIsNaN","implementation","is","getPolyfill","define","polyfill","keysShim","has","isArgs","isEnumerable","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","ctor","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","window","isObject","isFunction","isArguments","isString","theKeys","skipProto","String","skipConstructor","equalsConstructorPrototypeIfNotBuggy","str","callee","vs","xi","yi","xj","yj","quickselect","arr","quickselectStep","defaultCompare","sd","swap","tmp","factory","functionsHaveConfigurableNames","$Object","$TypeError","hasIndices","global","ignoreCase","multiline","dotAll","unicode","unicodeSets","sticky","defineProperty","supportsDescriptors","$gOPD","flags","RegExp","get","calls","gOPD","TypeErr","getProto","getPrototypeOf","regex","proto","configurable","Float64Array","orient2d","A","F","O","g","B","D","E","G","H","I","J","K","Q","orient2dfast","eudist","mandist","Distance","kmrand","ks","multi","kmpp","dists","lk","dsum","prs","_dist","_i","_i2","pr","cs","_i3","rnd","idx","ClusterInit","val","initial","maxit","old","idxs","conv","it","vlen","_idxs","_idx","_j","_j2","vsum","vect","_j3","ksj","sumj","oldj","cj","_h","_h2","_j4","_j5","buffer","ArrayBuffer","Uint32Array","Spline","options","duration","sharpness","centers","controls","stepLength","delay","dz","steps","cacheSteps","mindist","laststep","pos","step","vector","speed","time","t2","c1","c2","t3","bezier","EdgeRing","envelope","some","isValid","isHole","_this","hiIndex","reduce","high","iPrev","iNext","disc","orientationIndex","toMultiPoint","multiPoint","toPolygon","getEnvelope","findEdgeRingContaining","testEdgeRing","shellList","minEnvelope","minShell","testEnvelope","shell","tryEnvelope","envelopeIsEqual","envelopeContains","testEdgeRingCoordinates","testPoint","_loop_1","pt","coordinatesEqual","testEdgeRingCoordinates_1","booleanPointInPolygon","buildId","innerEdges","outerEdges","outerEdgesSorted","removeInnerEdge","removeOuterEdge","addOuterEdge","sortOuterEdges","aNode","bNode","det","getOuterEdges","getOuterEdge","addInnerEdge","Edge","label","symetric","getSymetric","deleteEdge","isEqual","toLineString","lineString","compareTo","Graph","nodes","fromGeoJson","geoJson","validateGeoJson","graph","flattenEach","feature","featureOf","coordReduce","cur","getNode","addEdge","symetricEdge","deleteDangles","_removeIfDangle","outerNodes","deleteCutEdges","_computeNextCWEdges","_findLabeledEdgeRings","removeEdge","_computeNextCCWEdges","firstOutDE","prevInDE","de","outDE","inDE","edgeRingStarts","getEdgeRings","_findIntersectionNodes","edgeRingList","_findEdgeRing","startEdge","intersectionNodes","degree","edgeRing","dx1","dy1","dx2","dy2","env1","env2","envX1","envY1","envX2","envY2","env","every","coord1","coord2"],"sourceRoot":""}