Created
May 1, 2019 19:14
-
-
Save Jerdak/f4f591132f75acdf234bb247eb9a109e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"source": [ | |
"import os\n", | |
"import sys\n", | |
"print(sys.version)" | |
], | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"3.5.2 (default, Nov 12 2018, 13:43:14) \n", | |
"[GCC 5.4.0 20160609]\n" | |
] | |
} | |
], | |
"execution_count": 8, | |
"metadata": { | |
"collapsed": false, | |
"outputHidden": false, | |
"inputHidden": false | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"import plotly\n", | |
"import plotly.graph_objs as go\n", | |
"\n", | |
"from plotly.offline import plot, iplot\n", | |
"\n", | |
"plotly.offline.init_notebook_mode()\n", | |
"iplot([go.Scatter(x=[1, 2, 3], y=[3, 1, 6])])" | |
], | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/vnd.plotly.v1+html": [ | |
"<script type='text/javascript'>if(!window.Plotly){define('plotly', function(require, exports, module) {/**\n", | |
"* plotly.js v1.31.2\n", | |
"* Copyright 2012-2017, Plotly, Inc.\n", | |
"* All rights reserved.\n", | |
"* Licensed under the MIT license\n", | |
"*/\n", | |
"!function(t){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{var e;e=\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l=\"function\"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error(\"Cannot find module '\"+o+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}var c=r[o]={exports:{}};e[o][0].call(c.exports,function(t){var r=e[o][1][t];return i(r||t)},c,c.exports,t,e,r,n)}return r[o].exports}for(var a=\"function\"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){\"use strict\";var n=t(\"../src/lib\"),i={\"X,X div\":\"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;\",\"X input,X button\":\"font-family:'Open Sans', verdana, arial, sans-serif;\",\"X input:focus,X button:focus\":\"outline:none;\",\"X a\":\"text-decoration:none;\",\"X a:hover\":\"text-decoration:none;\",\"X .crisp\":\"shape-rendering:crispEdges;\",\"X .user-select-none\":\"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\"X svg\":\"overflow:hidden;\",\"X svg a\":\"fill:#447adb;\",\"X svg a:hover\":\"fill:#3c6dc5;\",\"X .main-svg\":\"position:absolute;top:0;left:0;pointer-events:none;\",\"X .main-svg .draglayer\":\"pointer-events:all;\",\"X .cursor-default\":\"cursor:default;\",\"X .cursor-pointer\":\"cursor:pointer;\",\"X .cursor-crosshair\":\"cursor:crosshair;\",\"X .cursor-move\":\"cursor:move;\",\"X .cursor-col-resize\":\"cursor:col-resize;\",\"X .cursor-row-resize\":\"cursor:row-resize;\",\"X .cursor-ns-resize\":\"cursor:ns-resize;\",\"X .cursor-ew-resize\":\"cursor:ew-resize;\",\"X .cursor-sw-resize\":\"cursor:sw-resize;\",\"X .cursor-s-resize\":\"cursor:s-resize;\",\"X .cursor-se-resize\":\"cursor:se-resize;\",\"X .cursor-w-resize\":\"cursor:w-resize;\",\"X .cursor-e-resize\":\"cursor:e-resize;\",\"X .cursor-nw-resize\":\"cursor:nw-resize;\",\"X .cursor-n-resize\":\"cursor:n-resize;\",\"X .cursor-ne-resize\":\"cursor:ne-resize;\",\"X .modebar\":\"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);\",\"X .modebar--hover\":\"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;\",\"X:hover .modebar--hover\":\"opacity:1;\",\"X .modebar-group\":\"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;\",\"X .modebar-group:first-child\":\"margin-left:0px;\",\"X .modebar-btn\":\"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;\",\"X .modebar-btn svg\":\"position:relative;top:2px;\",\"X .modebar-btn path\":\"fill:rgba(0,31,95,0.3);\",\"X .modebar-btn.active path,X .modebar-btn:hover path\":\"fill:rgba(0,22,72,0.5);\",\"X .modebar-btn.modebar-btn--logo\":\"padding:3px 1px;\",\"X .modebar-btn.modebar-btn--logo path\":\"fill:#447adb !important;\",\"X [data-title]:before,X [data-title]:after\":\"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;\",\"X [data-title]:hover:before,X [data-title]:hover:after\":\"display:block;opacity:1;\",\"X [data-title]:before\":\"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;\",\"X [data-title]:after\":\"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;\",\"X .select-outline\":\"fill:none;stroke-width:1;shape-rendering:crispEdges;\",\"X .select-outline-1\":\"stroke:white;\",\"X .select-outline-2\":\"stroke:black;stroke-dasharray:2px 2px;\",Y:\"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;\",\"Y p\":\"margin:0;\",\"Y .notifier-note\":\"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;\",\"Y .notifier-close\":\"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;\",\"Y .notifier-close:hover\":\"color:#444;text-decoration:none;cursor:pointer;\"};for(var a in i){var o=a.replace(/^,/,\" ,\").replace(/X/g,\".js-plotly-plot .plotly\").replace(/Y/g,\".plotly-notifier\");n.addStyleRule(o,i[a])}},{\"../src/lib\":728}],2:[function(t,e,r){\"use strict\";e.exports={undo:{width:857.1,path:\"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z\",ascent:850,descent:-150},home:{width:928.6,path:\"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z\",ascent:850,descent:-150},\"camera-retro\":{width:1e3,path:\"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z\",ascent:850,descent:-150},zoombox:{width:1e3,path:\"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z\",ascent:850,descent:-150},pan:{width:1e3,path:\"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z\",ascent:850,descent:-150},zoom_plus:{width:1e3,path:\"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z\",ascent:850,descent:-150},zoom_minus:{width:1e3,path:\"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z\",ascent:850,descent:-150},autoscale:{width:1e3,path:\"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z\",ascent:850,descent:-150},tooltip_basic:{width:1500,path:\"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z\",ascent:850,descent:-150},tooltip_compare:{width:1125,path:\"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z\",ascent:850,descent:-150},plotlylogo:{width:1542,path:\"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z\",ascent:850,descent:-150},\"z-axis\":{width:1e3,path:\"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z\",ascent:850,descent:-150},\"3d_rotate\":{width:1e3,path:\"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z\",ascent:850,descent:-150},camera:{width:1e3,path:\"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z\",ascent:850,descent:-150},movie:{width:1e3,path:\"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z\",ascent:850,descent:-150},question:{width:857.1,path:\"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z\",ascent:850,descent:-150},disk:{width:857.1,path:\"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z\",ascent:850,descent:-150},lasso:{width:1031,path:\"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z\",ascent:850,descent:-150},selectbox:{width:1e3,path:\"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z\",ascent:850,descent:-150},spikeline:{width:1e3,path:\"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z\",ascent:850,descent:-150}}},{}],3:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/aggregate\")},{\"../src/transforms/aggregate\":1114}],4:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/bar\")},{\"../src/traces/bar\":860}],5:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/box\")},{\"../src/traces/box\":873}],6:[function(t,e,r){\"use strict\";e.exports=t(\"../src/components/calendars\")},{\"../src/components/calendars\":602}],7:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/candlestick\")},{\"../src/traces/candlestick\":881}],8:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/carpet\")},{\"../src/traces/carpet\":902}],9:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/choropleth\")},{\"../src/traces/choropleth\":917}],10:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/contour\")},{\"../src/traces/contour\":929}],11:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/contourcarpet\")},{\"../src/traces/contourcarpet\":944}],12:[function(t,e,r){\"use strict\";e.exports=t(\"../src/core\")},{\"../src/core\":710}],13:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/filter\")},{\"../src/transforms/filter\":1115}],14:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/groupby\")},{\"../src/transforms/groupby\":1116}],15:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/heatmap\")},{\"../src/traces/heatmap\":957}],16:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/heatmapgl\")},{\"../src/traces/heatmapgl\":966}],17:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram\")},{\"../src/traces/histogram\":974}],18:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram2d\")},{\"../src/traces/histogram2d\":979}],19:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/histogram2dcontour\")},{\"../src/traces/histogram2dcontour\":983}],20:[function(t,e,r){\"use strict\";var n=t(\"./core\");n.register([t(\"./bar\"),t(\"./box\"),t(\"./heatmap\"),t(\"./histogram\"),t(\"./histogram2d\"),t(\"./histogram2dcontour\"),t(\"./pie\"),t(\"./contour\"),t(\"./scatterternary\"),t(\"./sankey\"),t(\"./scatter3d\"),t(\"./surface\"),t(\"./mesh3d\"),t(\"./scattergeo\"),t(\"./choropleth\"),t(\"./scattergl\"),t(\"./pointcloud\"),t(\"./heatmapgl\"),t(\"./parcoords\"),t(\"./table\"),t(\"./scattermapbox\"),t(\"./carpet\"),t(\"./scattercarpet\"),t(\"./contourcarpet\"),t(\"./ohlc\"),t(\"./candlestick\")]),n.register([t(\"./aggregate\"),t(\"./filter\"),t(\"./groupby\"),t(\"./sort\")]),n.register([t(\"./calendars\")]),e.exports=n},{\"./aggregate\":3,\"./bar\":4,\"./box\":5,\"./calendars\":6,\"./candlestick\":7,\"./carpet\":8,\"./choropleth\":9,\"./contour\":10,\"./contourcarpet\":11,\"./core\":12,\"./filter\":13,\"./groupby\":14,\"./heatmap\":15,\"./heatmapgl\":16,\"./histogram\":17,\"./histogram2d\":18,\"./histogram2dcontour\":19,\"./mesh3d\":21,\"./ohlc\":22,\"./parcoords\":23,\"./pie\":24,\"./pointcloud\":25,\"./sankey\":26,\"./scatter3d\":27,\"./scattercarpet\":28,\"./scattergeo\":29,\"./scattergl\":30,\"./scattermapbox\":31,\"./scatterternary\":32,\"./sort\":33,\"./surface\":34,\"./table\":35}],21:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/mesh3d\")},{\"../src/traces/mesh3d\":989}],22:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/ohlc\")},{\"../src/traces/ohlc\":994}],23:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/parcoords\")},{\"../src/traces/parcoords\":1003}],24:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/pie\")},{\"../src/traces/pie\":1012}],25:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/pointcloud\")},{\"../src/traces/pointcloud\":1021}],26:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/sankey\")},{\"../src/traces/sankey\":1027}],27:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatter3d\")},{\"../src/traces/scatter3d\":1060}],28:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattercarpet\")},{\"../src/traces/scattercarpet\":1065}],29:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattergeo\")},{\"../src/traces/scattergeo\":1074}],30:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattergl\")},{\"../src/traces/scattergl\":1081}],31:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scattermapbox\")},{\"../src/traces/scattermapbox\":1088}],32:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/scatterternary\")},{\"../src/traces/scatterternary\":1095}],33:[function(t,e,r){\"use strict\";e.exports=t(\"../src/transforms/sort\")},{\"../src/transforms/sort\":1117}],34:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/surface\")},{\"../src/traces/surface\":1104}],35:[function(t,e,r){\"use strict\";e.exports=t(\"../src/traces/table\")},{\"../src/traces/table\":1112}],36:[function(t,e,r){\"use strict\";function n(t,e){function r(e,r,n,a){var o=1/t.clientHeight,s=o*(r-m),l=o*(n-g),c=p.flipX?1:-1,f=p.flipY?1:-1,d=Math.PI*p.rotateSpeed,y=i();if(1&e)a.shift?u.rotate(y,0,0,-s*d):u.rotate(y,c*d*s,-f*d*l,0);else if(2&e)u.pan(y,-p.translateSpeed*s*h,p.translateSpeed*l*h,0);else if(4&e){var b=p.zoomSpeed*l/window.innerHeight*(y-u.lastT())*50;u.pan(y,0,0,h*(Math.exp(b)-1))}m=r,g=n,v=a}t=t||document.body,e=e||{};var n=[.01,1/0];\"distanceLimits\"in e&&(n[0]=e.distanceLimits[0],n[1]=e.distanceLimits[1]),\"zoomMin\"in e&&(n[0]=e.zoomMin),\"zoomMax\"in e&&(n[1]=e.zoomMax);var u=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||\"orbit\",distanceLimits:n}),c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,f=t.clientWidth,d=t.clientHeight,p={view:u,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:u.modes,tick:function(){var e=i(),r=this.delay;u.idle(e-r),u.flush(e-(100+2*r));var n=e-2*r;u.recalcMatrix(n);for(var a=!0,o=u.computedMatrix,s=0;s<16;++s)a=a&&c[s]===o[s],c[s]=o[s];var l=t.clientWidth===f&&t.clientHeight===d;return f=t.clientWidth,d=t.clientHeight,a?!l:(h=Math.exp(u.computedRadius[0]),!0)},lookAt:function(t,e,r){u.lookAt(u.lastT(),t,e,r)},rotate:function(t,e,r){u.rotate(u.lastT(),t,e,r)},pan:function(t,e,r){u.pan(u.lastT(),t,e,r)},translate:function(t,e,r){u.translate(u.lastT(),t,e,r)}};Object.defineProperties(p,{matrix:{get:function(){return u.computedMatrix},set:function(t){return u.setMatrix(u.lastT(),t),u.computedMatrix},enumerable:!0},mode:{get:function(){return u.getMode()},set:function(t){return u.setMode(t),u.getMode()},enumerable:!0},center:{get:function(){return u.computedCenter},set:function(t){return u.lookAt(u.lastT(),t),u.computedCenter},enumerable:!0},eye:{get:function(){return u.computedEye},set:function(t){return u.lookAt(u.lastT(),null,t),u.computedEye},enumerable:!0},up:{get:function(){return u.computedUp},set:function(t){return u.lookAt(u.lastT(),null,null,t),u.computedUp},enumerable:!0},distance:{get:function(){return h},set:function(t){return u.setDistance(u.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return u.getDistanceLimits(n)},set:function(t){return u.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener(\"contextmenu\",function(t){return t.preventDefault(),!1});var m=0,g=0,v={shift:!1,control:!1,alt:!1,meta:!1};return o(t,r),t.addEventListener(\"touchstart\",function(e){var n=l(e.changedTouches[0],t);r(0,n[0],n[1],v),r(1,n[0],n[1],v)}),t.addEventListener(\"touchmove\",function(e){var n=l(e.changedTouches[0],t);r(1,n[0],n[1],v)}),t.addEventListener(\"touchend\",function(e){l(e.changedTouches[0],t);r(0,m,g,v)}),s(t,function(t,e,r){var n=p.flipX?1:-1,a=p.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))u.rotate(o,0,0,-t*n*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-u.lastT())/100;u.pan(o,0,0,h*(Math.exp(s)-1))}},!0),p}e.exports=n;var i=t(\"right-now\"),a=t(\"3d-view\"),o=t(\"mouse-change\"),s=t(\"mouse-wheel\"),l=t(\"mouse-event-offset\")},{\"3d-view\":37,\"mouse-change\":452,\"mouse-event-offset\":453,\"mouse-wheel\":455,\"right-now\":502}],37:[function(t,e,r){\"use strict\";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode=\"turntable\",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function i(t){t=t||{};var e=t.eye||[0,0,1],r=t.center||[0,0,0],i=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||\"turntable\",c=a(),h=o(),f=s();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,i),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,i),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,i),new n({turntable:c,orbit:h,matrix:f},u)}e.exports=i;var a=t(\"turntable-camera-controller\"),o=t(\"orbit-camera-controller\"),s=t(\"matrix-camera-controller\"),l=n.prototype;[[\"flush\",1],[\"idle\",1],[\"lookAt\",4],[\"rotate\",4],[\"pan\",4],[\"translate\",4],[\"setMatrix\",2],[\"setDistanceLimits\",2],[\"setDistance\",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n<t[1];++n)r.push(\"a\"+n);var i=\"var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i].\"+t[0]+\"(\"+r.join()+\")}\";l[e]=Function.apply(null,r.concat(i))}),l.recalcMatrix=function(t){this._active.recalcMatrix(t)},l.getDistance=function(t){return this._active.getDistance(t)},l.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},l.lastT=function(){return this._active.lastT()},l.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(e<0)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},l.getMode=function(){return this._mode}},{\"matrix-camera-controller\":450,\"orbit-camera-controller\":473,\"turntable-camera-controller\":538}],38:[function(e,r,n){!function(i,a){\"object\"==typeof n&&void 0!==r?a(n,e(\"d3-array\"),e(\"d3-collection\"),e(\"d3-interpolate\")):\"function\"==typeof t&&t.amd?t([\"exports\",\"d3-array\",\"d3-collection\",\"d3-interpolate\"],a):a(i.d3=i.d3||{},i.d3,i.d3,i.d3)}(this,function(t,e,r,n){\"use strict\";var i=function(){function t(){g.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),v.forEach(function(t,e){var r=t.source,n=t.target;\"number\"==typeof r&&(r=t.source=g[t.source]),\"number\"==typeof n&&(n=t.target=g[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)})}function i(){g.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,h),e.sum(t.targetLinks,h))})}function a(){for(var t,e=g,r=0;e.length;)t=[],e.forEach(function(e){e.x=r,e.dx=d,e.sourceLinks.forEach(function(e){t.indexOf(e.target)<0&&t.push(e.target)})}),e=t,++r;o(r),s((m[0]-d)/(r-1))}function o(t){g.forEach(function(e){e.sourceLinks.length||(e.x=t-1)})}function s(t){g.forEach(function(e){e.x*=t})}function l(t){function n(){a.forEach(function(t){var e,r,n,a=0,o=t.length;for(t.sort(i),n=0;n<o;++n)e=t[n],r=a-e.y,r>0&&(e.y+=r),a=e.y+e.dy+p;if((r=a-p-m[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)e=t[n],r=e.y+e.dy+p-a,r>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(g).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(m[1]-(t.length-1)*p)/e.sum(t,h)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),v.forEach(function(e){e.dy=e.value*t})}(),n();for(var o=1;t>0;--t)!function(t){function r(t){return c(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,h);n.y+=(i-c(n))*t}})})}(o*=.99),n(),function(t){function r(t){return c(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,h);n.y+=(i-c(n))*t}})})}(o),n()}function u(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}g.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),g.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function c(t){return t.y+t.dy/2}function h(t){return t.value}var f={},d=24,p=8,m=[1,1],g=[],v=[];return f.nodeWidth=function(t){return arguments.length?(d=+t,f):d},f.nodePadding=function(t){return arguments.length?(p=+t,f):p},f.nodes=function(t){return arguments.length?(g=t,f):g},f.links=function(t){return arguments.length?(v=t,f):v},f.size=function(t){return arguments.length?(m=t,f):m},f.layout=function(e){return t(),i(),a(),l(e),u(),f},f.relayout=function(){return u(),f},f.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,u=l+t.dy,c=t.target.y+t.ty,h=c+t.dy;return\"M\"+r+\",\"+l+\"C\"+o+\",\"+l+\" \"+s+\",\"+c+\" \"+i+\",\"+c+\"L\"+i+\",\"+h+\"C\"+s+\",\"+h+\" \"+o+\",\"+u+\" \"+r+\",\"+u+\"Z\"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},f};t.sankey=i,Object.defineProperty(t,\"__esModule\",{value:!0})})},{\"d3-array\":114,\"d3-collection\":115,\"d3-interpolate\":119}],39:[function(t,e,r){\"use strict\";function n(t){var e=s.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=a(t,new Float32Array([-1,-1,-1,4,4,-1]));e=o(t,[{buffer:n,type:t.FLOAT,size:2}]),e._triangleBuffer=n,s.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}var i=\"undefined\"==typeof WeakMap?t(\"weak-map\"):WeakMap,a=t(\"gl-buffer\"),o=t(\"gl-vao\"),s=new i;e.exports=n},{\"gl-buffer\":156,\"gl-vao\":271,\"weak-map\":559}],40:[function(t,e,r){function n(t,e,r){e=\"number\"==typeof e?e:1,r=r||\": \";var n=t.split(/\\r?\\n/),a=String(n.length+e-1).length;return n.map(function(t,n){var o=n+e,s=String(o).length;return i(o,a-s)+r+t}).join(\"\\n\")}var i=t(\"pad-left\");e.exports=n},{\"pad-left\":474}],41:[function(t,e,r){\"use strict\";function n(t,e){for(var r=new Array(e+1),n=0;n<t.length;++n)r[n]=t[n];for(var n=0;n<=t.length;++n){for(var i=t.length;i<=e;++i){for(var o=new Array(e),s=0;s<e;++s)o[s]=Math.pow(i+1-n,s);r[i]=o}if(a.apply(void 0,r))return!0}return!1}function i(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,i=[t[0]],a=[0],o=1;o<e;++o)if(i.push(t[o]),n(i,r)){if(a.push(o),a.length===r+1)return a}else i.pop();return a}e.exports=i;var a=t(\"robust-orientation\")},{\"robust-orientation\":508}],42:[function(t,e,r){\"use strict\";function n(t,e){return i(e).filter(function(r){for(var n=new Array(r.length),i=0;i<r.length;++i)n[i]=e[r[i]];return a(n)*t<1})}e.exports=n;var i=t(\"delaunay-triangulate\"),a=t(\"circumradius\")},{circumradius:87,\"delaunay-triangulate\":123}],43:[function(t,e,r){function n(t,e){return a(i(t,e))}e.exports=n;var i=t(\"alpha-complex\"),a=t(\"simplicial-complex-boundary\")},{\"alpha-complex\":42,\"simplicial-complex-boundary\":516}],44:[function(t,e,r){\"use strict\";function n(t,e){if(!t||null==t.length)throw Error(\"Argument should be an array\");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;n<e;n++){for(var i=-1/0,a=1/0,o=n,s=t.length;o<s;o+=e)t[o]>i&&(i=t[o]),t[o]<a&&(a=t[o]);r[n]=a,r[e+n]=i}return r}e.exports=n},{}],45:[function(t,e,r){\"use strict\";function n(t,e,r){if(!t||null==t.length)throw Error(\"Argument should be an array\");null==e&&(e=1),null==r&&(r=i(t,e));for(var n=0;n<e;n++){var a=r[e+n],o=r[n],s=n,l=t.length;if(a===1/0&&o===-1/0)for(s=n;s<l;s+=e)t[s]=t[s]===a?1:t[s]===o?0:.5;else if(a===1/0)for(s=n;s<l;s+=e)t[s]=t[s]===a?1:0;else if(o===-1/0)for(s=n;s<l;s+=e)t[s]=t[s]===o?0:1;else{var u=a-o;for(s=n;s<l;s+=e)t[s]=(t[s]-o)/u}}return t}var i=t(\"array-bounds\");e.exports=n},{\"array-bounds\":44}],46:[function(t,e,r){\"use strict\";e.exports=function(){function t(t){return!Array.isArray(t)&&null!==t&&\"object\"==typeof t}function e(t,e,r){for(var n=(e-t)/Math.max(r-1,1),i=[],a=0;a<r;a++)i.push(t+a*n);return i}function r(){for(var t=[].slice.call(arguments),e=t.map(function(t){return t.length}),r=Math.min.apply(null,e),n=[],i=0;i<r;i++){n[i]=[];for(var a=0;a<t.length;++a)n[i][a]=t[a][i]}return n}function n(t,e,r){for(var n=Math.min.apply(null,[t.length,e.length,r.length]),i=[],a=0;a<n;a++)i.push([t[a],e[a],r[a]]);return i}function i(t){function e(t){for(var n=0;n<t.length;n++)Array.isArray(t[n])?e(t[n],r):r+=t[n]}var r=0;return e(t,r),r}function a(t){for(var e=[],r=0;r<t.length;++r){e[r]=[];for(var n=0;n<t[r].length;++n)e[r][n]=t[r][n]}return e}function o(t){for(var e=[],r=0;r<t.length;++r)e[r]=t[r];return e}function s(t,e){if(t.length!==e.length)return!1;for(var r=t.length;r--;)if(t[r]!==e[r])return!1;return!0}function l(t,e){var r,n;if(\"string\"!=typeof t)return t;if(r=[],\"#\"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3])),!e)for(var i=0;i<3;++i)r[i]=r[i]/255;return r}function u(t,e){var r,n;if(\"string\"!=typeof t)return t;if(r=[],\"#\"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3]),n[4]?r[3]=parseFloat(n[4]):r[3]=1),!e)for(var i=0;i<3;++i)r[i]=r[i]/255;return r}var c={},h=/^rgba?\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*(,.*)?\\)$/,f=/^rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,?\\s*(.*)?\\)$/;return c.isPlainObject=t,c.linspace=e,c.zip3=n,c.sum=i,c.zip=r,c.isEqual=s,c.copy2D=a,c.copy1D=o,c.str2RgbArray=l,c.str2RgbaArray=u,c}()},{}],47:[function(t,e,r){(function(r){\"use strict\";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function i(t){return r.Buffer&&\"function\"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}function a(t){return Object.prototype.toString.call(t)}function o(t){return!i(t)&&(\"function\"==typeof r.ArrayBuffer&&(\"function\"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}function s(t){if(x.isFunction(t)){if(M)return t.name;var e=t.toString(),r=e.match(A);return r&&r[1]}}function l(t,e){return\"string\"==typeof t?t.length<e?t:t.slice(0,e):t}function u(t){if(M||!x.isFunction(t))return x.inspect(t);var e=s(t);return\"[Function\"+(e?\": \"+e:\"\")+\"]\"}function c(t){return l(u(t.actual),128)+\" \"+t.operator+\" \"+l(u(t.expected),128)}function h(t,e,r,n,i){throw new k.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function f(t,e){t||h(t,!0,e,\"==\",k.ok)}function d(t,e,r,s){if(t===e)return!0;if(i(t)&&i(e))return 0===n(t,e);if(x.isDate(t)&&x.isDate(e))return t.getTime()===e.getTime();if(x.isRegExp(t)&&x.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&\"object\"==typeof t||null!==e&&\"object\"==typeof e){if(o(t)&&o(e)&&a(t)===a(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===n(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;s=s||{actual:[],expected:[]};var l=s.actual.indexOf(t);return-1!==l&&l===s.expected.indexOf(e)||(s.actual.push(t),s.expected.push(e),m(t,e,r,s))}return r?t===e:t==e}function p(t){return\"[object Arguments]\"==Object.prototype.toString.call(t)}function m(t,e,r,n){if(null===t||void 0===t||null===e||void 0===e)return!1;if(x.isPrimitive(t)||x.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=p(t),a=p(e);if(i&&!a||!i&&a)return!1;if(i)return t=w.call(t),e=w.call(e),d(t,e,r);var o,s,l=T(t),u=T(e);if(l.length!==u.length)return!1;for(l.sort(),u.sort(),s=l.length-1;s>=0;s--)if(l[s]!==u[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!d(t[o],e[o],r,n))return!1\n", | |
";return!0}function g(t,e,r){d(t,e,!0)&&h(t,e,r,\"notDeepStrictEqual\",g)}function v(t,e){if(!t||!e)return!1;if(\"[object RegExp]\"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function y(t){var e;try{t()}catch(t){e=t}return e}function b(t,e,r,n){var i;if(\"function\"!=typeof e)throw new TypeError('\"block\" argument must be a function');\"string\"==typeof r&&(n=r,r=null),i=y(e),n=(r&&r.name?\" (\"+r.name+\").\":\".\")+(n?\" \"+n:\".\"),t&&!i&&h(i,r,\"Missing expected exception\"+n);var a=\"string\"==typeof n,o=!t&&x.isError(i),s=!t&&i&&!r;if((o&&a&&v(i,r)||s)&&h(i,r,\"Got unwanted exception\"+n),t&&i&&r&&!v(i,r)||!t&&i)throw i}var x=t(\"util/\"),_=Object.prototype.hasOwnProperty,w=Array.prototype.slice,M=function(){return\"foo\"===function(){}.name}(),k=e.exports=f,A=/\\s*function\\s+([^\\(\\s]*)\\s*/;k.AssertionError=function(t){this.name=\"AssertionError\",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=c(this),this.generatedMessage=!0);var e=t.stackStartFunction||h;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf(\"\\n\"+i);if(a>=0){var o=n.indexOf(\"\\n\",a+1);n=n.substring(o+1)}this.stack=n}}},x.inherits(k.AssertionError,Error),k.fail=h,k.ok=f,k.equal=function(t,e,r){t!=e&&h(t,e,r,\"==\",k.equal)},k.notEqual=function(t,e,r){t==e&&h(t,e,r,\"!=\",k.notEqual)},k.deepEqual=function(t,e,r){d(t,e,!1)||h(t,e,r,\"deepEqual\",k.deepEqual)},k.deepStrictEqual=function(t,e,r){d(t,e,!0)||h(t,e,r,\"deepStrictEqual\",k.deepStrictEqual)},k.notDeepEqual=function(t,e,r){d(t,e,!1)&&h(t,e,r,\"notDeepEqual\",k.notDeepEqual)},k.notDeepStrictEqual=g,k.strictEqual=function(t,e,r){t!==e&&h(t,e,r,\"===\",k.strictEqual)},k.notStrictEqual=function(t,e,r){t===e&&h(t,e,r,\"!==\",k.notStrictEqual)},k.throws=function(t,e,r){b(!0,t,e,r)},k.doesNotThrow=function(t,e,r){b(!1,t,e,r)},k.ifError=function(t){if(t)throw t};var T=Object.keys||function(t){var e=[];for(var r in t)_.call(t,r)&&e.push(r);return e}}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"util/\":549}],48:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],49:[function(t,e,r){\"use strict\";function n(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}function i(t,e){for(var r=e.length,i=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=t[l][o];i[o]=s}i[r]=new Array(r+1);for(var o=0;o<=r;++o)i[r][o]=1;for(var u=new Array(r+1),o=0;o<r;++o)u[o]=e[o];u[r]=1;var c=a(i,u),h=n(c[r+1]);0===h&&(h=1);for(var f=new Array(r+1),o=0;o<=r;++o)f[o]=n(c[o])/h;return f}e.exports=i;var a=t(\"robust-linear-solve\")},{\"robust-linear-solve\":507}],50:[function(t,e,r){\"use strict\";function n(t,e){return i(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}var i=t(\"./lib/rationalize\");e.exports=n},{\"./lib/rationalize\":60}],51:[function(t,e,r){\"use strict\";function n(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}e.exports=n},{}],52:[function(t,e,r){\"use strict\";function n(t,e){return i(t[0].mul(e[1]),t[1].mul(e[0]))}var i=t(\"./lib/rationalize\");e.exports=n},{\"./lib/rationalize\":60}],53:[function(t,e,r){\"use strict\";function n(t,e){if(i(t))return e?u(t,n(e)):[t[0].clone(),t[1].clone()];var r,c,h=0;if(a(t))r=t.clone();else if(\"string\"==typeof t)r=s(t);else{if(0===t)return[o(0),o(1)];if(t===Math.floor(t))r=o(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),h-=256;r=o(t)}}if(i(e))r.mul(e[1]),c=e[0].clone();else if(a(e))c=e.clone();else if(\"string\"==typeof e)c=s(e);else if(e)if(e===Math.floor(e))c=o(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h+=256;c=o(e)}else c=o(1);return h>0?r=r.ushln(h):h<0&&(c=c.ushln(-h)),l(r,c)}var i=t(\"./is-rat\"),a=t(\"./lib/is-bn\"),o=t(\"./lib/num-to-bn\"),s=t(\"./lib/str-to-bn\"),l=t(\"./lib/rationalize\"),u=t(\"./div\");e.exports=n},{\"./div\":52,\"./is-rat\":54,\"./lib/is-bn\":58,\"./lib/num-to-bn\":59,\"./lib/rationalize\":60,\"./lib/str-to-bn\":61}],54:[function(t,e,r){\"use strict\";function n(t){return Array.isArray(t)&&2===t.length&&i(t[0])&&i(t[1])}var i=t(\"./lib/is-bn\");e.exports=n},{\"./lib/is-bn\":58}],55:[function(t,e,r){\"use strict\";function n(t){return t.cmp(new i(0))}var i=t(\"bn.js\");e.exports=n},{\"bn.js\":68}],56:[function(t,e,r){\"use strict\";function n(t){var e=t.length,r=t.words,n=0;if(1===e)n=r[0];else if(2===e)n=r[0]+67108864*r[1];else for(var a=0;a<e;a++){var o=r[a];n+=o*Math.pow(67108864,a)}return i(t)*n}var i=t(\"./bn-sign\");e.exports=n},{\"./bn-sign\":55}],57:[function(t,e,r){\"use strict\";function n(t){var e=a(i.lo(t));if(e<32)return e;var r=a(i.hi(t));return r>20?52:r+32}var i=t(\"double-bits\"),a=t(\"bit-twiddle\").countTrailingZeros;e.exports=n},{\"bit-twiddle\":67,\"double-bits\":124}],58:[function(t,e,r){\"use strict\";function n(t){return t&&\"object\"==typeof t&&Boolean(t.words)}t(\"bn.js\");e.exports=n},{\"bn.js\":68}],59:[function(t,e,r){\"use strict\";function n(t){var e=a.exponent(t);return e<52?new i(t):new i(t*Math.pow(2,52-e)).ushln(e-52)}var i=t(\"bn.js\"),a=t(\"double-bits\");e.exports=n},{\"bn.js\":68,\"double-bits\":124}],60:[function(t,e,r){\"use strict\";function n(t,e){var r=a(t),n=a(e);if(0===r)return[i(0),i(1)];if(0===n)return[i(0),i(0)];n<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}var i=t(\"./num-to-bn\"),a=t(\"./bn-sign\");e.exports=n},{\"./bn-sign\":55,\"./num-to-bn\":59}],61:[function(t,e,r){\"use strict\";function n(t){return new i(t)}var i=t(\"bn.js\");e.exports=n},{\"bn.js\":68}],62:[function(t,e,r){\"use strict\";function n(t,e){return i(t[0].mul(e[0]),t[1].mul(e[1]))}var i=t(\"./lib/rationalize\");e.exports=n},{\"./lib/rationalize\":60}],63:[function(t,e,r){\"use strict\";function n(t){return i(t[0])*i(t[1])}var i=t(\"./lib/bn-sign\");e.exports=n},{\"./lib/bn-sign\":55}],64:[function(t,e,r){\"use strict\";function n(t,e){return i(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}var i=t(\"./lib/rationalize\");e.exports=n},{\"./lib/rationalize\":60}],65:[function(t,e,r){\"use strict\";function n(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var n=e.abs().divmod(r.abs()),o=n.div,s=i(o),l=n.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4,h=i(l.ushln(c).divRound(r));return u*(s+h*Math.pow(2,-c))}var f=r.bitLength()-l.bitLength()+53,h=i(l.ushln(f).divRound(r));return f<1023?u*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),u*h*Math.pow(2,1023-f))}var i=t(\"./lib/bn-to-num\"),a=t(\"./lib/ctz\");e.exports=n},{\"./lib/bn-to-num\":56,\"./lib/ctz\":57}],66:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){var o=[\"function \",t,\"(a,l,h,\",n.join(\",\"),\"){\",a?\"\":\"var i=\",r?\"l-1\":\"h+1\",\";while(l<=h){var m=(l+h)>>>1,x=a\",i?\".get(m)\":\"[m]\"];return a?e.indexOf(\"c\")<0?o.push(\";if(x===y){return m}else if(x<=y){\"):o.push(\";var p=c(x,y);if(p===0){return m}else if(p<=0){\"):o.push(\";if(\",e,\"){i=m;\"),r?o.push(\"l=m+1}else{h=m-1}\"):o.push(\"h=m-1}else{l=m+1}\"),o.push(\"}\"),a?o.push(\"return -1};\"):o.push(\"return i};\"),o.join(\"\")}function i(t,e,r,i){return new Function([n(\"A\",\"x\"+t+\"y\",e,[\"y\"],!1,i),n(\"B\",\"x\"+t+\"y\",e,[\"y\"],!0,i),n(\"P\",\"c(x,y)\"+t+\"0\",e,[\"y\",\"c\"],!1,i),n(\"Q\",\"c(x,y)\"+t+\"0\",e,[\"y\",\"c\"],!0,i),\"function dispatchBsearch\",r,\"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch\",r].join(\"\"))()}e.exports={ge:i(\">=\",!1,\"GE\"),gt:i(\">\",!1,\"GT\"),lt:i(\"<\",!0,\"LT\"),le:i(\"<=\",!0,\"LE\"),eq:i(\"-\",!0,\"EQ\",!0)}},{}],67:[function(t,e,r){\"use strict\";\"use restrict\";function n(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t<e)},r.max=function(t,e){return t^(t^e)&-(t<e)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(i),r.reverse=function(t){return i[255&t]<<24|i[t>>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],68:[function(t,e,r){!function(e,r){\"use strict\";function n(t,e){if(!t)throw new Error(e||\"Assertion failed\")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(\"le\"!==e&&\"be\"!==e||(r=e,e=10),this._init(t||0,e||10,r||\"be\"))}function o(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a<i;a++){var o=t.charCodeAt(a)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o<a;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function l(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}function u(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u<n;u++){for(var c=l>>>26,h=67108863&l,f=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=f;d++){var p=u-d|0;i=0|t.words[p],a=0|e.words[d],o=i*a+h,c+=o/67108864|0,h=67108863&o}r.words[u]=0|h,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}function c(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,l=Math.min(a,e.length-1),u=Math.max(0,a-t.length+1);u<=l;u++){var c=a-u,h=0|t.words[c],f=0|e.words[u],d=h*f,p=67108863&d;o=o+(d/67108864|0)|0,p=p+s|0,s=67108863&p,o=o+(p>>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function h(t,e,r){return(new f).mulp(t,e,r)}function f(t,e){this.x=t,this.y=e}function d(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){d.call(this,\"k256\",\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\")}function m(){d.call(this,\"p224\",\"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\")}function g(){d.call(this,\"p192\",\"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\")}function v(){d.call(this,\"25519\",\"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\")}function y(t){if(\"string\"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),\"modulus must be greater than 1\"),this.m=t,this.prime=null}function b(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}\"object\"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var x;try{x=t(\"buffer\").Buffer}catch(t){}a.isBN=function(t){return t instanceof a||null!==t&&\"object\"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if(\"number\"==typeof t)return this._initNumber(t,e,r);if(\"object\"==typeof t)return this._initArray(t,e,r);\"hex\"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\\s+/g,\"\");var i=0;\"-\"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),\"-\"===t[0]&&(this.negative=1),this.strip(),\"le\"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),\"le\"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n(\"number\"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if(\"be\"===r)for(i=t.length-1,a=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if(\"le\"===r)for(i=0,a=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,a=0;for(r=t.length-6,n=0;r>=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,l=Math.min(a,a-o)+r,u=0,c=r;c<l;c+=n)u=s(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var h=1;for(u=s(t,c,t.length,e),c=0;c<o;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},a.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?\"<BN-R: \":\"<BN: \")+this.toString(16)+\">\"};var _=[\"\",\"0\",\"00\",\"000\",\"0000\",\"00000\",\"000000\",\"0000000\",\"00000000\",\"000000000\",\"0000000000\",\"00000000000\",\"000000000000\",\"0000000000000\",\"00000000000000\",\"000000000000000\",\"0000000000000000\",\"00000000000000000\",\"000000000000000000\",\"0000000000000000000\",\"00000000000000000000\",\"000000000000000000000\",\"0000000000000000000000\",\"00000000000000000000000\",\"000000000000000000000000\",\"0000000000000000000000000\"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||\"hex\"===t){r=\"\";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-l.length]+l+r:l+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r=\"0\"+r;return 0!==this.negative&&(r=\"-\"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=w[t],c=M[t];r=\"\";var h=this.clone();for(h.negative=0;!h.isZero();){var f=h.modn(c).toString(t);h=h.idivn(c),r=h.isZero()?f+r:_[u-f.length]+f+r}for(this.isZero()&&(r=\"0\"+r);r.length%e!=0;)r=\"0\"+r;return 0!==this.negative&&(r=\"-\"+r),r}n(!1,\"Base should be between 2 and 36\")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,\"Number can only safely store up to 53 bits\"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==x),this.toArrayLike(x,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,\"byte array longer than desired length\"),n(a>0,\"Requested array length <= 0\"),this.strip();var o,s,l=\"le\"===e,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s<a;s++)u[s]=0}else{for(s=0;s<a-i;s++)u[s]=0;for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[a-s-1]=o}return u},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},a.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},a.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},a.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n(\"number\"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n(\"number\"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(t){var e;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();var r,n;this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)e=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&e,i=e>>>26;for(;0!==i&&a<r.length;a++)e=(0|r.words[a])+i,this.words[a]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o<i.length;o++)e=(0|n.words[o])-(0|i.words[o])+a,a=e>>26,this.words[o]=67108863&e;for(;0!==a&&o<n.length;o++)e=(0|n.words[o])+a,a=e>>26,this.words[o]=67108863&e;if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var k=function(t,e,r){var n,i,a,o=t.words,s=e.words,l=r.words,u=0,c=0|o[0],h=8191&c,f=c>>>13,d=0|o[1],p=8191&d,m=d>>>13,g=0|o[2],v=8191&g,y=g>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],M=8191&w,k=w>>>13,A=0|o[5],T=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,I=0|o[7],z=8191&I,D=I>>>13,P=0|o[8],O=8191&P,R=P>>>13,F=0|o[9],j=8191&F,N=F>>>13,B=0|s[0],U=8191&B,V=B>>>13,H=0|s[1],q=8191&H,G=H>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ht=8191&ct,ft=ct>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(h,U),i=Math.imul(h,V),i=i+Math.imul(f,U)|0,a=Math.imul(f,V);var gt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=Math.imul(p,V),i=i+Math.imul(m,U)|0,a=Math.imul(m,V),n=n+Math.imul(h,q)|0,i=i+Math.imul(h,G)|0,i=i+Math.imul(f,q)|0,a=a+Math.imul(f,G)|0;var vt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=Math.imul(v,V),i=i+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,q)|0,i=i+Math.imul(p,G)|0,i=i+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0,n=n+Math.imul(h,W)|0,i=i+Math.imul(h,X)|0,i=i+Math.imul(f,W)|0,a=a+Math.imul(f,X)|0;var yt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),i=Math.imul(x,V),i=i+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,q)|0,i=i+Math.imul(v,G)|0,i=i+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=i+Math.imul(p,X)|0,i=i+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0,n=n+Math.imul(h,J)|0,i=i+Math.imul(h,K)|0,i=i+Math.imul(f,J)|0,a=a+Math.imul(f,K)|0;var bt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=Math.imul(M,V),i=i+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(x,q)|0,i=i+Math.imul(x,G)|0,i=i+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=i+Math.imul(v,X)|0,i=i+Math.imul(y,W)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,K)|0,i=i+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0,n=n+Math.imul(h,$)|0,i=i+Math.imul(h,tt)|0,i=i+Math.imul(f,$)|0,a=a+Math.imul(f,tt)|0;var xt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=Math.imul(T,V),i=i+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,q)|0,i=i+Math.imul(M,G)|0,i=i+Math.imul(k,q)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(x,W)|0,i=i+Math.imul(x,X)|0,i=i+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,K)|0,i=i+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,tt)|0,i=i+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0,n=n+Math.imul(h,rt)|0,i=i+Math.imul(h,nt)|0,i=i+Math.imul(f,rt)|0,a=a+Math.imul(f,nt)|0;var _t=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=Math.imul(L,V),i=i+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(T,q)|0,i=i+Math.imul(T,G)|0,i=i+Math.imul(S,q)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(M,W)|0,i=i+Math.imul(M,X)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(x,J)|0,i=i+Math.imul(x,K)|0,i=i+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,i=i+Math.imul(v,tt)|0,i=i+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=i+Math.imul(p,nt)|0,i=i+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0,n=n+Math.imul(h,at)|0,i=i+Math.imul(h,ot)|0,i=i+Math.imul(f,at)|0,a=a+Math.imul(f,ot)|0;var wt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(z,U),i=Math.imul(z,V),i=i+Math.imul(D,U)|0,a=Math.imul(D,V),n=n+Math.imul(L,q)|0,i=i+Math.imul(L,G)|0,i=i+Math.imul(C,q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,W)|0,i=i+Math.imul(T,X)|0,i=i+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(M,J)|0,i=i+Math.imul(M,K)|0,i=i+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(x,$)|0,i=i+Math.imul(x,tt)|0,i=i+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=i+Math.imul(v,nt)|0,i=i+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(p,at)|0,i=i+Math.imul(p,ot)|0,i=i+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0,n=n+Math.imul(h,lt)|0,i=i+Math.imul(h,ut)|0,i=i+Math.imul(f,lt)|0,a=a+Math.imul(f,ut)|0;var Mt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=Math.imul(O,V),i=i+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(z,q)|0,i=i+Math.imul(z,G)|0,i=i+Math.imul(D,q)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(L,W)|0,i=i+Math.imul(L,X)|0,i=i+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,J)|0,i=i+Math.imul(T,K)|0,i=i+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(M,$)|0,i=i+Math.imul(M,tt)|0,i=i+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(x,rt)|0,i=i+Math.imul(x,nt)|0,i=i+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=i+Math.imul(v,ot)|0,i=i+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=i+Math.imul(p,ut)|0,i=i+Math.imul(m,lt)|0,a=a+Math.imul(m,ut)|0,n=n+Math.imul(h,ht)|0,i=i+Math.imul(h,ft)|0,i=i+Math.imul(f,ht)|0,a=a+Math.imul(f,ft)|0;var kt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(j,U),i=Math.imul(j,V),i=i+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(O,q)|0,i=i+Math.imul(O,G)|0,i=i+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(z,W)|0,i=i+Math.imul(z,X)|0,i=i+Math.imul(D,W)|0,a=a+Math.imul(D,X)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,i=i+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,$)|0,i=i+Math.imul(T,tt)|0,i=i+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(M,rt)|0,i=i+Math.imul(M,nt)|0,i=i+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(x,at)|0,i=i+Math.imul(x,ot)|0,i=i+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=i+Math.imul(v,ut)|0,i=i+Math.imul(y,lt)|0,a=a+Math.imul(y,ut)|0,n=n+Math.imul(p,ht)|0,i=i+Math.imul(p,ft)|0,i=i+Math.imul(m,ht)|0,a=a+Math.imul(m,ft)|0,n=n+Math.imul(h,pt)|0,i=i+Math.imul(h,mt)|0,i=i+Math.imul(f,pt)|0,a=a+Math.imul(f,mt)|0;var At=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,q),i=Math.imul(j,G),i=i+Math.imul(N,q)|0,a=Math.imul(N,G),n=n+Math.imul(O,W)|0,i=i+Math.imul(O,X)|0,i=i+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(z,J)|0,i=i+Math.imul(z,K)|0,i=i+Math.imul(D,J)|0,a=a+Math.imul(D,K)|0,n=n+Math.imul(L,$)|0,i=i+Math.imul(L,tt)|0,i=i+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,i=i+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(M,at)|0,i=i+Math.imul(M,ot)|0,i=i+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(x,lt)|0,i=i+Math.imul(x,ut)|0,i=i+Math.imul(_,lt)|0,a=a+Math.imul(_,ut)|0,n=n+Math.imul(v,ht)|0,i=i+Math.imul(v,ft)|0,i=i+Math.imul(y,ht)|0,a=a+Math.imul(y,ft)|0,n=n+Math.imul(p,pt)|0,i=i+Math.imul(p,mt)|0,i=i+Math.imul(m,pt)|0,a=a+Math.imul(m,mt)|0;var Tt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(j,W),i=Math.imul(j,X),i=i+Math.imul(N,W)|0,a=Math.imul(N,X),n=n+Math.imul(O,J)|0,i=i+Math.imul(O,K)|0,i=i+Math.imul(R,J)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(z,$)|0,i=i+Math.imul(z,tt)|0,i=i+Math.imul(D,$)|0,a=a+Math.imul(D,tt)|0,n=n+Math.imul(L,rt)|0,i=i+Math.imul(L,nt)|0,i=i+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(T,at)|0,i=i+Math.imul(T,ot)|0,i=i+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=i+Math.imul(M,ut)|0,i=i+Math.imul(k,lt)|0,a=a+Math.imul(k,ut)|0,n=n+Math.imul(x,ht)|0,i=i+Math.imul(x,ft)|0,i=i+Math.imul(_,ht)|0,a=a+Math.imul(_,ft)|0,n=n+Math.imul(v,pt)|0,i=i+Math.imul(v,mt)|0,i=i+Math.imul(y,pt)|0,a=a+Math.imul(y,mt)|0;var St=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,J),i=Math.imul(j,K),i=i+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(O,$)|0,i=i+Math.imul(O,tt)|0,i=i+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(z,rt)|0,i=i+Math.imul(z,nt)|0,i=i+Math.imul(D,rt)|0,a=a+Math.imul(D,nt)|0,n=n+Math.imul(L,at)|0,i=i+Math.imul(L,ot)|0,i=i+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(T,lt)|0,i=i+Math.imul(T,ut)|0,i=i+Math.imul(S,lt)|0,a=a+Math.imul(S,ut)|0,n=n+Math.imul(M,ht)|0,i=i+Math.imul(M,ft)|0,i=i+Math.imul(k,ht)|0,a=a+Math.imul(k,ft)|0,n=n+Math.imul(x,pt)|0,i=i+Math.imul(x,mt)|0,i=i+Math.imul(_,pt)|0,a=a+Math.imul(_,mt)|0;var Et=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(j,$),i=Math.imul(j,tt),i=i+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(O,rt)|0,i=i+Math.imul(O,nt)|0,i=i+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(z,at)|0,i=i+Math.imul(z,ot)|0,i=i+Math.imul(D,at)|0,a=a+Math.imul(D,ot)|0,n=n+Math.imul(L,lt)|0,i=i+Math.imul(L,ut)|0,i=i+Math.imul(C,lt)|0,a=a+Math.imul(C,ut)|0,n=n+Math.imul(T,ht)|0,i=i+Math.imul(T,ft)|0,i=i+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0,n=n+Math.imul(M,pt)|0,i=i+Math.imul(M,mt)|0,i=i+Math.imul(k,pt)|0,a=a+Math.imul(k,mt)|0;var Lt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,rt),i=Math.imul(j,nt),i=i+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(O,at)|0,i=i+Math.imul(O,ot)|0,i=i+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(z,lt)|0,i=i+Math.imul(z,ut)|0,i=i+Math.imul(D,lt)|0,a=a+Math.imul(D,ut)|0,n=n+Math.imul(L,ht)|0,\n", | |
"i=i+Math.imul(L,ft)|0,i=i+Math.imul(C,ht)|0,a=a+Math.imul(C,ft)|0,n=n+Math.imul(T,pt)|0,i=i+Math.imul(T,mt)|0,i=i+Math.imul(S,pt)|0,a=a+Math.imul(S,mt)|0;var Ct=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(j,at),i=Math.imul(j,ot),i=i+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(O,lt)|0,i=i+Math.imul(O,ut)|0,i=i+Math.imul(R,lt)|0,a=a+Math.imul(R,ut)|0,n=n+Math.imul(z,ht)|0,i=i+Math.imul(z,ft)|0,i=i+Math.imul(D,ht)|0,a=a+Math.imul(D,ft)|0,n=n+Math.imul(L,pt)|0,i=i+Math.imul(L,mt)|0,i=i+Math.imul(C,pt)|0,a=a+Math.imul(C,mt)|0;var It=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,lt),i=Math.imul(j,ut),i=i+Math.imul(N,lt)|0,a=Math.imul(N,ut),n=n+Math.imul(O,ht)|0,i=i+Math.imul(O,ft)|0,i=i+Math.imul(R,ht)|0,a=a+Math.imul(R,ft)|0,n=n+Math.imul(z,pt)|0,i=i+Math.imul(z,mt)|0,i=i+Math.imul(D,pt)|0,a=a+Math.imul(D,mt)|0;var zt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(j,ht),i=Math.imul(j,ft),i=i+Math.imul(N,ht)|0,a=Math.imul(N,ft),n=n+Math.imul(O,pt)|0,i=i+Math.imul(O,mt)|0,i=i+Math.imul(R,pt)|0,a=a+Math.imul(R,mt)|0;var Dt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(j,pt),i=Math.imul(j,mt),i=i+Math.imul(N,pt)|0,a=Math.imul(N,mt);var Pt=(u+n|0)+((8191&i)<<13)|0;return u=(a+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=It,l[16]=zt,l[17]=Dt,l[18]=Pt,0!==u&&(l[19]=u,r.length++),r};Math.imul||(k=u),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?k(this,t,e):r<63?u(this,t,e):r<1024?c(this,t,e):h(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},f.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},f.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o<a;o++)n[o]=e[t[o]],i[o]=r[t[o]]},f.prototype.transform=function(t,e,r,n,i,a){this.permute(a,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var h=l,f=u,d=0;d<o;d++){var p=r[c+d],m=n[c+d],g=r[c+d+o],v=n[c+d+o],y=h*g-f*v;v=h*v+f*g,g=y,r[c+d]=p+g,n[c+d]=m+v,r[c+d+o]=p-g,n[c+d+o]=m-v,d!==s&&(y=l*h-u*f,f=l*f+u*h,h=y)}},f.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},f.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},f.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},f.prototype.convert13b=function(t,e,r,i){for(var a=0,o=0;o<e;o++)a+=0|t[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===a),n(0==(-8192&a))},f.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},f.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,a,s,l,n,i),this.transform(u,a,c,h,n,i);for(var d=0;d<n;d++){var p=s[d]*c[d]-l[d]*h[d];l[d]=s[d]*h[d]+l[d]*c[d],s[d]=p}return this.conjugate(s,l,n),this.transform(s,l,f,a,n,i),this.conjugate(f,a,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),h(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){n(\"number\"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=l(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(t){n(\"number\"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&a,l=(0|this.words[e])-s<<r;this.words[e]=l|o,o=s>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){n(\"number\"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<<a,l=r;if(i-=o,i=Math.max(0,i),l){for(var u=0;u<o;u++)l.words[u]=this.words[u];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n(\"number\"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},a.prototype.imaskn=function(t){n(\"number\"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,\"imaskn works only with positive numbers\"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return n(\"number\"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n(\"number\"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var i,a=t.length+r;this._expand(a);var o,s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var l=(0|t.words[i])*e;o-=67108863&l,s=(o>>26)-(l/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)o=(0|this.words[i+r])+s,s=o>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)o=-(0|this.words[i])+s,s=o>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if(\"mod\"!==e){s=new a(null),s.length=l+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),n.strip(),\"div\"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),\"mod\"!==e&&(i=s.div.neg()),\"div\"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),\"mod\"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),\"div\"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?\"div\"===e?{div:this.divn(t.words[0]),mod:null}:\"mod\"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e)},a.prototype.div=function(t){return this.divmod(t,\"div\",!1).div},a.prototype.mod=function(t){return this.divmod(t,\"mod\",!1).mod},a.prototype.umod=function(t){return this.divmod(t,\"mod\",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,u=1;0==(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var c=0,h=1;0==(r.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var f;return f=0===e.cmpn(1)?i:o,f.cmpn(0)<0&&f.iadd(t),f},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n(\"number\"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];s+=a,a=s>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,\"Number is too big\");var i=0|this.words[0];r=i===t?0:i<t?-1:1}return 0!==this.negative?0|-r:r},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new y(t)},a.prototype.toRed=function(t){return n(!this.red,\"Already a number in reduction context\"),n(0===this.negative,\"red works only with positives\"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,\"fromRed works only with numbers in reduction context\"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,\"Already a number in reduction context\"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,\"redAdd works only with red numbers\"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,\"redIAdd works only with red numbers\"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,\"redSub works only with red numbers\"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,\"redISub works only with red numbers\"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,\"redShl works only with red numbers\"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,\"redSqr works only with red numbers\"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,\"redISqr works only with red numbers\"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,\"redSqrt works only with red numbers\"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,\"redInvm works only with red numbers\"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,\"redNeg works only with red numbers\"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,\"redPow(normalNum)\"),this.red._verify1(this),this.red.pow(this,t)};var A={k256:null,p224:null,p192:null,p25519:null};d.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},d.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},d.prototype.split=function(t,e){t.iushrn(this.n,0,e)},d.prototype.imulK=function(t){return t.imul(this.k)},i(p,d),p.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var a=0|t.words[n];t.words[n-10]=(4194303&a)<<4|i>>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},p.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(m,d),i(g,d),i(v,d),v.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(A[t])return A[t];var e;if(\"k256\"===t)e=new p;else if(\"p224\"===t)e=new m;else if(\"p192\"===t)e=new g;else{if(\"p25519\"!==t)throw new Error(\"Unknown prime \"+t);e=new v}return A[t]=e,e},y.prototype._verify1=function(t){n(0===t.negative,\"red works only with positives\"),n(t.red,\"red works only with red numbers\")},y.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),\"red works only with positives\"),n(t.red&&t.red===e.red,\"red works only with red numbers\")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},y.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},y.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},y.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},y.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},y.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<p);var v=this.pow(h,new a(1).iushln(p-g-1));f=f.redMul(v),h=v.redSqr(),d=d.redMul(h),p=g}return f},y.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},y.prototype.pow=function(t,e){if(e.isZero())return new a(1);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},y.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},y.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new b(t)},i(b,y),b.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},b.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},b.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},b.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},b.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],69:[function(t,e,r){\"use strict\";function n(t){var e,r,n,i=t.length,a=0;for(e=0;e<i;++e)a+=t[e].length;var o=new Array(a),s=0;for(e=0;e<i;++e){var l=t[e],u=l.length;for(r=0;r<u;++r){var c=o[s++]=new Array(u-1),h=0;for(n=0;n<u;++n)n!==r&&(c[h++]=l[n]);if(1&r){var f=c[1];c[1]=c[0],c[0]=f}}}return o}e.exports=n},{}],70:[function(t,e,r){\"use strict\";function n(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function i(t,e,r,i){for(var a=0,o=0,s=0,l=t.length;s<l;++s){var u=t[s];if(!n(e,u)){for(var c=0;c<2*e;++c)r[a++]=u[c];i[o++]=s}}return o}function a(t,e,r,n){var a=t.length,o=e.length;if(!(a<=0||o<=0)){var s=t[0].length>>>1;if(!(s<=0)){var l,u=h.mallocDouble(2*s*a),c=h.mallocInt32(a);if((a=i(t,s,u,c))>0){if(1===s&&n)f.init(a),l=f.sweepComplete(s,r,0,a,u,c,0,a,u,c);else{var p=h.mallocDouble(2*s*o),m=h.mallocInt32(o);o=i(e,s,p,m),o>0&&(f.init(a+o),l=1===s?f.sweepBipartite(s,r,0,a,u,c,0,o,p,m):d(s,r,n,a,u,c,o,p,m),h.free(p),h.free(m))}h.free(u),h.free(c)}return l}}}function o(t,e){c.push([t,e])}function s(t){return c=[],a(t,t,o,!0),c}function l(t,e){return c=[],a(t,e,o,!1),c}function u(t,e,r){switch(arguments.length){case 1:return s(t);case 2:return\"function\"==typeof e?a(t,t,e,!0):l(t,e);case 3:return a(t,e,r,!1);default:throw new Error(\"box-intersect: Invalid arguments\")}}e.exports=u;var c,h=t(\"typedarray-pool\"),f=t(\"./lib/sweep\"),d=t(\"./lib/intersect\")},{\"./lib/intersect\":72,\"./lib/sweep\":76,\"typedarray-pool\":541}],71:[function(t,e,r){\"use strict\";function n(t,e,r){var n=\"bruteForce\"+(t?\"Red\":\"Blue\")+(e?\"Flip\":\"\")+(r?\"Full\":\"\"),i=[\"function \",n,\"(\",w.join(),\"){\",\"var \",u,\"=2*\",a,\";\"],l=\"for(var i=\"+c+\",\"+p+\"=\"+u+\"*\"+c+\";i<\"+h+\";++i,\"+p+\"+=\"+u+\"){var x0=\"+f+\"[\"+o+\"+\"+p+\"],x1=\"+f+\"[\"+o+\"+\"+p+\"+\"+a+\"],xi=\"+d+\"[i];\",M=\"for(var j=\"+m+\",\"+b+\"=\"+u+\"*\"+m+\";j<\"+g+\";++j,\"+b+\"+=\"+u+\"){var y0=\"+v+\"[\"+o+\"+\"+b+\"],\"+(r?\"y1=\"+v+\"[\"+o+\"+\"+b+\"+\"+a+\"],\":\"\")+\"yi=\"+y+\"[j];\";return t?i.push(l,_,\":\",M):i.push(M,_,\":\",l),r?i.push(\"if(y1<x0||x1<y0)continue;\"):e?i.push(\"if(y0<=x0||x1<y0)continue;\"):i.push(\"if(y0<x0||x1<y0)continue;\"),i.push(\"for(var k=\"+o+\"+1;k<\"+a+\";++k){var r0=\"+f+\"[k+\"+p+\"],r1=\"+f+\"[k+\"+a+\"+\"+p+\"],b0=\"+v+\"[k+\"+b+\"],b1=\"+v+\"[k+\"+a+\"+\"+b+\"];if(r1<b0||b1<r0)continue \"+_+\";}var \"+x+\"=\"+s+\"(\"),e?i.push(\"yi,xi\"):i.push(\"xi,yi\"),i.push(\");if(\"+x+\"!==void 0)return \"+x+\";}}}\"),{name:n,code:i.join(\"\")}}function i(t){function e(e,r){var a=n(e,r,t);i.push(a.code),o.push(\"return \"+a.name+\"(\"+w.join()+\");\")}var r=\"bruteForce\"+(t?\"Full\":\"Partial\"),i=[],a=w.slice();t||a.splice(3,0,l);var o=[\"function \"+r+\"(\"+a.join()+\"){\"];o.push(\"if(\"+h+\"-\"+c+\">\"+g+\"-\"+m+\"){\"),t?(e(!0,!1),o.push(\"}else{\"),e(!1,!1)):(o.push(\"if(\"+l+\"){\"),e(!0,!0),o.push(\"}else{\"),e(!0,!1),o.push(\"}}else{if(\"+l+\"){\"),e(!1,!0),o.push(\"}else{\"),e(!1,!1),o.push(\"}\")),o.push(\"}}return \"+r);var s=i.join(\"\")+o.join(\"\");return new Function(s)()}var a=\"d\",o=\"ax\",s=\"vv\",l=\"fp\",u=\"es\",c=\"rs\",h=\"re\",f=\"rb\",d=\"ri\",p=\"rp\",m=\"bs\",g=\"be\",v=\"bb\",y=\"bi\",b=\"bp\",x=\"rv\",_=\"Q\",w=[a,o,s,c,h,f,d,m,g,v,y];r.partial=i(!1),r.full=i(!0)},{}],72:[function(t,e,r){\"use strict\";function n(t,e){var r=8*u.log2(e+1)*(t+1)|0,n=u.nextPow2(A*r);S.length<n&&(l.free(S),S=l.mallocInt32(n));var i=u.nextPow2(T*r);E<i&&(l.free(E),E=l.mallocDouble(i))}function i(t,e,r,n,i,a,o,s,l){var u=A*t;S[u]=e,S[u+1]=r,S[u+2]=n,S[u+3]=i,S[u+4]=a,S[u+5]=o;var c=T*t;E[c]=s,E[c+1]=l}function a(t,e,r,n,i,a,o,s,l,u,c){var h=2*t,f=l*h,d=u[f+e];t:for(var p=i,m=i*h;p<a;++p,m+=h){var g=o[m+e],v=o[m+e+t];if(!(d<g||v<d)&&(!n||d!==g)){for(var y=s[p],b=e+1;b<t;++b){var g=o[m+b],v=o[m+b+t],x=u[f+b],_=u[f+b+t];if(v<x||_<g)continue t}var w;if(void 0!==(w=n?r(c,y):r(y,c)))return w}}}function o(t,e,r,n,i,a,o,s,l,u){var c=2*t,h=s*c,f=l[h+e];t:for(var d=n,p=n*c;d<i;++d,p+=c){var m=o[d];if(m!==u){var g=a[p+e],v=a[p+e+t];if(!(f<g||v<f)){for(var y=e+1;y<t;++y){var g=a[p+y],v=a[p+y+t],b=l[h+y],x=l[h+y+t];if(v<b||x<g)continue t}var _=r(m,u);if(void 0!==_)return _}}}}function s(t,e,r,s,l,u,c,m,L){n(t,s+c);var C,I=0,z=2*t;for(i(I++,0,0,s,0,c,r?16:0,-1/0,1/0),r||i(I++,0,0,c,0,s,1,-1/0,1/0);I>0;){I-=1;var D=I*A,P=S[D],O=S[D+1],R=S[D+2],F=S[D+3],j=S[D+4],N=S[D+5],B=I*T,U=E[B],V=E[B+1],H=1&N,q=!!(16&N),G=l,Y=u,W=m,X=L;if(H&&(G=m,Y=L,W=l,X=u),!(2&N&&(R=_(t,P,O,R,G,Y,V),O>=R)||4&N&&(O=w(t,P,O,R,G,Y,U))>=R)){var Z=R-O,J=j-F;if(q){if(t*Z*(Z+J)<y){if(void 0!==(C=d.scanComplete(t,P,e,O,R,G,Y,F,j,W,X)))return C;continue}}else{if(t*Math.min(Z,J)<g){if(void 0!==(C=h(t,P,e,H,O,R,G,Y,F,j,W,X)))return C;continue}if(t*Z*J<v){if(void 0!==(C=d.scanBipartite(t,P,e,H,O,R,G,Y,F,j,W,X)))return C;continue}}var K=b(t,P,O,R,G,Y,U,V);if(O<K)if(t*(K-O)<g){if(void 0!==(C=f(t,P+1,e,O,K,G,Y,F,j,W,X)))return C}else if(P===t-2){if(void 0!==(C=H?d.sweepBipartite(t,e,F,j,W,X,O,K,G,Y):d.sweepBipartite(t,e,O,K,G,Y,F,j,W,X)))return C}else i(I++,P+1,O,K,F,j,H,-1/0,1/0),i(I++,P+1,F,j,O,K,1^H,-1/0,1/0);if(K<R){var Q=p(t,P,F,j,W,X),$=W[z*Q+P],tt=x(t,P,Q,j,W,X,$);if(tt<j&&i(I++,P,K,R,tt,j,(4|H)+(q?16:0),$,V),F<Q&&i(I++,P,K,R,F,Q,(2|H)+(q?16:0),U,$),Q+1===tt){if(void 0!==(C=q?o(t,P,e,K,R,G,Y,Q,W,X[Q]):a(t,P,e,H,K,R,G,Y,Q,W,X[Q])))return C}else if(Q<tt){var et;if(q){if(et=M(t,P,K,R,G,Y,$),K<et){var rt=x(t,P,K,et,G,Y,$);if(P===t-2){if(K<rt&&void 0!==(C=d.sweepComplete(t,e,K,rt,G,Y,Q,tt,W,X)))return C;if(rt<et&&void 0!==(C=d.sweepBipartite(t,e,rt,et,G,Y,Q,tt,W,X)))return C}else K<rt&&i(I++,P+1,K,rt,Q,tt,16,-1/0,1/0),rt<et&&(i(I++,P+1,rt,et,Q,tt,0,-1/0,1/0),i(I++,P+1,Q,tt,rt,et,1,-1/0,1/0))}}else et=H?k(t,P,K,R,G,Y,$):M(t,P,K,R,G,Y,$),K<et&&(P===t-2?C=H?d.sweepBipartite(t,e,Q,tt,W,X,K,et,G,Y):d.sweepBipartite(t,e,K,et,G,Y,Q,tt,W,X):(i(I++,P+1,K,et,Q,tt,H,-1/0,1/0),i(I++,P+1,Q,tt,K,et,1^H,-1/0,1/0)))}}}}}e.exports=s;var l=t(\"typedarray-pool\"),u=t(\"bit-twiddle\"),c=t(\"./brute\"),h=c.partial,f=c.full,d=t(\"./sweep\"),p=t(\"./median\"),m=t(\"./partition\"),g=128,v=1<<22,y=1<<22,b=m(\"!(lo>=p0)&&!(p1>=hi)\",[\"p0\",\"p1\"]),x=m(\"lo===p0\",[\"p0\"]),_=m(\"lo<p0\",[\"p0\"]),w=m(\"hi<=p0\",[\"p0\"]),M=m(\"lo<=p0&&p0<=hi\",[\"p0\"]),k=m(\"lo<p0&&p0<=hi\",[\"p0\"]),A=6,T=2,S=l.mallocInt32(1024),E=l.mallocDouble(1024)},{\"./brute\":71,\"./median\":73,\"./partition\":74,\"./sweep\":76,\"bit-twiddle\":67,\"typedarray-pool\":541}],73:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var u=i[s],c=l,h=o*(l-1);c>r&&i[h+e]>u;--c,h-=o){for(var f=h,d=h+o,p=0;p<o;++p,++f,++d){var m=i[f];i[f]=i[d],i[d]=m}var g=a[c];a[c]=a[c-1],a[c-1]=g}}function i(t,e,r,i,a,l){if(i<=r+1)return r;for(var u=r,c=i,h=i+r>>>1,f=2*t,d=h,p=a[f*h+e];u<c;){if(c-u<s){n(t,e,u,c,a,l),p=a[f*h+e];break}var m=c-u,g=Math.random()*m+u|0,v=a[f*g+e],y=Math.random()*m+u|0,b=a[f*y+e],x=Math.random()*m+u|0,_=a[f*x+e];v<=b?_>=b?(d=y,p=b):v>=_?(d=g,p=v):(d=x,p=_):b>=_?(d=y,p=b):_>=v?(d=g,p=v):(d=x,p=_);for(var w=f*(c-1),M=f*d,k=0;k<f;++k,++w,++M){var A=a[w];a[w]=a[M],a[M]=A}var T=l[c-1];l[c-1]=l[d],l[d]=T,d=o(t,e,u,c-1,a,l,p);for(var w=f*(c-1),M=f*d,k=0;k<f;++k,++w,++M){var A=a[w];a[w]=a[M],a[M]=A}var T=l[c-1];if(l[c-1]=l[d],l[d]=T,h<d){for(c=d-1;u<c&&a[f*(c-1)+e]===p;)c-=1;c+=1}else{if(!(d<h))break;for(u=d+1;u<c&&a[f*u+e]===p;)u+=1}}return o(t,e,r,h,a,l,a[f*h+e])}e.exports=i;var a=t(\"./partition\"),o=a(\"lo<p0\",[\"p0\"]),s=8},{\"./partition\":74}],74:[function(t,e,r){\"use strict\";function n(t,e){var r=\"abcdef\".split(\"\").concat(e),n=[];return t.indexOf(\"lo\")>=0&&n.push(\"lo=e[k+n]\"),t.indexOf(\"hi\")>=0&&n.push(\"hi=e[k+o]\"),r.push(i.replace(\"_\",n.join()).replace(\"$\",t)),Function.apply(void 0,r)}e.exports=n;var i=\"for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m\"},{}],75:[function(t,e,r){\"use strict\";function n(t,e){e<=4*f?i(0,e-1,t):h(0,e-1,t)}function i(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(u<a)break;if(u===a&&c<o)break;r[l]=u,r[l+1]=c,l-=2}r[l]=a,r[l+1]=o}}function a(t,e,r){t*=2,e*=2;var n=r[t],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function o(t,e,r){t*=2,e*=2,r[t]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){t*=2,e*=2,r*=2;var i=n[t],a=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=a}function l(t,e,r,n,i){t*=2,e*=2,i[t]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function u(t,e,r){t*=2,e*=2;var n=r[t],i=r[e];return!(n<i)&&(n!==i||r[t+1]>r[e+1])}function c(t,e,r,n){t*=2;var i=n[t];return i<e||i===e&&n[t+1]<r}function h(t,e,r){var n=(e-t+1)/6|0,d=t+n,p=e-n,m=t+e>>1,g=m-n,v=m+n,y=d,b=g,x=m,_=v,w=p,M=t+1,k=e-1,A=0;u(y,b,r)&&(A=y,y=b,b=A),u(_,w,r)&&(A=_,_=w,w=A),u(y,x,r)&&(A=y,y=x,x=A),u(b,x,r)&&(A=b,b=x,x=A),u(y,_,r)&&(A=y,y=_,_=A),u(x,_,r)&&(A=x,x=_,_=A),u(b,w,r)&&(A=b,b=w,w=A),u(b,x,r)&&(A=b,b=x,x=A),u(_,w,r)&&(A=_,_=w,w=A);for(var T=r[2*b],S=r[2*b+1],E=r[2*_],L=r[2*_+1],C=2*y,I=2*x,z=2*w,D=2*d,P=2*m,O=2*p,R=0;R<2;++R){var F=r[C+R],j=r[I+R],N=r[z+R];r[D+R]=F,r[P+R]=j,r[O+R]=N}o(g,t,r),o(v,e,r);for(var B=M;B<=k;++B)if(c(B,T,S,r))B!==M&&a(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,T,S,r)?(s(B,M,k,r),++M,--k):(a(B,k,r),--k);break}if(--k<B)break}l(t,M-1,T,S,r),l(e,k+1,E,L,r),M-2-t<=f?i(t,M-2,r):h(t,M-2,r),e-(k+2)<=f?i(k+2,e,r):h(k+2,e,r),k-M<=f?i(M,k,r):h(M,k,r)}e.exports=n;var f=32},{}],76:[function(t,e,r){\"use strict\";function n(t){var e=h.nextPow2(t);p.length<e&&(c.free(p),p=c.mallocInt32(e)),m.length<e&&(c.free(m),m=c.mallocInt32(e)),g.length<e&&(c.free(g),g=c.mallocInt32(e)),v.length<e&&(c.free(v),v=c.mallocInt32(e)),y.length<e&&(c.free(y),y=c.mallocInt32(e)),b.length<e&&(c.free(b),b=c.mallocInt32(e));var r=8*e;x.length<r&&(c.free(x),x=c.mallocDouble(r))}function i(t,e,r,n){var i=e[n],a=t[r-1];t[i]=a,e[a]=i}function a(t,e,r,n){t[r]=n,e[n]=r}function o(t,e,r,n,o,s,l,u,c,h){for(var y=0,b=2*t,_=t-1,w=b-1,M=r;M<n;++M){var k=s[M],A=b*M;x[y++]=o[A+_],x[y++]=-(k+1),x[y++]=o[A+w],x[y++]=k}for(var M=l;M<u;++M){var k=h[M]+d,T=b*M;x[y++]=c[T+_],x[y++]=-k,x[y++]=c[T+w],x[y++]=k}var S=y>>>1;f(x,S);for(var E=0,L=0,M=0;M<S;++M){var C=0|x[2*M+1];if(C>=d)C=C-d|0,i(g,v,L--,C);else if(C>=0)i(p,m,E--,C);else if(C<=-d){C=-C-d|0;for(var I=0;I<E;++I){var z=e(p[I],C);if(void 0!==z)return z}a(g,v,L++,C)}else{C=-C-1|0;for(var I=0;I<L;++I){var z=e(C,g[I]);if(void 0!==z)return z}a(p,m,E++,C)}}}function s(t,e,r,n,o,s,l,u,c,h){for(var d=0,_=2*t,w=t-1,M=_-1,k=r;k<n;++k){var A=s[k]+1<<1,T=_*k;x[d++]=o[T+w],x[d++]=-A,x[d++]=o[T+M],x[d++]=A}for(var k=l;k<u;++k){var A=h[k]+1<<1,S=_*k;x[d++]=c[S+w],x[d++]=1|-A,x[d++]=c[S+M],x[d++]=1|A}var E=d>>>1;f(x,E);for(var L=0,C=0,I=0,k=0;k<E;++k){var z=0|x[2*k+1],D=1&z;if(k<E-1&&z>>1==x[2*k+3]>>1&&(D=2,k+=1),z<0){for(var P=-(z>>1)-1,O=0;O<I;++O){var R=e(y[O],P);if(void 0!==R)return R}if(0!==D)for(var O=0;O<L;++O){var R=e(p[O],P);if(void 0!==R)return R}if(1!==D)for(var O=0;O<C;++O){var R=e(g[O],P);if(void 0!==R)return R}0===D?a(p,m,L++,P):1===D?a(g,v,C++,P):2===D&&a(y,b,I++,P)}else{var P=(z>>1)-1;0===D?i(p,m,L--,P):1===D?i(g,v,C--,P):2===D&&i(y,b,I--,P)}}}function l(t,e,r,n,o,s,l,u,c,h,g,v){var y=0,b=2*t,_=e,w=e+t,M=1,k=1;n?k=d:M=d\n", | |
";for(var A=o;A<s;++A){var T=A+M,S=b*A;x[y++]=l[S+_],x[y++]=-T,x[y++]=l[S+w],x[y++]=T}for(var A=c;A<h;++A){var T=A+k,E=b*A;x[y++]=g[E+_],x[y++]=-T}var L=y>>>1;f(x,L);for(var C=0,A=0;A<L;++A){var I=0|x[2*A+1];if(I<0){var T=-I,z=!1;if(T>=d?(z=!n,T-=d):(z=!!n,T-=1),z)a(p,m,C++,T);else{var D=v[T],P=b*T,O=g[P+e+1],R=g[P+e+1+t];t:for(var F=0;F<C;++F){var j=p[F],N=b*j;if(!(R<l[N+e+1]||l[N+e+1+t]<O)){for(var B=e+2;B<t;++B)if(g[P+B+t]<l[N+B]||l[N+B+t]<g[P+B])continue t;var U,V=u[j];if(void 0!==(U=n?r(D,V):r(V,D)))return U}}}}else i(p,m,C--,I-M)}}function u(t,e,r,n,i,a,o,s,l,u,c){for(var h=0,m=2*t,g=e,v=e+t,y=n;y<i;++y){var b=y+d,_=m*y;x[h++]=a[_+g],x[h++]=-b,x[h++]=a[_+v],x[h++]=b}for(var y=s;y<l;++y){var b=y+1,w=m*y;x[h++]=u[w+g],x[h++]=-b}var M=h>>>1;f(x,M);for(var k=0,y=0;y<M;++y){var A=0|x[2*y+1];if(A<0){var b=-A;if(b>=d)p[k++]=b-d;else{b-=1;var T=c[b],S=m*b,E=u[S+e+1],L=u[S+e+1+t];t:for(var C=0;C<k;++C){var I=p[C],z=o[I];if(z===T)break;var D=m*I;if(!(L<a[D+e+1]||a[D+e+1+t]<E)){for(var P=e+2;P<t;++P)if(u[S+P+t]<a[D+P]||a[D+P+t]<u[S+P])continue t;var O=r(z,T);if(void 0!==O)return O}}}}else{for(var b=A-d,C=k-1;C>=0;--C)if(p[C]===b){for(var P=C+1;P<k;++P)p[P-1]=p[P];break}--k}}}e.exports={init:n,sweepBipartite:o,sweepComplete:s,scanBipartite:l,scanComplete:u};var c=t(\"typedarray-pool\"),h=t(\"bit-twiddle\"),f=t(\"./sort\"),d=1<<28,p=c.mallocInt32(1024),m=c.mallocInt32(1024),g=c.mallocInt32(1024),v=c.mallocInt32(1024),y=c.mallocInt32(1024),b=c.mallocInt32(1024),x=c.mallocDouble(8192)},{\"./sort\":75,\"bit-twiddle\":67,\"typedarray-pool\":541}],77:[function(t,e,r){\"use strict\";function n(t){if(t>Z)throw new RangeError(\"Invalid typed array length\");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if(\"number\"==typeof t){if(\"string\"==typeof e)throw new Error(\"If encoding is specified then the first argument must be a string\");return l(t)}return a(t,e,r)}function a(t,e,r){if(\"number\"==typeof t)throw new TypeError('\"value\" argument must not be a number');return t instanceof ArrayBuffer?h(t,e,r):\"string\"==typeof t?u(t,e):f(t)}function o(t){if(\"number\"!=typeof t)throw new TypeError('\"size\" argument must be a number');if(t<0)throw new RangeError('\"size\" argument must not be negative')}function s(t,e,r){return o(t),t<=0?n(t):void 0!==e?\"string\"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}function l(t){return o(t),n(t<0?0:0|d(t))}function u(t,e){if(\"string\"==typeof e&&\"\"!==e||(e=\"utf8\"),!i.isEncoding(e))throw new TypeError('\"encoding\" must be a valid string encoding');var r=0|m(t,e),a=n(r),o=a.write(t,e);return o!==r&&(a=a.slice(0,o)),a}function c(t){for(var e=t.length<0?0:0|d(t.length),r=n(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function h(t,e,r){if(e<0||t.byteLength<e)throw new RangeError(\"'offset' is out of bounds\");if(t.byteLength<e+(r||0))throw new RangeError(\"'length' is out of bounds\");var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),n.__proto__=i.prototype,n}function f(t){if(i.isBuffer(t)){var e=0|d(t.length),r=n(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if(G(t)||\"length\"in t)return\"number\"!=typeof t.length||Y(t.length)?n(0):c(t);if(\"Buffer\"===t.type&&Array.isArray(t.data))return c(t.data)}throw new TypeError(\"First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.\")}function d(t){if(t>=Z)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+Z.toString(16)+\" bytes\");return 0|t}function p(t){return+t!=t&&(t=0),i.alloc(+t)}function m(t,e){if(i.isBuffer(t))return t.length;if(G(t)||t instanceof ArrayBuffer)return t.byteLength;\"string\"!=typeof t&&(t=\"\"+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return B(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return H(t).length;default:if(n)return B(t).length;e=(\"\"+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if(r>>>=0,e>>>=0,r<=e)return\"\";for(t||(t=\"utf8\");;)switch(t){case\"hex\":return I(this,e,r);case\"utf8\":case\"utf-8\":return S(this,e,r);case\"ascii\":return L(this,e,r);case\"latin1\":case\"binary\":return C(this,e,r);case\"base64\":return T(this,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return z(this,e,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,a){if(0===t.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Y(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if(\"string\"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,a);if(\"number\"==typeof e)return e&=255,\"function\"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,a);throw new TypeError(\"val must be string, number or Buffer\")}function b(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,l=e.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}var u;if(i){var c=-1;for(u=r;u<s;u++)if(a(t,u)===a(e,-1===c?0:u-c)){if(-1===c&&(c=u),u-c+1===l)return c*o}else-1!==c&&(u-=u-c),c=-1}else for(r+l>s&&(r=s-l),u=r;u>=0;u--){for(var h=!0,f=0;f<l;f++)if(a(t,u+f)!==a(e,f)){h=!1;break}if(h)return u}return-1}function x(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError(\"Invalid hex string\");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(Y(s))return o;t[r+o]=s}return o}function _(t,e,r,n){return q(B(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(U(e),t,r,n)}function M(t,e,r,n){return w(t,e,r,n)}function k(t,e,r,n){return q(H(e),t,r,n)}function A(t,e,r,n){return q(V(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?W.fromByteArray(t):W.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){var l,u,c,h;switch(s){case 1:a<128&&(o=a);break;case 2:l=t[i+1],128==(192&l)&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(h=(15&a)<<12|(63&l)<<6|63&u)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(h=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return E(n)}function E(t){var e=t.length;if(e<=J)return String.fromCharCode.apply(String,t);for(var r=\"\",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=J));return r}function L(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function C(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function I(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i=\"\",a=e;a<r;++a)i+=N(t[a]);return i}function z(t,e,r){for(var n=t.slice(e,r),i=\"\",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function D(t,e,r){if(t%1!=0||t<0)throw new RangeError(\"offset is not uint\");if(t+e>r)throw new RangeError(\"Trying to access beyond buffer length\")}function P(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(e>a||e<o)throw new RangeError('\"value\" argument is out of bounds');if(r+n>t.length)throw new RangeError(\"Index out of range\")}function O(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function R(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(t,e,r,n,52,8),r+8}function j(t){if(t=t.trim().replace(K,\"\"),t.length<2)return\"\";for(;t.length%4!=0;)t+=\"=\";return t}function N(t){return t<16?\"0\"+t.toString(16):t.toString(16)}function B(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function U(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function V(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function H(t){return W.toByteArray(j(t))}function q(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function G(t){return\"function\"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function Y(t){return t!==t}var W=t(\"base64-js\"),X=t(\"ieee754\");r.Buffer=i,r.SlowBuffer=p,r.INSPECT_MAX_BYTES=50;var Z=2147483647;r.kMaxLength=Z,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),\"undefined\"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return s(t,e,r)},i.allocUnsafe=function(t){return l(t)},i.allocUnsafeSlow=function(t){return l(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError(\"Arguments must be Buffers\");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a<o;++a)if(t[a]!==e[a]){r=t[a],n=e[a];break}return r<n?-1:n<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),a=0;for(r=0;r<t.length;++r){var o=t[r];if(!i.isBuffer(o))throw new TypeError('\"list\" argument must be an Array of Buffers');o.copy(n,a),a+=o.length}return n},i.byteLength=m,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?\"\":0===arguments.length?S(this,0,t):g.apply(this,arguments)},i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t=\"\",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString(\"hex\",0,e).match(/.{2}/g).join(\" \"),this.length>e&&(t+=\" ... \")),\"<Buffer \"+t+\">\"},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError(\"out of range index\");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),u=this.slice(n,a),c=t.slice(e,r),h=0;h<l;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},i.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},i.prototype.write=function(t,e,r,n){if(void 0===e)n=\"utf8\",r=this.length,e=0;else if(void 0===r&&\"string\"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n=\"utf8\")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var a=!1;;)switch(n){case\"hex\":return x(this,t,e,r);case\"utf8\":case\"utf-8\":return _(this,t,e,r);case\"ascii\":return w(this,t,e,r);case\"latin1\":case\"binary\":return M(this,t,e,r);case\"base64\":return k(this,t,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return A(this,t,e,r);default:if(a)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=i.prototype,n},i.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},i.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||D(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||D(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||D(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||D(t,4,this.length),X.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||D(t,4,this.length),X.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||D(t,8,this.length),X.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||D(t,8,this.length),X.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){P(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},i.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){P(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a<r&&(o*=256);)t<0&&0===s&&0!==this[e+a-1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError(\"targetStart out of bounds\");if(r<0||r>=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,a=n-r;if(this===t&&r<e&&e<n)for(i=a-1;i>=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i<a;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},i.prototype.fill=function(t,e,r,n){if(\"string\"==typeof t){if(\"string\"==typeof e?(n=e,e=0,r=this.length):\"string\"==typeof r&&(n=r,r=this.length),1===t.length){var a=t.charCodeAt(0);a<256&&(t=a)}if(void 0!==n&&\"string\"!=typeof n)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof n&&!i.isEncoding(n))throw new TypeError(\"Unknown encoding: \"+n)}else\"number\"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError(\"Out of range index\");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if(\"number\"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=i.isBuffer(t)?t:new i(t,n),l=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%l]}return this};var K=/[^+\\/0-9A-Za-z-_]/g},{\"base64-js\":78,ieee754:289}],78:[function(t,e,r){\"use strict\";function n(t){var e=t.length;if(e%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");return\"=\"===t[e-2]?2:\"=\"===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function a(t){var e,r,i,a,o,s,l=t.length;o=n(t),s=new h(3*l/4-o),i=o>0?l-4:l;var u=0;for(e=0,r=0;e<i;e+=4,r+=3)a=c[t.charCodeAt(e)]<<18|c[t.charCodeAt(e+1)]<<12|c[t.charCodeAt(e+2)]<<6|c[t.charCodeAt(e+3)],s[u++]=a>>16&255,s[u++]=a>>8&255,s[u++]=255&a;return 2===o?(a=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[u++]=255&a):1===o&&(a=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[u++]=a>>8&255,s[u++]=255&a),s}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(o(n));return i.join(\"\")}function l(t){for(var e,r=t.length,n=r%3,i=\"\",a=[],o=0,l=r-n;o<l;o+=16383)a.push(s(t,o,o+16383>l?l:o+16383));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+=\"==\"):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+=\"=\"),a.push(i),a.join(\"\")}r.byteLength=i,r.toByteArray=a,r.fromByteArray=l;for(var u=[],c=[],h=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,f=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",d=0,p=f.length;d<p;++d)u[d]=f[d],c[f.charCodeAt(d)]=d;c[\"-\".charCodeAt(0)]=62,c[\"_\".charCodeAt(0)]=63},{}],79:[function(t,e,r){\"use strict\";function n(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function i(t,e){return t[0]-e[0]||t[1]-e[1]}function a(t){return t.map(n).sort(i)}function o(t,e,r){return e in t?t[e]:r}function s(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var n=!!o(r,\"delaunay\",!0),i=!!o(r,\"interior\",!0),s=!!o(r,\"exterior\",!0),f=!!o(r,\"infinity\",!1);if(!i&&!s||0===t.length)return[];var d=l(t,e);if(n||i!==s||f){for(var p=u(t.length,a(e)),m=0;m<d.length;++m){var g=d[m];p.addTriangle(g[0],g[1],g[2])}return n&&c(t,p),s?i?f?h(p,0,f):p.cells():h(p,1,f):h(p,-1)}return d}var l=t(\"./lib/monotone\"),u=t(\"./lib/triangulation\"),c=t(\"./lib/delaunay\"),h=t(\"./lib/filter\");e.exports=s},{\"./lib/delaunay\":80,\"./lib/filter\":81,\"./lib/monotone\":82,\"./lib/triangulation\":83}],80:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,o){var s=e.opposite(n,i);if(!(s<0)){if(i<n){var l=n;n=i,i=l,l=o,o=s,s=l}e.isConstraint(n,i)||a(t[n],t[i],t[o],t[s])<0&&r.push(n,i)}}function i(t,e){for(var r=[],i=t.length,o=e.stars,s=0;s<i;++s)for(var l=o[s],u=1;u<l.length;u+=2){var c=l[u];if(!(c<s)&&!e.isConstraint(s,c)){for(var h=l[u-1],f=-1,d=1;d<l.length;d+=2)if(l[d-1]===c){f=l[d];break}f<0||a(t[s],t[c],t[h],t[f])<0&&r.push(s,c)}}for(;r.length>0;){for(var c=r.pop(),s=r.pop(),h=-1,f=-1,l=o[s],p=1;p<l.length;p+=2){var m=l[p-1],g=l[p];m===c?f=g:g===c&&(h=m)}h<0||f<0||(a(t[s],t[c],t[h],t[f])>=0||(e.flip(s,c),n(t,e,r,h,s,f),n(t,e,r,s,f,h),n(t,e,r,f,c,h),n(t,e,r,c,h,f)))}}var a=t(\"robust-in-sphere\")[4];t(\"binary-search-bounds\");e.exports=i},{\"binary-search-bounds\":84,\"robust-in-sphere\":506}],81:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function a(t,e){for(var r=t.cells(),a=r.length,o=0;o<a;++o){var s=r[o],l=s[0],u=s[1],c=s[2];u<c?u<l&&(s[0]=u,s[1]=c,s[2]=l):c<l&&(s[0]=c,s[1]=l,s[2]=u)}r.sort(i);for(var h=new Array(a),o=0;o<h.length;++o)h[o]=0;var f=[],d=[],p=new Array(3*a),m=new Array(3*a),g=null;e&&(g=[]);for(var v=new n(r,p,m,h,f,d,g),o=0;o<a;++o)for(var s=r[o],y=0;y<3;++y){var l=s[y],u=s[(y+1)%3],b=p[3*o+y]=v.locate(u,l,t.opposite(u,l)),x=m[3*o+y]=t.isConstraint(l,u);b<0&&(x?d.push(o):(f.push(o),h[o]=1),e&&g.push([u,l,-1]))}return v}function o(t,e,r){for(var n=0,i=0;i<t.length;++i)e[i]===r&&(t[n++]=t[i]);return t.length=n,t}function s(t,e,r){var n=a(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;for(var i=1,s=n.active,l=n.next,u=n.flags,c=n.cells,h=n.constraint,f=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i;for(var p=(c[d],0);p<3;++p){var m=f[3*d+p];m>=0&&0===u[m]&&(h[3*d+p]?l.push(m):(s.push(m),u[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var v=o(c,u,e);return r?v.concat(n.boundary):v}var l=t(\"binary-search-bounds\");e.exports=s,n.prototype.locate=function(){var t=[0,0,0];return function(e,r,n){var a=e,o=r,s=n;return r<n?r<e&&(a=r,o=n,s=e):n<e&&(a=n,o=e,s=r),a<0?-1:(t[0]=a,t[1]=o,t[2]=s,l.eq(this.cells,t,i))}}()},{\"binary-search-bounds\":84}],82:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function i(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function a(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||(t.type!==p&&(r=d(t.a,t.b,e.b))?r:t.idx-e.idx)}function o(t,e){return d(t.a,t.b,e)}function s(t,e,r,n,i){for(var a=f.lt(e,n,o),s=f.gt(e,n,o),l=a;l<s;++l){for(var u=e[l],c=u.lowerIds,h=c.length;h>1&&d(r[c[h-2]],r[c[h-1]],n)>0;)t.push([c[h-1],c[h-2],i]),h-=1;c.length=h,c.push(i);for(var p=u.upperIds,h=p.length;h>1&&d(r[p[h-2]],r[p[h-1]],n)<0;)t.push([p[h-2],p[h-1],i]),h-=1;p.length=h,p.push(i)}}function l(t,e){var r;return(r=t.a[0]<e.a[0]?d(t.a,t.b,e.a):d(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?d(t.a,t.b,e.b):d(e.b,e.a,t.b))||t.idx-e.idx}function u(t,e,r){var i=f.le(t,r,l),a=t[i],o=a.upperIds,s=o[o.length-1];a.upperIds=[s],t.splice(i+1,0,new n(r.a,r.b,r.idx,[s],o))}function c(t,e,r){var n=r.a;r.a=r.b,r.b=n;var i=f.eq(t,r,l),a=t[i];t[i-1].upperIds=a.upperIds,t.splice(i,1)}function h(t,e){for(var r=t.length,o=e.length,l=[],h=0;h<r;++h)l.push(new i(t[h],null,p,h));for(var h=0;h<o;++h){var f=e[h],d=t[f[0]],v=t[f[1]];d[0]<v[0]?l.push(new i(d,v,g,h),new i(v,d,m,h)):d[0]>v[0]&&l.push(new i(v,d,g,h),new i(d,v,m,h))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],h=0,_=l.length;h<_;++h){var w=l[h],M=w.type;M===p?s(x,b,t,w.a,w.idx):M===g?u(b,t,w):c(b,t,w)}return x}var f=t(\"binary-search-bounds\"),d=t(\"robust-orientation\")[3],p=0,m=1,g=2;e.exports=h},{\"binary-search-bounds\":84,\"robust-orientation\":508}],83:[function(t,e,r){\"use strict\";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n<i;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}function a(t,e){for(var r=new Array(t),i=0;i<t;++i)r[i]=[];return new n(r,e)}var o=t(\"binary-search-bounds\");e.exports=a;var s=n.prototype;s.isConstraint=function(){function t(t,e){return t[0]-e[0]||t[1]-e[1]}var e=[0,0];return function(r,n){return e[0]=Math.min(r,n),e[1]=Math.max(r,n),o.eq(this.edges,e,t)>=0}}(),s.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},s.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},s.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n<i;n+=2)if(r[n]===t)return r[n-1];return-1},s.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},s.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2)e.push([i[a],i[a+1]]);return e},s.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2){var s=i[a],l=i[a+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},{\"binary-search-bounds\":84}],84:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){var a=[\"function \",t,\"(a,l,h,\",n.join(\",\"),\"){\",i?\"\":\"var i=\",r?\"l-1\":\"h+1\",\";while(l<=h){var m=(l+h)>>>1,x=a[m]\"];return i?e.indexOf(\"c\")<0?a.push(\";if(x===y){return m}else if(x<=y){\"):a.push(\";var p=c(x,y);if(p===0){return m}else if(p<=0){\"):a.push(\";if(\",e,\"){i=m;\"),r?a.push(\"l=m+1}else{h=m-1}\"):a.push(\"h=m-1}else{l=m+1}\"),a.push(\"}\"),i?a.push(\"return -1};\"):a.push(\"return i};\"),a.join(\"\")}function i(t,e,r,i){return new Function([n(\"A\",\"x\"+t+\"y\",e,[\"y\"],i),n(\"P\",\"c(x,y)\"+t+\"0\",e,[\"y\",\"c\"],i),\"function dispatchBsearch\",r,\"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch\",r].join(\"\"))()}e.exports={ge:i(\">=\",!1,\"GE\"),gt:i(\">\",!1,\"GT\"),lt:i(\"<\",!0,\"LT\"),le:i(\"<=\",!0,\"LE\"),eq:i(\"-\",!0,\"EQ\",!0)}},{}],85:[function(t,e,r){\"use strict\";function n(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;n<r;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}e.exports=n},{}],86:[function(t,e,r){\"use strict\";function n(t,e){for(var r=0,n=t.length,i=0;i<n;++i)r+=t[i]*e[i];return r}function i(t){var e=t.length;if(0===e)return[];var r=(t[0].length,o([t.length+1,t.length+1],1)),i=o([t.length+1],1);r[e][e]=0;for(var a=0;a<e;++a){for(var l=0;l<=a;++l)r[l][a]=r[a][l]=2*n(t[a],t[l]);i[a]=n(t[a],t[a])}for(var u=s(r,i),c=0,h=u[e+1],a=0;a<h.length;++a)c+=h[a];for(var f=new Array(e),a=0;a<e;++a){for(var h=u[a],d=0,l=0;l<h.length;++l)d+=h[l];f[a]=d/c}return f}function a(t){if(0===t.length)return[];for(var e=t[0].length,r=o([e]),n=i(t),a=0;a<t.length;++a)for(var s=0;s<e;++s)r[s]+=t[a][s]*n[a];return r}var o=t(\"dup\"),s=t(\"robust-linear-solve\");a.barycenetric=i,e.exports=a},{dup:125,\"robust-linear-solve\":507}],87:[function(t,e,r){function n(t){for(var e=i(t),r=0,n=0;n<t.length;++n)for(var a=t[n],o=0;o<e.length;++o)r+=Math.pow(a[o]-e[o],2);return Math.sqrt(r/t.length)}e.exports=n;var i=t(\"circumcenter\")},{circumcenter:86}],88:[function(t,e,r){function n(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?e:t}e.exports=n},{}],89:[function(t,e,r){\"use strict\";function n(t){var e=_(t);return[M(e,-1/0),M(e,1/0)]}function i(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var i=e[n],a=t[i[0]],o=t[i[1]];r[n]=[M(Math.min(a[0],o[0]),-1/0),M(Math.min(a[1],o[1]),-1/0),M(Math.max(a[0],o[0]),1/0),M(Math.max(a[1],o[1]),1/0)]}return r}function a(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[M(n[0],-1/0),M(n[1],-1/0),M(n[0],1/0),M(n[1],1/0)]}return e}function o(t,e,r){var n=[];return v(r,function(r,i){var a=e[r],o=e[i];if(a[0]!==o[0]&&a[0]!==o[1]&&a[1]!==o[0]&&a[1]!==o[1]){var s=t[a[0]],l=t[a[1]],u=t[o[0]],c=t[o[1]];y(s,l,u,c)&&n.push([r,i])}}),n}function s(t,e,r,n){var i=[];return v(r,n,function(r,n){var a=e[r];if(a[0]!==n&&a[1]!==n){var o=t[n],s=t[a[0]],l=t[a[1]];y(s,l,o,o)&&i.push([r,n])}}),i}function l(t,e,r,n,i){var a,o,s=t.map(function(t){return[b(t[0]),b(t[1])]});for(a=0;a<r.length;++a){var l=r[a];o=l[0];var u=l[1],c=e[o],h=e[u],f=k(w(t[c[0]]),w(t[c[1]]),w(t[h[0]]),w(t[h[1]]));if(f){var d=t.length;t.push([_(f[0]),_(f[1])]),s.push(f),n.push([o,d],[u,d])}}for(n.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=s[t[1]],n=s[e[1]];return x(r[0],n[0])||x(r[1],n[1])}),a=n.length-1;a>=0;--a){var p=n[a];o=p[0];var m=e[o],g=m[0],v=m[1],y=t[g],M=t[v];if((y[0]-M[0]||y[1]-M[1])<0){var A=g;g=v,v=A}m[0]=g;var T,S=m[1]=p[1];for(i&&(T=m[2]);a>0&&n[a-1][0]===o;){var p=n[--a],E=p[1];i?e.push([S,E,T]):e.push([S,E]),S=E}i?e.push([S,v,T]):e.push([S,v])}return s}function u(t,e,r){for(var i=e.length,a=new g(i),o=[],s=0;s<e.length;++s){var l=e[s],u=n(l[0]),c=n(l[1]);o.push([M(u[0],-1/0),M(c[0],-1/0),M(u[1],1/0),M(c[1],1/0)])}v(o,function(t,e){a.link(t,e)});for(var h=!0,f=new Array(i),s=0;s<i;++s){var d=a.find(s);d!==s&&(h=!1,t[d]=[Math.min(t[s][0],t[d][0]),Math.min(t[s][1],t[d][1])])}if(h)return null;for(var p=0,s=0;s<i;++s){var d=a.find(s);d===s?(f[s]=p,t[p++]=t[s]):f[s]=-1}t.length=p;for(var s=0;s<i;++s)f[s]<0&&(f[s]=f[a.find(s)]);return f}function c(t,e){return t[0]-e[0]||t[1]-e[1]}function h(t,e){var r=t[0]-e[0]||t[1]-e[1];return r||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}\n", | |
"function f(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=t[n],a=e[i[0]],o=e[i[1]];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}else for(var n=0;n<t.length;++n){var i=t[n],a=i[0],o=i[1];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}r?t.sort(h):t.sort(c);for(var s=1,n=1;n<t.length;++n){var l=t[n-1],u=t[n];(u[0]!==l[0]||u[1]!==l[1]||r&&u[2]!==l[2])&&(t[s++]=u)}t.length=s}}function d(t,e,r){var n=u(t,[],a(t));return f(e,n,r),!!n}function p(t,e,r){var n=i(t,e),c=o(t,e,n),h=a(t),d=s(t,e,n,h),p=l(t,e,c,d,r),m=u(t,p,h);return f(e,m,r),!!m||(c.length>0||d.length>0)}function m(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;a<e.length;++a){var o=e[a];i[a]=[o[0],o[1],r[a]]}e=i}for(var s=d(t,e,!!r);p(t,e,!!r);)s=!0;if(r&&s){n.length=0,r.length=0;for(var a=0;a<e.length;++a){var o=e[a];n.push([o[0],o[1]]),r.push(o[2])}}return s}e.exports=m;var g=t(\"union-find\"),v=t(\"box-intersect\"),y=t(\"robust-segment-intersect\"),b=t(\"big-rat\"),x=t(\"big-rat/cmp\"),_=t(\"big-rat/to-float\"),w=t(\"rat-vec\"),M=t(\"nextafter\"),k=t(\"./lib/rat-seg-intersect\")},{\"./lib/rat-seg-intersect\":90,\"big-rat\":53,\"big-rat/cmp\":51,\"big-rat/to-float\":65,\"box-intersect\":70,nextafter:468,\"rat-vec\":495,\"robust-segment-intersect\":511,\"union-find\":542}],90:[function(t,e,r){\"use strict\";function n(t,e){return s(a(t[0],e[1]),a(t[1],e[0]))}function i(t,e,r,i){var a=u(e,t),s=u(i,r),f=n(a,s);if(0===l(f))return null;var d=u(t,r),p=n(s,d),m=o(p,f),g=h(a,m);return c(t,g)}e.exports=i;var a=t(\"big-rat/mul\"),o=t(\"big-rat/div\"),s=t(\"big-rat/sub\"),l=t(\"big-rat/sign\"),u=t(\"rat-vec/sub\"),c=t(\"rat-vec/add\"),h=t(\"rat-vec/muls\")},{\"big-rat/div\":52,\"big-rat/mul\":62,\"big-rat/sign\":63,\"big-rat/sub\":64,\"rat-vec/add\":494,\"rat-vec/muls\":496,\"rat-vec/sub\":497}],91:[function(t,e,r){(function(t){var r=function(){\"use strict\";function e(r,n,i,a){function s(r,i){if(null===r)return null;if(0==i)return r;var h,f;if(\"object\"!=typeof r)return r;if(e.__isArray(r))h=[];else if(e.__isRegExp(r))h=new RegExp(r.source,o(r)),r.lastIndex&&(h.lastIndex=r.lastIndex);else if(e.__isDate(r))h=new Date(r.getTime());else{if(c&&t.isBuffer(r))return h=new t(r.length),r.copy(h),h;void 0===a?(f=Object.getPrototypeOf(r),h=Object.create(f)):(h=Object.create(a),f=a)}if(n){var d=l.indexOf(r);if(-1!=d)return u[d];l.push(r),u.push(h)}for(var p in r){var m;f&&(m=Object.getOwnPropertyDescriptor(f,p)),m&&null==m.set||(h[p]=s(r[p],i-1))}return h}\"object\"==typeof n&&(i=n.depth,a=n.prototype,n.filter,n=n.circular);var l=[],u=[],c=void 0!==t;return void 0===n&&(n=!0),void 0===i&&(i=1/0),s(r,i)}function r(t){return Object.prototype.toString.call(t)}function n(t){return\"object\"==typeof t&&\"[object Date]\"===r(t)}function i(t){return\"object\"==typeof t&&\"[object Array]\"===r(t)}function a(t){return\"object\"==typeof t&&\"[object RegExp]\"===r(t)}function o(t){var e=\"\";return t.global&&(e+=\"g\"),t.ignoreCase&&(e+=\"i\"),t.multiline&&(e+=\"m\"),e}return e.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},e.__objToStr=r,e.__isDate=n,e.__isArray=i,e.__isRegExp=a,e.__getRegExpFlags=o,e}();\"object\"==typeof e&&e.exports&&(e.exports=r)}).call(this,t(\"buffer\").Buffer)},{buffer:77}],92:[function(t,e,r){\"use strict\";function n(t,e){null==e&&(e=!0);var r=t[0],n=t[1],i=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,n*=255,i*=255,o*=255),r=255&a(r,0,255),n=255&a(n,0,255),i=255&a(i,0,255),o=255&a(o,0,255),16777216*r+(n<<16)+(i<<8)+o}function i(t,e){t=+t;var r=t>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}var a=t(\"clamp\");e.exports=n,e.exports.to=n,e.exports.from=i},{clamp:88}],93:[function(t,e,r){\"use strict\";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],94:[function(t,e,r){(function(r){\"use strict\";function n(t){var e,n,s=[],l=1;if(\"string\"==typeof t)if(i[t])s=i[t].slice(),n=\"rgb\";else if(\"transparent\"===t)l=0,n=\"rgb\",s=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1),c=u.length,h=c<=4;l=1,h?(s=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===c&&(l=parseInt(u[3]+u[3],16)/255)):(s=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===c&&(l=parseInt(u[6]+u[7],16)/255)),s[0]||(s[0]=0),s[1]||(s[1]=0),s[2]||(s[2]=0),n=\"rgb\"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\\s*\\(([^\\)]*)\\)/.exec(t)){var f=e[1],u=f.replace(/a$/,\"\");n=u;var c=\"cmyk\"===u?4:\"gray\"===u?1:3;s=e[2].trim().split(/\\s*,\\s*/).map(function(t,e){if(/%$/.test(t))return e===c?parseFloat(t)/100:\"rgb\"===u?255*parseFloat(t)/100:parseFloat(t);if(\"h\"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),f===u&&s.push(1),l=void 0===s[c]?1:s[c],s=s.slice(0,c)}else t.length>10&&/[0-9](?:\\s|\\/)/.test(t)&&(s=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),n=t.match(/([a-z])/gi).join(\"\").toLowerCase());else\"number\"==typeof t?(n=\"rgb\",s=[t>>>16,(65280&t)>>>8,255&t]):a(t)?(null!=t.r?(s=[t.r,t.g,t.b],n=\"rgb\"):null!=t.red?(s=[t.red,t.green,t.blue],n=\"rgb\"):null!=t.h?(s=[t.h,t.s,t.l],n=\"hsl\"):null!=t.hue&&(s=[t.hue,t.saturation,t.lightness],n=\"hsl\"),null!=t.a?l=t.a:null!=t.alpha?l=t.alpha:null!=t.opacity&&(l=t.opacity/100)):(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(s=[t[0],t[1],t[2]],n=\"rgb\",l=4===t.length?t[3]:1);return{space:n,values:s,alpha:l}}e.exports=n;var i=t(\"color-name\"),a=t(\"is-plain-obj\"),o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"color-name\":93,\"is-plain-obj\":297}],95:[function(t,e,r){\"use strict\";var n=t(\"color-parse\"),i=t(\"color-space/hsl\"),a=t(\"clamp\");e.exports=function(t,e){if(Array.isArray(t))return t;null==e&&(e=!0);var r=n(t);if(!r.space)return[];var o,s=r.values,l=s.length;for(o=0;o<l;o++)s[o]=a(s[o],0,255);if(\"h\"===r.space[0]&&(s=i.rgb(s)),e)for(o=0;o<l;o++)s[o]/=255;return s.push(a(r.alpha,0,1)),s}},{clamp:88,\"color-parse\":94,\"color-space/hsl\":96}],96:[function(t,e,r){\"use strict\";var n=t(\"./rgb\");e.exports={name:\"hsl\",min:[0,0,0],max:[360,100,100],channel:[\"hue\",\"saturation\",\"lightness\"],alias:[\"HSL\"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return a=255*l,[a,a,a];r=l<.5?l*(1+s):l+s-l*s,e=2*l-r,i=[0,0,0];for(var u=0;u<3;u++)n=o+1/3*-(u-1),n<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),u=l-s;return l===s?e=0:i===l?e=(a-o)/u:a===l?e=2+(o-i)/u:o===l&&(e=4+(i-a)/u),e=Math.min(60*e,360),e<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?u/(l+s):u/(2-l-s),[e,100*r,100*n]}},{\"./rgb\":97}],97:[function(t,e,r){\"use strict\";e.exports={name:\"rgb\",min:[0,0,0],max:[255,255,255],channel:[\"red\",\"green\",\"blue\"],alias:[\"RGB\"]}},{}],98:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],\"rainbow-soft\":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],\"freesurface-blue\":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],\"freesurface-red\":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],\"velocity-blue\":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],\"velocity-green\":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],99:[function(t,e,r){\"use strict\";function n(t){var e,r,n,u,c,h,f,d,p,m,g,v,y,b=[],x=[],_=[],w=[];if(o.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||\"hex\",f=t.colormap,f||(f=\"jet\"),\"string\"==typeof f){if(f=f.toLowerCase(),!l[f])throw Error(f+\" not a supported colorscale\");h=s(l[f])}else{if(!Array.isArray(f))throw Error(\"unsupported colormap option\",f);h=s(f)}if(h.length>p)throw new Error(f+\" map requires nshades to be at least size \"+h.length);for(g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:s(t.alpha):\"number\"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=h.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),y=0;y<e.length;++y)v=h[y].index,r=h[y].rgb,4===r.length&&r[3]>=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(y=0;y<e.length-1;++y)c=e[y+1]-e[y],n=h[y].rgb,u=h[y+1].rgb,b=b.concat(o.linspace(n[0],u[0],c)),x=x.concat(o.linspace(n[1],u[1],c)),_=_.concat(o.linspace(n[2],u[2],c)),w=w.concat(o.linspace(n[3],u[3],c));return b=b.map(Math.round),x=x.map(Math.round),_=_.map(Math.round),m=o.zip(b,x,_,w),\"hex\"===d&&(m=m.map(i)),\"rgbaString\"===d&&(m=m.map(a)),m}function i(t){for(var e,r=\"#\",n=0;n<3;++n)e=t[n],e=e.toString(16),r+=(\"00\"+e).substr(e.length);return r}function a(t){return\"rgba(\"+t.join(\",\")+\")\"}var o=t(\"arraytools\"),s=t(\"clone\"),l=t(\"./colorScales\");e.exports=n},{\"./colorScales\":98,arraytools:46,clone:91}],100:[function(t,e,r){\"use strict\";function n(t,e,r){var n=s(t[0],-e[0]),i=s(t[1],-e[1]),a=s(r[0],-e[0]),o=s(r[1],-e[1]),c=u(l(n,a),l(i,o));return c[c.length-1]>=0}function i(t,e,r,i){var s=a(e,r,i);if(0===s){var l=o(a(t,e,r)),u=o(a(t,e,i));if(l===u){if(0===l){var c=n(t,e,r);return c===n(t,e,i)?0:c?1:-1}return 0}return 0===u?l>0?-1:n(t,e,i)?-1:1:0===l?u>0?1:n(t,e,r)?1:-1:o(u-l)}var h=a(t,e,r);return h>0?s>0&&a(t,e,i)>0?1:-1:h<0?s>0||a(t,e,i)>0?1:-1:a(t,e,i)>0?1:n(t,e,r)?1:-1}e.exports=i;var a=t(\"robust-orientation\"),o=t(\"signum\"),s=t(\"two-sum\"),l=t(\"robust-product\"),u=t(\"robust-sum\")},{\"robust-orientation\":508,\"robust-product\":509,\"robust-sum\":513,signum:515,\"two-sum\":540}],101:[function(t,e,r){function n(t,e){return t-e}function i(t,e){var r=t.length,i=t.length-e.length;if(i)return i;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||a(t[0],t[1])-a(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(i=o+t[2]-(s+e[2]))return i;var l=a(t[0],t[1]),u=a(e[0],e[1]);return a(l,t[2])-a(u,e[2])||a(l+t[2],o)-a(u+e[2],s);case 4:var c=t[0],h=t[1],f=t[2],d=t[3],p=e[0],m=e[1],g=e[2],v=e[3];return c+h+f+d-(p+m+g+v)||a(c,h,f,d)-a(p,m,g,v,p)||a(c+h,c+f,c+d,h+f,h+d,f+d)-a(p+m,p+g,p+v,m+g,m+v,g+v)||a(c+h+f,c+h+d,c+f+d,h+f+d)-a(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var y=t.slice().sort(n),b=e.slice().sort(n),x=0;x<r;++x)if(i=y[x]-b[x])return i;return 0}}e.exports=i;var a=Math.min},{}],102:[function(t,e,r){\"use strict\";function n(t,e){return i(t,e)||a(t)-a(e)}var i=t(\"compare-cell\"),a=t(\"cell-orientation\");e.exports=n},{\"cell-orientation\":85,\"compare-cell\":101}],103:[function(t,e,r){\"use strict\";function n(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;return 0===r?[]:1===r?i(t):2===r?a(t):o(t,r)}var i=t(\"./lib/ch1d\"),a=t(\"./lib/ch2d\"),o=t(\"./lib/chnd\");e.exports=n},{\"./lib/ch1d\":104,\"./lib/ch2d\":105,\"./lib/chnd\":106}],104:[function(t,e,r){\"use strict\";function n(t){for(var e=0,r=0,n=1;n<t.length;++n)t[n][0]<t[e][0]&&(e=n),t[n][0]>t[r][0]&&(r=n);return e<r?[[e],[r]]:e>r?[[r],[e]]:[[e]]}e.exports=n},{}],105:[function(t,e,r){\"use strict\";function n(t){var e=i(t),r=e.length;if(r<=2)return[];for(var n=new Array(r),a=e[r-1],o=0;o<r;++o){var s=e[o];n[o]=[a,s],a=s}return n}e.exports=n;var i=t(\"monotone-convex-hull-2d\")},{\"monotone-convex-hull-2d\":451}],106:[function(t,e,r){\"use strict\";function n(t,e){for(var r=t.length,n=new Array(r),i=0;i<e.length;++i)n[i]=t[e[i]];for(var a=e.length,i=0;i<r;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}function i(t,e){for(var r=t.length,n=e.length,i=0;i<r;++i)for(var a=t[i],o=0;o<a.length;++o){var s=a[o];if(s<n)a[o]=e[s];else{s-=n;for(var l=0;l<n;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}function a(t,e){try{return o(t,!0)}catch(u){var r=s(t);if(r.length<=e)return[];var a=n(t,r),l=o(a,!0);return i(l,r)}}e.exports=a;var o=t(\"incremental-convex-hull\"),s=t(\"affine-hull\")},{\"affine-hull\":41,\"incremental-convex-hull\":290}],107:[function(t,e,r){e.exports={AFG:\"afghan\",ALA:\"\\\\b\\\\wland\",ALB:\"albania\",DZA:\"algeria\",ASM:\"^(?=.*americ).*samoa\",AND:\"andorra\",AGO:\"angola\",AIA:\"anguill?a\",ATA:\"antarctica\",ATG:\"antigua\",ARG:\"argentin\",ARM:\"armenia\",ABW:\"^(?!.*bonaire).*\\\\baruba\",AUS:\"australia\",AUT:\"^(?!.*hungary).*austria|\\\\baustri.*\\\\bemp\",AZE:\"azerbaijan\",BHS:\"bahamas\",BHR:\"bahrain\",BGD:\"bangladesh|^(?=.*east).*paki?stan\",BRB:\"barbados\",BLR:\"belarus|byelo\",BEL:\"^(?!.*luxem).*belgium\",BLZ:\"belize|^(?=.*british).*honduras\",BEN:\"benin|dahome\",BMU:\"bermuda\",BTN:\"bhutan\",BOL:\"bolivia\",BES:\"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\\\bbes.?islands\",BIH:\"herzegovina|bosnia\",BWA:\"botswana|bechuana\",BVT:\"bouvet\",BRA:\"brazil\",IOT:\"british.?indian.?ocean\",BRN:\"brunei\",BGR:\"bulgaria\",BFA:\"burkina|\\\\bfaso|upper.?volta\",BDI:\"burundi\",CPV:\"verde\",KHM:\"cambodia|kampuchea|khmer\",CMR:\"cameroon\",CAN:\"canada\",CYM:\"cayman\",CAF:\"\\\\bcentral.african.republic\",TCD:\"\\\\bchad\",CHL:\"\\\\bchile\",CHN:\"^(?!.*\\\\bmac)(?!.*\\\\bhong)(?!.*\\\\btai)(?!.*\\\\brep).*china|^(?=.*peo)(?=.*rep).*china\",CXR:\"christmas\",CCK:\"\\\\bcocos|keeling\",COL:\"colombia\",COM:\"comoro\",COG:\"^(?!.*\\\\bdem)(?!.*\\\\bd[\\\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\\\bcongo\",COK:\"\\\\bcook\",CRI:\"costa.?rica\",CIV:\"ivoire|ivory\",HRV:\"croatia\",CUB:\"\\\\bcuba\",CUW:\"^(?!.*bonaire).*\\\\bcura(c|\\xe7)ao\",CYP:\"cyprus\",CSK:\"czechoslovakia\",CZE:\"^(?=.*rep).*czech|czechia|bohemia\",COD:\"\\\\bdem.*congo|congo.*\\\\bdem|congo.*\\\\bd[\\\\.]?r|\\\\bd[\\\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc\",DNK:\"denmark\",DJI:\"djibouti\",DMA:\"dominica(?!n)\",DOM:\"dominican.rep\",ECU:\"ecuador\",EGY:\"egypt\",SLV:\"el.?salvador\",GNQ:\"guine.*eq|eq.*guine|^(?=.*span).*guinea\",ERI:\"eritrea\",EST:\"estonia\",ETH:\"ethiopia|abyssinia\",FLK:\"falkland|malvinas\",FRO:\"faroe|faeroe\",FJI:\"fiji\",FIN:\"finland\",FRA:\"^(?!.*\\\\bdep)(?!.*martinique).*france|french.?republic|\\\\bgaul\",GUF:\"^(?=.*french).*guiana\",PYF:\"french.?polynesia|tahiti\",ATF:\"french.?southern\",GAB:\"gabon\",GMB:\"gambia\",GEO:\"^(?!.*south).*georgia\",DDR:\"german.?democratic.?republic|democratic.?republic.*germany|east.germany\",DEU:\"^(?!.*east).*germany|^(?=.*\\\\bfed.*\\\\brep).*german\",GHA:\"ghana|gold.?coast\",GIB:\"gibraltar\",GRC:\"greece|hellenic|hellas\",GRL:\"greenland\",GRD:\"grenada\",GLP:\"guadeloupe\",GUM:\"\\\\bguam\",GTM:\"guatemala\",GGY:\"guernsey\",GIN:\"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea\",GNB:\"bissau|^(?=.*portu).*guinea\",GUY:\"guyana|british.?guiana\",HTI:\"haiti\",HMD:\"heard.*mcdonald\",VAT:\"holy.?see|vatican|papal.?st\",HND:\"^(?!.*brit).*honduras\",HKG:\"hong.?kong\",HUN:\"^(?!.*austr).*hungary\",ISL:\"iceland\",IND:\"india(?!.*ocea)\",IDN:\"indonesia\",IRN:\"\\\\biran|persia\",IRQ:\"\\\\biraq|mesopotamia\",IRL:\"(^ireland)|(^republic.*ireland)\",IMN:\"^(?=.*isle).*\\\\bman\",ISR:\"israel\",ITA:\"italy\",JAM:\"jamaica\",JPN:\"japan\",JEY:\"jersey\",JOR:\"jordan\",KAZ:\"kazak\",KEN:\"kenya|british.?east.?africa|east.?africa.?prot\",KIR:\"kiribati\",PRK:\"^(?=.*democrat|people|north|d.*p.*.r).*\\\\bkorea|dprk|korea.*(d.*p.*r)\",KWT:\"kuwait\",KGZ:\"kyrgyz|kirghiz\",LAO:\"\\\\blaos?\\\\b\",LVA:\"latvia\",LBN:\"lebanon\",LSO:\"lesotho|basuto\",LBR:\"liberia\",LBY:\"libya\",LIE:\"liechtenstein\",LTU:\"lithuania\",LUX:\"^(?!.*belg).*luxem\",MAC:\"maca(o|u)\",MDG:\"madagascar|malagasy\",MWI:\"malawi|nyasa\",MYS:\"malaysia\",MDV:\"maldive\",MLI:\"\\\\bmali\\\\b\",MLT:\"\\\\bmalta\",MHL:\"marshall\",MTQ:\"martinique\",MRT:\"mauritania\",MUS:\"mauritius\",MYT:\"\\\\bmayotte\",MEX:\"\\\\bmexic\",FSM:\"fed.*micronesia|micronesia.*fed\",MCO:\"monaco\",MNG:\"mongolia\",MNE:\"^(?!.*serbia).*montenegro\",MSR:\"montserrat\",MAR:\"morocco|\\\\bmaroc\",MOZ:\"mozambique\",MMR:\"myanmar|burma\",NAM:\"namibia\",NRU:\"nauru\",NPL:\"nepal\",NLD:\"^(?!.*\\\\bant)(?!.*\\\\bcarib).*netherlands\",ANT:\"^(?=.*\\\\bant).*(nether|dutch)\",NCL:\"new.?caledonia\",NZL:\"new.?zealand\",NIC:\"nicaragua\",NER:\"\\\\bniger(?!ia)\",NGA:\"nigeria\",NIU:\"niue\",NFK:\"norfolk\",MNP:\"mariana\",NOR:\"norway\",OMN:\"\\\\boman|trucial\",PAK:\"^(?!.*east).*paki?stan\",PLW:\"palau\",PSE:\"palestin|\\\\bgaza|west.?bank\",PAN:\"panama\",PNG:\"papua|new.?guinea\",PRY:\"paraguay\",PER:\"peru\",PHL:\"philippines\",PCN:\"pitcairn\",POL:\"poland\",PRT:\"portugal\",PRI:\"puerto.?rico\",QAT:\"qatar\",KOR:\"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\\\bkorea(?!.*d.*p.*r)\",MDA:\"moldov|b(a|e)ssarabia\",REU:\"r(e|\\xe9)union\",ROU:\"r(o|u|ou)mania\",RUS:\"\\\\brussia|soviet.?union|u\\\\.?s\\\\.?s\\\\.?r|socialist.?republics\",RWA:\"rwanda\",BLM:\"barth(e|\\xe9)lemy\",SHN:\"helena\",KNA:\"kitts|\\\\bnevis\",LCA:\"\\\\blucia\",MAF:\"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)\",SPM:\"miquelon\",VCT:\"vincent\",WSM:\"^(?!.*amer).*samoa\",SMR:\"san.?marino\",STP:\"\\\\bs(a|\\xe3)o.?tom(e|\\xe9)\",SAU:\"\\\\bsa\\\\w*.?arabia\",SEN:\"senegal\",SRB:\"^(?!.*monte).*serbia\",SYC:\"seychell\",SLE:\"sierra\",SGP:\"singapore\",SXM:\"^(?!.*martin)(?!.*saba).*maarten\",SVK:\"^(?!.*cze).*slovak\",SVN:\"slovenia\",SLB:\"solomon\",SOM:\"somali\",ZAF:\"south.africa|s\\\\\\\\..?africa\",SGS:\"south.?georgia|sandwich\",SSD:\"\\\\bs\\\\w*.?sudan\",ESP:\"spain\",LKA:\"sri.?lanka|ceylon\",SDN:\"^(?!.*\\\\bs(?!u)).*sudan\",SUR:\"surinam|dutch.?guiana\",SJM:\"svalbard\",SWZ:\"swaziland\",SWE:\"sweden\",CHE:\"switz|swiss\",SYR:\"syria\",TWN:\"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china\",TJK:\"tajik\",THA:\"thailand|\\\\bsiam\",MKD:\"macedonia|fyrom\",TLS:\"^(?=.*leste).*timor|^(?=.*east).*timor\",TGO:\"togo\",TKL:\"tokelau\",TON:\"tonga\",TTO:\"trinidad|tobago\",TUN:\"tunisia\",TUR:\"turkey\",TKM:\"turkmen\",TCA:\"turks\",TUV:\"tuvalu\",UGA:\"uganda\",UKR:\"ukrain\",ARE:\"emirates|^u\\\\.?a\\\\.?e\\\\.?$|united.?arab.?em\",GBR:\"united.?kingdom|britain|^u\\\\.?k\\\\.?$\",TZA:\"tanzania\",USA:\"united.?states\\\\b(?!.*islands)|\\\\bu\\\\.?s\\\\.?a\\\\.?\\\\b|^\\\\s*u\\\\.?s\\\\.?\\\\b(?!.*islands)\",UMI:\"minor.?outlying.?is\",URY:\"uruguay\",UZB:\"uzbek\",VUT:\"vanuatu|new.?hebrides\",VEN:\"venezuela\",VNM:\"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam\",VGB:\"^(?=.*\\\\bu\\\\.?\\\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin\",VIR:\"^(?=.*\\\\bu\\\\.?\\\\s?s).*virgin|^(?=.*states).*virgin\",WLF:\"futuna|wallis\",ESH:\"western.sahara\",YEM:\"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\\\bp\\\\.?d\\\\.?r).*yemen\",YMD:\"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\\\bp\\\\.?d\\\\.?r).*yemen\",YUG:\"yugoslavia\",ZMB:\"zambia|northern.?rhodesia\",EAZ:\"zanzibar\",ZWE:\"zimbabwe|^(?!.*northern).*rhodesia\"}},{}],108:[function(t,e,r){function n(t){return t=Math.round(t),t<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return n(\"%\"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return i(\"%\"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,\"\").toLowerCase();if(e in u)return u[e].slice();if(\"#\"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf(\"(\"),l=e.indexOf(\")\");if(-1!==i&&l+1===e.length){var c=e.substr(0,i),h=e.substr(i+1,l-(i+1)).split(\",\"),f=1;switch(c){case\"rgba\":if(4!==h.length)return null;f=o(h.pop());case\"rgb\":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case\"hsla\":if(4!==h.length)return null;f=o(h.pop());case\"hsl\":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,p=o(h[1]),m=o(h[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[n(255*s(v,g,d+1/3)),n(255*s(v,g,d)),n(255*s(v,g,d-1/3)),f];default:return null}}return null}var u={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],\n", | |
"cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],109:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+h*r[d]+f*n[d];return a}return u*t+c*e+h*r+f*n}e.exports=i,e.exports.derivative=n},{}],110:[function(t,e,r){\"use strict\";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName=\"\",this.pre=null,this.body=null,this.post=null,this.debug=!1}function i(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i<r.length;++i){var o=r[i];if(\"array\"===o||\"object\"==typeof o&&o.blockIndices){if(e.argTypes[i]=\"array\",e.arrayArgs.push(i),e.arrayBlockIndices.push(o.blockIndices?o.blockIndices:0),e.shimArgs.push(\"array\"+i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error(\"cwise: pre() block may not reference array args\");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error(\"cwise: post() block may not reference array args\")}else if(\"scalar\"===o)e.scalarArgs.push(i),e.shimArgs.push(\"scalar\"+i);else if(\"index\"===o){if(e.indexArgs.push(i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error(\"cwise: pre() block may not reference array index\");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error(\"cwise: body() block may not write to array index\");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error(\"cwise: post() block may not reference array index\")}else if(\"shape\"===o){if(e.shapeArgs.push(i),i<e.pre.args.length&&e.pre.args[i].lvalue)throw new Error(\"cwise: pre() block may not write to array shape\");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error(\"cwise: body() block may not write to array shape\");if(i<e.post.args.length&&e.post.args[i].lvalue)throw new Error(\"cwise: post() block may not write to array shape\")}else{if(\"object\"!=typeof o||!o.offset)throw new Error(\"cwise: Unknown argument type \"+r[i]);e.argTypes[i]=\"offset\",e.offsetArgs.push({array:o.array,offset:o.offset}),e.offsetArgIndex.push(i)}}if(e.arrayArgs.length<=0)throw new Error(\"cwise: No array arguments specified\");if(e.pre.args.length>r.length)throw new Error(\"cwise: Too many arguments in pre() block\");if(e.body.args.length>r.length)throw new Error(\"cwise: Too many arguments in body() block\");if(e.post.args.length>r.length)throw new Error(\"cwise: Too many arguments in post() block\");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||\"cwise\",e.blockSize=t.blockSize||64,a(e)}var a=t(\"./lib/thunk.js\");e.exports=i},{\"./lib/thunk.js\":112}],111:[function(t,e,r){\"use strict\";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,h=0;for(n=0;n<a;++n)u.push([\"i\",n,\"=0\"].join(\"\"));for(i=0;i<o;++i)for(n=0;n<a;++n)h=c,c=t[n],0===n?u.push([\"d\",i,\"s\",n,\"=t\",i,\"p\",c].join(\"\")):u.push([\"d\",i,\"s\",n,\"=(t\",i,\"p\",c,\"-s\",h,\"*t\",i,\"p\",h,\")\"].join(\"\"));for(u.length>0&&l.push(\"var \"+u.join(\",\")),n=a-1;n>=0;--n)c=t[n],l.push([\"for(i\",n,\"=0;i\",n,\"<s\",c,\";++i\",n,\"){\"].join(\"\"));for(l.push(r),n=0;n<a;++n){for(h=c,c=t[n],i=0;i<o;++i)l.push([\"p\",i,\"+=d\",i,\"s\",n].join(\"\"));s&&(n>0&&l.push([\"index[\",h,\"]-=s\",h].join(\"\")),l.push([\"++index[\",c,\"]\"].join(\"\"))),l.push(\"}\")}return l.join(\"\\n\")}function i(t,e,r,i){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;c<o;++c)u.push([\"var offset\",c,\"=p\",c].join(\"\"));for(var c=t;c<a;++c)u.push([\"for(var j\"+c+\"=SS[\",e[c],\"]|0;j\",c,\">0;){\"].join(\"\")),u.push([\"if(j\",c,\"<\",s,\"){\"].join(\"\")),u.push([\"s\",e[c],\"=j\",c].join(\"\")),u.push([\"j\",c,\"=0\"].join(\"\")),u.push([\"}else{s\",e[c],\"=\",s].join(\"\")),u.push([\"j\",c,\"-=\",s,\"}\"].join(\"\")),l&&u.push([\"index[\",e[c],\"]=j\",c].join(\"\"));for(var c=0;c<o;++c){for(var h=[\"offset\"+c],f=t;f<a;++f)h.push([\"j\",f,\"*t\",c,\"p\",e[f]].join(\"\"));u.push([\"p\",c,\"=(\",h.join(\"+\"),\")\"].join(\"\"))}u.push(n(e,r,i));for(var c=t;c<a;++c)u.push(\"}\");return u.join(\"\\n\")}function a(t){for(var e=0,r=t[0].length;e<r;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}function o(t,e,r){for(var n=t.body,i=[],a=[],o=0;o<t.args.length;++o){var s=t.args[o];if(!(s.count<=0)){var l=new RegExp(s.name,\"g\"),u=\"\",c=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case\"offset\":var h=e.offsetArgIndex.indexOf(o);c=e.offsetArgs[h].array,u=\"+q\"+h;case\"array\":u=\"p\"+c+u;var f=\"l\"+o,d=\"a\"+c;if(0===e.arrayBlockIndices[c])1===s.count?\"generic\"===r[c]?s.lvalue?(i.push([\"var \",f,\"=\",d,\".get(\",u,\")\"].join(\"\")),n=n.replace(l,f),a.push([d,\".set(\",u,\",\",f,\")\"].join(\"\"))):n=n.replace(l,[d,\".get(\",u,\")\"].join(\"\")):n=n.replace(l,[d,\"[\",u,\"]\"].join(\"\")):\"generic\"===r[c]?(i.push([\"var \",f,\"=\",d,\".get(\",u,\")\"].join(\"\")),n=n.replace(l,f),s.lvalue&&a.push([d,\".set(\",u,\",\",f,\")\"].join(\"\"))):(i.push([\"var \",f,\"=\",d,\"[\",u,\"]\"].join(\"\")),n=n.replace(l,f),s.lvalue&&a.push([d,\"[\",u,\"]=\",f].join(\"\")));else{for(var p=[s.name],m=[u],g=0;g<Math.abs(e.arrayBlockIndices[c]);g++)p.push(\"\\\\s*\\\\[([^\\\\]]+)\\\\]\"),m.push(\"$\"+(g+1)+\"*t\"+c+\"b\"+g);if(l=new RegExp(p.join(\"\"),\"g\"),u=m.join(\"+\"),\"generic\"===r[c])throw new Error(\"cwise: Generic arrays not supported in combination with blocks!\");n=n.replace(l,[d,\"[\",u,\"]\"].join(\"\"))}break;case\"scalar\":n=n.replace(l,\"Y\"+e.scalarArgs.indexOf(o));break;case\"index\":n=n.replace(l,\"index\");break;case\"shape\":n=n.replace(l,\"shape\")}}}return[i.join(\"\\n\"),n,a.join(\"\\n\")].join(\"\\n\").trim()}function s(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var i=t[n],a=i.match(/\\d+/);a=a?a[0]:\"\",0===i.charAt(0)?e[n]=\"u\"+i.charAt(1)+a:e[n]=i.charAt(0)+a,n>0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join(\"\")}function l(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,l=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),h=0;h<t.arrayArgs.length;++h)c[h]=e[2*h],l[h]=e[2*h+1];for(var f=[],d=[],p=[],m=[],g=[],h=0;h<t.arrayArgs.length;++h){t.arrayBlockIndices[h]<0?(p.push(0),m.push(r),f.push(r),d.push(r+t.arrayBlockIndices[h])):(p.push(t.arrayBlockIndices[h]),m.push(t.arrayBlockIndices[h]+r),f.push(0),d.push(t.arrayBlockIndices[h]));for(var v=[],y=0;y<l[h].length;y++)p[h]<=l[h][y]&&l[h][y]<m[h]&&v.push(l[h][y]-p[h]);g.push(v)}for(var b=[\"SS\"],x=[\"'use strict'\"],_=[],y=0;y<r;++y)_.push([\"s\",y,\"=SS[\",y,\"]\"].join(\"\"));for(var h=0;h<t.arrayArgs.length;++h){b.push(\"a\"+h),b.push(\"t\"+h),b.push(\"p\"+h);for(var y=0;y<r;++y)_.push([\"t\",h,\"p\",y,\"=t\",h,\"[\",p[h]+y,\"]\"].join(\"\"));for(var y=0;y<Math.abs(t.arrayBlockIndices[h]);++y)_.push([\"t\",h,\"b\",y,\"=t\",h,\"[\",f[h]+y,\"]\"].join(\"\"))}for(var h=0;h<t.scalarArgs.length;++h)b.push(\"Y\"+h);if(t.shapeArgs.length>0&&_.push(\"shape=SS.slice(0)\"),t.indexArgs.length>0){for(var w=new Array(r),h=0;h<r;++h)w[h]=\"0\";_.push([\"index=[\",w.join(\",\"),\"]\"].join(\"\"))}for(var h=0;h<t.offsetArgs.length;++h){for(var M=t.offsetArgs[h],k=[],y=0;y<M.offset.length;++y)0!==M.offset[y]&&(1===M.offset[y]?k.push([\"t\",M.array,\"p\",y].join(\"\")):k.push([M.offset[y],\"*t\",M.array,\"p\",y].join(\"\")));0===k.length?_.push(\"q\"+h+\"=0\"):_.push([\"q\",h,\"=\",k.join(\"+\")].join(\"\"))}var A=u([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));_=_.concat(A),_.length>0&&x.push(\"var \"+_.join(\",\"));for(var h=0;h<t.arrayArgs.length;++h)x.push(\"p\"+h+\"|=0\");t.pre.body.length>3&&x.push(o(t.pre,t,c));var T=o(t.body,t,c),S=a(g);S<r?x.push(i(S,g[0],t,T)):x.push(n(g[0],t,T)),t.post.body.length>3&&x.push(o(t.post,t,c)),t.debug&&console.log(\"-----Generated cwise routine for \",e,\":\\n\"+x.join(\"\\n\")+\"\\n----------\");var E=[t.funcName||\"unnamed\",\"_cwise_loop_\",l[0].join(\"s\"),\"m\",S,s(c)].join(\"\");return new Function([\"function \",E,\"(\",b.join(\",\"),\"){\",x.join(\"\\n\"),\"} return \",E].join(\"\"))()}var u=t(\"uniq\");e.exports=l},{uniq:543}],112:[function(t,e,r){\"use strict\";function n(t){var e=[\"'use strict'\",\"var CACHED={}\"],r=[],n=t.funcName+\"_cwise_thunk\";e.push([\"return function \",n,\"(\",t.shimArgs.join(\",\"),\"){\"].join(\"\"));for(var a=[],o=[],s=[[\"array\",t.arrayArgs[0],\".shape.slice(\",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?\",\"+t.arrayBlockIndices[0]+\")\":\")\"].join(\"\")],l=[],u=[],c=0;c<t.arrayArgs.length;++c){var h=t.arrayArgs[c];r.push([\"t\",h,\"=array\",h,\".dtype,\",\"r\",h,\"=array\",h,\".order\"].join(\"\")),a.push(\"t\"+h),a.push(\"r\"+h),o.push(\"t\"+h),o.push(\"r\"+h+\".join()\"),s.push(\"array\"+h+\".data\"),s.push(\"array\"+h+\".stride\"),s.push(\"array\"+h+\".offset|0\"),c>0&&(l.push(\"array\"+t.arrayArgs[0]+\".shape.length===array\"+h+\".shape.length+\"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push(\"array\"+t.arrayArgs[0]+\".shape[shapeIndex+\"+Math.max(0,t.arrayBlockIndices[0])+\"]===array\"+h+\".shape[shapeIndex+\"+Math.max(0,t.arrayBlockIndices[c])+\"]\"))}t.arrayArgs.length>1&&(e.push(\"if (!(\"+l.join(\" && \")+\")) throw new Error('cwise: Arrays do not all have the same dimensionality!')\"),e.push(\"for(var shapeIndex=array\"+t.arrayArgs[0]+\".shape.length-\"+Math.abs(t.arrayBlockIndices[0])+\"; shapeIndex--\\x3e0;) {\"),e.push(\"if (!(\"+u.join(\" && \")+\")) throw new Error('cwise: Arrays do not all have the same shape!')\"),e.push(\"}\"));for(var c=0;c<t.scalarArgs.length;++c)s.push(\"scalar\"+t.scalarArgs[c]);return r.push([\"type=[\",o.join(\",\"),\"].join()\"].join(\"\")),r.push(\"proc=CACHED[type]\"),e.push(\"var \"+r.join(\",\")),e.push([\"if(!proc){\",\"CACHED[type]=proc=compile([\",a.join(\",\"),\"])}\",\"return proc(\",s.join(\",\"),\")}\"].join(\"\")),t.debug&&console.log(\"-----Generated thunk:\\n\"+e.join(\"\\n\")+\"\\n----------\"),new Function(\"compile\",e.join(\"\\n\"))(i.bind(void 0,t))}var i=t(\"./compile.js\");e.exports=n},{\"./compile.js\":111}],113:[function(t,e,r){e.exports=t(\"cwise-compiler\")},{\"cwise-compiler\":110}],114:[function(e,r,n){!function(e,i){\"object\"==typeof n&&void 0!==r?i(n):\"function\"==typeof t&&t.amd?t([\"exports\"],i):i(e.d3=e.d3||{})}(this,function(t){\"use strict\";function e(t){return function(e,r){return o(t(e),r)}}function r(t,e){return[t,e]}function n(t,e,r){var n=(e-t)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=k?10:a>=A?5:a>=T?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=k?10:a>=A?5:a>=T?2:1)}function i(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=k?i*=10:a>=A?i*=5:a>=T&&(i*=2),e<t?-i:i}function a(t){return t.length}var o=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},s=function(t){return 1===t.length&&(t=e(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},l=s(o),u=l.right,c=l.left,h=function(t,e){null==e&&(e=r);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(a,a=t[++n]);return o},f=function(t,e,n){var i,a,o,s,l=t.length,u=e.length,c=new Array(l*u);for(null==n&&(n=r),i=o=0;i<l;++i)for(s=t[i],a=0;a<u;++a,++o)c[o]=n(s,e[a]);return c},d=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},p=function(t){return null===t?NaN:+t},m=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o<i;)isNaN(r=p(t[o]))||(n=r-s,s+=n/++a,l+=n*(r-s));else for(;++o<i;)isNaN(r=p(e(t[o],o,t)))||(n=r-s,s+=n/++a,l+=n*(r-s));if(a>1)return l/(a-1)},g=function(t,e){var r=m(t,e);return r?Math.sqrt(r):r},v=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o<a;)if(null!=(r=t[o])&&r>=r)for(n=i=r;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),i<r&&(i=r))}else for(;++o<a;)if(null!=(r=e(t[o],o,t))&&r>=r)for(n=i=r;++o<a;)null!=(r=e(t[o],o,t))&&(n>r&&(n=r),i<r&&(i=r));return[n,i]},y=Array.prototype,b=y.slice,x=y.map,_=function(t){return function(){return t}},w=function(t){return t},M=function(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++n<i;)a[n]=t+n*r;return a},k=Math.sqrt(50),A=Math.sqrt(10),T=Math.sqrt(2),S=function(t,e,r){var i,a,o,s=e<t,l=-1;if(s&&(i=t,t=e,e=i),0===(o=n(t,e,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++l<i;)a[l]=(t+l)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),a=new Array(i=Math.ceil(t-e+1));++l<i;)a[l]=(t-l)/o;return s&&a.reverse(),a},E=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},L=function(){function t(t){var a,o,s=t.length,l=new Array(s);for(a=0;a<s;++a)l[a]=e(t[a],a,t);var c=r(l),h=c[0],f=c[1],d=n(l,h,f);Array.isArray(d)||(d=i(h,f,d),d=M(Math.ceil(h/d)*d,Math.floor(f/d)*d,d));for(var p=d.length;d[0]<=h;)d.shift(),--p;for(;d[p-1]>f;)d.pop(),--p;var m,g=new Array(p+1);for(a=0;a<=p;++a)m=g[a]=[],m.x0=a>0?d[a-1]:h,m.x1=a<p?d[a]:f;for(a=0;a<s;++a)o=l[a],h<=o&&o<=f&&g[u(d,o,0,p)].push(t[a]);return g}var e=w,r=v,n=E;return t.value=function(r){return arguments.length?(e=\"function\"==typeof r?r:_(r),t):e},t.domain=function(e){return arguments.length?(r=\"function\"==typeof e?e:_([e[0],e[1]]),t):r},t.thresholds=function(e){return arguments.length?(n=\"function\"==typeof e?e:_(Array.isArray(e)?b.call(e):e),t):n},t},C=function(t,e,r){if(null==r&&(r=p),n=t.length){if((e=+e)<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},I=function(t,e,r){return t=x.call(t,p).sort(o),Math.ceil((r-e)/(2*(C(t,.75)-C(t,.25))*Math.pow(t.length,-1/3)))},z=function(t,e,r){return Math.ceil((r-e)/(3.5*g(t)*Math.pow(t.length,-1/3)))},D=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&r>n&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&r>n&&(n=r);return n},P=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a<n;)isNaN(r=p(t[a]))?--i:o+=r;else for(;++a<n;)isNaN(r=p(e(t[a],a,t)))?--i:o+=r;if(i)return o/i},O=function(t,e){var r,n=t.length,i=-1,a=[];if(null==e)for(;++i<n;)isNaN(r=p(t[i]))||a.push(r);else for(;++i<n;)isNaN(r=p(e(t[i],i,t)))||a.push(r);return C(a.sort(o),.5)},R=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r},F=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&n>r&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&n>r&&(n=r);return n},j=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},N=function(t,e){if(r=t.length){var r,n,i=0,a=0,s=t[a];for(null==e&&(e=o);++i<r;)(e(n=t[i],s)<0||0!==e(s,s))&&(s=n,a=i);return 0===e(s,s)?a:void 0}},B=function(t,e,r){for(var n,i,a=(null==r?t.length:r)-(e=null==e?0:+e);a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},U=function(t,e){var r,n=t.length,i=-1,a=0;if(null==e)for(;++i<n;)(r=+t[i])&&(a+=r);else for(;++i<n;)(r=+e(t[i],i,t))&&(a+=r);return a},V=function(t){if(!(i=t.length))return[];for(var e=-1,r=F(t,a),n=new Array(r);++e<r;)for(var i,o=-1,s=n[e]=new Array(i);++o<i;)s[o]=t[o][e];return n},H=function(){return V(arguments)};t.bisect=u,t.bisectRight=u,t.bisectLeft=c,t.ascending=o,t.bisector=s,t.cross=f,t.descending=d,t.deviation=g,t.extent=v,t.histogram=L,t.thresholdFreedmanDiaconis=I,t.thresholdScott=z,t.thresholdSturges=E,t.max=D,t.mean=P,t.median=O,t.merge=R,t.min=F,t.pairs=h,t.permute=j,t.quantile=C,t.range=M,t.scan=N,t.shuffle=B,t.sum=U,t.ticks=S,t.tickIncrement=n,t.tickStep=i,t.transpose=V,t.variance=m,t.zip=H,Object.defineProperty(t,\"__esModule\",{value:!0})})},{}],115:[function(e,r,n){!function(e,i){\"object\"==typeof n&&void 0!==r?i(n):\"function\"==typeof t&&t.amd?t([\"exports\"],i):i(e.d3=e.d3||{})}(this,function(t){\"use strict\";function e(){}function r(t,r){var n=new e;if(t instanceof e)t.each(function(t,e){n.set(e,t)});else if(Array.isArray(t)){var i,a=-1,o=t.length;if(null==r)for(;++a<o;)n.set(a,t[a]);else for(;++a<o;)n.set(r(i=t[a],a,t),i)}else if(t)for(var s in t)n.set(s,t[s]);return n}function n(){return{}}function i(t,e,r){t[e]=r}function a(){return r()}function o(t,e,r){t.set(e,r)}function s(){}function l(t,e){var r=new s;if(t instanceof s)t.each(function(t){r.add(t)});else if(t){var n=-1,i=t.length;if(null==e)for(;++n<i;)r.add(t[n]);else for(;++n<i;)r.add(e(t[n],n,t))}return r}e.prototype=r.prototype={constructor:e,has:function(t){return\"$\"+t in this},get:function(t){return this[\"$\"+t]},set:function(t,e){return this[\"$\"+t]=e,this},remove:function(t){var e=\"$\"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)\"$\"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)\"$\"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)\"$\"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)\"$\"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)\"$\"===e[0]&&++t;return t},empty:function(){for(var t in this)if(\"$\"===t[0])return!1;return!0},each:function(t){for(var e in this)\"$\"===e[0]&&t(this[e],e.slice(1),this)}};var u=function(){function t(e,n,i,a){if(n>=c.length)return null!=l?l(e):null!=s?e.sort(s):e;for(var o,u,h,f=-1,d=e.length,p=c[n++],m=r(),g=i();++f<d;)(h=m.get(o=p(u=e[f])+\"\"))?h.push(u):m.set(o,[u]);return m.each(function(e,r){a(g,r,t(e,n,i,a))}),g}function e(t,r){if(++r>c.length)return t;var n,i=h[r-1];return null!=l&&r>=c.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,u,c=[],h=[];return u={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return c.push(t),u},sortKeys:function(t){return h[c.length-1]=t,u},sortValues:function(t){return s=t,u},rollup:function(t){return l=t,u}}},c=r.prototype;s.prototype=l.prototype={constructor:s,has:c.has,add:function(t){return t+=\"\",this[\"$\"+t]=t,this},remove:c.remove,clear:c.clear,values:c.keys,size:c.size,empty:c.empty,each:c.each};var h=function(t){var e=[];for(var r in t)e.push(r);return e},f=function(t){var e=[];for(var r in t)e.push(t[r]);return e},d=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e};t.nest=u,t.set=l,t.map=r,t.keys=h,t.values=f,t.entries=d,Object.defineProperty(t,\"__esModule\",{value:!0})})},{}],116:[function(e,r,n){!function(e,i){\"object\"==typeof n&&void 0!==r?i(n):\"function\"==typeof t&&t.amd?t([\"exports\"],i):i(e.d3=e.d3||{})}(this,function(t){\"use strict\";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+\"\").trim().toLowerCase(),(e=I.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=z.exec(t))?i(parseInt(e[1],16)):(e=D.exec(t))?new l(e[1],e[2],e[3],1):(e=P.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=O.exec(t))?a(e[1],e[2],e[3],e[4]):(e=R.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=F.exec(t))?u(e[1],e[2]/100,e[3]/100,1):(e=j.exec(t))?u(e[1],e[2]/100,e[3]/100,e[4]):N.hasOwnProperty(t)?i(N[t]):\"transparent\"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=NaN),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function u(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new f(t,e,r,n)}function c(t){if(t instanceof f)return new f(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new f;if(t instanceof f)return t;t=t.rgb();var e=t.r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=NaN,u=s-o,c=(s+o)/2;return u?(l=e===s?(i-a)/u+6*(i<a):i===s?(a-e)/u+2:(e-i)/u+4,u/=c<.5?s+o:2-s-o,l*=60):u=c>0&&c<1?0:l,new f(l,u,c,t.opacity)}function h(t,e,r,n){return 1===arguments.length?c(t):new f(t,e,r,null==n?1:n)}function f(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function d(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function p(t){if(t instanceof g)return new g(t.l,t.a,t.b,t.opacity);if(t instanceof M){var e=t.h*B;return new g(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=x(t.r),n=x(t.g),i=x(t.b),a=v((.4124564*r+.3575761*n+.1804375*i)/V),s=v((.2126729*r+.7151522*n+.072175*i)/H);return new g(116*s-16,500*(a-s),200*(s-v((.0193339*r+.119192*n+.9503041*i)/q)),t.opacity)}function m(t,e,r,n){return 1===arguments.length?p(t):new g(t,e,r,null==n?1:n)}function g(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function v(t){return t>X?Math.pow(t,1/3):t/W+G}function y(t){return t>Y?t*t*t:W*(t-G)}function b(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function x(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _(t){if(t instanceof M)return new M(t.h,t.c,t.l,t.opacity);t instanceof g||(t=p(t));var e=Math.atan2(t.b,t.a)*U;return new M(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function w(t,e,r,n){return 1===arguments.length?_(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function k(t){if(t instanceof T)return new T(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(rt*n+tt*e-et*r)/(rt+tt-et),a=n-i,s=($*(r-i)-K*a)/Q,u=Math.sqrt(s*s+a*a)/($*i*(1-i)),c=u?Math.atan2(s,a)*U-120:NaN;return new T(c<0?c+360:c,u,i,t.opacity)}function A(t,e,r,n){return 1===arguments.length?k(t):new T(t,e,r,null==n?1:n)}function T(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var S=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},E=\"\\\\s*([+-]?\\\\d+)\\\\s*\",L=\"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",C=\"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",I=/^#([0-9a-f]{3})$/,z=/^#([0-9a-f]{6})$/,D=new RegExp(\"^rgb\\\\(\"+[E,E,E]+\"\\\\)$\"),P=new RegExp(\"^rgb\\\\(\"+[C,C,C]+\"\\\\)$\"),O=new RegExp(\"^rgba\\\\(\"+[E,E,E,L]+\"\\\\)$\"),R=new RegExp(\"^rgba\\\\(\"+[C,C,C,L]+\"\\\\)$\"),F=new RegExp(\"^hsl\\\\(\"+[L,C,C]+\"\\\\)$\"),j=new RegExp(\"^hsla\\\\(\"+[L,C,C,L]+\"\\\\)$\"),N={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};S(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+\"\"}}),S(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?\"rgb(\":\"rgba(\")+Math.max(0,Math.min(255,Math.round(this.r)||0))+\", \"+Math.max(0,Math.min(255,Math.round(this.g)||0))+\", \"+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?\")\":\", \"+t+\")\")}})),S(f,h,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new f(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new f(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(d(t>=240?t-240:t+120,i,n),d(t,i,n),d(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var B=Math.PI/180,U=180/Math.PI,V=.95047,H=1,q=1.08883,G=4/29,Y=6/29,W=3*Y*Y,X=Y*Y*Y;S(g,m,e(r,{brighter:function(t){return new g(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new g(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=H*y(t),e=V*y(e),r=q*y(r),new l(b(3.2404542*e-1.5371385*t-.4985314*r),b(-.969266*e+1.8760108*t+.041556*r),b(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),S(M,w,e(r,{brighter:function(t){return new M(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new M(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return p(this).rgb()}}));var Z=-.14861,J=1.78277,K=-.29227,Q=-.90649,$=1.97294,tt=$*Q,et=$*J,rt=J*K-Q*Z;S(T,A,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new T(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new T(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*B,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(Z*n+J*i)),255*(e+r*(K*n+Q*i)),255*(e+r*($*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=h,t.lab=m,t.hcl=w,t.cubehelix=A,Object.defineProperty(t,\"__esModule\",{value:!0})})},{}],117:[function(e,r,n){!function(e,i){\"object\"==typeof n&&void 0!==r?i(n):\"function\"==typeof t&&t.amd?t([\"exports\"],i):i(e.d3=e.d3||{})}(this,function(t){\"use strict\";function e(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+\"\")||t in i)throw new Error(\"illegal type: \"+t);i[t]=[]}return new r(i)}function r(t){this._=t}function n(t,e){return t.trim().split(/^|\\s+/).map(function(t){var r=\"\",n=t.indexOf(\".\");if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error(\"unknown type: \"+t);return{type:t,name:r}})}function i(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function a(t,e,r){for(var n=0,i=t.length;n<i;++n)if(t[n].name===e){t[n]=o,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=r&&t.push({name:e,value:r}),t}var o={value:function(){}};r.prototype=e.prototype={constructor:r,on:function(t,e){var r,o=this._,s=n(t+\"\",o),l=-1,u=s.length;{if(!(arguments.length<2)){\n", | |
"if(null!=e&&\"function\"!=typeof e)throw new Error(\"invalid callback: \"+e);for(;++l<u;)if(r=(t=s[l]).type)o[r]=a(o[r],t.name,e);else if(null==e)for(r in o)o[r]=a(o[r],t.name,null);return this}for(;++l<u;)if((r=(t=s[l]).type)&&(r=i(o[r],t.name)))return r}},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new r(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error(\"unknown type: \"+t);for(n=this._[t],a=0,r=n.length;a<r;++a)n[a].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error(\"unknown type: \"+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}},t.dispatch=e,Object.defineProperty(t,\"__esModule\",{value:!0})})},{}],118:[function(e,r,n){!function(i,a){\"object\"==typeof n&&void 0!==r?a(n,e(\"d3-quadtree\"),e(\"d3-collection\"),e(\"d3-dispatch\"),e(\"d3-timer\")):\"function\"==typeof t&&t.amd?t([\"exports\",\"d3-quadtree\",\"d3-collection\",\"d3-dispatch\",\"d3-timer\"],a):a(i.d3=i.d3||{},i.d3,i.d3,i.d3,i.d3)}(this,function(t,e,r,n,i){\"use strict\";function a(t){return t.x+t.vx}function o(t){return t.y+t.vy}function s(t){return t.index}function l(t,e){var r=t.get(e);if(!r)throw new Error(\"missing: \"+e);return r}function u(t){return t.x}function c(t){return t.y}var h=function(t,e){function r(){var r,i,a=n.length,o=0,s=0;for(r=0;r<a;++r)i=n[r],o+=i.x,s+=i.y;for(o=o/a-t,s=s/a-e,r=0;r<a;++r)i=n[r],i.x-=o,i.y-=s}var n;return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r},f=function(t){return function(){return t}},d=function(){return 1e-6*(Math.random()-.5)},p=function(t){function r(){function t(t,e,r,n,i){var a=t.data,o=t.r,s=m+o;{if(!a)return e>f+s||n<f-s||r>p+s||i<p-s;if(a.index>h.index){var l=f-a.x-a.vx,c=p-a.y-a.vy,v=l*l+c*c;v<s*s&&(0===l&&(l=d(),v+=l*l),0===c&&(c=d(),v+=c*c),v=(s-(v=Math.sqrt(v)))/v*u,h.vx+=(l*=v)*(s=(o*=o)/(g+o)),h.vy+=(c*=v)*s,a.vx-=l*(s=1-s),a.vy-=c*s)}}}for(var r,i,h,f,p,m,g,v=s.length,y=0;y<c;++y)for(i=e.quadtree(s,a,o).visitAfter(n),r=0;r<v;++r)h=s[r],m=l[h.index],g=m*m,f=h.x+h.vx,p=h.y+h.vy,i.visit(t)}function n(t){if(t.data)return t.r=l[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e<n;++e)r=s[e],l[r.index]=+t(r,e,s)}}var s,l,u=1,c=1;return\"function\"!=typeof t&&(t=f(null==t?1:+t)),r.initialize=function(t){s=t,i()},r.iterations=function(t){return arguments.length?(c=+t,r):c},r.strength=function(t){return arguments.length?(u=+t,r):u},r.radius=function(e){return arguments.length?(t=\"function\"==typeof e?e:f(+e),i(),r):t},r},m=function(t){function e(t){return 1/Math.min(p[t.source.index],p[t.target.index])}function n(e){for(var r=0,n=t.length;r<b;++r)for(var i,a,o,s,l,h,f,p=0;p<n;++p)i=t[p],a=i.source,o=i.target,s=o.x+o.vx-a.x-a.vx||d(),l=o.y+o.vy-a.y-a.vy||d(),h=Math.sqrt(s*s+l*l),h=(h-c[p])/h*e*u[p],s*=h,l*=h,o.vx-=s*(f=m[p]),o.vy-=l*f,a.vx+=s*(f=1-f),a.vy+=l*f}function i(){if(h){var e,n,i=h.length,s=t.length,f=r.map(h,g);for(e=0,p=new Array(i);e<s;++e)n=t[e],n.index=e,\"object\"!=typeof n.source&&(n.source=l(f,n.source)),\"object\"!=typeof n.target&&(n.target=l(f,n.target)),p[n.source.index]=(p[n.source.index]||0)+1,p[n.target.index]=(p[n.target.index]||0)+1;for(e=0,m=new Array(s);e<s;++e)n=t[e],m[e]=p[n.source.index]/(p[n.source.index]+p[n.target.index]);u=new Array(s),a(),c=new Array(s),o()}}function a(){if(h)for(var e=0,r=t.length;e<r;++e)u[e]=+v(t[e],e,t)}function o(){if(h)for(var e=0,r=t.length;e<r;++e)c[e]=+y(t[e],e,t)}var u,c,h,p,m,g=s,v=e,y=f(30),b=1;return null==t&&(t=[]),n.initialize=function(t){h=t,i()},n.links=function(e){return arguments.length?(t=e,i(),n):t},n.id=function(t){return arguments.length?(g=t,n):g},n.iterations=function(t){return arguments.length?(b=+t,n):b},n.strength=function(t){return arguments.length?(v=\"function\"==typeof t?t:f(+t),a(),n):v},n.distance=function(t){return arguments.length?(y=\"function\"==typeof t?t:f(+t),o(),n):y},n},g=10,v=Math.PI*(3-Math.sqrt(5)),y=function(t){function e(){a(),y.call(\"tick\",l),u<c&&(m.stop(),y.call(\"end\",l))}function a(){var e,r,n=t.length;for(u+=(f-u)*h,p.each(function(t){t(u)}),e=0;e<n;++e)r=t[e],null==r.fx?r.x+=r.vx*=d:(r.x=r.fx,r.vx=0),null==r.fy?r.y+=r.vy*=d:(r.y=r.fy,r.vy=0)}function o(){for(var e,r=0,n=t.length;r<n;++r){if(e=t[r],e.index=r,isNaN(e.x)||isNaN(e.y)){var i=g*Math.sqrt(r),a=r*v;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function s(e){return e.initialize&&e.initialize(t),e}var l,u=1,c=.001,h=1-Math.pow(c,1/300),f=0,d=.6,p=r.map(),m=i.timer(e),y=n.dispatch(\"tick\",\"end\");return null==t&&(t=[]),o(),l={tick:a,restart:function(){return m.restart(e),l},stop:function(){return m.stop(),l},nodes:function(e){return arguments.length?(t=e,o(),p.each(s),l):t},alpha:function(t){return arguments.length?(u=+t,l):u},alphaMin:function(t){return arguments.length?(c=+t,l):c},alphaDecay:function(t){return arguments.length?(h=+t,l):+h},alphaTarget:function(t){return arguments.length?(f=+t,l):f},velocityDecay:function(t){return arguments.length?(d=1-t,l):1-d},force:function(t,e){return arguments.length>1?(null==e?p.remove(t):p.set(t,s(e)),l):p.get(t)},find:function(e,r,n){var i,a,o,s,l,u=0,c=t.length;for(null==n?n=1/0:n*=n,u=0;u<c;++u)s=t[u],i=e-s.x,a=r-s.y,(o=i*i+a*a)<n&&(l=s,n=o);return l},on:function(t,e){return arguments.length>1?(y.on(t,e),l):y.on(t)}}},b=function(){function t(t){var r,l=a.length,h=e.quadtree(a,u,c).visitAfter(n);for(s=t,r=0;r<l;++r)o=a[r],h.visit(i)}function r(){if(a){var t,e,r=a.length;for(l=new Array(r),t=0;t<r;++t)e=a[t],l[e.index]=+h(e,t,a)}}function n(t){var e,r,n,i,a,o=0;if(t.length){for(n=i=a=0;a<4;++a)(e=t[a])&&(r=e.value)&&(o+=r,n+=r*e.x,i+=r*e.y);t.x=n/o,t.y=i/o}else{e=t,e.x=e.data.x,e.y=e.data.y;do{o+=l[e.data.index]}while(e=e.next)}t.value=o}function i(t,e,r,n){if(!t.value)return!0;var i=t.x-o.x,a=t.y-o.y,u=n-e,c=i*i+a*a;if(u*u/g<c)return c<m&&(0===i&&(i=d(),c+=i*i),0===a&&(a=d(),c+=a*a),c<p&&(c=Math.sqrt(p*c)),o.vx+=i*t.value*s/c,o.vy+=a*t.value*s/c),!0;if(!(t.length||c>=m)){(t.data!==o||t.next)&&(0===i&&(i=d(),c+=i*i),0===a&&(a=d(),c+=a*a),c<p&&(c=Math.sqrt(p*c)));do{t.data!==o&&(u=l[t.data.index]*s/c,o.vx+=i*u,o.vy+=a*u)}while(t=t.next)}}var a,o,s,l,h=f(-30),p=1,m=1/0,g=.81;return t.initialize=function(t){a=t,r()},t.strength=function(e){return arguments.length?(h=\"function\"==typeof e?e:f(+e),r(),t):h},t.distanceMin=function(e){return arguments.length?(p=e*e,t):Math.sqrt(p)},t.distanceMax=function(e){return arguments.length?(m=e*e,t):Math.sqrt(m)},t.theta=function(e){return arguments.length?(g=e*e,t):Math.sqrt(g)},t},x=function(t){function e(t){for(var e,r=0,o=n.length;r<o;++r)e=n[r],e.vx+=(a[r]-e.x)*i[r]*t}function r(){if(n){var e,r=n.length;for(i=new Array(r),a=new Array(r),e=0;e<r;++e)i[e]=isNaN(a[e]=+t(n[e],e,n))?0:+o(n[e],e,n)}}var n,i,a,o=f(.1);return\"function\"!=typeof t&&(t=f(null==t?0:+t)),e.initialize=function(t){n=t,r()},e.strength=function(t){return arguments.length?(o=\"function\"==typeof t?t:f(+t),r(),e):o},e.x=function(n){return arguments.length?(t=\"function\"==typeof n?n:f(+n),r(),e):t},e},_=function(t){function e(t){for(var e,r=0,o=n.length;r<o;++r)e=n[r],e.vy+=(a[r]-e.y)*i[r]*t}function r(){if(n){var e,r=n.length;for(i=new Array(r),a=new Array(r),e=0;e<r;++e)i[e]=isNaN(a[e]=+t(n[e],e,n))?0:+o(n[e],e,n)}}var n,i,a,o=f(.1);return\"function\"!=typeof t&&(t=f(null==t?0:+t)),e.initialize=function(t){n=t,r()},e.strength=function(t){return arguments.length?(o=\"function\"==typeof t?t:f(+t),r(),e):o},e.y=function(n){return arguments.length?(t=\"function\"==typeof n?n:f(+n),r(),e):t},e};t.forceCenter=h,t.forceCollide=p,t.forceLink=m,t.forceManyBody=b,t.forceSimulation=y,t.forceX=x,t.forceY=_,Object.defineProperty(t,\"__esModule\",{value:!0})})},{\"d3-collection\":115,\"d3-dispatch\":117,\"d3-quadtree\":120,\"d3-timer\":121}],119:[function(e,r,n){!function(i,a){\"object\"==typeof n&&void 0!==r?a(n,e(\"d3-color\")):\"function\"==typeof t&&t.amd?t([\"exports\",\"d3-color\"],a):a(i.d3=i.d3||{},i.d3)}(this,function(t,e){\"use strict\";function r(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}function n(t,e){return function(r){return t+r*e}}function i(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function a(t,e){var r=e-t;return r?n(t,r>180||r<-180?r-360*Math.round(r/360):r):S(isNaN(t)?e:t)}function o(t){return 1==(t=+t)?s:function(e,r){return r-e?i(e,r,t):S(isNaN(e)?r:e)}}function s(t,e){var r=e-t;return r?n(t,r):S(isNaN(t)?e:t)}function l(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n<a;++n)i=e.rgb(r[n]),o[n]=i.r||0,s[n]=i.g||0,l[n]=i.b||0;return o=t(o),s=t(s),l=t(l),i.opacity=1,function(t){return i.r=o(t),i.g=s(t),i.b=l(t),i+\"\"}}}function u(t){return function(){return t}}function c(t){return function(e){return t(e)+\"\"}}function h(t){return\"none\"===t?U:(_||(_=document.createElement(\"DIV\"),w=document.documentElement,M=document.defaultView),_.style.transform=t,t=M.getComputedStyle(w.appendChild(_),null).getPropertyValue(\"transform\"),w.removeChild(_),t=t.slice(7,-1).split(\",\"),V(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function f(t){return null==t?U:(k||(k=document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\")),k.setAttribute(\"transform\",t),(t=k.transform.baseVal.consolidate())?(t=t.matrix,V(t.a,t.b,t.c,t.d,t.e,t.f)):U)}function d(t,e,r,n){function i(t){return t.length?t.pop()+\" \":\"\"}function a(t,n,i,a,o,s){if(t!==i||n!==a){var l=o.push(\"translate(\",null,e,null,r);s.push({i:l-4,x:D(t,i)},{i:l-2,x:D(n,a)})}else(i||a)&&o.push(\"translate(\"+i+e+a+r)}function o(t,e,r,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+\"rotate(\",null,n)-2,x:D(t,e)})):e&&r.push(i(r)+\"rotate(\"+e+n)}function s(t,e,r,a){t!==e?a.push({i:r.push(i(r)+\"skewX(\",null,n)-2,x:D(t,e)}):e&&r.push(i(r)+\"skewX(\"+e+n)}function l(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+\"scale(\",null,\",\",null,\")\");o.push({i:s-4,x:D(t,r)},{i:s-2,x:D(e,n)})}else 1===r&&1===n||a.push(i(a)+\"scale(\"+r+\",\"+n+\")\")}return function(e,r){var n=[],i=[];return e=t(e),r=t(r),a(e.translateX,e.translateY,r.translateX,r.translateY,n,i),o(e.rotate,r.rotate,n,i),s(e.skewX,r.skewX,n,i),l(e.scaleX,e.scaleY,r.scaleX,r.scaleY,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r<a;)n[(e=i[r]).i]=e.x(t);return n.join(\"\")}}}function p(t){return((t=Math.exp(t))+1/t)/2}function m(t){return((t=Math.exp(t))-1/t)/2}function g(t){return((t=Math.exp(2*t))-1)/(t+1)}function v(t){return function(r,n){var i=t((r=e.hsl(r)).h,(n=e.hsl(n)).h),a=s(r.s,n.s),o=s(r.l,n.l),l=s(r.opacity,n.opacity);return function(t){return r.h=i(t),r.s=a(t),r.l=o(t),r.opacity=l(t),r+\"\"}}}function y(t,r){var n=s((t=e.lab(t)).l,(r=e.lab(r)).l),i=s(t.a,r.a),a=s(t.b,r.b),o=s(t.opacity,r.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=a(e),t.opacity=o(e),t+\"\"}}function b(t){return function(r,n){var i=t((r=e.hcl(r)).h,(n=e.hcl(n)).h),a=s(r.c,n.c),o=s(r.l,n.l),l=s(r.opacity,n.opacity);return function(t){return r.h=i(t),r.c=a(t),r.l=o(t),r.opacity=l(t),r+\"\"}}}function x(t){return function r(n){function i(r,i){var a=t((r=e.cubehelix(r)).h,(i=e.cubehelix(i)).h),o=s(r.s,i.s),l=s(r.l,i.l),u=s(r.opacity,i.opacity);return function(t){return r.h=a(t),r.s=o(t),r.l=l(Math.pow(t,n)),r.opacity=u(t),r+\"\"}}return n=+n,i.gamma=r,i}(1)}var _,w,M,k,A=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=i<e-1?t[i+2]:2*o-a;return r((n-i/e)*e,s,a,o,l)}},T=function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),a=t[(i+e-1)%e],o=t[i%e],s=t[(i+1)%e],l=t[(i+2)%e];return r((n-i/e)*e,a,o,s,l)}},S=function(t){return function(){return t}},E=function t(r){function n(t,r){var n=i((t=e.rgb(t)).r,(r=e.rgb(r)).r),a=i(t.g,r.g),o=i(t.b,r.b),l=s(t.opacity,r.opacity);return function(e){return t.r=n(e),t.g=a(e),t.b=o(e),t.opacity=l(e),t+\"\"}}var i=o(r);return n.gamma=t,n}(1),L=l(A),C=l(T),I=function(t,e){var r,n=e?e.length:0,i=t?Math.min(n,t.length):0,a=new Array(n),o=new Array(n);for(r=0;r<i;++r)a[r]=j(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(t){for(r=0;r<i;++r)o[r]=a[r](t);return o}},z=function(t,e){var r=new Date;return t=+t,e-=t,function(n){return r.setTime(t+e*n),r}},D=function(t,e){return t=+t,e-=t,function(r){return t+e*r}},P=function(t,e){var r,n={},i={};null!==t&&\"object\"==typeof t||(t={}),null!==e&&\"object\"==typeof e||(e={});for(r in e)r in t?n[r]=j(t[r],e[r]):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}},O=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,R=new RegExp(O.source,\"g\"),F=function(t,e){var r,n,i,a=O.lastIndex=R.lastIndex=0,o=-1,s=[],l=[];for(t+=\"\",e+=\"\";(r=O.exec(t))&&(n=R.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:D(r,n)})),a=R.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?c(l[0].x):u(e):(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join(\"\")})},j=function(t,r){var n,i=typeof r;return null==r||\"boolean\"===i?S(r):(\"number\"===i?D:\"string\"===i?(n=e.color(r))?(r=n,E):F:r instanceof e.color?E:r instanceof Date?z:Array.isArray(r)?I:\"function\"!=typeof r.valueOf&&\"function\"!=typeof r.toString||isNaN(r)?P:D)(t,r)},N=function(t,e){return t=+t,e-=t,function(r){return Math.round(t+e*r)}},B=180/Math.PI,U={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},V=function(t,e,r,n,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),t*n<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*B,skewX:Math.atan(l)*B,scaleX:o,scaleY:s}},H=d(h,\"px, \",\"px)\",\"deg)\"),q=d(f,\", \",\")\",\")\"),G=Math.SQRT2,Y=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,h=l-a,f=c*c+h*h;if(f<1e-12)n=Math.log(u/o)/G,r=function(t){return[i+t*c,a+t*h,o*Math.exp(G*t*n)]};else{var d=Math.sqrt(f),v=(u*u-o*o+4*f)/(2*o*2*d),y=(u*u-o*o-4*f)/(2*u*2*d),b=Math.log(Math.sqrt(v*v+1)-v),x=Math.log(Math.sqrt(y*y+1)-y);n=(x-b)/G,r=function(t){var e=t*n,r=p(b),s=o/(2*d)*(r*g(G*e+b)-m(b));return[i+s*c,a+s*h,o*r/p(G*e+b)]}}return r.duration=1e3*n,r},W=v(a),X=v(s),Z=b(a),J=b(s),K=x(a),Q=x(s),$=function(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t(n/(e-1));return r};t.interpolate=j,t.interpolateArray=I,t.interpolateBasis=A,t.interpolateBasisClosed=T,t.interpolateDate=z,t.interpolateNumber=D,t.interpolateObject=P,t.interpolateRound=N,t.interpolateString=F,t.interpolateTransformCss=H,t.interpolateTransformSvg=q,t.interpolateZoom=Y,t.interpolateRgb=E,t.interpolateRgbBasis=L,t.interpolateRgbBasisClosed=C,t.interpolateHsl=W,t.interpolateHslLong=X,t.interpolateLab=y,t.interpolateHcl=Z,t.interpolateHclLong=J,t.interpolateCubehelix=K,t.interpolateCubehelixLong=Q,t.quantize=$,Object.defineProperty(t,\"__esModule\",{value:!0})})},{\"d3-color\":116}],120:[function(e,r,n){!function(e,i){\"object\"==typeof n&&void 0!==r?i(n):\"function\"==typeof t&&t.amd?t([\"exports\"],i):i(e.d3=e.d3||{})}(this,function(t){\"use strict\";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,u,c,h,f,d=t._root,p={data:n},m=t._x0,g=t._y0,v=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((u=e>=(a=(m+v)/2))?m=a:v=a,(c=r>=(o=(g+y)/2))?g=o:y=o,i=d,!(d=d[h=c<<1|u]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(u=e>=(a=(m+v)/2))?m=a:v=a,(c=r>=(o=(g+y)/2))?g=o:y=o}while((h=c<<1|u)==(f=(l>=o)<<1|s>=a));return i[f]=d,i[h]=p,t}function r(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),u=1/0,c=1/0,h=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,r=t[n]))||isNaN(a=+this._y.call(null,r))||(s[n]=i,l[n]=a,i<u&&(u=i),i>h&&(h=i),a<c&&(c=a),a>f&&(f=a));for(h<u&&(u=this._x0,h=this._x1),f<c&&(c=this._y0,f=this._y1),this.cover(u,c).cover(h,f),n=0;n<o;++n)e(this,s[n],l[n],t[n]);return this}function n(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this}function i(t){return t[0]}function a(t){return t[1]}function o(t,e,r){var n=new s(null==e?i:e,null==r?a:r,NaN,NaN,NaN,NaN);return null==t?n:n.addAll(t)}function s(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function l(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var u=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},c=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(t))+1,a=(n=Math.floor(e))+1;else{if(!(r>t||t>i||n>e||e>a))return this;var o,s,l=i-r,u=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=u,u=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=u,u=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=u,u=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=u,u=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},h=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},f=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},d=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},p=function(t,e,r){var n,i,a,o,s,l,u,c=this._x0,h=this._y0,f=this._x1,p=this._y1,m=[],g=this._root;for(g&&m.push(new d(g,c,h,f,p)),null==r?r=1/0:(c=t-r,h=e-r,f=t+r,p=e+r,r*=r);l=m.pop();)if(!(!(g=l.node)||(i=l.x0)>f||(a=l.y0)>p||(o=l.x1)<c||(s=l.y1)<h))if(g.length){var v=(i+o)/2,y=(a+s)/2;m.push(new d(g[3],v,y,o,s),new d(g[2],i,y,v,s),new d(g[1],v,a,o,y),new d(g[0],i,a,v,y)),(u=(e>=y)<<1|t>=v)&&(l=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=l)}else{var b=t-+this._x.call(null,g.data),x=e-+this._y.call(null,g.data),_=b*b+x*x;if(_<r){var w=Math.sqrt(r=_);c=t-w,h=e-w,f=t+w,p=e+w,n=g.data}}return n},m=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,r,n,i,a,o,s,l,u,c,h,f,d=this._root,p=this._x0,m=this._y0,g=this._x1,v=this._y1;if(!d)return this;if(d.length)for(;;){if((u=a>=(s=(p+g)/2))?p=s:g=s,(c=o>=(l=(m+v)/2))?m=l:v=l,e=d,!(d=d[h=c<<1|u]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[f]=d:this._root=d),this):(this._root=i,this)},g=function(){return this._root},v=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},y=function(t){var e,r,n,i,a,o,s=[],l=this._root;for(l&&s.push(new d(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,n=e.x0,i=e.y0,a=e.x1,o=e.y1)&&l.length){var u=(n+a)/2,c=(i+o)/2;(r=l[3])&&s.push(new d(r,u,c,a,o)),(r=l[2])&&s.push(new d(r,n,c,u,o)),(r=l[1])&&s.push(new d(r,u,i,a,c)),(r=l[0])&&s.push(new d(r,n,i,u,c))}return this},b=function(t){var e,r=[],n=[];for(this._root&&r.push(new d(this._root,this._x0,this._y0,this._x1,this._y1));e=r.pop();){var i=e.node;if(i.length){var a,o=e.x0,s=e.y0,l=e.x1,u=e.y1,c=(o+l)/2,h=(s+u)/2;(a=i[0])&&r.push(new d(a,o,s,c,h)),(a=i[1])&&r.push(new d(a,c,s,l,h)),(a=i[2])&&r.push(new d(a,o,h,c,u)),(a=i[3])&&r.push(new d(a,c,h,l,u))}n.push(e)}for(;e=n.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},x=function(t){return arguments.length?(this._x=t,this):this._x},_=function(t){return arguments.length?(this._y=t,this):this._y},w=o.prototype=s.prototype;w.copy=function(){var t,e,r=new s(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=l(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=l(e));return r},w.add=u,w.addAll=r,w.cover=c,w.data=h,w.extent=f,w.find=p,w.remove=m,w.removeAll=n,w.root=g,w.size=v,w.visit=y,w.visitAfter=b,w.x=x,w.y=_,t.quadtree=o,Object.defineProperty(t,\"__esModule\",{value:!0})})},{}],121:[function(e,r,n){!function(e,i){\"object\"==typeof n&&void 0!==r?i(n):\"function\"==typeof t&&t.amd?t([\"exports\"],i):i(e.d3=e.d3||{})}(this,function(t){\"use strict\";function e(){return v||(x(r),v=b.now()+y)}function r(){v=0}function n(){this._call=this._time=this._next=null}function i(t,e,r){var i=new n;return i.restart(t,e,r),i}function a(){e(),++f;for(var t,r=c;r;)(t=v-r._time)>=0&&r._call.call(null,t),r=r._next;--f}function o(){v=(g=b.now())+y,f=d=0;try{a()}finally{f=0,l(),v=0}}function s(){var t=b.now(),e=t-g;e>m&&(y-=e,g=t)}function l(){for(var t,e,r=c,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:c=e);h=t,u(n)}function u(t){if(!f){d&&(d=clearTimeout(d));var e=t-v;e>24?(t<1/0&&(d=setTimeout(o,e)),p&&(p=clearInterval(p))):(p||(g=v,p=setInterval(s,m)),f=1,x(o))}}var c,h,f=0,d=0,p=0,m=1e3,g=0,v=0,y=0,b=\"object\"==typeof performance&&performance.now?performance:Date,x=\"function\"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if(\"function\"!=typeof t)throw new TypeError(\"callback is not a function\");n=(null==n?e():+n)+(null==r?0:+r),this._next||h===this||(h?h._next=this:c=this,h=this),this._call=t,this._time=n,u()},stop:function(){this._call&&(this._call=null,this._time=1/0,u())}};var _=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},w=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=_,t.interval=w,Object.defineProperty(t,\"__esModule\",{value:!0})})},{}],122:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function a(t){return null===t?NaN:+t}function o(t){return!isNaN(t)}function s(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function h(){this._=Object.create(null)}function f(t){return(t+=\"\")===_o||t[0]===wo?wo+t:t}function d(t){return(t+=\"\")[0]===wo?t.slice(1):t}function p(t){return f(t)in this._}function m(t){return(t=f(t))in this._&&delete this._[t]}function g(){var t=[];for(var e in this._)t.push(d(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function x(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=Mo.length;r<n;++r){var i=Mo[r]+e;if(i in t)return i}}function M(){}function k(){}function A(t){function e(){for(var e,n=r,i=-1,a=n.length;++i<a;)(e=n[i].on)&&e.apply(this,arguments);return t}var r=[],n=new h;return e.on=function(e,i){var a,o=n.get(e);return arguments.length<2?o&&o.on:(o&&(o.on=null,r=r.slice(0,a=r.indexOf(o)).concat(r.slice(a+1)),n.remove(e)),i&&r.push(n.set(e,{on:i})),t)},e}function T(){uo.event.preventDefault()}function S(){for(var t,e=uo.event;t=e.sourceEvent;)e=t;return e}function E(t){for(var e=new k,r=0,n=arguments.length;++r<n;)e[arguments[r]]=A(e);return e.of=function(r,n){return function(i){try{var a=i.sourceEvent=uo.event;i.target=t,uo.event=i,e[i.type].apply(r,n)}finally{uo.event=a}}},e}function L(t){return Ao(t,Lo),t}function C(t){return\"function\"==typeof t?t:function(){return To(t,this)}}function I(t){return\"function\"==typeof t?t:function(){return So(t,this)}}function z(t,e){function r(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function a(){this.setAttributeNS(t.space,t.local,e)}function o(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}function s(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}return t=uo.ns.qualify(t),null==e?t.local?n:r:\"function\"==typeof e?t.local?s:o:t.local?a:i}function D(t){return t.trim().replace(/\\s+/g,\" \")}function P(t){return new RegExp(\"(?:^|\\\\s+)\"+uo.requote(t)+\"(?:\\\\s+|$)\",\"g\")}function O(t){return(t+\"\").trim().split(/^|\\s+/)}function R(t,e){function r(){for(var r=-1;++r<i;)t[r](this,e)}function n(){for(var r=-1,n=e.apply(this,arguments);++r<i;)t[r](this,n)}t=O(t).map(F);var i=t.length;return\"function\"==typeof e?n:r}function F(t){var e=P(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute(\"class\")||\"\";n?(e.lastIndex=0,e.test(i)||r.setAttribute(\"class\",D(i+\" \"+t))):r.setAttribute(\"class\",D(i.replace(e,\" \")))}}function j(t,e,r){function n(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,r)}function a(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}return null==e?n:\"function\"==typeof e?a:i}function N(t,e){function r(){delete this[t]}function n(){this[t]=e}function i(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}return null==e?r:\"function\"==typeof e?i:n}function B(t){function e(){var e=this.ownerDocument,r=this.namespaceURI;return r===Co&&e.documentElement.namespaceURI===Co?e.createElement(t):e.createElementNS(r,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return\"function\"==typeof t?t:(t=uo.ns.qualify(t)).local?r:e}function U(){var t=this.parentNode;t&&t.removeChild(this)}function V(t){return{__data__:t}}function H(t){return function(){return Eo(this,t)}}function q(t){return arguments.length||(t=i),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function G(t,e){for(var r=0,n=t.length;r<n;r++)for(var i,a=t[r],o=0,s=a.length;o<s;o++)(i=a[o])&&e(i,o,r);return t}function Y(t){return Ao(t,zo),t}function W(t){var e,r;return function(n,i,a){var o,s=t[a].update,l=s.length;for(a!=r&&(r=a,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e<l;);return o}}function X(t,e,r){function n(){var e=this[o];e&&(this.removeEventListener(t,e,e.$),delete this[o])}function i(){var i=l(e,ho(arguments));n.call(this),this.addEventListener(t,this[o]=i,i.$=r),i._=e}function a(){var e,r=new RegExp(\"^__on([^.]+)\"+uo.requote(t)+\"$\");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}var o=\"__on\"+t,s=t.indexOf(\".\"),l=Z;s>0&&(t=t.slice(0,s));var u=Do.get(t);return u&&(t=u,l=J),s?e?i:n:e?M:a}function Z(t,e){return function(r){var n=uo.event;uo.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{uo.event=n}}}function J(t,e){var r=Z(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function K(t){var r=\".dragsuppress-\"+ ++Oo,i=\"click\"+r,a=uo.select(n(t)).on(\"touchmove\"+r,T).on(\"dragstart\"+r,T).on(\"selectstart\"+r,T);if(null==Po&&(Po=!(\"onselectstart\"in t)&&w(t.style,\"userSelect\")),Po){var o=e(t).style,s=o[Po];o[Po]=\"none\"}return function(t){if(a.on(r,null),Po&&(o[Po]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){T(),e()},!0),setTimeout(e,0)}}}function Q(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(Ro<0){var a=n(t);if(a.scrollX||a.scrollY){r=uo.select(\"body\").append(\"svg\").style({position:\"absolute\",top:0,left:0,margin:0,padding:0,border:\"none\"},\"important\");var o=r[0][0].getScreenCTM();Ro=!(o.f||o.e),r.remove()}}return Ro?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function $(){return uo.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function rt(t){return t>1?0:t<-1?No:Math.acos(t)}function nt(t){return t>1?Vo:t<-1?-Vo:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function at(t){return((t=Math.exp(t))+1/t)/2}function ot(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ut(t,e,r){return this instanceof ut?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):Mt(\"\"+t,kt,ut):new ut(t,e,r)}function ct(t,e,r){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?a+(o-a)*t/60:t<180?o:t<240?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*n(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,o=r<=.5?r*(1+e):r+e-r*e,a=2*r-o,new bt(i(t+120),i(t),i(t-120))}function ht(t,e,r){return this instanceof ht?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ht?new ht(t.h,t.c,t.l):t instanceof dt?mt(t.l,t.a,t.b):mt((t=At((t=uo.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ht(t,e,r)}function ft(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new dt(r,Math.cos(t*=Ho)*e,Math.sin(t)*e)}function dt(t,e,r){return this instanceof dt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ht?ft(t.h,t.c,t.l):At((t=bt(t)).r,t.g,t.b):new dt(t,e,r)}function pt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=gt(i)*Qo,n=gt(n)*$o,a=gt(a)*ts,new bt(yt(3.2404542*i-1.5371385*n-.4985314*a),yt(-.969266*i+1.8760108*n+.041556*a),yt(.0556434*i-.2040259*n+1.0572252*a))}function mt(t,e,r){return t>0?new ht(Math.atan2(r,e)*qo,Math.sqrt(e*e+r*r),t):new ht(NaN,NaN,t)}function gt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function vt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,e,r){return this instanceof bt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):Mt(\"\"+t,bt,ct):new bt(t,e,r)}function xt(t){return new bt(t>>16,t>>8&255,255&t)}function _t(t){return xt(t)+\"\"}function wt(t){return t<16?\"0\"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function Mt(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\\((.*)\\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(\",\"),n[1]){case\"hsl\":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case\"rgb\":return e(St(i[0]),St(i[1]),St(i[2]))}return(a=ns.get(t))?e(a.r,a.g,a.b):(null==t||\"#\"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function kt(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new ut(n,i,l)}function At(t,e,r){t=Tt(t),e=Tt(e),r=Tt(r);var n=vt((.4124564*t+.3575761*e+.1804375*r)/Qo),i=vt((.2126729*t+.7151522*e+.072175*r)/$o);return dt(116*i-16,500*(n-i),200*(i-vt((.0193339*t+.119192*e+.9503041*r)/ts)))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function St(t){var e=parseFloat(t);return\"%\"===t.charAt(t.length-1)?Math.round(2.55*e):e}\n", | |
"function Et(t){return\"function\"==typeof t?t:function(){return t}}function Lt(t){return function(e,r,n){return 2===arguments.length&&\"function\"==typeof r&&(n=r,r=null),Ct(e,r,t,n)}}function Ct(t,e,r,n){function i(){var t,e=l.status;if(!e&&zt(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=uo.dispatch(\"beforesend\",\"progress\",\"load\",\"error\"),s={},l=new XMLHttpRequest,u=null;return!this.XDomainRequest||\"withCredentials\"in l||!/^(http(s)?:)?\\/\\//.test(t)||(l=new XDomainRequest),\"onload\"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=uo.event;uo.event=t;try{o.progress.call(a,l)}finally{uo.event=e}},a.header=function(t,e){return t=(t+\"\").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+\"\",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+\"\",a):e},a.responseType=function(t){return arguments.length?(u=t,a):u},a.response=function(t){return r=t,a},[\"get\",\"post\"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ho(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&\"function\"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||\"accept\"in s||(s.accept=e+\",*/*\"),l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=u&&(l.responseType=u),null!=i&&a.on(\"error\",i).on(\"load\",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},uo.rebind(a,o,\"on\"),null==n?a:a.get(It(n))}function It(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function zt(t){var e=t.responseType;return e&&\"text\"!==e?t.response:t.responseText}function Dt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i=r+e,a={c:t,t:i,n:null};return as?as.n=a:is=a,as=a,os||(ss=clearTimeout(ss),os=1,ls(Pt)),a}function Pt(){var t=Ot(),e=Rt()-t;e>24?(isFinite(e)&&(clearTimeout(ss),ss=setTimeout(Pt,e)),os=0):(os=1,ls(Pt))}function Ot(){for(var t=Date.now(),e=is;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Rt(){for(var t,e=is,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:is=e.n;return as=t,r}function Ft(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function jt(t,e){var r=Math.pow(10,3*xo(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Nt(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:x;return function(t){var r=cs.exec(t),n=r[1]||\" \",o=r[2]||\">\",s=r[3]||\"-\",l=r[4]||\"\",u=r[5],c=+r[6],h=r[7],f=r[8],d=r[9],p=1,m=\"\",g=\"\",v=!1,y=!0;switch(f&&(f=+f.substring(1)),(u||\"0\"===n&&\"=\"===o)&&(u=n=\"0\",o=\"=\"),d){case\"n\":h=!0,d=\"g\";break;case\"%\":p=100,g=\"%\",d=\"f\";break;case\"p\":p=100,g=\"%\",d=\"r\";break;case\"b\":case\"o\":case\"x\":case\"X\":\"#\"===l&&(m=\"0\"+d.toLowerCase());case\"c\":y=!1;case\"d\":v=!0,f=0;break;case\"s\":p=-1,d=\"r\"}\"$\"===l&&(m=i[0],g=i[1]),\"r\"!=d||f||(d=\"g\"),null!=f&&(\"g\"==d?f=Math.max(1,Math.min(21,f)):\"e\"!=d&&\"f\"!=d||(f=Math.max(0,Math.min(20,f)))),d=hs.get(d)||Bt;var b=u&&h;return function(t){var r=g;if(v&&t%1)return\"\";var i=t<0||0===t&&1/t<0?(t=-t,\"-\"):\"-\"===s?\"\":s;if(p<0){var l=uo.formatPrefix(t,f);t=l.scale(t),r=l.symbol+g}else t*=p;t=d(t,f);var x,_,w=t.lastIndexOf(\".\");if(w<0){var M=y?t.lastIndexOf(\"e\"):-1;M<0?(x=t,_=\"\"):(x=t.substring(0,M),_=t.substring(M))}else x=t.substring(0,w),_=e+t.substring(w+1);!u&&h&&(x=a(x,1/0));var k=m.length+x.length+_.length+(b?0:i.length),A=k<c?new Array(k=c-k+1).join(n):\"\";return b&&(x=a(A+x,A.length?c-_.length:1/0)),i+=m,t=x+_,(\"<\"===o?i+t+A:\">\"===o?A+i+t:\"^\"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(b?t:A+t))+r}}}function Bt(t){return t+\"\"}function Ut(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Vt(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r<n-e?r:n}function i(r){return e(r=t(new ds(r-1)),1),r}function a(t,r){return e(t=new ds(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;o<n;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}function s(t,e,r){try{ds=Ut;var n=new Ut;return n._=t,o(n,e,r)}finally{ds=Date}}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var l=t.utc=Ht(t);return l.floor=l,l.round=Ht(n),l.ceil=Ht(i),l.offset=Ht(a),l.range=s,t}function Ht(t){return function(e,r){try{ds=Ut;var n=new Ut;return n._=e,t(n,r)._}finally{ds=Date}}}function qt(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s<n;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=ms[r=t.charAt(++s)])&&(r=t.charAt(++s)),(a=E[r])&&(r=a(e,null==i?\"e\"===r?\" \":\"0\":i)),o.push(r),l=s+1);return o.push(t.slice(l,s)),o.join(\"\")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(r(n,t,e,0)!=e.length)return null;\"p\"in n&&(n.H=n.H%12+12*n.p);var i=null!=n.Z&&ds!==Ut,a=new(i?Ut:ds);return\"j\"in n?a.setFullYear(n.y,0,n.j):\"W\"in n||\"U\"in n?(\"w\"in n||(n.w=\"W\"in n?1:0),a.setFullYear(n.y,0,1),a.setFullYear(n.y,0,\"W\"in n?(n.w+6)%7+7*n.W-(a.getDay()+5)%7:n.w+7*n.U-(a.getDay()+6)%7)):a.setFullYear(n.y,n.m,n.d),a.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),i?a._:a},e.toString=function(){return t},e}function r(t,e,r,n){for(var i,a,o,s=0,l=e.length,u=r.length;s<l;){if(n>=u)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=L[o in ms?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=M.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=S.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){k.lastIndex=0;var n=k.exec(e.slice(r));return n?(t.m=A.get(n[0].toLowerCase()),r+n[0].length):-1}function s(t,e,n){return r(t,E.c.toString(),e,n)}function l(t,e,n){return r(t,E.x.toString(),e,n)}function u(t,e,n){return r(t,E.X.toString(),e,n)}function c(t,e,r){var n=b.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,m=t.days,g=t.shortDays,v=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{ds=Ut;var e=new ds;return e._=t,n(e)}finally{ds=Date}}var n=e(t);return r.parse=function(t){try{ds=Ut;var e=n.parse(t);return e&&e._}finally{ds=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ce;var b=uo.map(),x=Yt(m),_=Wt(m),w=Yt(g),M=Wt(g),k=Yt(v),A=Wt(v),T=Yt(y),S=Wt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var E={a:function(t){return g[t.getDay()]},A:function(t){return m[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return v[t.getMonth()]},c:e(h),d:function(t,e){return Gt(t.getDate(),e,2)},e:function(t,e){return Gt(t.getDate(),e,2)},H:function(t,e){return Gt(t.getHours(),e,2)},I:function(t,e){return Gt(t.getHours()%12||12,e,2)},j:function(t,e){return Gt(1+fs.dayOfYear(t),e,3)},L:function(t,e){return Gt(t.getMilliseconds(),e,3)},m:function(t,e){return Gt(t.getMonth()+1,e,2)},M:function(t,e){return Gt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Gt(t.getSeconds(),e,2)},U:function(t,e){return Gt(fs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Gt(fs.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return Gt(t.getFullYear()%100,e,2)},Y:function(t,e){return Gt(t.getFullYear()%1e4,e,4)},Z:le,\"%\":function(){return\"%\"}},L={a:n,A:i,b:a,B:o,c:s,d:re,e:re,H:ie,I:ie,j:ne,L:se,m:ee,M:ae,p:c,S:oe,U:Zt,w:Xt,W:Jt,x:l,X:u,y:Qt,Y:Kt,Z:$t,\"%\":ue};return e}function Gt(t,e,r){var n=t<0?\"-\":\"\",i=(n?-t:t)+\"\",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function Yt(t){return new RegExp(\"^(?:\"+t.map(uo.requote).join(\"|\")+\")\",\"i\")}function Wt(t){for(var e=new h,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Xt(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Zt(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Jt(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Kt(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Qt(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+2));return n?(t.y=te(+n[0]),r+n[0].length):-1}function $t(t,e,r){return/^[+-]\\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function te(t){return t+(t>68?1900:2e3)}function ee(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ie(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ae(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function oe(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function se(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function le(t){var e=t.getTimezoneOffset(),r=e>0?\"-\":\"+\",n=xo(e)/60|0,i=xo(e)%60;return r+Gt(n,\"0\",2)+Gt(i,\"0\",2)}function ue(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ce(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}function he(){}function fe(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function de(t,e){t&&_s.hasOwnProperty(t.type)&&_s[t.type](t,e)}function pe(t,e,r){var n,i=-1,a=t.length-r;for(e.lineStart();++i<a;)n=t[i],e.point(n[0],n[1],n[2]);e.lineEnd()}function me(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)pe(t[r],e,1);e.polygonEnd()}function ge(){function t(t,e){t*=Ho,e=e*Ho/2+No/4;var r=t-n,o=r>=0?1:-1,s=o*r,l=Math.cos(e),u=Math.sin(e),c=a*u,h=i*l+c*Math.cos(s),f=c*o*Math.sin(s);Ms.add(Math.atan2(f,h)),n=t,i=l,a=u}var e,r,n,i,a;ks.point=function(o,s){ks.point=t,n=(e=o)*Ho,i=Math.cos(s=(r=s)*Ho/2+No/4),a=Math.sin(s)},ks.lineEnd=function(){t(e,r)}}function ve(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function be(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function xe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Me(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function ke(t,e){return xo(t[0]-e[0])<Fo&&xo(t[1]-e[1])<Fo}function Ae(t,e){t*=Ho;var r=Math.cos(e*=Ho);Te(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Te(t,e,r){++As,Ss+=(t-Ss)/As,Es+=(e-Es)/As,Ls+=(r-Ls)/As}function Se(){function t(t,i){t*=Ho;var a=Math.cos(i*=Ho),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=r*l-n*s)*u+(u=n*o-e*l)*u+(u=e*s-r*o)*u),e*o+r*s+n*l);Ts+=u,Cs+=u*(e+(e=o)),Is+=u*(r+(r=s)),zs+=u*(n+(n=l)),Te(e,r,n)}var e,r,n;Rs.point=function(i,a){i*=Ho;var o=Math.cos(a*=Ho);e=o*Math.cos(i),r=o*Math.sin(i),n=Math.sin(a),Rs.point=t,Te(e,r,n)}}function Ee(){Rs.point=Ae}function Le(){function t(t,e){t*=Ho;var r=Math.cos(e*=Ho),o=r*Math.cos(t),s=r*Math.sin(t),l=Math.sin(e),u=i*l-a*s,c=a*o-n*l,h=n*s-i*o,f=Math.sqrt(u*u+c*c+h*h),d=n*o+i*s+a*l,p=f&&-rt(d)/f,m=Math.atan2(f,d);Ds+=p*u,Ps+=p*c,Os+=p*h,Ts+=m,Cs+=m*(n+(n=o)),Is+=m*(i+(i=s)),zs+=m*(a+(a=l)),Te(n,i,a)}var e,r,n,i,a;Rs.point=function(o,s){e=o,r=s,Rs.point=t,o*=Ho;var l=Math.cos(s*=Ho);n=l*Math.cos(o),i=l*Math.sin(o),a=Math.sin(s),Te(n,i,a)},Rs.lineEnd=function(){t(e,r),Rs.lineEnd=Ee,Rs.point=Ae}}function Ce(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Ie(){return!0}function ze(t,e,r,n,i){var a=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(ke(r,n)){i.lineStart();for(var s=0;s<e;++s)i.point((r=t[s])[0],r[1]);return void i.lineEnd()}var l=new Pe(r,t,null,!0),u=new Pe(r,null,l,!1);l.o=u,a.push(l),o.push(u),l=new Pe(n,t,null,!1),u=new Pe(n,null,l,!0),l.o=u,a.push(l),o.push(u)}}),o.sort(e),De(a),De(o),a.length){for(var s=0,l=r,u=o.length;s<u;++s)o[s].e=l=!l;for(var c,h,f=a[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var s=0,u=c.length;s<u;++s)i.point((h=c[s])[0],h[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(p){c=d.p.z;for(var s=c.length-1;s>=0;--s)i.point((h=c[s])[0],h[1])}else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,p=!p}while(!d.v);i.lineEnd()}}}function De(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function Pe(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Oe(t,e,r,n){return function(i,a){function o(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&a.point(e,r)}function s(t,e){var r=i(t,e);g.point(r[0],r[1])}function l(){y.point=s,g.lineStart()}function u(){y.point=o,g.lineEnd()}function c(t,e){m.push([t,e]);var r=i(t,e);x.point(r[0],r[1])}function h(){x.lineStart(),m=[]}function f(){c(m[0][0],m[0][1]),x.lineEnd();var t,e=x.clean(),r=b.buffer(),n=r.length;if(m.pop(),p.push(m),m=null,n)if(1&e){t=r[0];var i,n=t.length-1,o=-1;if(n>0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o<n;)a.point((i=t[o])[0],i[1]);a.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(Re))}var d,p,m,g=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=h,y.lineEnd=f,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=u,d=uo.merge(d);var t=Ve(v,p);d.length?(_||(a.polygonStart(),_=!0),ze(d,je,t,r,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),r(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),r(null,null,1,a),a.lineEnd(),a.polygonEnd()}},b=Fe(),x=e(b),_=!1;return y}}function Re(t){return t.length>1}function Fe(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:M,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function je(t,e){return((t=t.x)[0]<0?t[1]-Vo-Fo:Vo-t[1])-((e=e.x)[0]<0?e[1]-Vo-Fo:Vo-e[1])}function Ne(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?No:-No,l=xo(a-r);xo(l-No)<Fo?(t.point(r,n=(n+o)/2>0?Vo:-Vo),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=No&&(xo(r-i)<Fo&&(r-=i*Fo),xo(a-s)<Fo&&(a-=s*Fo),n=Be(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}function Be(t,e,r,n){var i,a,o=Math.sin(t-r);return xo(o)>Fo?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}function Ue(t,e,r,n){var i;if(null==t)i=r*Vo,n.point(-No,i),n.point(0,i),n.point(No,i),n.point(No,0),n.point(No,-i),n.point(0,-i),n.point(-No,-i),n.point(-No,0),n.point(-No,i);else if(xo(t[0]-e[0])>Fo){var a=t[0]<e[0]?No:-No;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])}function Ve(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;Ms.reset();for(var s=0,l=e.length;s<l;++s){var u=e[s],c=u.length;if(c)for(var h=u[0],f=h[0],d=h[1]/2+No/4,p=Math.sin(d),m=Math.cos(d),g=1;;){g===c&&(g=0),t=u[g];var v=t[0],y=t[1]/2+No/4,b=Math.sin(y),x=Math.cos(y),_=v-f,w=_>=0?1:-1,M=w*_,k=M>No,A=p*b;if(Ms.add(Math.atan2(A*w*Math.sin(M),m*x+A*Math.cos(M))),a+=k?_+w*Bo:_,k^f>=r^v>=r){var T=be(ve(h),ve(t));we(T);var S=be(i,T);we(S);var E=(k^_>=0?-1:1)*nt(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!g++)break;f=v,p=b,m=x,h=t}}return(a<-Fo||a<Fo&&Ms<-Fo)^1&o}function He(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function r(t){var r,a,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,f){var d,p=[h,f],m=e(h,f),g=o?m?0:i(h,f):m?i(h+(h<0?No:-No),f):0;if(!r&&(u=l=m)&&t.lineStart(),m!==l&&(d=n(r,p),(ke(r,d)||ke(p,d))&&(p[0]+=Fo,p[1]+=Fo,m=e(p[0],p[1]))),m!==l)c=0,m?(t.lineStart(),d=n(p,r),t.point(d[0],d[1])):(d=n(r,p),t.point(d[0],d[1]),t.lineEnd()),r=d;else if(s&&r&&o^m){var v;g&a||!(v=n(p,r,!0))||(c=0,o?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||r&&ke(r,p)||t.point(p[0],p[1]),r=p,l=m,a=g},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return c|(u&&l)<<1}}}function n(t,e,r){var n=ve(t),i=ve(e),o=[1,0,0],s=be(n,i),l=ye(s,s),u=s[0],c=l-u*u;if(!c)return!r&&t;var h=a*l/c,f=-a*u/c,d=be(o,s),p=_e(o,h);xe(p,_e(s,f));var m=d,g=ye(p,m),v=ye(m,m),y=g*g-v*(ye(p,p)-1);if(!(y<0)){var b=Math.sqrt(y),x=_e(m,(-g-b)/v);if(xe(x,p),x=Me(x),!r)return x;var _,w=t[0],M=e[0],k=t[1],A=e[1];M<w&&(_=w,w=M,M=_);var T=M-w,S=xo(T-No)<Fo,E=S||T<Fo;if(!S&&A<k&&(_=k,k=A,A=_),E?S?k+A>0^x[1]<(xo(x[0]-w)<Fo?k:A):k<=x[1]&&x[1]<=A:T>No^(w<=x[0]&&x[0]<=M)){var L=_e(m,(-g+b)/v);return xe(L,p),[x,Me(L)]}}}function i(e,r){var n=o?t:No-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var a=Math.cos(t),o=a>0,s=xo(a)>Fo;return Oe(e,r,gr(t,6*Ho),o?[0,-t]:[-No,t-No])}function qe(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=s.x,h=s.y,f=0,d=1,p=c-l,m=h-u;if(a=t-l,p||!(a>0)){if(a/=p,p<0){if(a<f)return;a<d&&(d=a)}else if(p>0){if(a>d)return;a>f&&(f=a)}if(a=r-l,p||!(a<0)){if(a/=p,p<0){if(a>d)return;a>f&&(f=a)}else if(p>0){if(a<f)return;a<d&&(d=a)}if(a=e-u,m||!(a>0)){if(a/=m,m<0){if(a<f)return;a<d&&(d=a)}else if(m>0){if(a>d)return;a>f&&(f=a)}if(a=n-u,m||!(a<0)){if(a/=m,m<0){if(a>d)return;a>f&&(f=a)}else if(m>0){if(a<f)return;a<d&&(d=a)}return f>0&&(i.a={x:l+f*p,y:u+f*m}),d<1&&(i.b={x:l+d*p,y:u+d*m}),i}}}}}}function Ge(t,e,r,n){function i(n,i){return xo(n[0]-t)<Fo?i>0?0:3:xo(n[0]-r)<Fo?i>0?2:1:xo(n[1]-e)<Fo?i>0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,r=g.length,n=t[1],i=0;i<r;++i)for(var a,o=1,s=g[i],l=s.length,u=s[0];o<l;++o)a=s[o],u[1]<=n?a[1]>n&&et(u,a,t)>0&&++e:a[1]<=n&&et(u,a,t)<0&&--e,u=a;return 0!==e}function u(a,s,l,u){var c=0,h=0;if(null==a||(c=i(a,l))!==(h=i(s,l))||o(a,s)<0^l>0)do{u.point(0===c||3===c?t:r,c>1?n:e)}while((c=(c+l+4)%4)!==h);else u.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function h(t,e){c(t,e)&&s.point(t,e)}function f(){L.point=p,g&&g.push(v=[]),k=!0,M=!1,_=w=NaN}function d(){m&&(p(y,b),x&&M&&S.rejoin(),m.push(S.buffer())),L.point=h,M&&s.lineEnd()}function p(t,e){t=Math.max(-js,Math.min(js,t)),e=Math.max(-js,Math.min(js,e));var r=c(t,e);if(g&&v.push([t,e]),k)y=t,b=e,x=r,k=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&M)s.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};E(n)?(M||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),A=!1):r&&(s.lineStart(),s.point(t,e),A=!1)}_=t,w=e,M=r}var m,g,v,y,b,x,_,w,M,k,A,T=s,S=Fe(),E=qe(t,e,r,n),L={point:h,lineStart:f,lineEnd:d,polygonStart:function(){s=S,m=[],g=[],A=!0},polygonEnd:function(){s=T,m=uo.merge(m);var e=l([t,n]),r=A&&e,i=m.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&ze(m,a,e,u,s),s.polygonEnd()),m=g=v=null}};return L}}function Ye(t){var e=0,r=No/3,n=lr(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*No/180,r=t[1]*No/180):[e/No*180,r/No*180]},i}function We(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,nt((a-(t*t+r*r)*i*i)/(2*i))]},r}function Xe(){function t(t,e){Bs+=i*t-n*e,n=t,i=e}var e,r,n,i;Gs.point=function(a,o){Gs.point=t,e=n=a,r=i=o},Gs.lineEnd=function(){t(e,r)}}function Ze(t,e){t<Us&&(Us=t),t>Hs&&(Hs=t),e<Vs&&(Vs=e),e>qs&&(qs=e)}function Je(){function t(t,e){o.push(\"M\",t,\",\",e,a)}function e(t,e){o.push(\"M\",t,\",\",e),s.point=r}function r(t,e){o.push(\"L\",t,\",\",e)}function n(){s.point=t}function i(){o.push(\"Z\")}var a=Ke(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ke(t),s},result:function(){if(o.length){var t=o.join(\"\");return o=[],t}}};return s}function Ke(t){return\"m0,\"+t+\"a\"+t+\",\"+t+\" 0 1,1 0,\"+-2*t+\"a\"+t+\",\"+t+\" 0 1,1 0,\"+2*t+\"z\"}function Qe(t,e){Ss+=t,Es+=e,++Ls}function $e(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);Cs+=o*(e+t)/2,Is+=o*(r+n)/2,zs+=o,Qe(e=t,r=n)}var e,r;Ws.point=function(n,i){Ws.point=t,Qe(e=n,r=i)}}function tr(){Ws.point=Qe}function er(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);Cs+=o*(n+t)/2,Is+=o*(i+e)/2,zs+=o,o=i*t-n*e,Ds+=o*(n+t),Ps+=o*(i+e),Os+=3*o,Qe(n=t,i=e)}var e,r,n,i;Ws.point=function(a,o){Ws.point=t,Qe(e=n=a,r=i=o)},Ws.lineEnd=function(){t(e,r)}}function rr(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Bo)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:M};return s}function nr(t){function e(t){return(s?n:r)(t)}function r(e){return or(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){b=NaN,k.point=a,e.lineStart()}function a(r,n){var a=ve([r,n]),o=t(r,n);i(b,x,y,_,w,M,b=o[0],x=o[1],y=r,_=a[0],w=a[1],M=a[2],s,e),e.point(b,x)}function o(){k.point=r,e.lineEnd()}function l(){n(),k.point=u,k.lineEnd=c}function u(t,e){a(h=t,f=e),d=b,p=x,m=_,g=w,v=M,k.point=a}function c(){i(b,x,y,_,w,M,d,p,h,m,g,v,s,e),k.lineEnd=o,o()}var h,f,d,p,m,g,v,y,b,x,_,w,M,k={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),k.lineStart=l},polygonEnd:function(){e.polygonEnd(),k.lineStart=n}};return k}function i(e,r,n,s,l,u,c,h,f,d,p,m,g,v){var y=c-e,b=h-r,x=y*y+b*b;if(x>4*a&&g--){var _=s+d,w=l+p,M=u+m,k=Math.sqrt(_*_+w*w+M*M),A=Math.asin(M/=k),T=xo(xo(M)-1)<Fo||xo(n-f)<Fo?(n+f)/2:Math.atan2(w,_),S=t(T,A),E=S[0],L=S[1],C=E-e,I=L-r,z=b*C-y*I;(z*z/x>a||xo((y*C+b*I)/x-.5)>.3||s*d+l*p+u*m<o)&&(i(e,r,n,s,l,u,E,L,T,_/=k,w/=k,M,g,v),v.point(E,L),i(E,L,T,_,w,M,c,h,f,d,p,m,g,v))}}var a=.5,o=Math.cos(30*Ho),s=16;return e.precision=function(t){return arguments.length?(s=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function ir(t){var e=nr(function(e,r){return t([e*qo,r*qo])});return function(t){return ur(e(t))}}function ar(t){this.stream=t}function or(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function sr(t){return lr(function(){return t})()}function lr(t){function e(t){return t=s(t[0]*Ho,t[1]*Ho),[t[0]*f+l,u-t[1]*f]}function r(t){return(t=s.invert((t[0]-l)/f,(u-t[1])/f))&&[t[0]*qo,t[1]*qo]}function n(){s=Ce(o=fr(v,y,b),a);var t=a(m,g);return l=d-t[0]*f,u=p+t[1]*f,i()}function i(){return c&&(c.valid=!1,c=null),e}var a,o,s,l,u,c,h=nr(function(t,e){return t=a(t,e),[t[0]*f+l,u-t[1]*f]}),f=150,d=480,p=250,m=0,g=0,v=0,y=0,b=0,_=Fs,w=x,M=null,k=null;return e.stream=function(t){return c&&(c.valid=!1),c=ur(_(o,h(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(_=null==t?(M=t,Fs):He((M=+t)*Ho),i()):M},e.clipExtent=function(t){return arguments.length?(k=t,w=t?Ge(t[0][0],t[0][1],t[1][0],t[1][1]):x,i()):k},e.scale=function(t){return arguments.length?(f=+t,n()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],n()):[d,p]},e.center=function(t){return arguments.length?(m=t[0]%360*Ho,g=t[1]%360*Ho,n()):[m*qo,g*qo]},e.rotate=function(t){return arguments.length?(v=t[0]%360*Ho,y=t[1]%360*Ho,b=t.length>2?t[2]%360*Ho:0,n()):[v*qo,y*qo,b*qo]},uo.rebind(e,h,\"precision\"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&r,n()}}function ur(t){return or(t,function(e,r){t.point(e*Ho,r*Ho)})}function cr(t,e){return[t,e]}function hr(t,e){return[t>No?t-Bo:t<-No?t+Bo:t,e]}function fr(t,e,r){return t?e||r?Ce(pr(t),mr(e,r)):pr(t):e||r?mr(e,r):hr}function dr(t){return function(e,r){return e+=t,[e>No?e-Bo:e<-No?e+Bo:e,r]}}function pr(t){var e=dr(t);return e.invert=dr(-t),e}function mr(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*n+s*i;return[Math.atan2(l*a-c*o,s*n-u*i),nt(c*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*a-l*o;return[Math.atan2(l*a+u*o,s*n+c*i),nt(c*n-s*i)]},r}function gr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=vr(r,i),a=vr(r,a),(o>0?i<a:i>a)&&(i+=o*Bo)):(i=t+o*Bo,a=t-.5*l);for(var u,c=i;o>0?c>a:c<a;c-=l)s.point((u=Me([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function vr(t,e){var r=ve(e);r[0]-=t,we(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Fo)%(2*Math.PI)}function yr(t,e,r){var n=uo.range(t,e-Fo,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function br(t,e,r){var n=uo.range(t,e-Fo,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function xr(t){return t.source}function _r(t){return t.target}function wr(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),u=i*Math.sin(t),c=o*Math.cos(r),h=o*Math.sin(r),f=2*Math.asin(Math.sqrt(st(n-e)+i*o*st(r-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,r=Math.sin(f-t)*d,n=r*l+e*c,i=r*u+e*h,o=r*a+e*s;return[Math.atan2(i,n)*qo,Math.atan2(o,Math.sqrt(n*n+i*i))*qo]}:function(){return[t*qo,e*qo]};return p.distance=f,p}function Mr(){function t(t,i){var a=Math.sin(i*=Ho),o=Math.cos(i),s=xo((t*=Ho)-e),l=Math.cos(s);Xs+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;Zs.point=function(i,a){e=i*Ho,r=Math.sin(a*=Ho),n=Math.cos(a),Zs.point=t},Zs.lineEnd=function(){Zs.point=Zs.lineEnd=M}}function kr(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}function Ar(t,e){function r(t,e){o>0?e<-Vo+Fo&&(e=-Vo+Fo):e>Vo-Fo&&(e=Vo-Fo);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(No/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=tt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Vo]},r):Sr}function Tr(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return xo(i)<Fo?cr:(r.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/i,a-tt(i)*Math.sqrt(t*t+r*r)]},r)}function Sr(t,e){return[t,Math.log(Math.tan(No/4+e/2))]}function Er(t){var e,r=sr(t),n=r.scale,i=r.translate,a=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=i.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=a.apply(r,arguments);if(o===r){if(e=null==t){var s=No*n(),l=i();a([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}function Lr(t,e){return[Math.log(Math.tan(No/4+e/2)),-t]}function Cr(t){return t[0]}function Ir(t){return t[1]}function zr(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Dr(t,e){return t[0]-e[0]||t[1]-e[1]}function Pr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Or(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],u=r[1],c=e[1]-l,h=n[1]-u,f=(s*(l-u)-h*(i-a))/(h*o-s*c);return[i+f*o,l+f*c]}function Rr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Fr(){an(this),this.edge=this.site=this.circle=null}function jr(t){var e=sl.pop()||new Fr;return e.site=t,e}function Nr(t){Zr(t),il.remove(t),sl.push(t),an(t)}function Br(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];Nr(t);for(var l=a;l.circle&&xo(r-l.circle.x)<Fo&&xo(n-l.circle.cy)<Fo;)a=l.P,s.unshift(l),Nr(l),l=a;s.unshift(l),Zr(l);for(var u=o;u.circle&&xo(r-u.circle.x)<Fo&&xo(n-u.circle.cy)<Fo;)o=u.N,s.push(u),Nr(u),u=o;s.push(u),Zr(u);var c,h=s.length;for(c=1;c<h;++c)u=s[c],l=s[c-1],en(u.edge,l.site,u.site,i);l=s[0],u=s[h-1],u.edge=$r(l.site,u.site,null,i),Xr(l),Xr(u)}function Ur(t){for(var e,r,n,i,a=t.x,o=t.y,s=il._;s;)if((n=Vr(s,o)-a)>Fo)s=s.L;else{if(!((i=a-Hr(s,o))>Fo)){n>-Fo?(e=s.P,r=s):i>-Fo?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=jr(t);if(il.insert(e,l),e||r){if(e===r)return Zr(e),r=jr(e.site),il.insert(l,r),l.edge=r.edge=$r(e.site,l.site),Xr(e),void Xr(r);if(!r)return void(l.edge=$r(e.site,l.site));Zr(e),Zr(r);var u=e.site,c=u.x,h=u.y,f=t.x-c,d=t.y-h,p=r.site,m=p.x-c,g=p.y-h,v=2*(f*g-d*m),y=f*f+d*d,b=m*m+g*g,x={x:(g*y-d*b)/v+c,y:(f*b-m*y)/v+h};en(r.edge,u,p,x),l.edge=$r(u,t,null,x),r.edge=$r(t,p,null,x),Xr(e),Xr(r)}}function Vr(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;r=o.site;var s=r.x,l=r.y,u=l-e;if(!u)return s;var c=s-n,h=1/a-1/u,f=c/u;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*u)-l+u/2+i-a/2)))/h+n:(n+s)/2}function Hr(t,e){var r=t.N;if(r)return Vr(r,e);var n=t.site;return n.y===e?n.x:1/0}function qr(t){this.site=t,this.edges=[]}function Gr(t){for(var e,r,n,i,a,o,s,l,u,c,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],m=nl,g=m.length;g--;)if((a=m[g])&&a.prepare())for(s=a.edges,l=s.length,o=0;o<l;)c=s[o].end(),n=c.x,i=c.y,u=s[++o%l].start(),e=u.x,r=u.y,(xo(n-e)>Fo||xo(i-r)>Fo)&&(s.splice(o,0,new rn(tn(a.site,c,xo(n-h)<Fo&&p-i>Fo?{x:h,y:xo(e-h)<Fo?r:p}:xo(i-p)<Fo&&f-n>Fo?{x:xo(r-p)<Fo?e:f,y:p}:xo(n-f)<Fo&&i-d>Fo?{x:f,y:xo(e-f)<Fo?r:d}:xo(i-d)<Fo&&n-h>Fo?{x:xo(r-d)<Fo?e:h,y:d}:null),a.site,null)),++l)}function Yr(t,e){return e.angle-t.angle}function Wr(){an(this),this.x=this.y=this.arc=this.site=this.cy=null}function Xr(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,h=a.y-s,f=2*(l*h-u*c);if(!(f>=-jo)){var d=l*l+u*u,p=c*c+h*h,m=(h*d-u*p)/f,g=(l*p-c*d)/f,h=g+s,v=ll.pop()||new Wr;v.arc=t,v.site=i,v.x=m+o,v.y=h+Math.sqrt(m*m+g*g),v.cy=h,t.circle=v;for(var y=null,b=ol._;b;)if(v.y<b.y||v.y===b.y&&v.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}ol.insert(y,v),y||(al=v)}}}}function Zr(t){var e=t.circle;e&&(e.P||(al=e.N),ol.remove(e),ll.push(e),an(e),t.circle=null)}function Jr(t){for(var e,r=rl,n=qe(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)e=r[i],(!Kr(e,t)||!n(e)||xo(e.a.x-e.b.x)<Fo&&xo(e.a.y-e.b.y)<Fo)&&(e.a=e.b=null,r.splice(i,1))}function Kr(t,e){var r=t.b;if(r)return!0;var n,i,a=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,h=t.r,f=c.x,d=c.y,p=h.x,m=h.y,g=(f+p)/2,v=(d+m)/2;if(m===d){if(g<o||g>=s)return;if(f>p){if(a){if(a.y>=u)return}else a={x:g,y:l};r={x:g,y:u}}else{if(a){if(a.y<l)return}else a={x:g,y:u};r={x:g,y:l}}}else if(n=(f-p)/(m-d),i=v-n*g,n<-1||n>1)if(f>p){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y<l)return}else a={x:(u-i)/n,y:u};r={x:(l-i)/n,y:l}}else if(d<m){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={\n", | |
"x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function Qr(t,e){this.l=t,this.r=e,this.a=this.b=null}function $r(t,e,r,n){var i=new Qr(t,e);return rl.push(i),r&&en(i,t,e,r),n&&en(i,e,t,n),nl[t.i].edges.push(new rn(i,t,e)),nl[e.i].edges.push(new rn(i,e,t)),i}function tn(t,e,r){var n=new Qr(t,null);return n.a=e,n.b=r,rl.push(n),n}function en(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function rn(t,e,r){var n=t.a,i=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function nn(){this._=null}function an(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function on(t,e){var r=e,n=e.R,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function sn(t,e){var r=e,n=e.L,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function ln(t){for(;t.L;)t=t.L;return t}function un(t,e){var r,n,i,a=t.sort(cn).pop();for(rl=[],nl=new Array(t.length),il=new nn,ol=new nn;;)if(i=al,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(nl[a.i]=new qr(a),Ur(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;Br(i.arc)}e&&(Jr(e),Gr(e));var o={cells:nl,edges:rl};return il=ol=rl=nl=null,o}function cn(t,e){return e.y-t.y||e.x-t.x}function hn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function fn(t){return t.x}function dn(t){return t.y}function pn(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function mn(t,e,r,n,i,a){if(!t(e,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=e.nodes;l[0]&&mn(t,l[0],r,n,o,s),l[1]&&mn(t,l[1],o,n,i,s),l[2]&&mn(t,l[2],r,s,o,a),l[3]&&mn(t,l[3],o,s,i,a)}}function gn(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,h,f,d){if(!(c>a||h>o||f<n||d<i)){if(p=u.point){var p,m=e-u.x,g=r-u.y,v=m*m+g*g;if(v<l){var y=Math.sqrt(l=v);n=e-y,i=r-y,a=e+y,o=r+y,s=p}}for(var b=u.nodes,x=.5*(c+f),_=.5*(h+d),w=e>=x,M=r>=_,k=M<<1|w,A=k+4;k<A;++k)if(u=b[3&k])switch(3&k){case 0:t(u,c,h,x,_);break;case 1:t(u,x,h,f,_);break;case 2:t(u,c,_,x,d);break;case 3:t(u,x,_,f,d)}}}(t,n,i,a,o),s}function vn(t,e){t=uo.rgb(t),e=uo.rgb(e);var r=t.r,n=t.g,i=t.b,a=e.r-r,o=e.g-n,s=e.b-i;return function(t){return\"#\"+wt(Math.round(r+a*t))+wt(Math.round(n+o*t))+wt(Math.round(i+s*t))}}function yn(t,e){var r,n={},i={};for(r in t)r in e?n[r]=_n(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function bn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function xn(t,e){var r,n,i,a=cl.lastIndex=hl.lastIndex=0,o=-1,s=[],l=[];for(t+=\"\",e+=\"\";(r=cl.exec(t))&&(n=hl.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:bn(r,n)})),a=hl.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+\"\"}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join(\"\")})}function _n(t,e){for(var r,n=uo.interpolators.length;--n>=0&&!(r=uo.interpolators[n](t,e)););return r}function wn(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push(_n(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}function Mn(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function kn(t){return function(e){return 1-t(1-e)}}function An(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Tn(t){return t*t}function Sn(t){return t*t*t}function En(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Ln(t){return function(e){return Math.pow(e,t)}}function Cn(t){return 1-Math.cos(t*Vo)}function In(t){return Math.pow(2,10*(t-1))}function zn(t){return 1-Math.sqrt(1-t*t)}function Dn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Bo*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Bo/e)}}function Pn(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function On(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Rn(t,e){t=uo.hcl(t),e=uo.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ft(r+a*t,n+o*t,i+s*t)+\"\"}}function Fn(t,e){t=uo.hsl(t),e=uo.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ct(r+a*t,n+o*t,i+s*t)+\"\"}}function jn(t,e){t=uo.lab(t),e=uo.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return pt(r+a*t,n+o*t,i+s*t)+\"\"}}function Nn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Bn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Vn(e),i=Un(e,r),a=Vn(Hn(r,e,-i))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,i*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*qo,this.translate=[t.e,t.f],this.scale=[n,a],this.skew=a?Math.atan2(i,a)*qo:0}function Un(t,e){return t[0]*e[0]+t[1]*e[1]}function Vn(t){var e=Math.sqrt(Un(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Hn(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}function qn(t){return t.length?t.pop()+\",\":\"\"}function Gn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(\"translate(\",null,\",\",null,\")\");n.push({i:i-4,x:bn(t[0],e[0])},{i:i-2,x:bn(t[1],e[1])})}else(e[0]||e[1])&&r.push(\"translate(\"+e+\")\")}function Yn(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(qn(r)+\"rotate(\",null,\")\")-2,x:bn(t,e)})):e&&r.push(qn(r)+\"rotate(\"+e+\")\")}function Wn(t,e,r,n){t!==e?n.push({i:r.push(qn(r)+\"skewX(\",null,\")\")-2,x:bn(t,e)}):e&&r.push(qn(r)+\"skewX(\"+e+\")\")}function Xn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(qn(r)+\"scale(\",null,\",\",null,\")\");n.push({i:i-4,x:bn(t[0],e[0])},{i:i-2,x:bn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(qn(r)+\"scale(\"+e+\")\")}function Zn(t,e){var r=[],n=[];return t=uo.transform(t),e=uo.transform(e),Gn(t.translate,e.translate,r,n),Yn(t.rotate,e.rotate,r,n),Wn(t.skew,e.skew,r,n),Xn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i<a;)r[(e=n[i]).i]=e.x(t);return r.join(\"\")}}function Jn(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Kn(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Qn(t){for(var e=t.source,r=t.target,n=ti(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function $n(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function ti(t,e){if(t===e)return t;for(var r=$n(t),n=$n(e),i=r.pop(),a=n.pop(),o=null;i===a;)o=i,i=r.pop(),a=n.pop();return o}function ei(t){t.fixed|=2}function ri(t){t.fixed&=-7}function ni(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ii(t){t.fixed&=-5}function ai(t,e,r){var n=0,i=0;if(t.charge=0,!t.leaf)for(var a,o=t.nodes,s=o.length,l=-1;++l<s;)null!=(a=o[l])&&(ai(a,e,r),t.charge+=a.charge,n+=a.charge*a.cx,i+=a.charge*a.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=e*r[t.point.index];t.charge+=t.pointCharge=u,n+=u*t.point.x,i+=u*t.point.y}t.cx=n/t.charge,t.cy=i/t.charge}function oi(t,e){return uo.rebind(t,e,\"sort\",\"children\",\"value\"),t.nodes=t,t.links=fi,t}function si(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(i=t.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function li(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o<i;)r.push(a[o]);for(;null!=(t=n.pop());)e(t)}function ui(t){return t.children}function ci(t){return t.value}function hi(t,e){return e.value-t.value}function fi(t){return uo.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function di(t){return t.x}function pi(t){return t.y}function mi(t,e,r){t.y0=e,t.y=r}function gi(t){return uo.range(t.length)}function vi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function yi(t){for(var e,r=1,n=0,i=t[0][1],a=t.length;r<a;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function bi(t){return t.reduce(xi,0)}function xi(t,e){return t+e[1]}function _i(t,e){return wi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wi(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Mi(t){return[uo.min(t),uo.max(t)]}function ki(t,e){return t.value-e.value}function Ai(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ti(t,e){t._pack_next=e,e._pack_prev=t}function Si(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Ei(t){function e(t){c=Math.min(t.x-t.r,c),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(u=r.length)){var r,n,i,a,o,s,l,u,c=1/0,h=-1/0,f=1/0,d=-1/0;if(r.forEach(Li),n=r[0],n.x=-n.r,n.y=0,e(n),u>1&&(i=r[1],i.x=i.r,i.y=0,e(i),u>2))for(a=r[2],zi(n,i,a),e(a),Ai(n,a),n._pack_prev=a,Ai(a,i),i=n._pack_next,o=3;o<u;o++){zi(n,i,a=r[o]);var p=0,m=1,g=1;for(s=i._pack_next;s!==i;s=s._pack_next,m++)if(Si(s,a)){p=1;break}if(1==p)for(l=n._pack_prev;l!==s._pack_prev&&!Si(l,a);l=l._pack_prev,g++);p?(m<g||m==g&&i.r<n.r?Ti(n,i=s):Ti(n=l,i),o--):(Ai(n,a),i=a,e(a))}var v=(c+h)/2,y=(f+d)/2,b=0;for(o=0;o<u;o++)a=r[o],a.x-=v,a.y-=y,b=Math.max(b,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=b,r.forEach(Ci)}}function Li(t){t._pack_next=t._pack_prev=t}function Ci(t){delete t._pack_next,delete t._pack_prev}function Ii(t,e,r,n){var i=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n,i)for(var a=-1,o=i.length;++a<o;)Ii(i[a],e,r,n)}function zi(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a;o*=o,n*=n;var l=.5+(n-o)/(2*s),u=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+u*a,r.y=t.y+l*a-u*i}else r.x=t.x+n,r.y=t.y}function Di(t,e){return t.parent==e.parent?1:2}function Pi(t){var e=t.children;return e.length?e[0]:t.t}function Oi(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function Ri(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function Fi(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)e=i[a],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function ji(t,e,r){return t.a.parent===e.parent?t.a:r}function Ni(t){return 1+uo.max(t,function(t){return t.y})}function Bi(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ui(t){var e=t.children;return e&&e.length?Ui(e[0]):t}function Vi(t){var e,r=t.children;return r&&(e=r.length)?Vi(r[e-1]):t}function Hi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function qi(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function Gi(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function Yi(t){return t.rangeExtent?t.rangeExtent():Gi(t.range())}function Wi(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function Xi(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function Zi(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:wl}function Ji(t,e,r,n){var i=[],a=[],o=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<=s;)i.push(r(t[o-1],t[o])),a.push(n(e[o-1],e[o]));return function(e){var r=uo.bisect(t,e,1,s)-1;return a[r](i[r](e))}}function Ki(t,e,r,n){function i(){var i=Math.min(t.length,e.length)>2?Ji:Wi,l=n?Kn:Jn;return o=i(t,e,l,r),s=i(e,t,l,_n),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Nn)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return ea(t,e)},a.tickFormat=function(e,r){return ra(t,e,r)},a.nice=function(e){return $i(t,e),i()},a.copy=function(){return Ki(t,e,r,n)},i()}function Qi(t,e){return uo.rebind(t,e,\"range\",\"rangeRound\",\"interpolate\",\"clamp\")}function $i(t,e){return Xi(t,Zi(ta(t,e)[2])),Xi(t,Zi(ta(t,e)[2])),t}function ta(t,e){null==e&&(e=10);var r=Gi(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function ea(t,e){return uo.range.apply(uo,ta(t,e))}function ra(t,e,r){var n=ta(t,e);if(r){var i=cs.exec(r);if(i.shift(),\"s\"===i[8]){var a=uo.formatPrefix(Math.max(xo(n[0]),xo(n[1])));return i[7]||(i[7]=\".\"+na(a.scale(n[2]))),i[8]=\"f\",r=uo.format(i.join(\"\")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]=\".\"+ia(i[8],n)),r=i.join(\"\")}else r=\",.\"+na(n[2])+\"f\";return uo.format(r)}function na(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ia(t,e){var r=na(e[2]);return t in Ml?Math.abs(r-na(Math.max(xo(e[0]),xo(e[1]))))+ +(\"e\"!==t):r-2*(\"%\"===t)}function aa(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Xi(n.map(i),r?Math:Al);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Gi(n),o=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(c-u)){if(r){for(;u<c;u++)for(var f=1;f<h;f++)o.push(a(u)*f);o.push(a(u))}else for(o.push(a(u));u++<c;)for(var f=h-1;f>0;f--)o.push(a(u)*f);for(u=0;o[u]<s;u++);for(c=o.length;o[c-1]>l;c--);o=o.slice(u,c)}return o},o.tickFormat=function(t,r){if(!arguments.length)return kl;arguments.length<2?r=kl:\"function\"!=typeof r&&(r=uo.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e<e-.5&&(o*=e),o<=n?r(t):\"\"}},o.copy=function(){return aa(t.copy(),e,r,n)},Qi(o,t)}function oa(t,e,r){function n(e){return t(i(e))}var i=sa(e),a=sa(1/e);return n.invert=function(e){return a(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(i)),n):r},n.ticks=function(t){return ea(r,t)},n.tickFormat=function(t,e){return ra(r,t,e)},n.nice=function(t){return n.domain($i(r,t))},n.exponent=function(o){return arguments.length?(i=sa(e=o),a=sa(1/e),t.domain(r.map(i)),n):e},n.copy=function(){return oa(t.copy(),e,r)},Qi(n,t)}function sa(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function la(t,e){function r(r){return a[((i.get(r)||(\"range\"===e.t?i.set(r,t.push(r)):NaN))-1)%a.length]}function n(e,r){return uo.range(t.length).map(function(t){return e+r*t})}var i,a,o;return r.domain=function(n){if(!arguments.length)return t;t=[],i=new h;for(var a,o=-1,s=n.length;++o<s;)i.has(a=n[o])||i.set(a,t.push(a));return r[e.t].apply(r,e.a)},r.range=function(t){return arguments.length?(a=t,o=0,e={t:\"range\",a:arguments},r):a},r.rangePoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=(l+u)/2,0):(u-l)/(t.length-1+s);return a=n(l+c*s/2,c),o=0,e={t:\"rangePoints\",a:arguments},r},r.rangeRoundPoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(t.length-1+s)|0;return a=n(l+Math.round(c*s/2+(u-l-(t.length-1+s)*c)/2),c),o=0,e={t:\"rangeRoundPoints\",a:arguments},r},r.rangeBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],h=i[1-u],f=(h-c)/(t.length-s+2*l);return a=n(c+f*l,f),u&&a.reverse(),o=f*(1-s),e={t:\"rangeBands\",a:arguments},r},r.rangeRoundBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],h=i[1-u],f=Math.floor((h-c)/(t.length-s+2*l));return a=n(c+Math.round((h-c-(t.length-s)*f)/2),f),u&&a.reverse(),o=Math.round(f*(1-s)),e={t:\"rangeRoundBands\",a:arguments},r},r.rangeBand=function(){return o},r.rangeExtent=function(){return Gi(e.a[0])},r.copy=function(){return la(t,e)},r.domain(t)}function ua(t,e){function r(){var r=0,i=e.length;for(s=[];++r<i;)s[r-1]=uo.quantile(t,r/i);return n}function n(t){if(!isNaN(t=+t))return e[uo.bisect(s,t)]}var s;return n.domain=function(e){return arguments.length?(t=e.map(a).filter(o).sort(i),r()):t},n.range=function(t){return arguments.length?(e=t,r()):e},n.quantiles=function(){return s},n.invertExtent=function(r){return r=e.indexOf(r),r<0?[NaN,NaN]:[r>0?s[r-1]:t[0],r<s.length?s[r]:t[t.length-1]]},n.copy=function(){return ua(t,e)},r()}function ca(t,e,r){function n(e){return r[Math.max(0,Math.min(o,Math.floor(a*(e-t))))]}function i(){return a=r.length/(e-t),o=r.length-1,n}var a,o;return n.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],i()):[t,e]},n.range=function(t){return arguments.length?(r=t,i()):r},n.invertExtent=function(e){return e=r.indexOf(e),e=e<0?NaN:e/a+t,[e,e+1/a]},n.copy=function(){return ca(t,e,r)},i()}function ha(t,e){function r(r){if(r<=r)return e[uo.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return ha(t,e)},r}function fa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return ea(t,e)},e.tickFormat=function(e,r){return ra(t,e,r)},e.copy=function(){return fa(t)},e}function da(){return 0}function pa(t){return t.innerRadius}function ma(t){return t.outerRadius}function ga(t){return t.startAngle}function va(t){return t.endAngle}function ya(t){return t&&t.padAngle}function ba(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function xa(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,h=t[1]+u,f=e[0]+l,d=e[1]+u,p=(c+f)/2,m=(h+d)/2,g=f-c,v=d-h,y=g*g+v*v,b=r-n,x=c*d-f*h,_=(v<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*v-g*_)/y,M=(-x*g-v*_)/y,k=(x*v+g*_)/y,A=(-x*g+v*_)/y,T=w-p,S=M-m,E=k-p,L=A-m;return T*T+S*S>E*E+L*L&&(w=k,M=A),[[w-l,M-u],[w*r/b,M*r/b]]}function _a(t){function e(e){function o(){u.push(\"M\",a(t(c),s))}for(var l,u=[],c=[],h=-1,f=e.length,d=Et(r),p=Et(n);++h<f;)i.call(this,l=e[h],h)?c.push([+d.call(this,l,h),+p.call(this,l,h)]):c.length&&(o(),c=[]);return c.length&&o(),u.length?u.join(\"\"):null}var r=Cr,n=Ir,i=Ie,a=wa,o=a.key,s=.7;return e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(o=\"function\"==typeof t?a=t:(a=Il.get(t)||wa).key,e):o},e.tension=function(t){return arguments.length?(s=t,e):s},e}function wa(t){return t.length>1?t.join(\"L\"):t+\"Z\"}function Ma(t){return t.join(\"L\")+\"Z\"}function ka(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"H\",(n[0]+(n=t[e])[0])/2,\"V\",n[1]);return r>1&&i.push(\"H\",n[0]),i.join(\"\")}function Aa(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"V\",(n=t[e])[1],\"H\",n[0]);return i.join(\"\")}function Ta(t){for(var e=0,r=t.length,n=t[0],i=[n[0],\",\",n[1]];++e<r;)i.push(\"H\",(n=t[e])[0],\"V\",n[1]);return i.join(\"\")}function Sa(t,e){return t.length<4?wa(t):t[1]+Ca(t.slice(1,-1),Ia(t,e))}function Ea(t,e){return t.length<3?Ma(t):t[0]+Ca((t.push(t[0]),t),Ia([t[t.length-2]].concat(t,[t[1]]),e))}function La(t,e){return t.length<3?wa(t):t[0]+Ca(t,Ia(t,e))}function Ca(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return wa(t);var r=t.length!=e.length,n=\"\",i=t[0],a=t[1],o=e[0],s=o,l=1;if(r&&(n+=\"Q\"+(a[0]-2*o[0]/3)+\",\"+(a[1]-2*o[1]/3)+\",\"+a[0]+\",\"+a[1],i=t[1],l=2),e.length>1){s=e[1],a=t[l],l++,n+=\"C\"+(i[0]+o[0])+\",\"+(i[1]+o[1])+\",\"+(a[0]-s[0])+\",\"+(a[1]-s[1])+\",\"+a[0]+\",\"+a[1];for(var u=2;u<e.length;u++,l++)a=t[l],s=e[u],n+=\"S\"+(a[0]-s[0])+\",\"+(a[1]-s[1])+\",\"+a[0]+\",\"+a[1]}if(r){var c=t[l];n+=\"Q\"+(a[0]+2*s[0]/3)+\",\"+(a[1]+2*s[1]/3)+\",\"+c[0]+\",\"+c[1]}return n}function Ia(t,e){for(var r,n=[],i=(1-e)/2,a=t[0],o=t[1],s=1,l=t.length;++s<l;)r=a,a=o,o=t[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function za(t){if(t.length<3)return wa(t);var e=1,r=t.length,n=t[0],i=n[0],a=n[1],o=[i,i,i,(n=t[1])[0]],s=[a,a,a,n[1]],l=[i,\",\",a,\"L\",Ra(Pl,o),\",\",Ra(Pl,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Fa(l,o,s);return t.pop(),l.push(\"L\",n),l.join(\"\")}function Da(t){if(t.length<4)return wa(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Ra(Pl,a)+\",\"+Ra(Pl,o)),--n;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Fa(r,a,o);return r.join(\"\")}function Pa(t){for(var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);for(e=[Ra(Pl,o),\",\",Ra(Pl,s)],--n;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Fa(e,o,s);return e.join(\"\")}function Oa(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,u=-1;++u<=r;)n=t[u],i=u/r,n[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return za(t)}function Ra(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Fa(t,e,r){t.push(\"C\",Ra(zl,e),\",\",Ra(zl,r),\",\",Ra(Dl,e),\",\",Ra(Dl,r),\",\",Ra(Pl,e),\",\",Ra(Pl,r))}function ja(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Na(t){for(var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=ja(i,a);++e<r;)n[e]=(o+(o=ja(i=a,a=t[e+1])))/2;return n[e]=o,n}function Ba(t){for(var e,r,n,i,a=[],o=Na(t),s=-1,l=t.length-1;++s<l;)e=ja(t[s],t[s+1]),xo(e)<Fo?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,(i=r*r+n*n)>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}function Ua(t){return t.length<3?wa(t):t[0]+Ca(t,Ba(t))}function Va(t){for(var e,r,n,i=-1,a=t.length;++i<a;)e=t[i],r=e[0],n=e[1]-Vo,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Ha(t){function e(e){function l(){m.push(\"M\",s(t(v),h),c,u(t(g.reverse()),h),\"Z\")}for(var f,d,p,m=[],g=[],v=[],y=-1,b=e.length,x=Et(r),_=Et(i),w=r===n?function(){return d}:Et(n),M=i===a?function(){return p}:Et(a);++y<b;)o.call(this,f=e[y],y)?(g.push([d=+x.call(this,f,y),p=+_.call(this,f,y)]),v.push([+w.call(this,f,y),+M.call(this,f,y)])):g.length&&(l(),g=[],v=[]);return g.length&&l(),m.length?m.join(\"\"):null}var r=Cr,n=Cr,i=0,a=Ir,o=Ie,s=wa,l=s.key,u=s,c=\"L\",h=.7;return e.x=function(t){return arguments.length?(r=n=t,e):n},e.x0=function(t){return arguments.length?(r=t,e):r},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=a=t,e):a},e.y0=function(t){return arguments.length?(i=t,e):i},e.y1=function(t){return arguments.length?(a=t,e):a},e.defined=function(t){return arguments.length?(o=t,e):o},e.interpolate=function(t){return arguments.length?(l=\"function\"==typeof t?s=t:(s=Il.get(t)||wa).key,u=s.reverse||s,c=s.closed?\"M\":\"L\",e):l},e.tension=function(t){return arguments.length?(h=t,e):h},e}function qa(t){return t.radius}function Ga(t){return[t.x,t.y]}function Ya(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Vo;return[r*Math.cos(n),r*Math.sin(n)]}}function Wa(){return 64}function Xa(){return\"circle\"}function Za(t){var e=Math.sqrt(t/No);return\"M0,\"+e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+-e+\"A\"+e+\",\"+e+\" 0 1,1 0,\"+e+\"Z\"}function Ja(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Ka(t,e,r){return Ao(t,Ul),t.namespace=e,t.id=r,t}function Qa(t,e,r,n){var i=t.id,a=t.namespace;return G(t,\"function\"==typeof r?function(t,o,s){t[a][i].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[a][i].tween.set(e,r)}))}function $a(t){return null==t&&(t=\"\"),function(){this.textContent=t}}function to(t){return null==t?\"__transition__\":\"__transition_\"+t+\"__\"}function eo(t,e,r,n,i){function a(t){var e=m.delay;if(u.t=e+l,e<=t)return o(t-e);u.c=o}function o(r){var i=p.active,a=p[i];a&&(a.timer.c=null,a.timer.t=NaN,--p.count,delete p[i],a.event&&a.event.interrupt.call(t,t.__data__,a.index));for(var o in p)if(+o<n){var h=p[o];h.timer.c=null,h.timer.t=NaN,--p.count,delete p[o]}u.c=s,Dt(function(){return u.c&&s(r||1)&&(u.c=null,u.t=NaN),1},0,l),p.active=n,m.event&&m.event.start.call(t,t.__data__,e),d=[],m.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&d.push(n)}),f=m.ease,c=m.duration}function s(i){for(var a=i/c,o=f(a),s=d.length;s>0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,c,f,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=Dt(a,0,l),m=p[n]={tween:new h,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function ro(t,e,r){t.attr(\"transform\",function(t){var n=e(t);return\"translate(\"+(isFinite(n)?n:r(t))+\",0)\"})}function no(t,e,r){t.attr(\"transform\",function(t){var n=e(t);return\"translate(0,\"+(isFinite(n)?n:r(t))+\")\"})}function io(t){return t.toISOString()}function ao(t,e,r){function n(e){return t(e)}function i(t,r){var n=t[1]-t[0],i=n/r,a=uo.bisect(Jl,i);return a==Jl.length?[e.year,ta(t.map(function(t){return t/31536e6}),r)[2]]:a?e[i/Jl[a-1]<Jl[a]/i?a-1:a]:[$l,ta(t,r)[2]]}return n.invert=function(e){return oo(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(oo)},n.nice=function(t,e){function r(r){return!isNaN(r)&&!t.range(r,oo(+r+1),e).length}var a=n.domain(),o=Gi(a),s=null==t?i(o,10):\"number\"==typeof t&&i(o,t);return s&&(t=s[0],e=s[1]),n.domain(Xi(a,e>1?{floor:function(e){for(;r(e=t.floor(e));)e=oo(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=oo(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Gi(n.domain()),a=null==t?i(r,10):\"number\"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],oo(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return ao(t.copy(),e,r)},Qi(n,t)}function oo(t){return new Date(t)}function so(t){return JSON.parse(t.responseText)}function lo(t){var e=fo.createRange();return e.selectNode(fo.body),e.createContextualFragment(t.responseText)}var uo={version:\"3.5.17\"},co=[].slice,ho=function(t){return co.call(t)},fo=this.document;if(fo)try{ho(fo.documentElement.childNodes)[0].nodeType}catch(t){ho=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement(\"DIV\").style.setProperty(\"opacity\",0,\"\")}catch(t){var po=this.Element.prototype,mo=po.setAttribute,go=po.setAttributeNS,vo=this.CSSStyleDeclaration.prototype,yo=vo.setProperty;po.setAttribute=function(t,e){mo.call(this,t,e+\"\")},po.setAttributeNS=function(t,e,r){go.call(this,t,e,r+\"\")},vo.setProperty=function(t,e,r){yo.call(this,t,e+\"\",r)}}uo.ascending=i,uo.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},uo.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},uo.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},uo.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},uo.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)o(r=+t[a])&&(n+=r);else for(;++a<i;)o(r=+e.call(t,t[a],a))&&(n+=r);return n},uo.mean=function(t,e){var r,n=0,i=t.length,s=-1,l=i;if(1===arguments.length)for(;++s<i;)o(r=a(t[s]))?n+=r:--l;else for(;++s<i;)o(r=a(e.call(t,t[s],s)))?n+=r:--l;if(l)return n/l},uo.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i},uo.median=function(t,e){var r,n=[],s=t.length,l=-1;if(1===arguments.length)for(;++l<s;)o(r=a(t[l]))&&n.push(r);else for(;++l<s;)o(r=a(e.call(t,t[l],l)))&&n.push(r);if(n.length)return uo.quantile(n.sort(i),.5)},uo.variance=function(t,e){var r,n,i=t.length,s=0,l=0,u=-1,c=0;if(1===arguments.length)for(;++u<i;)o(r=a(t[u]))&&(n=r-s,s+=n/++c,l+=n*(r-s));else for(;++u<i;)o(r=a(e.call(t,t[u],u)))&&(n=r-s,s+=n/++c,l+=n*(r-s));if(c>1)return l/(c-1)},uo.deviation=function(){var t=uo.variance.apply(this,arguments);return t?Math.sqrt(t):t};var bo=s(i);uo.bisectLeft=bo.left,uo.bisect=uo.bisectRight=bo.right,uo.bisector=function(t){return s(1===t.length?function(e,r){return i(t(e),r)}:t)},uo.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},uo.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},uo.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e<r;)i[e]=[n,n=t[++e]];return i},uo.transpose=function(t){if(!(i=t.length))return[];for(var e=-1,r=uo.min(t,l),n=new Array(r);++e<r;)for(var i,a=-1,o=n[e]=new Array(i);++a<i;)o[a]=t[a][e];return n},uo.zip=function(){return uo.transpose(arguments)},uo.keys=function(t){var e=[];for(var r in t)e.push(r);return e},uo.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},uo.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},uo.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r};var xo=Math.abs;uo.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error(\"infinite range\");var n,i=[],a=u(xo(r)),o=-1;if(t*=a,e*=a,r*=a,r<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},uo.map=function(t,e){var r=new h;if(t instanceof h)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,i=-1,a=t.length;if(1===arguments.length)for(;++i<a;)r.set(i,t[i]);else for(;++i<a;)r.set(e.call(t,n=t[i],i),n)}else for(var o in t)r.set(o,t[o]);return r};var _o=\"__proto__\",wo=\"\\0\";c(h,{has:p,get:function(t){return this._[f(t)]},set:function(t,e){return this._[f(t)]=e},remove:m,keys:g,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:d(e),value:this._[e]});return t},size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e),this._[e])}}),uo.nest=function(){function t(e,o,s){if(s>=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,c,f,d=-1,p=o.length,m=a[s++],g=new h;++d<p;)(f=g.get(l=m(u=o[d])))?f.push(u):g.set(l,[u]);return e?(u=e(),c=function(r,n){u.set(r,t(e,n,s))}):(u={},c=function(r,n){u[r]=t(e,n,s)}),g.forEach(c),u}function e(t,r){if(r>=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t(uo.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},uo.set=function(t){var e=new b;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},c(b,{has:p,add:function(t){return this._[f(t+=\"\")]=!0,t},remove:m,values:g,size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e))}}),uo.behavior={},uo.rebind=function(t,e){\n", | |
"for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=_(t,e,e[r]);return t};var Mo=[\"webkit\",\"ms\",\"moz\",\"Moz\",\"o\",\"O\"];uo.dispatch=function(){for(var t=new k,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=A(t);return t},k.prototype.on=function(t,e){var r=t.indexOf(\".\"),n=\"\";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},uo.event=null,uo.requote=function(t){return t.replace(ko,\"\\\\$&\")};var ko=/[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g,Ao={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},To=function(t,e){return e.querySelector(t)},So=function(t,e){return e.querySelectorAll(t)},Eo=function(t,e){var r=t.matches||t[w(t,\"matchesSelector\")];return(Eo=function(t,e){return r.call(t,e)})(t,e)};\"function\"==typeof Sizzle&&(To=function(t,e){return Sizzle(t,e)[0]||null},So=Sizzle,Eo=Sizzle.matchesSelector),uo.selection=function(){return uo.select(fo.documentElement)};var Lo=uo.selection.prototype=[];Lo.select=function(t){var e,r,n,i,a=[];t=C(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&\"__data__\"in i&&(r.__data__=i.__data__)):e.push(null)}return L(a)},Lo.selectAll=function(t){var e,r,n=[];t=I(t);for(var i=-1,a=this.length;++i<a;)for(var o=this[i],s=-1,l=o.length;++s<l;)(r=o[s])&&(n.push(e=ho(t.call(r,r.__data__,s,i))),e.parentNode=r);return L(n)};var Co=\"http://www.w3.org/1999/xhtml\",Io={svg:\"http://www.w3.org/2000/svg\",xhtml:Co,xlink:\"http://www.w3.org/1999/xlink\",xml:\"http://www.w3.org/XML/1998/namespace\",xmlns:\"http://www.w3.org/2000/xmlns/\"};uo.ns={prefix:Io,qualify:function(t){var e=t.indexOf(\":\"),r=t;return e>=0&&\"xmlns\"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Io.hasOwnProperty(r)?{space:Io[r],local:t}:t}},Lo.attr=function(t,e){if(arguments.length<2){if(\"string\"==typeof t){var r=this.node();return t=uo.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(z(e,t[e]));return this}return this.each(z(t,e))},Lo.classed=function(t,e){if(arguments.length<2){if(\"string\"==typeof t){var r=this.node(),n=(t=O(t)).length,i=-1;if(e=r.classList){for(;++i<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute(\"class\");++i<n;)if(!P(t[i]).test(e))return!1;return!0}for(e in t)this.each(R(e,t[e]));return this}return this.each(R(t,e))},Lo.style=function(t,e,r){var i=arguments.length;if(i<3){if(\"string\"!=typeof t){i<2&&(e=\"\");for(r in t)this.each(j(r,t[r],e));return this}if(i<2){var a=this.node();return n(a).getComputedStyle(a,null).getPropertyValue(t)}r=\"\"}return this.each(j(t,e,r))},Lo.property=function(t,e){if(arguments.length<2){if(\"string\"==typeof t)return this.node()[t];for(e in t)this.each(N(e,t[e]));return this}return this.each(N(t,e))},Lo.text=function(t){return arguments.length?this.each(\"function\"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?\"\":e}:null==t?function(){this.textContent=\"\"}:function(){this.textContent=t}):this.node().textContent},Lo.html=function(t){return arguments.length?this.each(\"function\"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?\"\":e}:null==t?function(){this.innerHTML=\"\"}:function(){this.innerHTML=t}):this.node().innerHTML},Lo.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Lo.insert=function(t,e){return t=B(t),e=C(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Lo.remove=function(){return this.each(U)},Lo.data=function(t,e){function r(t,r){var n,i,a,o=t.length,c=r.length,f=Math.min(o,c),d=new Array(c),p=new Array(c),m=new Array(o);if(e){var g,v=new h,y=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(v.has(g=e.call(i,i.__data__,n))?m[n]=i:v.set(g,i),y[n]=g);for(n=-1;++n<c;)(i=v.get(g=e.call(r,a=r[n],n)))?!0!==i&&(d[n]=i,i.__data__=a):p[n]=V(a),v.set(g,!0);for(n=-1;++n<o;)n in y&&!0!==v.get(y[n])&&(m[n]=t[n])}else{for(n=-1;++n<f;)i=t[n],a=r[n],i?(i.__data__=a,d[n]=i):p[n]=V(a);for(;n<c;++n)p[n]=V(r[n]);for(;n<o;++n)m[n]=t[n]}p.update=d,p.parentNode=d.parentNode=m.parentNode=t.parentNode,s.push(p),l.push(d),u.push(m)}var n,i,a=-1,o=this.length;if(!arguments.length){for(t=new Array(o=(n=this[0]).length);++a<o;)(i=n[a])&&(t[a]=i.__data__);return t}var s=Y([]),l=L([]),u=L([]);if(\"function\"==typeof t)for(;++a<o;)r(n=this[a],t.call(n,n.parentNode.__data__,a));else for(;++a<o;)r(n=this[a],t);return l.enter=function(){return s},l.exit=function(){return u},l},Lo.datum=function(t){return arguments.length?this.property(\"__data__\",t):this.property(\"__data__\")},Lo.filter=function(t){var e,r,n,i=[];\"function\"!=typeof t&&(t=H(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return L(i)},Lo.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],i=n.length-1,a=n[i];--i>=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Lo.sort=function(t){t=q.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Lo.each=function(t){return G(this,function(e,r,n){t.call(e,e.__data__,r,n)})},Lo.call=function(t){var e=ho(arguments);return t.apply(e[0]=this,e),this},Lo.empty=function(){return!this.node()},Lo.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},Lo.size=function(){var t=0;return G(this,function(){++t}),t};var zo=[];uo.selection.enter=Y,uo.selection.enter.prototype=zo,zo.append=Lo.append,zo.empty=Lo.empty,zo.node=Lo.node,zo.call=Lo.call,zo.size=Lo.size,zo.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(e=[]),e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(a=i[u])?(e.push(n[u]=r=t.call(i.parentNode,a.__data__,u,s)),r.__data__=a.__data__):e.push(null)}return L(o)},zo.insert=function(t,e){return arguments.length<2&&(e=W(this)),Lo.insert.call(this,t,e)},uo.select=function(t){var r;return\"string\"==typeof t?(r=[To(t,fo)],r.parentNode=fo.documentElement):(r=[t],r.parentNode=e(t)),L([r])},uo.selectAll=function(t){var e;return\"string\"==typeof t?(e=ho(So(t,fo)),e.parentNode=fo.documentElement):(e=ho(t),e.parentNode=null),L([e])},Lo.on=function(t,e,r){var n=arguments.length;if(n<3){if(\"string\"!=typeof t){n<2&&(e=!1);for(r in t)this.each(X(r,t[r],e));return this}if(n<2)return(n=this.node()[\"__on\"+t])&&n._;r=!1}return this.each(X(t,e,r))};var Do=uo.map({mouseenter:\"mouseover\",mouseleave:\"mouseout\"});fo&&Do.forEach(function(t){\"on\"+t in fo&&Do.remove(t)});var Po,Oo=0;uo.mouse=function(t){return Q(t,S())};var Ro=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;uo.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=S().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return Q(t,n)},uo.behavior.drag=function(){function t(){this.on(\"mousedown.drag\",a).on(\"touchstart.drag\",o)}function e(t,e,n,a,o){return function(){function s(){var t,r,n=e(f,m);n&&(t=n[0]-b[0],r=n[1]-b[1],p|=t|r,b=n,d({type:\"drag\",x:n[0]+u[0],y:n[1]+u[1],dx:t,dy:r}))}function l(){e(f,m)&&(v.on(a+g,null).on(o+g,null),y(p),d({type:\"dragend\"}))}var u,c=this,h=uo.event.target.correspondingElement||uo.event.target,f=c.parentNode,d=r.of(c,arguments),p=0,m=t(),g=\".drag\"+(null==m?\"\":\"-\"+m),v=uo.select(n(h)).on(a+g,s).on(o+g,l),y=K(h),b=e(f,m);i?(u=i.apply(c,arguments),u=[u.x-b[0],u.y-b[1]]):u=[0,0],d({type:\"dragstart\"})}}var r=E(t,\"drag\",\"dragstart\",\"dragend\"),i=null,a=e(M,uo.mouse,n,\"mousemove\",\"mouseup\"),o=e($,uo.touch,x,\"touchmove\",\"touchend\");return t.origin=function(e){return arguments.length?(i=e,t):i},uo.rebind(t,r,\"on\")},uo.touches=function(t,e){return arguments.length<2&&(e=S().touches),e?ho(e).map(function(e){var r=Q(t,e);return r.identifier=e.identifier,r}):[]};var Fo=1e-6,jo=Fo*Fo,No=Math.PI,Bo=2*No,Uo=Bo-Fo,Vo=No/2,Ho=No/180,qo=180/No,Go=Math.SQRT2;uo.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,h=l-a,f=c*c+h*h;if(f<jo)n=Math.log(u/o)/Go,r=function(t){return[i+t*c,a+t*h,o*Math.exp(Go*t*n)]};else{var d=Math.sqrt(f),p=(u*u-o*o+4*f)/(2*o*2*d),m=(u*u-o*o-4*f)/(2*u*2*d),g=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(m*m+1)-m);n=(v-g)/Go,r=function(t){var e=t*n,r=at(g),s=o/(2*d)*(r*ot(Go*e+g)-it(g));return[i+s*c,a+s*h,o*r/at(Go*e+g)]}}return r.duration=1e3*n,r},uo.behavior.zoom=function(){function t(t){t.on(I,h).on(Wo+\".zoom\",d).on(\"dblclick.zoom\",p).on(P,f)}function e(t){return[(t[0]-k.x)/k.k,(t[1]-k.y)/k.k]}function r(t){return[t[0]*k.k+k.x,t[1]*k.k+k.y]}function i(t){k.k=Math.max(S[0],Math.min(S[1],t))}function a(t,e){e=r(e),k.x+=t[0]-e[0],k.y+=t[1]-e[1]}function o(e,r,n,o){e.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),a(g=r,n),e=uo.select(e),L>0&&(e=e.transition().duration(L)),e.call(t.event)}function s(){_&&_.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),M&&M.domain(w.range().map(function(t){return(t-k.y)/k.k}).map(w.invert))}function l(t){C++||t({type:\"zoomstart\"})}function u(t){s(),t({type:\"zoom\",scale:k.k,translate:[k.x,k.y]})}function c(t){--C||(t({type:\"zoomend\"}),g=null)}function h(){function t(){s=1,a(uo.mouse(i),f),u(o)}function r(){h.on(z,null).on(D,null),d(s),c(o)}var i=this,o=O.of(i,arguments),s=0,h=uo.select(n(i)).on(z,t).on(D,r),f=e(uo.mouse(i)),d=K(i);Bl.call(i),l(o)}function f(){function t(){var t=uo.touches(p);return d=k.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function r(){var e=uo.event.target;uo.select(e).on(x,n).on(_,s),w.push(e);for(var r=uo.event.changedTouches,i=0,a=r.length;i<a;++i)g[r[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(u-b<500){var c=l[0];o(p,c,g[c.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),T()}b=u}else if(l.length>1){var c=l[0],h=l[1],f=c[0]-h[0],d=c[1]-h[1];v=f*f+d*d}}function n(){var t,e,r,n,o=uo.touches(p);Bl.call(p);for(var s=0,l=o.length;s<l;++s,n=null)if(r=o[s],n=g[r.identifier]){if(e)break;t=r,e=n}if(n){var c=(c=r[0]-t[0])*c+(c=r[1]-t[1])*c,h=v&&Math.sqrt(c/v);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],i(h*d)}b=null,a(t,e),u(m)}function s(){if(uo.event.touches.length){for(var e=uo.event.changedTouches,r=0,n=e.length;r<n;++r)delete g[e[r].identifier];for(var i in g)return void t()}uo.selectAll(w).on(y,null),M.on(I,h).on(P,f),A(),c(m)}var d,p=this,m=O.of(p,arguments),g={},v=0,y=\".zoom-\"+uo.event.changedTouches[0].identifier,x=\"touchmove\"+y,_=\"touchend\"+y,w=[],M=uo.select(p),A=K(p);r(),l(m),M.on(I,null).on(P,r)}function d(){var t=O.of(this,arguments);y?clearTimeout(y):(Bl.call(this),m=e(g=v||uo.mouse(this)),l(t)),y=setTimeout(function(){y=null,c(t)},50),T(),i(Math.pow(2,.002*Yo())*k.k),a(g,m),u(t)}function p(){var t=uo.mouse(this),r=Math.log(k.k)/Math.LN2;o(this,t,e(t),uo.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var m,g,v,y,b,x,_,w,M,k={x:0,y:0,k:1},A=[960,500],S=Xo,L=250,C=0,I=\"mousedown.zoom\",z=\"mousemove.zoom\",D=\"mouseup.zoom\",P=\"touchstart.zoom\",O=E(t,\"zoomstart\",\"zoom\",\"zoomend\");return Wo||(Wo=\"onwheel\"in fo?(Yo=function(){return-uo.event.deltaY*(uo.event.deltaMode?120:1)},\"wheel\"):\"onmousewheel\"in fo?(Yo=function(){return uo.event.wheelDelta},\"mousewheel\"):(Yo=function(){return-uo.event.detail},\"MozMousePixelScroll\")),t.event=function(t){t.each(function(){var t=O.of(this,arguments),e=k;jl?uo.select(this).transition().each(\"start.zoom\",function(){k=this.__chart__||{x:0,y:0,k:1},l(t)}).tween(\"zoom:zoom\",function(){var r=A[0],n=A[1],i=g?g[0]:r/2,a=g?g[1]:n/2,o=uo.interpolateZoom([(i-k.x)/k.k,(a-k.y)/k.k,r/k.k],[(i-e.x)/e.k,(a-e.y)/e.k,r/e.k]);return function(e){var n=o(e),s=r/n[2];this.__chart__=k={x:i-n[0]*s,y:a-n[1]*s,k:s},u(t)}}).each(\"interrupt.zoom\",function(){c(t)}).each(\"end.zoom\",function(){c(t)}):(this.__chart__=k,l(t),u(t),c(t))})},t.translate=function(e){return arguments.length?(k={x:+e[0],y:+e[1],k:k.k},s(),t):[k.x,k.y]},t.scale=function(e){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+e),s(),t):k.k},t.scaleExtent=function(e){return arguments.length?(S=null==e?Xo:[+e[0],+e[1]],t):S},t.center=function(e){return arguments.length?(v=e&&[+e[0],+e[1]],t):v},t.size=function(e){return arguments.length?(A=e&&[+e[0],+e[1]],t):A},t.duration=function(e){return arguments.length?(L=+e,t):L},t.x=function(e){return arguments.length?(_=e,x=e.copy(),k={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(M=e,w=e.copy(),k={x:0,y:0,k:1},t):M},uo.rebind(t,O,\"on\")};var Yo,Wo,Xo=[0,1/0];uo.color=lt,lt.prototype.toString=function(){return this.rgb()+\"\"},uo.hsl=ut;var Zo=ut.prototype=new lt;Zo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,this.l/t)},Zo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,t*this.l)},Zo.rgb=function(){return ct(this.h,this.s,this.l)},uo.hcl=ht;var Jo=ht.prototype=new lt;Jo.brighter=function(t){return new ht(this.h,this.c,Math.min(100,this.l+Ko*(arguments.length?t:1)))},Jo.darker=function(t){return new ht(this.h,this.c,Math.max(0,this.l-Ko*(arguments.length?t:1)))},Jo.rgb=function(){return ft(this.h,this.c,this.l).rgb()},uo.lab=dt;var Ko=18,Qo=.95047,$o=1,ts=1.08883,es=dt.prototype=new lt;es.brighter=function(t){return new dt(Math.min(100,this.l+Ko*(arguments.length?t:1)),this.a,this.b)},es.darker=function(t){return new dt(Math.max(0,this.l-Ko*(arguments.length?t:1)),this.a,this.b)},es.rgb=function(){return pt(this.l,this.a,this.b)},uo.rgb=bt;var rs=bt.prototype=new lt;rs.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e<i&&(e=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new bt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new bt(i,i,i)},rs.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new bt(t*this.r,t*this.g,t*this.b)},rs.hsl=function(){return kt(this.r,this.g,this.b)},rs.toString=function(){return\"#\"+wt(this.r)+wt(this.g)+wt(this.b)};var ns=uo.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ns.forEach(function(t,e){ns.set(t,xt(e))}),uo.functor=Et,uo.xhr=Lt(x),uo.dsv=function(t,e){function r(t,r,a){arguments.length<3&&(a=r,r=null);var o=Ct(t,e,null==r?n:i(r),a);return o.row=function(t){return arguments.length?o.response(null==(r=t)?n:i(t)):r},o}function n(t){return r.parse(t.responseText)}function i(t){return function(e){return r.parse(e.responseText,t)}}function a(e){return e.map(o).join(t)}function o(t){return s.test(t)?'\"'+t.replace(/\\\"/g,'\"\"')+'\"':t}var s=new RegExp('[\"'+t+\"\\n]\"),l=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var i=new Function(\"d\",\"return {\"+t.map(function(t,e){return JSON.stringify(t)+\": d[\"+e+\"]\"}).join(\",\")+\"}\");n=e?function(t,r){return e(i(t),r)}:i})},r.parseRows=function(t,e){function r(){if(c>=u)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<u;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}c=r+2;var n=t.charCodeAt(r+1);return 13===n?(i=!0,10===t.charCodeAt(r+2)&&++c):10===n&&(i=!0),t.slice(e+1,r).replace(/\"\"/g,'\"')}for(;c<u;){var n=t.charCodeAt(c++),s=1;if(10===n)i=!0;else if(13===n)i=!0,10===t.charCodeAt(c)&&(++c,++s);else if(n!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var n,i,a={},o={},s=[],u=t.length,c=0,h=0;(n=r())!==o;){for(var f=[];n!==a&&n!==o;)f.push(n),n=r();e&&null==(f=e(f,h++))||s.push(f)}return s},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new b,i=[];return e.forEach(function(t){for(var e in t)n.has(e)||i.push(n.add(e))}),[i.map(o).join(t)].concat(e.map(function(e){return i.map(function(t){return o(e[t])}).join(t)})).join(\"\\n\")},r.formatRows=function(t){return t.map(a).join(\"\\n\")},r},uo.csv=uo.dsv(\",\",\"text/csv\"),uo.tsv=uo.dsv(\"\\t\",\"text/tab-separated-values\");var is,as,os,ss,ls=this[w(this,\"requestAnimationFrame\")]||function(t){setTimeout(t,17)};uo.timer=function(){Dt.apply(this,arguments)},uo.timer.flush=function(){Ot(),Rt()},uo.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var us=[\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\\xb5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"].map(jt);uo.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=uo.round(t,Ft(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),us[8+r/3]};var cs=/(?:([^{])?([<>=^]))?([+\\- ])?([$#])?(0)?(\\d+)?(,)?(\\.-?\\d+)?([a-z%])?/i,hs=uo.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=uo.round(t,Ft(t,e))).toFixed(Math.max(0,Math.min(20,Ft(t*(1+1e-15),e))))}}),fs=uo.time={},ds=Date;Ut.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){ps.setUTCDate.apply(this._,arguments)},setDay:function(){ps.setUTCDay.apply(this._,arguments)},setFullYear:function(){ps.setUTCFullYear.apply(this._,arguments)},setHours:function(){ps.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){ps.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){ps.setUTCMinutes.apply(this._,arguments)},setMonth:function(){ps.setUTCMonth.apply(this._,arguments)},setSeconds:function(){ps.setUTCSeconds.apply(this._,arguments)},setTime:function(){ps.setTime.apply(this._,arguments)}};var ps=Date.prototype;fs.year=Vt(function(t){return t=fs.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),fs.years=fs.year.range,fs.years.utc=fs.year.utc.range,fs.day=Vt(function(t){var e=new ds(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),fs.days=fs.day.range,fs.days.utc=fs.day.utc.range,fs.dayOfYear=function(t){var e=fs.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},[\"sunday\",\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\"].forEach(function(t,e){e=7-e;var r=fs[t]=Vt(function(t){return(t=fs.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=fs.year(t).getDay();return Math.floor((fs.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});fs[t+\"s\"]=r.range,fs[t+\"s\"].utc=r.utc.range,fs[t+\"OfYear\"]=function(t){var r=fs.year(t).getDay();return Math.floor((fs.dayOfYear(t)+(r+e)%7)/7)}}),fs.week=fs.sunday,fs.weeks=fs.sunday.range,fs.weeks.utc=fs.sunday.utc.range,fs.weekOfYear=fs.sundayOfYear;var ms={\"-\":\"\",_:\" \",0:\"0\"},gs=/^\\s*\\d+/,vs=/^%/;uo.locale=function(t){return{numberFormat:Nt(t),timeFormat:qt(t)}};var ys=uo.locale({decimal:\".\",thousands:\",\",grouping:[3],currency:[\"$\",\"\"],dateTime:\"%a %b %e %X %Y\",date:\"%m/%d/%Y\",time:\"%H:%M:%S\",periods:[\"AM\",\"PM\"],days:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],shortDays:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],shortMonths:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"]});uo.format=ys.numberFormat,uo.geo={},he.prototype={s:0,t:0,add:function(t){fe(t,this.t,bs),fe(bs.s,this.s,this),this.s?this.t+=bs.t:this.s=bs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var bs=new he;uo.geo.stream=function(t,e){t&&xs.hasOwnProperty(t.type)?xs[t.type](t,e):de(t,e)};var xs={Feature:function(t,e){de(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)de(r[n].geometry,e)}},_s={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){pe(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)pe(r[n],e,0)},Polygon:function(t,e){me(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)me(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)de(r[n],e)}};uo.geo.area=function(t){return ws=0,uo.geo.stream(t,ks),ws};var ws,Ms=new he,ks={sphere:function(){ws+=4*No},point:M,lineStart:M,lineEnd:M,polygonStart:function(){Ms.reset(),ks.lineStart=ge},polygonEnd:function(){var t=2*Ms;ws+=t<0?4*No+t:t,ks.lineStart=ks.lineEnd=ks.point=M}};uo.geo.bounds=function(){function t(t,e){b.push(x=[c=t,f=t]),e<h&&(h=e),e>d&&(d=e)}function e(e,r){var n=ve([e*Ho,r*Ho]);if(v){var i=be(v,n),a=[i[1],-i[0],0],o=be(a,i);we(o),o=Me(o);var l=e-p,u=l>0?1:-1,m=o[0]*qo*u,g=xo(l)>180;if(g^(u*p<m&&m<u*e)){var y=o[1]*qo;y>d&&(d=y)}else if(m=(m+360)%360-180,g^(u*p<m&&m<u*e)){var y=-o[1]*qo;y<h&&(h=y)}else r<h&&(h=r),r>d&&(d=r);g?e<p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e):f>=c?(e<c&&(c=e),e>f&&(f=e)):e>p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e)}else t(e,r);v=n,p=e}function r(){_.point=e}function n(){x[0]=c,x[1]=f,_.point=t,v=null}function i(t,r){if(v){var n=t-p;y+=xo(n)>180?n+(n>0?360:-360):n}else m=t,g=r;ks.point(t,r),e(t,r)}function a(){ks.lineStart()}function o(){i(m,g),ks.lineEnd(),xo(y)>Fo&&(c=-(f=180)),x[0]=c,x[1]=f,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,h,f,d,p,m,g,v,y,b,x,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=i,_.lineStart=a,_.lineEnd=o,y=0,ks.polygonStart()},polygonEnd:function(){ks.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,Ms<0?(c=-(f=180),h=-(d=90)):y>Fo?d=90:y<-Fo&&(h=-90),x[0]=c,x[1]=f}};return function(t){d=f=-(c=h=1/0),b=[],uo.geo.stream(t,_);var e=b.length;if(e){b.sort(l);for(var r,n=1,i=b[0],a=[i];n<e;++n)r=b[n],u(r[0],i)||u(r[1],i)?(s(i[0],r[1])>s(i[0],i[1])&&(i[1]=r[1]),s(r[0],i[1])>s(i[0],i[1])&&(i[0]=r[0])):a.push(i=r);for(var o,r,p=-1/0,e=a.length-1,n=0,i=a[e];n<=e;i=r,++n)r=a[n],(o=s(i[1],r[0]))>p&&(p=o,c=r[0],f=i[1])}return b=x=null,c===1/0||h===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,h],[f,d]]}}(),uo.geo.centroid=function(t){As=Ts=Ss=Es=Ls=Cs=Is=zs=Ds=Ps=Os=0,uo.geo.stream(t,Rs);var e=Ds,r=Ps,n=Os,i=e*e+r*r+n*n;return i<jo&&(e=Cs,r=Is,n=zs,Ts<Fo&&(e=Ss,r=Es,n=Ls),(i=e*e+r*r+n*n)<jo)?[NaN,NaN]:[Math.atan2(r,e)*qo,nt(n/Math.sqrt(i))*qo]};var As,Ts,Ss,Es,Ls,Cs,Is,zs,Ds,Ps,Os,Rs={sphere:M,point:Ae,lineStart:Se,lineEnd:Ee,polygonStart:function(){Rs.lineStart=Le},polygonEnd:function(){Rs.lineStart=Se}},Fs=Oe(Ie,Ne,Ue,[-No,-No/2]),js=1e9;uo.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),i=a(t),i.valid=!0,i},extent:function(s){return arguments.length?(a=Ge(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(uo.geo.conicEqualArea=function(){return Ye(We)}).raw=We,uo.geo.albers=function(){return uo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},uo.geo.albersUsa=function(){function t(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}var e,r,n,i,a=uo.geo.albers(),o=uo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=uo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};return t.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var u=a.scale(),c=+e[0],h=+e[1];return r=a.translate(e).clipExtent([[c-.455*u,h-.238*u],[c+.455*u,h+.238*u]]).stream(l).point,n=o.translate([c-.307*u,h+.201*u]).clipExtent([[c-.425*u+Fo,h+.12*u+Fo],[c-.214*u-Fo,h+.234*u-Fo]]).stream(l).point,i=s.translate([c-.205*u,h+.212*u]).clipExtent([[c-.214*u+Fo,h+.166*u+Fo],[c-.115*u-Fo,h+.234*u-Fo]]).stream(l).point,t},t.scale(1070)};var Ns,Bs,Us,Vs,Hs,qs,Gs={point:M,lineStart:M,lineEnd:M,polygonStart:function(){Bs=0,Gs.lineStart=Xe},polygonEnd:function(){Gs.lineStart=Gs.lineEnd=Gs.point=M,Ns+=xo(Bs/2)}},Ys={point:Ze,lineStart:M,lineEnd:M,polygonStart:M,polygonEnd:M},Ws={point:Qe,lineStart:$e,lineEnd:tr,polygonStart:function(){Ws.lineStart=er},polygonEnd:function(){Ws.point=Qe,Ws.lineStart=$e,Ws.lineEnd=tr}};uo.geo.path=function(){function t(t){return t&&(\"function\"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),uo.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Ns=0,uo.geo.stream(t,i(Gs)),Ns},t.centroid=function(t){return Ss=Es=Ls=Cs=Is=zs=Ds=Ps=Os=0,uo.geo.stream(t,i(Ws)),Os?[Ds/Os,Ps/Os]:zs?[Cs/zs,Is/zs]:Ls?[Ss/Ls,Es/Ls]:[NaN,NaN]},t.bounds=function(t){return Hs=qs=-(Us=Vs=1/0),uo.geo.stream(t,i(Ys)),[[Us,Vs],[Hs,qs]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||ir(t):x,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new Je:new rr(t),\"function\"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s=\"function\"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection(uo.geo.albersUsa()).context(null)},uo.geo.transform=function(t){return{stream:function(e){var r=new ar(e);for(var n in t)r[n]=t[n];return r}}},ar.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},uo.geo.projection=sr,uo.geo.projectionMutator=lr,(uo.geo.equirectangular=function(){return sr(cr)}).raw=cr.invert=cr,uo.geo.rotation=function(t){function e(e){return e=t(e[0]*Ho,e[1]*Ho),e[0]*=qo,e[1]*=qo,e}return t=fr(t[0]%360*Ho,t[1]*Ho,t.length>2?t[2]*Ho:0),e.invert=function(e){return e=t.invert(e[0]*Ho,e[1]*Ho),e[0]*=qo,e[1]*=qo,e},e},hr.invert=cr,uo.geo.circle=function(){function t(){var t=\"function\"==typeof n?n.apply(this,arguments):n,e=fr(-t[0]*Ho,-t[1]*Ho,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=qo,t[1]*=qo}}),{type:\"Polygon\",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=gr((e=+n)*Ho,i*Ho),t):e},t.precision=function(n){return arguments.length?(r=gr(e*Ho,(i=+n)*Ho),t):i},t.angle(90)},uo.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ho,i=t[1]*Ho,a=e[1]*Ho,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((r=h*o)*r+(r=u*c-l*h*s)*r),l*c+u*h*s)},uo.geo.graticule=function(){function t(){return{type:\"MultiLineString\",coordinates:e()}}function e(){return uo.range(Math.ceil(a/g)*g,i,g).map(f).concat(uo.range(Math.ceil(u/v)*v,l,v).map(d)).concat(uo.range(Math.ceil(n/p)*p,r,p).filter(function(t){return xo(t%g)>Fo}).map(c)).concat(uo.range(Math.ceil(s/m)*m,o,m).filter(function(t){return xo(t%v)>Fo}).map(h))}var r,n,i,a,o,s,l,u,c,h,f,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:\"LineString\",coordinates:t}})},t.outline=function(){return{type:\"Polygon\",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(u).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],u=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),u>l&&(e=u,u=l,l=e),t.precision(y)):[[a,u],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){\n", | |
"return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,c=yr(s,o,90),h=br(n,r,y),f=yr(u,l,90),d=br(a,i,y),t):y},t.majorExtent([[-180,-90+Fo],[180,90-Fo]]).minorExtent([[-180,-80-Fo],[180,80+Fo]])},uo.geo.greatArc=function(){function t(){return{type:\"LineString\",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=xr,i=_r;return t.distance=function(){return uo.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e=\"function\"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r=\"function\"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},uo.geo.interpolate=function(t,e){return wr(t[0]*Ho,t[1]*Ho,e[0]*Ho,e[1]*Ho)},uo.geo.length=function(t){return Xs=0,uo.geo.stream(t,Zs),Xs};var Xs,Zs={sphere:M,point:M,lineStart:Mr,lineEnd:M,polygonStart:M,polygonEnd:M},Js=kr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(uo.geo.azimuthalEqualArea=function(){return sr(Js)}).raw=Js;var Ks=kr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(uo.geo.azimuthalEquidistant=function(){return sr(Ks)}).raw=Ks,(uo.geo.conicConformal=function(){return Ye(Ar)}).raw=Ar,(uo.geo.conicEquidistant=function(){return Ye(Tr)}).raw=Tr;var Qs=kr(function(t){return 1/t},Math.atan);(uo.geo.gnomonic=function(){return sr(Qs)}).raw=Qs,Sr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Vo]},(uo.geo.mercator=function(){return Er(Sr)}).raw=Sr;var $s=kr(function(){return 1},Math.asin);(uo.geo.orthographic=function(){return sr($s)}).raw=$s;var tl=kr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(uo.geo.stereographic=function(){return sr(tl)}).raw=tl,Lr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Vo]},(uo.geo.transverseMercator=function(){var t=Er(Lr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Lr,uo.geom={},uo.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Et(r),a=Et(n),o=t.length,s=[],l=[];for(e=0;e<o;e++)s.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(s.sort(Dr),e=0;e<o;e++)l.push([s[e][0],-s[e][1]]);var u=zr(s),c=zr(l),h=c[0]===u[0],f=c[c.length-1]===u[u.length-1],d=[];for(e=u.length-1;e>=0;--e)d.push(t[s[u[e]][2]]);for(e=+h;e<c.length-f;++e)d.push(t[s[c[e]][2]]);return d}var r=Cr,n=Ir;return arguments.length?e(t):(e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e)},uo.geom.polygon=function(t){return Ao(t,el),t};var el=uo.geom.polygon.prototype=[];el.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},el.centroid=function(t){var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},el.clip=function(t){for(var e,r,n,i,a,o,s=Rr(t),l=-1,u=this.length-Rr(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)o=e[r],Pr(o,c,i)?(Pr(a,c,i)||t.push(Or(a,o,c,i)),t.push(o)):Pr(a,c,i)&&t.push(Or(a,o,c,i)),a=o;s&&t.push(t[0]),c=i}return t};var rl,nl,il,al,ol,sl=[],ll=[];qr.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)t=e[r].edge,t.b&&t.a||e.splice(r,1);return e.sort(Yr),e.length},rn.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},nn.prototype={insert:function(t,e){var r,n,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=ln(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)n=r.U,r===n.L?(i=n.R,i&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(on(this,r),t=r,r=t.U),r.C=!1,n.C=!0,sn(this,n))):(i=n.L,i&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(sn(this,r),t=r,r=t.U),r.C=!1,n.C=!0,on(this,n))),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,i=t.U,a=t.L,o=t.R;if(r=a?o?ln(o):a:o,i?i.L===t?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=t.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=o,o.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(e=i.R,e.C&&(e.C=!1,i.C=!0,on(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,sn(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,on(this,i),t=this._;break}}else if(e=i.L,e.C&&(e.C=!1,i.C=!0,sn(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,on(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,sn(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},uo.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=s[0][0],i=s[0][1],a=s[1][0],o=s[1][1];return un(r(t),s).cells.forEach(function(r,s){var l=r.edges,u=r.site;(e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=n&&u.x<=a&&u.y>=i&&u.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Fo)*Fo,y:Math.round(o(t,e)/Fo)*Fo,i:e}})}var n=Cr,i=Ir,a=n,o=i,s=ul;return t?e(t):(e.links=function(t){return un(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return un(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(Yr),s=-1,l=o.length,u=o[l-1].edge,c=u.l===a?u.r:u.l;++s<l;)u,i=c,u=o[s].edge,c=u.l===a?u.r:u.l,n<i.i&&n<c.i&&hn(a,i,c)<0&&e.push([t[n],t[i.i],t[c.i]])}),e},e.x=function(t){return arguments.length?(a=Et(n=t),e):n},e.y=function(t){return arguments.length?(o=Et(i=t),e):i},e.clipExtent=function(t){return arguments.length?(s=null==t?ul:t,e):s===ul?null:s},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===ul?null:s&&s[1]},e)};var ul=[[-1e6,-1e6],[1e6,1e6]];uo.geom.delaunay=function(t){return uo.geom.voronoi().triangles(t)},uo.geom.quadtree=function(t,e,r,n,i){function a(t){function a(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(xo(l-r)+xo(c-n)<.01)u(t,e,r,n,i,a,o,s);else{var h=t.point;t.x=t.y=t.point=null,u(t,h,l,c,i,a,o,s),u(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else u(t,e,r,n,i,a,o,s)}function u(t,e,r,n,i,o,s,l){var u=.5*(i+s),c=.5*(o+l),h=r>=u,f=n>=c,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=pn()),h?i=u:s=u,f?o=c:l=c,a(t,e,r,n,i,o,s,l)}var c,h,f,d,p,m,g,v,y,b=Et(s),x=Et(l);if(null!=e)m=e,g=r,v=n,y=i;else if(v=y=-(m=g=1/0),h=[],f=[],p=t.length,o)for(d=0;d<p;++d)c=t[d],c.x<m&&(m=c.x),c.y<g&&(g=c.y),c.x>v&&(v=c.x),c.y>y&&(y=c.y),h.push(c.x),f.push(c.y);else for(d=0;d<p;++d){var _=+b(c=t[d],d),w=+x(c,d);_<m&&(m=_),w<g&&(g=w),_>v&&(v=_),w>y&&(y=w),h.push(_),f.push(w)}var M=v-m,k=y-g;M>k?y=g+M:v=m+k;var A=pn();if(A.add=function(t){a(A,t,+b(t,++d),+x(t,d),m,g,v,y)},A.visit=function(t){mn(t,A,m,g,v,y)},A.find=function(t){return gn(A,t[0],t[1],m,g,v,y)},d=-1,null==e){for(;++d<p;)a(A,t[d],h[d],f[d],m,g,v,y);--d}else t.forEach(A.add);return h=f=t=c=null,A}var o,s=Cr,l=Ir;return(o=arguments.length)?(s=fn,l=dn,3===o&&(i=r,n=e,r=e=0),a(t)):(a.x=function(t){return arguments.length?(s=t,a):s},a.y=function(t){return arguments.length?(l=t,a):l},a.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),a):null==e?null:[[e,r],[n,i]]},a.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),a):null==e?null:[n-e,i-r]},a)},uo.interpolateRgb=vn,uo.interpolateObject=yn,uo.interpolateNumber=bn,uo.interpolateString=xn;var cl=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,hl=new RegExp(cl.source,\"g\");uo.interpolate=_n,uo.interpolators=[function(t,e){var r=typeof e;return(\"string\"===r?ns.has(e.toLowerCase())||/^(#|rgb\\(|hsl\\()/i.test(e)?vn:xn:e instanceof lt?vn:Array.isArray(e)?wn:\"object\"===r&&isNaN(e)?yn:bn)(t,e)}],uo.interpolateArray=wn;var fl=function(){return x},dl=uo.map({linear:fl,poly:Ln,quad:function(){return Tn},cubic:function(){return Sn},sin:function(){return Cn},exp:function(){return In},circle:function(){return zn},elastic:Dn,back:Pn,bounce:function(){return On}}),pl=uo.map({in:x,out:kn,\"in-out\":An,\"out-in\":function(t){return An(kn(t))}});uo.ease=function(t){var e=t.indexOf(\"-\"),r=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):\"in\";return r=dl.get(r)||fl,n=pl.get(n)||x,Mn(n(r.apply(null,co.call(arguments,1))))},uo.interpolateHcl=Rn,uo.interpolateHsl=Fn,uo.interpolateLab=jn,uo.interpolateRound=Nn,uo.transform=function(t){var e=fo.createElementNS(uo.ns.prefix.svg,\"g\");return(uo.transform=function(t){if(null!=t){e.setAttribute(\"transform\",t);var r=e.transform.baseVal.consolidate()}return new Bn(r?r.matrix:ml)})(t)},Bn.prototype.toString=function(){return\"translate(\"+this.translate+\")rotate(\"+this.rotate+\")skewX(\"+this.skew+\")scale(\"+this.scale+\")\"};var ml={a:1,b:0,c:0,d:1,e:0,f:0};uo.interpolateTransform=Zn,uo.layout={},uo.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Qn(t[r]));return e}},uo.layout.chord=function(){function t(){var t,u,h,f,d,p={},m=[],g=uo.range(a),v=[];for(r=[],n=[],t=0,f=-1;++f<a;){for(u=0,d=-1;++d<a;)u+=i[f][d];m.push(u),v.push(uo.range(a)),t+=u}for(o&&g.sort(function(t,e){return o(m[t],m[e])}),s&&v.forEach(function(t,e){t.sort(function(t,r){return s(i[e][t],i[e][r])})}),t=(Bo-c*a)/t,u=0,f=-1;++f<a;){for(h=u,d=-1;++d<a;){var y=g[f],b=v[y][d],x=i[y][b],_=u,w=u+=x*t;p[y+\"-\"+b]={index:y,subindex:b,startAngle:_,endAngle:w,value:x}}n[y]={index:y,startAngle:h,endAngle:u,value:m[y]},u+=c}for(f=-1;++f<a;)for(d=f-1;++d<a;){var M=p[f+\"-\"+d],k=p[d+\"-\"+f];(M.value||k.value)&&r.push(M.value<k.value?{source:k,target:M}:{source:M,target:k})}l&&e()}function e(){r.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var r,n,i,a,o,s,l,u={},c=0;return u.matrix=function(t){return arguments.length?(a=(i=t)&&i.length,r=n=null,u):i},u.padding=function(t){return arguments.length?(c=t,r=n=null,u):c},u.sortGroups=function(t){return arguments.length?(o=t,r=n=null,u):o},u.sortSubgroups=function(t){return arguments.length?(s=t,r=null,u):s},u.sortChords=function(t){return arguments.length?(l=t,r&&e(),u):l},u.chords=function(){return r||t(),r},u.groups=function(){return n||t(),n},u},uo.layout.force=function(){function t(t){return function(e,r,n,i){if(e.point!==t){var a=e.cx-t.x,o=e.cy-t.y,s=i-r,l=a*a+o*o;if(s*s/v<l){if(l<m){var u=e.charge/l;t.px-=a*u,t.py-=o*u}return!0}if(e.point&&l&&l<m){var u=e.pointCharge/l;t.px-=a*u,t.py-=o*u}}return!e.charge}}function e(t){t.px=uo.event.x,t.py=uo.event.y,l.resume()}var r,n,i,a,o,s,l={},u=uo.dispatch(\"start\",\"tick\",\"end\"),c=[1,1],h=.9,f=gl,d=vl,p=-30,m=yl,g=.1,v=.64,y=[],b=[];return l.tick=function(){if((i*=.99)<.005)return r=null,u.end({type:\"end\",alpha:i=0}),!0;var e,n,l,f,d,m,v,x,_,w=y.length,M=b.length;for(n=0;n<M;++n)l=b[n],f=l.source,d=l.target,x=d.x-f.x,_=d.y-f.y,(m=x*x+_*_)&&(m=i*o[n]*((m=Math.sqrt(m))-a[n])/m,x*=m,_*=m,d.x-=x*(v=f.weight+d.weight?f.weight/(f.weight+d.weight):.5),d.y-=_*v,f.x+=x*(v=1-v),f.y+=_*v);if((v=i*g)&&(x=c[0]/2,_=c[1]/2,n=-1,v))for(;++n<w;)l=y[n],l.x+=(x-l.x)*v,l.y+=(_-l.y)*v;if(p)for(ai(e=uo.geom.quadtree(y),i,s),n=-1;++n<w;)(l=y[n]).fixed||e.visit(t(l));for(n=-1;++n<w;)l=y[n],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*h,l.y-=(l.py-(l.py=l.y))*h);u.tick({type:\"tick\",alpha:i})},l.nodes=function(t){return arguments.length?(y=t,l):y},l.links=function(t){return arguments.length?(b=t,l):b},l.size=function(t){return arguments.length?(c=t,l):c},l.linkDistance=function(t){return arguments.length?(f=\"function\"==typeof t?t:+t,l):f},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(d=\"function\"==typeof t?t:+t,l):d},l.friction=function(t){return arguments.length?(h=+t,l):h},l.charge=function(t){return arguments.length?(p=\"function\"==typeof t?t:+t,l):p},l.chargeDistance=function(t){return arguments.length?(m=t*t,l):Math.sqrt(m)},l.gravity=function(t){return arguments.length?(g=+t,l):g},l.theta=function(t){return arguments.length?(v=t*t,l):Math.sqrt(v)},l.alpha=function(t){return arguments.length?(t=+t,i?t>0?i=t:(r.c=null,r.t=NaN,r=null,u.end({type:\"end\",alpha:i=0})):t>0&&(u.start({type:\"start\",alpha:i=t}),r=Dt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l<i;++l)r[l]=[];for(l=0;l<u;++l){var a=b[l];r[a.source.index].push(a.target),r[a.target.index].push(a.source)}}for(var o,s=r[e],l=-1,c=s.length;++l<c;)if(!isNaN(o=s[l][t]))return o;return Math.random()*n}var e,r,n,i=y.length,u=b.length,h=c[0],m=c[1];for(e=0;e<i;++e)(n=y[e]).index=e,n.weight=0;for(e=0;e<u;++e)n=b[e],\"number\"==typeof n.source&&(n.source=y[n.source]),\"number\"==typeof n.target&&(n.target=y[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<i;++e)n=y[e],isNaN(n.x)&&(n.x=t(\"x\",h)),isNaN(n.y)&&(n.y=t(\"y\",m)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(a=[],\"function\"==typeof f)for(e=0;e<u;++e)a[e]=+f.call(this,b[e],e);else for(e=0;e<u;++e)a[e]=f;if(o=[],\"function\"==typeof d)for(e=0;e<u;++e)o[e]=+d.call(this,b[e],e);else for(e=0;e<u;++e)o[e]=d;if(s=[],\"function\"==typeof p)for(e=0;e<i;++e)s[e]=+p.call(this,y[e],e);else for(e=0;e<i;++e)s[e]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){if(n||(n=uo.behavior.drag().origin(x).on(\"dragstart.force\",ei).on(\"drag.force\",e).on(\"dragend.force\",ri)),!arguments.length)return n;this.on(\"mouseover.force\",ni).on(\"mouseout.force\",ii).call(n)},uo.rebind(l,u,\"on\")};var gl=20,vl=1,yl=1/0;uo.layout.hierarchy=function(){function t(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(u=r.call(t,a,a.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;n&&(a.value=0),a.children=u}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return li(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=hi,r=ui,n=ci;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(si(e,function(t){t.children&&(t.value=0)}),li(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},uo.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++u<o;)t(s=a[u],r,l=s.value*n,i),r+=l}}function e(t){var r=t.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,e(r[a]));return 1+n}function r(r,a){var o=n.call(this,r,a);return t(o[0],0,i[0],i[1]/e(o[0])),o}var n=uo.layout.hierarchy(),i=[1,1];return r.size=function(t){return arguments.length?(i=t,r):i},oi(r,n)},uo.layout.pie=function(){function t(o){var s,l=o.length,u=o.map(function(r,n){return+e.call(t,r,n)}),c=+(\"function\"==typeof n?n.apply(this,arguments):n),h=(\"function\"==typeof i?i.apply(this,arguments):i)-c,f=Math.min(Math.abs(h)/l,+(\"function\"==typeof a?a.apply(this,arguments):a)),d=f*(h<0?-1:1),p=uo.sum(u),m=p?(h-l*d)/p:0,g=uo.range(l),v=[];return null!=r&&g.sort(r===bl?function(t,e){return u[e]-u[t]}:function(t,e){return r(o[t],o[e])}),g.forEach(function(t){v[t]={data:o[t],value:s=u[t],startAngle:c,endAngle:c+=s*m+d,padAngle:f}}),v}var e=Number,r=bl,n=0,i=Bo,a=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(a=e,t):a},t};var bl={};uo.layout.stack=function(){function t(s,l){if(!(f=s.length))return s;var u=s.map(function(r,n){return e.call(t,r,n)}),c=u.map(function(e){return e.map(function(e,r){return[a.call(t,e,r),o.call(t,e,r)]})}),h=r.call(t,c,l);u=uo.permute(u,h),c=uo.permute(c,h);var f,d,p,m,g=n.call(t,c,l),v=u[0].length;for(p=0;p<v;++p)for(i.call(t,u[0][p],m=g[p],c[0][p][1]),d=1;d<f;++d)i.call(t,u[d][p],m+=c[d-1][p][1],c[d][p][1]);return s}var e=x,r=gi,n=vi,i=mi,a=di,o=pi;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r=\"function\"==typeof e?e:xl.get(e)||gi,t):r},t.offset=function(e){return arguments.length?(n=\"function\"==typeof e?e:_l.get(e)||vi,t):n},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(o=e,t):o},t.out=function(e){return arguments.length?(i=e,t):i},t};var xl=uo.map({\"inside-out\":function(t){var e,r,n=t.length,i=t.map(yi),a=t.map(bi),o=uo.range(n).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;e<n;++e)r=o[e],s<l?(s+=a[r],u.push(r)):(l+=a[r],c.push(r));return c.reverse().concat(u)},reverse:function(t){return uo.range(t.length).reverse()},default:gi}),_l=uo.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,u,c=t.length,h=t[0],f=h.length,d=[];for(d[0]=l=u=0,r=1;r<f;++r){for(e=0,i=0;e<c;++e)i+=t[e][r][1];for(e=0,a=0,s=h[r][0]-h[r-1][0];e<c;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}d[r]=l-=i?a/i*s:0,l<u&&(u=l)}for(r=0;r<f;++r)d[r]-=u;return d},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];if(n)for(e=0;e<i;e++)t[e][r][1]/=n;else for(e=0;e<i;e++)t[e][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:vi});uo.layout.histogram=function(){function t(t,a){for(var o,s,l=[],u=t.map(r,this),c=n.call(this,u,a),h=i.call(this,c,u,a),a=-1,f=u.length,d=h.length-1,p=e?1:1/f;++a<d;)o=l[a]=[],o.dx=h[a+1]-(o.x=h[a]),o.y=0;if(d>0)for(a=-1;++a<f;)(s=u[a])>=c[0]&&s<=c[1]&&(o=l[uo.bisect(h,s,1,d)-1],o.y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Mi,i=_i;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=Et(e),t):n},t.bins=function(e){return arguments.length?(i=\"number\"==typeof e?function(t){return wi(t,e)}:Et(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},uo.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:\"function\"==typeof e?e:function(){return e};if(s.x=s.y=0,li(s,function(t){t.r=+c(t.value)}),li(s,Ei),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;li(s,function(t){t.r+=h}),li(s,Ei),li(s,function(t){t.r-=h})}return Ii(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}var e,r=uo.layout.hierarchy().sort(ki),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||\"function\"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},oi(t,r)},uo.layout.tree=function(){function t(t,i){var c=o.call(this,t,i),h=c[0],f=e(h);if(li(f,r),f.parent.m=-f.z,si(f,n),u)si(h,a);else{var d=h,p=h,m=h;si(h,function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>m.depth&&(m=t)});var g=s(d,p)/2-d.x,v=l[0]/(p.x+s(p,d)/2+g),y=l[1]/(m.depth||1);si(h,function(t){t.x=(t.x+g)*v,t.y=t.depth*y})}return c}function e(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){Fi(t);var a=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+s(t._,n._),t.m=t.z-a):t.z=a}else n&&(t.z=n.z+s(t._,n._));t.parent.A=i(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,r){if(e){for(var n,i=t,a=t,o=e,l=i.parent.children[0],u=i.m,c=a.m,h=o.m,f=l.m;o=Oi(o),i=Pi(i),o&&i;)l=Pi(l),a=Oi(a),a.a=t,n=o.z+h-i.z-u+s(o._,i._),n>0&&(Ri(ji(o,t,r),t,n),u+=n,c+=n),h+=o.m,u+=i.m,f+=l.m,c+=a.m;o&&!Oi(a)&&(a.t=o,a.m+=h-c),i&&!Pi(l)&&(l.t=i,l.m+=u-f,r=t)}return r}function a(t){t.x*=l[0],t.y=t.depth*l[1]}var o=uo.layout.hierarchy().sort(null).value(null),s=Di,l=[1,1],u=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(u=null==(l=e)?a:null,t):u?null:l},t.nodeSize=function(e){return arguments.length?(u=null==(l=e)?null:a,t):u?l:null},oi(t,o)},uo.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],u=0;li(l,function(t){var e=t.children;e&&e.length?(t.x=Bi(e),t.y=Ni(e)):(t.x=o?u+=r(t,o):0,t.y=0,o=t)});var c=Ui(l),h=Vi(l),f=c.x-r(c,h)/2,d=h.x+r(h,c)/2;return li(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=uo.layout.hierarchy().sort(null).value(null),r=Di,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},oi(t,e)},uo.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function e(r){var a=r.children;if(a&&a.length){var o,s,l,u=h(r),c=[],f=a.slice(),p=1/0,m=\"slice\"===d?u.dx:\"dice\"===d?u.dy:\"slice-dice\"===d?1&r.depth?u.dy:u.dx:Math.min(u.dx,u.dy);for(t(f,u.dx*u.dy/r.value),c.area=0;(l=f.length)>0;)c.push(o=f[l-1]),c.area+=o.area,\"squarify\"!==d||(s=n(c,m))<=p?(f.pop(),p=s):(c.area-=c.pop().area,i(c,m,u,!1),m=Math.min(u.dx,u.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,m,u,!0),c.length=c.area=0),a.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var a,o=h(e),s=n.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(i(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(i=r));return n*=n,e*=e,n?Math.max(e*i*p/n,n/(e*a*p)):1/0}function i(t,e,r,n){var i,a=-1,o=t.length,s=r.x,u=r.y,c=e?l(t.area/e):0;if(e==r.dx){for((n||c>r.dy)&&(c=r.dy);++a<o;)i=t[a],i.x=s,i.y=u,i.dy=c,s+=i.dx=Math.min(r.x+r.dx-s,c?l(i.area/c):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=c,r.dy-=c}else{for((n||c>r.dx)&&(c=r.dx);++a<o;)i=t[a],i.x=s,i.y=u,i.dx=c,u+=i.dy=Math.min(r.y+r.dy-u,c?l(i.area/c):0);i.z=!1,i.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function a(n){var i=o||s(n),a=i[0];return a.x=a.y=0,a.value?(a.dx=u[0],a.dy=u[1]):a.dx=a.dy=0,o&&s.revalue(a),t([a],a.dx*a.dy/a.value),(o?r:e)(a),f&&(o=i),i}var o,s=uo.layout.hierarchy(),l=Math.round,u=[1,1],c=null,h=Hi,f=!1,d=\"squarify\",p=.5*(1+Math.sqrt(5));return a.size=function(t){return arguments.length?(u=t,a):u},a.padding=function(t){function e(e){var r=t.call(a,e,e.depth);return null==r?Hi(e):qi(e,\"number\"==typeof r?[r,r,r,r]:r)}function r(e){return qi(e,t)}if(!arguments.length)return c;var n;return h=null==(c=t)?Hi:\"function\"==(n=typeof t)?e:\"number\"===n?(t=[t,t,t,t],r):r,a},a.round=function(t){return arguments.length?(l=t?Math.round:Number,a):l!=Number},a.sticky=function(t){return arguments.length?(f=t,o=null,a):f},a.ratio=function(t){return arguments.length?(p=t,a):p},a.mode=function(t){return arguments.length?(d=t+\"\",a):d},oi(a,s)},uo.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{r=2*Math.random()-1,n=2*Math.random()-1,i=r*r+n*n}while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=uo.random.normal.apply(uo,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=uo.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},uo.scale={};var wl={floor:x,ceil:x};uo.scale.linear=function(){return Ki([0,1],[0,1],_n,!1)};var Ml={s:1,g:1,p:1,r:1,e:1};uo.scale.log=function(){return aa(uo.scale.linear().domain([0,1]),10,!0,[1,10])};var kl=uo.format(\".0e\"),Al={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};uo.scale.pow=function(){return oa(uo.scale.linear(),1,[0,1])},uo.scale.sqrt=function(){return uo.scale.pow().exponent(.5)},uo.scale.ordinal=function(){return la([],{t:\"range\",a:[[]]})},uo.scale.category10=function(){return uo.scale.ordinal().range(Tl)},uo.scale.category20=function(){return uo.scale.ordinal().range(Sl)},uo.scale.category20b=function(){return uo.scale.ordinal().range(El)},uo.scale.category20c=function(){return uo.scale.ordinal().range(Ll)};var Tl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Sl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),El=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Ll=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);uo.scale.quantile=function(){return ua([],[])},uo.scale.quantize=function(){return ca(0,1,[0,1])},uo.scale.threshold=function(){return ha([.5],[0,1])},uo.scale.identity=function(){return fa([0,1])},uo.svg={},uo.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),u=Math.max(0,+n.apply(this,arguments)),c=o.apply(this,arguments)-Vo,h=s.apply(this,arguments)-Vo,f=Math.abs(h-c),d=c>h?0:1;if(u<t&&(p=u,u=t,t=p),f>=Uo)return e(u,d)+(t?e(t,1-d):\"\")+\"Z\";var p,m,g,v,y,b,x,_,w,M,k,A,T=0,S=0,E=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===Cl?Math.sqrt(t*t+u*u):+a.apply(this,arguments),d||(S*=-1),u&&(S=nt(g/u*Math.sin(v))),t&&(T=nt(g/t*Math.sin(v)))),u){y=u*Math.cos(c+S),b=u*Math.sin(c+S),x=u*Math.cos(h-S),_=u*Math.sin(h-S);var L=Math.abs(h-c-2*S)<=No?0:1;if(S&&ba(y,b,x,_)===d^L){var C=(c+h)/2;y=u*Math.cos(C),b=u*Math.sin(C),x=_=null}}else y=b=0;if(t){w=t*Math.cos(h-T),M=t*Math.sin(h-T),k=t*Math.cos(c+T),A=t*Math.sin(c+T);var I=Math.abs(c-h+2*T)<=No?0:1;if(T&&ba(w,M,k,A)===1-d^I){var z=(c+h)/2;w=t*Math.cos(z),M=t*Math.sin(z),k=A=null}}else w=M=0;if(f>Fo&&(p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){m=t<u^d?0:1;var D=p,P=p;if(f<No){var O=null==k?[w,M]:null==x?[y,b]:Or([y,b],[k,A],[x,_],[w,M]),R=y-O[0],F=b-O[1],j=x-O[0],N=_-O[1],B=1/Math.sin(Math.acos((R*j+F*N)/(Math.sqrt(R*R+F*F)*Math.sqrt(j*j+N*N)))/2),U=Math.sqrt(O[0]*O[0]+O[1]*O[1]);P=Math.min(p,(t-U)/(B-1)),D=Math.min(p,(u-U)/(B+1))}if(null!=x){var V=xa(null==k?[w,M]:[k,A],[y,b],u,D,d),H=xa([x,_],[w,M],u,D,d);p===D?E.push(\"M\",V[0],\"A\",D,\",\",D,\" 0 0,\",m,\" \",V[1],\"A\",u,\",\",u,\" 0 \",1-d^ba(V[1][0],V[1][1],H[1][0],H[1][1]),\",\",d,\" \",H[1],\"A\",D,\",\",D,\" 0 0,\",m,\" \",H[0]):E.push(\"M\",V[0],\"A\",D,\",\",D,\" 0 1,\",m,\" \",H[0])}else E.push(\"M\",y,\",\",b);if(null!=k){var q=xa([y,b],[k,A],t,-P,d),G=xa([w,M],null==x?[y,b]:[x,_],t,-P,d);p===P?E.push(\"L\",G[0],\"A\",P,\",\",P,\" 0 0,\",m,\" \",G[1],\"A\",t,\",\",t,\" 0 \",d^ba(G[1][0],G[1][1],q[1][0],q[1][1]),\",\",1-d,\" \",q[1],\"A\",P,\",\",P,\" 0 0,\",m,\" \",q[0]):E.push(\"L\",G[0],\"A\",P,\",\",P,\" 0 0,\",m,\" \",q[0])}else E.push(\"L\",w,\",\",M)}else E.push(\"M\",y,\",\",b),null!=x&&E.push(\"A\",u,\",\",u,\" 0 \",L,\",\",d,\" \",x,\",\",_),E.push(\"L\",w,\",\",M),null!=k&&E.push(\"A\",t,\",\",t,\" 0 \",I,\",\",1-d,\" \",k,\",\",A);return E.push(\"Z\"),E.join(\"\")}function e(t,e){return\"M0,\"+t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+-t+\"A\"+t+\",\"+t+\" 0 1,\"+e+\" 0,\"+t}var r=pa,n=ma,i=da,a=Cl,o=ga,s=va,l=ya;return t.innerRadius=function(e){return arguments.length?(r=Et(e),t):r},t.outerRadius=function(e){return arguments.length?(n=Et(e),t):n},t.cornerRadius=function(e){return arguments.length?(i=Et(e),t):i},t.padRadius=function(e){return arguments.length?(a=e==Cl?Cl:Et(e),t):a},t.startAngle=function(e){return arguments.length?(o=Et(e),t):o},t.endAngle=function(e){return arguments.length?(s=Et(e),t):s},t.padAngle=function(e){return arguments.length?(l=Et(e),t):l},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-Vo;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Cl=\"auto\";uo.svg.line=function(){return _a(x)};var Il=uo.map({linear:wa,\"linear-closed\":Ma,step:ka,\"step-before\":Aa,\"step-after\":Ta,basis:za,\"basis-open\":Da,\"basis-closed\":Pa,bundle:Oa,cardinal:La,\"cardinal-open\":Sa,\"cardinal-closed\":Ea,monotone:Ua});Il.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var zl=[0,2/3,1/3,0],Dl=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];uo.svg.line.radial=function(){var t=_a(Va);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Aa.reverse=Ta,Ta.reverse=Aa,uo.svg.area=function(){return Ha(x)},uo.svg.area.radial=function(){var t=Ha(Va);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},uo.svg.chord=function(){function t(t,s){var l=e(this,a,t,s),u=e(this,o,t,s);return\"M\"+l.p0+n(l.r,l.p1,l.a1-l.a0)+(r(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+n(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+\"Z\"}function e(t,e,r,n){var i=e.call(t,r,n),a=s.call(t,i,n),o=l.call(t,i,n)-Vo,c=u.call(t,i,n)-Vo;return{r:a,a0:o,a1:c,p0:[a*Math.cos(o),a*Math.sin(o)],p1:[a*Math.cos(c),a*Math.sin(c)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return\"A\"+t+\",\"+t+\" 0 \"+ +(r>No)+\",1 \"+e}function i(t,e,r,n){return\"Q 0,0 \"+n}var a=xr,o=_r,s=qa,l=ga,u=va;return t.radius=function(e){return arguments.length?(s=Et(e),t):s},t.source=function(e){return arguments.length?(a=Et(e),t):a},t.target=function(e){return arguments.length?(o=Et(e),t):o},t.startAngle=function(e){return arguments.length?(l=Et(e),t):l},t.endAngle=function(e){return arguments.length?(u=Et(e),t):u},t},uo.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return l=l.map(n),\"M\"+l[0]+\"C\"+l[1]+\" \"+l[2]+\" \"+l[3]}var e=xr,r=_r,n=Ga;return t.source=function(r){return arguments.length?(e=Et(r),t):e},t.target=function(e){return arguments.length?(r=Et(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},uo.svg.diagonal.radial=function(){var t=uo.svg.diagonal(),e=Ga,r=t.projection;return t.projection=function(t){return arguments.length?r(Ya(e=t)):e},t},uo.svg.symbol=function(){function t(t,n){return(Ol.get(e.call(this,t,n))||Za)(r.call(this,t,n))}var e=Xa,r=Wa;return t.type=function(r){return arguments.length?(e=Et(r),t):e},t.size=function(e){return arguments.length?(r=Et(e),t):r},t};var Ol=uo.map({circle:Za,cross:function(t){var e=Math.sqrt(t/5)/2;return\"M\"+-3*e+\",\"+-e+\"H\"+-e+\"V\"+-3*e+\"H\"+e+\"V\"+-e+\"H\"+3*e+\"V\"+e+\"H\"+e+\"V\"+3*e+\"H\"+-e+\"V\"+e+\"H\"+-3*e+\"Z\"},diamond:function(t){var e=Math.sqrt(t/(2*Fl)),r=e*Fl;return\"M0,\"+-e+\"L\"+r+\",0 0,\"+e+\" \"+-r+\",0Z\"},square:function(t){var e=Math.sqrt(t)/2;return\"M\"+-e+\",\"+-e+\"L\"+e+\",\"+-e+\" \"+e+\",\"+e+\" \"+-e+\",\"+e+\"Z\"},\"triangle-down\":function(t){var e=Math.sqrt(t/Rl),r=e*Rl/2;return\"M0,\"+r+\"L\"+e+\",\"+-r+\" \"+-e+\",\"+-r+\"Z\"},\"triangle-up\":function(t){var e=Math.sqrt(t/Rl),r=e*Rl/2;return\"M0,\"+-r+\"L\"+e+\",\"+r+\" \"+-e+\",\"+r+\"Z\"}});uo.svg.symbolTypes=Ol.keys();var Rl=Math.sqrt(3),Fl=Math.tan(30*Ho);Lo.transition=function(t){for(var e,r,n=jl||++Vl,i=to(t),a=[],o=Nl||{time:Date.now(),ease:En,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(r=u[c])&&eo(r,c,i,n,o),e.push(r)}return Ka(a,i,n)},Lo.interrupt=function(t){return this.each(null==t?Bl:Ja(to(t)))};var jl,Nl,Bl=Ja(to()),Ul=[],Vl=0;Ul.call=Lo.call,Ul.empty=Lo.empty,Ul.node=Lo.node,Ul.size=Lo.size,uo.transition=function(t,e){\n", | |
"return t&&t.transition?jl?t.transition(e):t:uo.selection().transition(t)},uo.transition.prototype=Ul,Ul.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=C(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?(\"__data__\"in n&&(r.__data__=n.__data__),eo(r,c,a,i,n[a][i]),e.push(r)):e.push(null)}return Ka(o,a,i)},Ul.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=I(t);for(var u=-1,c=this.length;++u<c;)for(var h=this[u],f=-1,d=h.length;++f<d;)if(n=h[f]){a=n[s][o],r=t.call(n,n.__data__,f,u),l.push(e=[]);for(var p=-1,m=r.length;++p<m;)(i=r[p])&&eo(i,p,s,o,a),e.push(i)}return Ka(l,s,o)},Ul.filter=function(t){var e,r,n,i=[];\"function\"!=typeof t&&(t=H(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]);for(var r=this[a],s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return Ka(i,this.namespace,this.id)},Ul.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):G(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},Ul.attr=function(t,e){function r(){this.removeAttribute(s)}function n(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?r:(t+=\"\",function(){var e,r=this.getAttribute(s);return r!==t&&(e=o(r,t),function(t){this.setAttribute(s,e(t))})})}function a(t){return null==t?n:(t+=\"\",function(){var e,r=this.getAttributeNS(s.space,s.local);return r!==t&&(e=o(r,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var o=\"transform\"==t?Zn:_n,s=uo.ns.qualify(t);return Qa(this,\"attr.\"+t,e,s.local?a:i)},Ul.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(i));return n&&function(t){this.setAttribute(i,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(i.space,i.local));return n&&function(t){this.setAttributeNS(i.space,i.local,n(t))}}var i=uo.ns.qualify(t);return this.tween(\"attr.\"+t,i.local?n:r)},Ul.style=function(t,e,r){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+=\"\",function(){var i,a=n(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=_n(a,e),function(e){this.style.setProperty(t,i(e),r)})})}var o=arguments.length;if(o<3){if(\"string\"!=typeof t){o<2&&(e=\"\");for(r in t)this.style(r,t[r],e);return this}r=\"\"}return Qa(this,\"style.\"+t,e,a)},Ul.styleTween=function(t,e,r){function i(i,a){var o=e.call(this,i,a,n(this).getComputedStyle(this,null).getPropertyValue(t));return o&&function(e){this.style.setProperty(t,o(e),r)}}return arguments.length<3&&(r=\"\"),this.tween(\"style.\"+t,i)},Ul.text=function(t){return Qa(this,\"text\",t,$a)},Ul.remove=function(){var t=this.namespace;return this.each(\"end.transition\",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Ul.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:(\"function\"!=typeof t&&(t=uo.ease.apply(uo,arguments)),G(this,function(n){n[r][e].ease=t}))},Ul.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:G(this,\"function\"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},Ul.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:G(this,\"function\"==typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},Ul.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var i=Nl,a=jl;try{jl=r,G(this,function(e,i,a){Nl=e[n][r],t.call(e,e.__data__,i,a)})}finally{Nl=i,jl=a}}else G(this,function(i){var a=i[n][r];(a.event||(a.event=uo.dispatch(\"start\",\"end\",\"interrupt\"))).on(t,e)});return this},Ul.transition=function(){for(var t,e,r,n,i=this.id,a=++Vl,o=this.namespace,s=[],l=0,u=this.length;l<u;l++){s.push(t=[]);for(var e=this[l],c=0,h=e.length;c<h;c++)(r=e[c])&&(n=r[o][i],eo(r,c,o,a,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),t.push(r)}return Ka(s,o,a)},uo.svg.axis=function(){function t(t){t.each(function(){var t,u=uo.select(this),c=this.__chart__||r,h=this.__chart__=r.copy(),f=null==l?h.ticks?h.ticks.apply(h,s):h.domain():l,d=null==e?h.tickFormat?h.tickFormat.apply(h,s):x:e,p=u.selectAll(\".tick\").data(f,h),m=p.enter().insert(\"g\",\".domain\").attr(\"class\",\"tick\").style(\"opacity\",Fo),g=uo.transition(p.exit()).style(\"opacity\",Fo).remove(),v=uo.transition(p.order()).style(\"opacity\",1),y=Math.max(i,0)+o,b=Yi(h),_=u.selectAll(\".domain\").data([0]),w=(_.enter().append(\"path\").attr(\"class\",\"domain\"),uo.transition(_));m.append(\"line\"),m.append(\"text\");var M,k,A,T,S=m.select(\"line\"),E=v.select(\"line\"),L=p.select(\"text\").text(d),C=m.select(\"text\"),I=v.select(\"text\"),z=\"top\"===n||\"left\"===n?-1:1;if(\"bottom\"===n||\"top\"===n?(t=ro,M=\"x\",A=\"y\",k=\"x2\",T=\"y2\",L.attr(\"dy\",z<0?\"0em\":\".71em\").style(\"text-anchor\",\"middle\"),w.attr(\"d\",\"M\"+b[0]+\",\"+z*a+\"V0H\"+b[1]+\"V\"+z*a)):(t=no,M=\"y\",A=\"x\",k=\"y2\",T=\"x2\",L.attr(\"dy\",\".32em\").style(\"text-anchor\",z<0?\"end\":\"start\"),w.attr(\"d\",\"M\"+z*a+\",\"+b[0]+\"H0V\"+b[1]+\"H\"+z*a)),S.attr(T,z*i),C.attr(A,z*y),E.attr(k,0).attr(T,z*i),I.attr(M,0).attr(A,z*y),h.rangeBand){var D=h,P=D.rangeBand()/2;c=h=function(t){return D(t)+P}}else c.rangeBand?c=h:g.call(t,h,c);m.call(t,c,h),v.call(t,h,h)})}var e,r=uo.scale.linear(),n=Hl,i=6,a=6,o=3,s=[10],l=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in ql?e+\"\":Hl,t):n},t.ticks=function(){return arguments.length?(s=ho(arguments),t):s},t.tickValues=function(e){return arguments.length?(l=e,t):l},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(i=+e,a=+arguments[r-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(o=+e,t):o},t.tickSubdivide=function(){return arguments.length&&t},t};var Hl=\"bottom\",ql={top:1,right:1,bottom:1,left:1};uo.svg.brush=function(){function t(n){n.each(function(){var n=uo.select(this).style(\"pointer-events\",\"all\").style(\"-webkit-tap-highlight-color\",\"rgba(0,0,0,0)\").on(\"mousedown.brush\",a).on(\"touchstart.brush\",a),o=n.selectAll(\".background\").data([0]);o.enter().append(\"rect\").attr(\"class\",\"background\").style(\"visibility\",\"hidden\").style(\"cursor\",\"crosshair\"),n.selectAll(\".extent\").data([0]).enter().append(\"rect\").attr(\"class\",\"extent\").style(\"cursor\",\"move\");var s=n.selectAll(\".resize\").data(m,x);s.exit().remove(),s.enter().append(\"g\").attr(\"class\",function(t){return\"resize \"+t}).style(\"cursor\",function(t){return Gl[t]}).append(\"rect\").attr(\"x\",function(t){return/[ew]$/.test(t)?-3:null}).attr(\"y\",function(t){return/^[ns]/.test(t)?-3:null}).attr(\"width\",6).attr(\"height\",6).style(\"visibility\",\"hidden\"),s.style(\"display\",t.empty()?\"none\":null);var l,h=uo.transition(n),f=uo.transition(o);u&&(l=Yi(u),f.attr(\"x\",l[0]).attr(\"width\",l[1]-l[0]),r(h)),c&&(l=Yi(c),f.attr(\"y\",l[0]).attr(\"height\",l[1]-l[0]),i(h)),e(h)})}function e(t){t.selectAll(\".resize\").attr(\"transform\",function(t){return\"translate(\"+h[+/e$/.test(t)]+\",\"+f[+/^s/.test(t)]+\")\"})}function r(t){t.select(\".extent\").attr(\"x\",h[0]),t.selectAll(\".extent,.n>rect,.s>rect\").attr(\"width\",h[1]-h[0])}function i(t){t.select(\".extent\").attr(\"y\",f[0]),t.selectAll(\".extent,.e>rect,.w>rect\").attr(\"height\",f[1]-f[0])}function a(){function a(){32==uo.event.keyCode&&(L||(b=null,I[0]-=h[1],I[1]-=f[1],L=2),T())}function m(){32==uo.event.keyCode&&2==L&&(I[0]+=h[1],I[1]+=f[1],L=0,T())}function g(){var t=uo.mouse(_),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),L||(uo.event.altKey?(b||(b=[(h[0]+h[1])/2,(f[0]+f[1])/2]),I[0]=h[+(t[0]<b[0])],I[1]=f[+(t[1]<b[1])]):b=null),S&&v(t,u,0)&&(r(k),n=!0),E&&v(t,c,1)&&(i(k),n=!0),n&&(e(k),M({type:\"brush\",mode:L?\"move\":\"resize\"}))}function v(t,e,r){var n,i,a=Yi(e),l=a[0],u=a[1],c=I[r],m=r?f:h,g=m[1]-m[0];if(L&&(l-=c,u-=g+c),n=(r?p:d)?Math.max(l,Math.min(u,t[r])):t[r],L?i=(n+=c)+g:(b&&(c=Math.max(l,Math.min(u,2*b[r]-n))),c<n?(i=n,n=c):i=c),m[0]!=n||m[1]!=i)return r?s=null:o=null,m[0]=n,m[1]=i,!0}function y(){g(),k.style(\"pointer-events\",\"all\").selectAll(\".resize\").style(\"display\",t.empty()?\"none\":null),uo.select(\"body\").style(\"cursor\",null),z.on(\"mousemove.brush\",null).on(\"mouseup.brush\",null).on(\"touchmove.brush\",null).on(\"touchend.brush\",null).on(\"keydown.brush\",null).on(\"keyup.brush\",null),C(),M({type:\"brushend\"})}var b,x,_=this,w=uo.select(uo.event.target),M=l.of(_,arguments),k=uo.select(_),A=w.datum(),S=!/^(n|s)$/.test(A)&&u,E=!/^(e|w)$/.test(A)&&c,L=w.classed(\"extent\"),C=K(_),I=uo.mouse(_),z=uo.select(n(_)).on(\"keydown.brush\",a).on(\"keyup.brush\",m);if(uo.event.changedTouches?z.on(\"touchmove.brush\",g).on(\"touchend.brush\",y):z.on(\"mousemove.brush\",g).on(\"mouseup.brush\",y),k.interrupt().selectAll(\"*\").interrupt(),L)I[0]=h[0]-I[0],I[1]=f[0]-I[1];else if(A){var D=+/w$/.test(A),P=+/^n/.test(A);x=[h[1-D]-I[0],f[1-P]-I[1]],I[0]=h[D],I[1]=f[P]}else uo.event.altKey&&(b=I.slice());k.style(\"pointer-events\",\"none\").selectAll(\".resize\").style(\"display\",null),uo.select(\"body\").style(\"cursor\",w.style(\"cursor\")),M({type:\"brushstart\"}),g()}var o,s,l=E(t,\"brushstart\",\"brush\",\"brushend\"),u=null,c=null,h=[0,0],f=[0,0],d=!0,p=!0,m=Yl[0];return t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:h,y:f,i:o,j:s},r=this.__chart__||e;this.__chart__=e,jl?uo.select(this).transition().each(\"start.brush\",function(){o=r.i,s=r.j,h=r.x,f=r.y,t({type:\"brushstart\"})}).tween(\"brush:brush\",function(){var r=wn(h,e.x),n=wn(f,e.y);return o=s=null,function(i){h=e.x=r(i),f=e.y=n(i),t({type:\"brush\",mode:\"resize\"})}}).each(\"end.brush\",function(){o=e.i,s=e.j,t({type:\"brush\",mode:\"resize\"}),t({type:\"brushend\"})}):(t({type:\"brushstart\"}),t({type:\"brush\",mode:\"resize\"}),t({type:\"brushend\"}))})},t.x=function(e){return arguments.length?(u=e,m=Yl[!u<<1|!c],t):u},t.y=function(e){return arguments.length?(c=e,m=Yl[!u<<1|!c],t):c},t.clamp=function(e){return arguments.length?(u&&c?(d=!!e[0],p=!!e[1]):u?d=!!e:c&&(p=!!e),t):u&&c?[d,p]:u?d:c?p:null},t.extent=function(e){var r,n,i,a,l;return arguments.length?(u&&(r=e[0],n=e[1],c&&(r=r[0],n=n[0]),o=[r,n],u.invert&&(r=u(r),n=u(n)),n<r&&(l=r,r=n,n=l),r==h[0]&&n==h[1]||(h=[r,n])),c&&(i=e[0],a=e[1],u&&(i=i[1],a=a[1]),s=[i,a],c.invert&&(i=c(i),a=c(a)),a<i&&(l=i,i=a,a=l),i==f[0]&&a==f[1]||(f=[i,a])),t):(u&&(o?(r=o[0],n=o[1]):(r=h[0],n=h[1],u.invert&&(r=u.invert(r),n=u.invert(n)),n<r&&(l=r,r=n,n=l))),c&&(s?(i=s[0],a=s[1]):(i=f[0],a=f[1],c.invert&&(i=c.invert(i),a=c.invert(a)),a<i&&(l=i,i=a,a=l))),u&&c?[[r,i],[n,a]]:u?[r,n]:c&&[i,a])},t.clear=function(){return t.empty()||(h=[0,0],f=[0,0],o=s=null),t},t.empty=function(){return!!u&&h[0]==h[1]||!!c&&f[0]==f[1]},uo.rebind(t,l,\"on\")};var Gl={n:\"ns-resize\",e:\"ew-resize\",s:\"ns-resize\",w:\"ew-resize\",nw:\"nwse-resize\",ne:\"nesw-resize\",se:\"nwse-resize\",sw:\"nesw-resize\"},Yl=[[\"n\",\"e\",\"s\",\"w\",\"nw\",\"ne\",\"se\",\"sw\"],[\"e\",\"w\"],[\"n\",\"s\"],[]],Wl=fs.format=ys.timeFormat,Xl=Wl.utc,Zl=Xl(\"%Y-%m-%dT%H:%M:%S.%LZ\");Wl.iso=Date.prototype.toISOString&&+new Date(\"2000-01-01T00:00:00.000Z\")?io:Zl,io.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},io.toString=Zl.toString,fs.second=Vt(function(t){return new ds(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),fs.seconds=fs.second.range,fs.seconds.utc=fs.second.utc.range,fs.minute=Vt(function(t){return new ds(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),fs.minutes=fs.minute.range,fs.minutes.utc=fs.minute.utc.range,fs.hour=Vt(function(t){var e=t.getTimezoneOffset()/60;return new ds(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),fs.hours=fs.hour.range,fs.hours.utc=fs.hour.utc.range,fs.month=Vt(function(t){return t=fs.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),fs.months=fs.month.range,fs.months.utc=fs.month.utc.range;var Jl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Kl=[[fs.second,1],[fs.second,5],[fs.second,15],[fs.second,30],[fs.minute,1],[fs.minute,5],[fs.minute,15],[fs.minute,30],[fs.hour,1],[fs.hour,3],[fs.hour,6],[fs.hour,12],[fs.day,1],[fs.day,2],[fs.week,1],[fs.month,1],[fs.month,3],[fs.year,1]],Ql=Wl.multi([[\".%L\",function(t){return t.getMilliseconds()}],[\":%S\",function(t){return t.getSeconds()}],[\"%I:%M\",function(t){return t.getMinutes()}],[\"%I %p\",function(t){return t.getHours()}],[\"%a %d\",function(t){return t.getDay()&&1!=t.getDate()}],[\"%b %d\",function(t){return 1!=t.getDate()}],[\"%B\",function(t){return t.getMonth()}],[\"%Y\",Ie]]),$l={range:function(t,e,r){return uo.range(Math.ceil(t/r)*r,+e,r).map(oo)},floor:x,ceil:x};Kl.year=fs.year,fs.scale=function(){return ao(uo.scale.linear(),Kl,Ql)};var tu=Kl.map(function(t){return[t[0].utc,t[1]]}),eu=Xl.multi([[\".%L\",function(t){return t.getUTCMilliseconds()}],[\":%S\",function(t){return t.getUTCSeconds()}],[\"%I:%M\",function(t){return t.getUTCMinutes()}],[\"%I %p\",function(t){return t.getUTCHours()}],[\"%a %d\",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[\"%b %d\",function(t){return 1!=t.getUTCDate()}],[\"%B\",function(t){return t.getUTCMonth()}],[\"%Y\",Ie]]);tu.year=fs.year.utc,fs.scale.utc=function(){return ao(uo.scale.linear(),tu,eu)},uo.text=Lt(function(t){return t.responseText}),uo.json=function(t,e){return Ct(t,\"application/json\",so,e)},uo.html=function(t,e){return Ct(t,\"text/html\",lo,e)},uo.xml=Lt(function(t){return t.responseXML}),\"function\"==typeof t&&t.amd?(this.d3=uo,t(uo)):\"object\"==typeof r&&r.exports?r.exports=uo:this.d3=uo}()},{}],123:[function(t,e,r){\"use strict\";function n(t,e){this.point=t,this.index=e}function i(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a<i;++a){var o=n[a]-r[a];if(o)return o}return 0}function a(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map(function(t,e){return[t[0],e]});n.sort(function(t,e){return t[0]-e[0]});for(var i=new Array(t-1),a=1;a<t;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[t-1][1],-1]),i}function o(t,e){var r=t.length;if(0===r)return[];var o=t[0].length;if(o<1)return[];if(1===o)return a(r,t,e);for(var u=new Array(r),c=1,h=0;h<r;++h){for(var f=t[h],d=new Array(o+1),p=0,m=0;m<o;++m){var g=f[m];d[m]=g,p+=g*g}d[o]=p,u[h]=new n(d,h),c=Math.max(p,c)}l(u,i),r=u.length;for(var v=new Array(r+o+1),y=new Array(r+o+1),b=(o+1)*(o+1)*c,x=new Array(o+1),h=0;h<=o;++h)x[h]=0;x[o]=b,v[0]=x.slice(),y[0]=-1;for(var h=0;h<=o;++h){var d=x.slice();d[h]=1,v[h+1]=d,y[h+1]=-1}for(var h=0;h<r;++h){var _=u[h];v[h+o+1]=_.point,y[h+o+1]=_.index}var w=s(v,!1);if(w=e?w.filter(function(t){for(var e=0,r=0;r<=o;++r){var n=y[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0}):w.filter(function(t){for(var e=0;e<=o;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&o)for(var h=0;h<w.length;++h){var _=w[h],d=_[0];_[0]=_[1],_[1]=d}return w}var s=t(\"incremental-convex-hull\"),l=t(\"uniq\");e.exports=o},{\"incremental-convex-hull\":290,uniq:543}],124:[function(t,e,r){(function(t){function r(t,e){return d[0]=t,d[1]=e,f[0]}function n(t){return f[0]=t,d[0]}function i(t){return f[0]=t,d[1]}function a(t,e){return d[1]=t,d[0]=e,f[0]}function o(t){return f[0]=t,d[1]}function s(t){return f[0]=t,d[0]}function l(t,e){return p.writeUInt32LE(t,0,!0),p.writeUInt32LE(e,4,!0),p.readDoubleLE(0,!0)}function u(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(0,!0)}function c(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(4,!0)}var h=!1;if(\"undefined\"!=typeof Float64Array){var f=new Float64Array(1),d=new Uint32Array(f.buffer);f[0]=1,h=!0,1072693248===d[1]?(e.exports=function(t){return f[0]=t,[d[0],d[1]]},e.exports.pack=r,e.exports.lo=n,e.exports.hi=i):1072693248===d[0]?(e.exports=function(t){return f[0]=t,[d[1],d[0]]},e.exports.pack=a,e.exports.lo=o,e.exports.hi=s):h=!1}if(!h){var p=new t(8);e.exports=function(t){return p.writeDoubleLE(t,0,!0),[p.readUInt32LE(0,!0),p.readUInt32LE(4,!0)]},e.exports.pack=l,e.exports.lo=u,e.exports.hi=c}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t(\"buffer\").Buffer)},{buffer:77}],125:[function(t,e,r){\"use strict\";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a<i;++a)o[a]=e;else for(a=0;a<i;++a)o[a]=n(t,e,r+1);return o}function i(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function a(t,e){switch(void 0===e&&(e=0),typeof t){case\"number\":if(t>0)return i(0|t,e);break;case\"object\":if(\"number\"==typeof t.length)return n(t,e,0)}return[]}e.exports=a},{}],126:[function(t,e,r){\"use strict\";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,s=i(t,0,a,r,!0),l=[];if(!s)return l;var u,c,f,d,p,m,g;if(n&&(s=h(t,e,s,r)),t.length>80*r){u=f=t[0],c=d=t[1];for(var v=r;v<a;v+=r)p=t[v],m=t[v+1],p<u&&(u=p),m<c&&(c=m),p>f&&(f=p),m>d&&(d=m);g=Math.max(f-u,d-c)}return o(s,l,r,u,c,g),l}function i(t,e,r,n,i){var a,o;if(i===I(t,e,r,n)>0)for(a=e;a<r;a+=n)o=E(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=E(a,t[a],t[a+1],o);return o&&w(o,o.next)&&(L(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!w(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(L(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,h,f){if(t){!f&&h&&m(t,n,i,h);for(var d,p,g=t;t.prev!==t.next;)if(d=t.prev,p=t.next,h?l(t,n,i,h):s(t))e.push(d.i/r),e.push(t.i/r),e.push(p.i/r),L(t),t=p.next,g=p.next;else if((t=p)===g){f?1===f?(t=u(t,e,r),o(t,e,r,n,i,h,2)):2===f&&c(t,e,r,n,i,h):o(a(t),e,r,n,i,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(_(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(b(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,a=t,o=t.next;if(_(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=v(s,l,e,r,n),f=v(u,c,e,r,n),d=t.nextZ;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&b(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&b(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!w(i,a)&&M(i,n,n.next,a)&&A(i,a)&&A(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),L(n),L(n.next),n=t=a),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&x(l,u)){var c=S(l,u);return l=a(l,l.next),c=a(c,c.next),o(l,e,r,n,i,s),void o(c,e,r,n,i,s)}u=u.next}l=l.next}while(l!==t)}function h(t,e,r,n){var o,s,l,u,c,h=[];for(o=0,s=e.length;o<s;o++)l=e[o]*n,u=o<s-1?e[o+1]*n:t.length,c=i(t,l,u,n,!1),c===c.next&&(c.steiner=!0),h.push(y(c));for(h.sort(f),o=0;o<h.length;o++)d(h[o],r),r=a(r,r.next);return r}function f(t,e){return t.x-e.x}function d(t,e){if(e=p(t,e)){var r=S(e,t);a(r,r.next)}}function p(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r.prev;var l,u=r,c=r.x,h=r.y,f=1/0;for(n=r.next;n!==u;)i>=n.x&&n.x>=c&&b(a<h?i:o,a,c,h,a<h?o:i,a,n.x,n.y)&&((l=Math.abs(a-n.y)/(i-n.x))<f||l===f&&n.x>r.x)&&A(n,t)&&(r=n,f=l),n=n.next;return r}function m(t,e,r,n){var i=t;do{null===i.z&&(i.z=v(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1);return t}function v(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do{e.x<r.x&&(r=e),e=e.next}while(e!==t);return r}function b(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!k(t,e)&&A(t,e)&&A(e,t)&&T(t,e)}function _(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||_(t,e,r)>0!=_(t,e,n)>0&&_(r,n,t)>0!=_(r,n,e)>0}function k(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&M(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function A(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function T(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}function S(t,e){var r=new C(t.i,t.x,t.y),n=new C(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function E(t,e,r,n){var i=new C(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function L(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}e.exports=n,n.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(I(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;o-=Math.abs(I(t,u,c,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,d=n[s+1]*r,p=n[s+2]*r;h+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],127:[function(t,e,r){\"use strict\";function n(t,e){var r=t.length;if(\"number\"!=typeof e){e=0;for(var n=0;n<r;++n){var a=t[n];e=Math.max(e,a[0],a[1])}e=1+(0|e)}e|=0;for(var o=new Array(e),n=0;n<e;++n)o[n]=[];for(var n=0;n<r;++n){var a=t[n];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;s<e;++s)i(o[s],function(t,e){return t-e});return o}e.exports=n;var i=t(\"uniq\")},{uniq:543}],128:[function(e,r,n){(function(i,a){!function(e,i){\"object\"==typeof n&&void 0!==r?r.exports=i():\"function\"==typeof t&&t.amd?t(i):e.ES6Promise=i()}(this,function(){\"use strict\";function t(t){return\"function\"==typeof t||\"object\"==typeof t&&null!==t}function r(t){return\"function\"==typeof t}function n(t){G=t}function o(t){Y=t}function s(){return function(){q(u)}}function l(){var t=setTimeout;return function(){return t(u,1)}}function u(){for(var t=0;t<H;t+=2){(0,Q[t])(Q[t+1]),Q[t]=void 0,Q[t+1]=void 0}H=0}function c(t,e){var r=arguments,n=this,i=new this.constructor(f);void 0===i[tt]&&I(i);var a=n._state;return a?function(){var t=r[a-1];Y(function(){return E(a,i,t,n._result)})}():k(n,i,t,e),i}function h(t){var e=this;if(t&&\"object\"==typeof t&&t.constructor===e)return t;var r=new e(f);return x(r,t),r}function f(){}function d(){return new TypeError(\"You cannot resolve a promise with itself\")}function p(){return new TypeError(\"A promises callback cannot return that same promise.\")}function m(t){try{return t.then}catch(t){return it.error=t,it}}function g(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function v(t,e,r){Y(function(t){var n=!1,i=g(r,e,function(r){n||(n=!0,e!==r?x(t,r):w(t,r))},function(e){n||(n=!0,M(t,e))},\"Settle: \"+(t._label||\" unknown promise\"));!n&&i&&(n=!0,M(t,i))},t)}function y(t,e){e._state===rt?w(t,e._result):e._state===nt?M(t,e._result):k(e,void 0,function(e){return x(t,e)},function(e){return M(t,e)})}function b(t,e,n){e.constructor===t.constructor&&n===c&&e.constructor.resolve===h?y(t,e):n===it?M(t,it.error):void 0===n?w(t,e):r(n)?v(t,e,n):w(t,e)}function x(e,r){e===r?M(e,d()):t(r)?b(e,r,m(r)):w(e,r)}function _(t){t._onerror&&t._onerror(t._result),A(t)}function w(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&Y(A,t))}function M(t,e){t._state===et&&(t._state=nt,t._result=e,Y(_,t))}function k(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+rt]=r,i[a+nt]=n,0===a&&t._state&&Y(A,t)}function A(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,i=void 0,a=t._result,o=0;o<e.length;o+=3)n=e[o],i=e[o+r],n?E(r,n,i,a):i(a);t._subscribers.length=0}}function T(){this.error=null}function S(t,e){try{return t(e)}catch(t){return at.error=t,at}}function E(t,e,n,i){var a=r(n),o=void 0,s=void 0,l=void 0,u=void 0;if(a){if(o=S(n,i),o===at?(u=!0,s=o.error,o=null):l=!0,e===o)return void M(e,p())}else o=i,l=!0;e._state!==et||(a&&l?x(e,o):u?M(e,s):t===rt?w(e,o):t===nt&&M(e,o))}function L(t,e){try{e(function(e){x(t,e)},function(e){M(t,e)})}catch(e){M(t,e)}}function C(){return ot++}function I(t){t[tt]=ot++,t._state=void 0,t._result=void 0,t._subscribers=[]}function z(t,e){this._instanceConstructor=t,this.promise=new t(f),this.promise[tt]||I(this.promise),V(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&w(this.promise,this._result))):M(this.promise,D())}function D(){return new Error(\"Array Methods must be provided an Array\")}function P(t){return new z(this,t).promise}function O(t){var e=this;return new e(V(t)?function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)}:function(t,e){return e(new TypeError(\"You must pass an array to race.\"))})}function R(t){var e=this,r=new e(f);return M(r,t),r}function F(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function j(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function N(t){this[tt]=C(),this._result=this._state=void 0,this._subscribers=[],f!==t&&(\"function\"!=typeof t&&F(),this instanceof N?L(this,t):j())}function B(){var t=void 0;if(void 0!==a)t=a;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(t){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if(\"[object Promise]\"===r&&!e.cast)return}t.Promise=N}var U=void 0;U=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)};var V=U,H=0,q=void 0,G=void 0,Y=function(t,e){Q[H]=t,Q[H+1]=e,2===(H+=2)&&(G?G(u):$())},W=\"undefined\"!=typeof window?window:void 0,X=W||{},Z=X.MutationObserver||X.WebKitMutationObserver,J=\"undefined\"==typeof self&&void 0!==i&&\"[object process]\"==={}.toString.call(i),K=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,Q=new Array(1e3),$=void 0;$=J?function(){return function(){return i.nextTick(u)}}():Z?function(){var t=0,e=new Z(u),r=document.createTextNode(\"\");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():K?function(){var t=new MessageChannel;return t.port1.onmessage=u,function(){return t.port2.postMessage(0)}}():void 0===W&&\"function\"==typeof e?function(){try{var t=e,r=t(\"vertx\");return q=r.runOnLoop||r.runOnContext,s()}catch(t){return l()}}():l();var tt=Math.random().toString(36).substring(16),et=void 0,rt=1,nt=2,it=new T,at=new T,ot=0;return z.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===et&&r<t;r++)this._eachEntry(e[r],r)},z.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===h){var i=m(t);if(i===c&&t._state!==et)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof i)this._remaining--,this._result[e]=t;else if(r===N){var a=new r(f);b(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},z.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===et&&(this._remaining--,t===nt?M(n,r):this._result[e]=r),0===this._remaining&&w(n,this._result)},z.prototype._willSettleAt=function(t,e){var r=this;k(t,void 0,function(t){return r._settledAt(rt,e,t)},function(t){return r._settledAt(nt,e,t)})},N.all=P,N.race=O,N.resolve=h,N.reject=R,N._setScheduler=n,N._setAsap=o,N._asap=Y,N.prototype={constructor:N,then:c,catch:function(t){return this.then(null,t)}},B(),N.polyfill=B,N.Promise=N,N})}).call(this,e(\"_process\"),\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{_process:487}],129:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return\"function\"==typeof t}function a(t){return\"number\"==typeof t}function o(t){return\"object\"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!a(t)||t<0||isNaN(t))throw TypeError(\"n must be a positive number\");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,a,l,u;if(this._events||(this._events={}),\"error\"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var c=new Error('Uncaught, unspecified \"error\" event. ('+e+\")\");throw c.context=e,c}if(r=this._events[t],s(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}else if(o(r))for(a=Array.prototype.slice.call(arguments,1),u=r.slice(),n=u.length,l=0;l<n;l++)u[l].apply(this,a);return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError(\"listener must be a function\");return this._events||(this._events={}),this._events.newListener&&this.emit(\"newListener\",t,i(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(r=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error(\"(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.\",this._events[t].length),\"function\"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError(\"listener must be a function\");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,n=-1,\n", | |
"r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit(\"removeListener\",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit(\"removeListener\",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)\"removeListener\"!==e&&this.removeAllListeners(e);return this.removeAllListeners(\"removeListener\"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],130:[function(t,e,r){\"use strict\";function n(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}e.exports=n},{}],131:[function(t,e,r){\"use strict\";function n(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}e.exports=function(t){var e=typeof t;if(\"string\"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if(\"number\"!==e)return!1;return t-t<1}},{}],132:[function(t,e,r){\"use strict\";function n(t){return new Function(\"f\",\"var p = (f && f.properties || {}); return \"+i(t))}function i(t){if(!t)return\"true\";var e=t[0];return t.length<=1?\"any\"===e?\"false\":\"true\":\"(\"+(\"==\"===e?o(t[1],t[2],\"===\",!1):\"!=\"===e?o(t[1],t[2],\"!==\",!1):\"<\"===e||\">\"===e||\"<=\"===e||\">=\"===e?o(t[1],t[2],e,!0):\"any\"===e?s(t.slice(1),\"||\"):\"all\"===e?s(t.slice(1),\"&&\"):\"none\"===e?c(s(t.slice(1),\"||\")):\"in\"===e?l(t[1],t.slice(2)):\"!in\"===e?c(l(t[1],t.slice(2))):\"has\"===e?u(t[1]):\"!has\"===e?c(u([t[1]])):\"true\")+\")\"}function a(t){return\"$type\"===t?\"f.type\":\"$id\"===t?\"f.id\":\"p[\"+JSON.stringify(t)+\"]\"}function o(t,e,r,n){var i=a(t),o=\"$type\"===t?f.indexOf(e):JSON.stringify(e);return(n?\"typeof \"+i+\"=== typeof \"+o+\"&&\":\"\")+i+r+o}function s(t,e){return t.map(i).join(e)}function l(t,e){\"$type\"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(h)),n=a(t);return e.length<=200?r+\".indexOf(\"+n+\") !== -1\":\"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }(\"+n+\", \"+r+\",0,\"+(e.length-1)+\")\"}function u(t){return JSON.stringify(t)+\" in p\"}function c(t){return\"!(\"+t+\")\"}function h(t,e){return t<e?-1:t>e?1:0}e.exports=n;var f=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"]},{}],133:[function(t,e,r){\"use strict\";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=t.slice().reverse(),this._velocity=e.slice().reverse(),this._time=[r],this._scratch=[t.slice(),t.slice(),t.slice(),t.slice(),t.slice()]}function a(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if(\"number\"==typeof t){var n=a(t);return new i(n,n,0)}return new i(t,a(t.length),0);case 2:if(\"number\"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error(\"state and velocity lengths must match\");return new i(t,e,r)}}e.exports=o;var s=t(\"cubic-hermite\"),l=t(\"binary-search-bounds\"),u=i.prototype;u.flush=function(t){var e=l.gt(this._time,t)-1;e<=0||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},u.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),a=this._scratch[0],o=this._state,u=this._velocity,c=this.dimension,h=this.bounds;if(i<0)for(var f=c-1,d=0;d<c;++d,--f)a[d]=o[f];else if(i>=r-1)for(var f=o.length-1,p=t-e[r-1],d=0;d<c;++d,--f)a[d]=o[f]+p*u[f];else{for(var f=c*(i+1)-1,m=e[i],g=e[i+1],v=g-m||1,y=this._scratch[1],b=this._scratch[2],x=this._scratch[3],_=this._scratch[4],w=!0,d=0;d<c;++d,--f)y[d]=o[f],x[d]=u[f]*v,b[d]=o[f+c],_[d]=u[f+c]*v,w=w&&y[d]===b[d]&&x[d]===_[d]&&0===x[d];if(w)for(var d=0;d<c;++d)a[d]=y[d];else s(y,x,b,_,(t-m)/v,a)}for(var M=h[0],k=h[1],d=0;d<c;++d)a[d]=n(M[d],k[d],a[d]);return a},u.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],a=this._state,o=this._velocity,u=this.dimension;if(n>=r-1)for(var c=a.length-1,h=(e[r-1],0);h<u;++h,--c)i[h]=o[c];else{for(var c=u*(n+1)-1,f=e[n],d=e[n+1],p=d-f||1,m=this._scratch[1],g=this._scratch[2],v=this._scratch[3],y=this._scratch[4],b=!0,h=0;h<u;++h,--c)m[h]=a[c],v[h]=o[c]*p,g[h]=a[c+u],y[h]=o[c+u]*p,b=b&&m[h]===g[h]&&v[h]===y[h]&&0===v[h];if(b)for(var h=0;h<u;++h)i[h]=0;else{s.derivative(m,v,g,y,(t-f)/p,i);for(var h=0;h<u;++h)i[h]/=p}}return i},u.lastT=function(){var t=this._time;return t[t.length-1]},u.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},u.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1];this._time.push(e,t);for(var c=0;c<2;++c)for(var h=0;h<r;++h)i.push(i[o++]),a.push(0);this._time.push(t);for(var h=r;h>0;--h)i.push(n(l[h-1],u[h-1],arguments[h])),a.push(0)}},u.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=t-e,l=this.bounds,u=l[0],c=l[1],h=s>1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var d=n(u[f-1],c[f-1],arguments[f]);i.push(d),a.push((d-i[o++])*h)}}},u.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,i=this._velocity,a=this.bounds,o=a[0],s=a[1];this._time.push(t);for(var l=e;l>0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},u.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,h=c>1e-6?1/c:0;this._time.push(t);for(var f=r;f>0;--f){var d=arguments[f];i.push(n(l[f-1],u[f-1],i[o++]+d)),a.push(d*h)}}},u.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,i=this._state,a=this._velocity,o=i.length-r,s=this.bounds,l=s[0],u=s[1],c=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)i.push(n(l[h],u[h],i[o]+c*a[o])),a.push(0),o+=1}}},{\"binary-search-bounds\":66,\"cubic-hermite\":109}],134:[function(t,e,r){\"use strict\";function n(t){t=t||{};var e,r,n=t.canvas||document.createElement(\"canvas\"),o=t.family||\"sans-serif\",s=t.shape||[512,512],l=t.step||[32,32],u=parseFloat(t.size)||16,c=t.chars||[32,126],h=Math.floor((l[0]-u)/2),f=t.radius||1.5*h,d=new a(u,h,f,0,o),p=null==t.align?\"optical\":t.align,m=null==t.fit||1==t.fit?.5:t.fit;if(Array.isArray(c)){if(2===c.length&&\"number\"==typeof c[0]&&\"number\"==typeof c[1]){var g=[];for(e=c[0],r=0;e<=c[1];e++)g[r++]=String.fromCharCode(e);c=g}}else c=String(c).split(\"\");s=s.slice(),n.width=s[0],n.height=s[1];var v=n.getContext(\"2d\");v.fillStyle=\"#000\",v.fillRect(0,0,n.width,n.height),v.textBaseline=\"middle\";var y=l[0],b=l[1],x=0,_=0,w=u/b,M=Math.min(c.length,Math.floor(s[0]/y)*Math.ceil(s[1]/b)),k=d.ctx.textAlign,A=d.buffer,T=d.middle;for(d.ctx.textAlign=\"center\",d.buffer=d.size/2,e=0;e<M;e++)if(c[e]){var S=i(c[e],o,w),E=1,L=[0,0];if(m){var C=m;Array.isArray(m)&&(C=m[e]);var I=.5*(S.bounds[3]-S.bounds[1]),z=.5*(S.bounds[2]-S.bounds[0]),D=Math.max(I,z),P=Math.sqrt(I*I+z*z),O=.333*S.radius+.333*D+.333*P;E=b*C/(O*b*2),d.ctx.font=u*E+\"px \"+o}else d.ctx.font=u+\"px \"+o;p&&(L=\"optical\"===p||!0===p?[.5*y-y*S.center[0],.5*b-b*S.center[1]]:[.5*y-y*(S.bounds[2]+S.bounds[0])*.5,.5*b-b*(S.bounds[3]+S.bounds[1])*.5],d.middle=T+L[1]*E);var R=d.draw(c[e]);v.putImageData(R,x+L[0]*E,_),x+=l[0],x>s[0]-l[0]&&(x=0,_+=l[1])}return d.ctx.textAlign=k,d.buffer=A,d.middle=T,n}function i(t,e,r){if(s[e]&&s[e][t])return s[e][t];var n=200*r,i=o(t,{size:200,fontSize:n,fontFamily:e});s[e]||(s[e]={});var a={center:[i.center[0]/200,i.center[1]/200],bounds:i.bounds.map(function(t){return t/200}),radius:i.radius/200};return s[e][t]=a,a}var a=t(\"tiny-sdf\"),o=t(\"optical-properties\");e.exports=n;var s={}},{\"optical-properties\":471,\"tiny-sdf\":533}],135:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){var r=l(t,e.left);if(r)return r}var r=t(e.key,e.value);return r||(e.right?l(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){if(n.left){var i=u(t,e,r,n.left);if(i)return i}var i=r(n.key,n.value);if(i)return i}if(n.right)return u(t,e,r,n.right)}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return c(t,e,r,n,i.right)}function h(t,e){this.tree=t,this._stack=e}function f(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=v);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===g){if(n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=v,r._color=v,s._color=v,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}return void(t[l-1]=n)}if(n.left&&n.left._color===g){if(n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=v,n._color=v,e._color=v,o(r),o(n),o(s),l>1){var u=t[l-2];u.left===r?u.left=s:u.right=s}return void(t[l-1]=s)}if(n._color===v){if(r._color===g)return r._color=v,void(r.right=a(g,n));r.right=a(g,n);continue}if(n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=g,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}else{if(n=r.left,n.left&&n.left._color===g){if(n=r.left=i(n),s=n.left=i(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,e._color=v,r._color=v,s._color=v,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}return void(t[l-1]=n)}if(n.right&&n.right._color===g){if(n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=v,n._color=v,e._color=v,o(r),o(n),o(s),l>1){var u=t[l-2];u.right===r?u.right=s:u.left=s}return void(t[l-1]=s)}if(n._color===v){if(r._color===g)return r._color=v,void(r.left=a(g,n));r.left=a(g,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=g,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}}}function p(t,e){return t<e?-1:t>e?1:0}function m(t){return new s(t||p,null)}e.exports=m;var g=0,v=1,y=s.prototype;Object.defineProperty(y,\"keys\",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,\"values\",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,\"length\",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],u=[];i;){var c=r(t,i.key);l.push(i),u.push(c),i=c<=0?i.left:i.right}l.push(new n(g,t,e,null,null,1));for(var h=l.length-2;h>=0;--h){var i=l[h];u[h]<=0?l[h]=new n(i._color,i.key,i.value,l[h+1],i.right,i._count+1):l[h]=new n(i._color,i.key,i.value,i.left,l[h+1],i._count+1)}for(var h=l.length-1;h>1;--h){var f=l[h-1],i=l[h];if(f._color===v||i._color===v)break;var d=l[h-2];if(d.left===f)if(f.left===i){var p=d.right;if(!p||p._color!==g){if(d._color=g,d.left=f.right,f._color=v,f.right=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var m=l[h-3];m.left===d?m.left=f:m.right=f}break}f._color=v,d.right=a(v,p),d._color=g,h-=1}else{var p=d.right;if(!p||p._color!==g){if(f.right=i.left,d._color=g,d.left=i.right,i._color=v,i.left=f,i.right=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var m=l[h-3];m.left===d?m.left=i:m.right=i}break}f._color=v,d.right=a(v,p),d._color=g,h-=1}else if(f.right===i){var p=d.left;if(!p||p._color!==g){if(d._color=g,d.right=f.left,f._color=v,f.left=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var m=l[h-3];m.right===d?m.right=f:m.left=f}break}f._color=v,d.left=a(v,p),d._color=g,h-=1}else{var p=d.left;if(!p||p._color!==g){if(f.left=i.right,d._color=g,d.right=i.left,i._color=v,i.right=f,i.left=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var m=l[h-3];m.right===d?m.right=i:m.left=i}break}f._color=v,d.left=a(v,p),d._color=g,h-=1}}return l[0]._color=v,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,\"begin\",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(y,\"end\",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),y.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new h(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new h(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var b=h.prototype;Object.defineProperty(b,\"valid\",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,\"node\",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new h(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var i=t.length-2;i>=0;--i){var r=t[i];r.left===t[i+1]?e[i]=new n(r._color,r.key,r.value,e[i+1],r.right,r._count):e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var a=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var o=e[a-1];e.push(new n(r._color,o.key,o.value,r.left,r.right,r._count)),e[a-1].key=r.key,e[a-1].value=r.value;for(var i=e.length-2;i>=a;--i)r=e[i],e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count);e[a-1].left=e[a]}if(r=e[e.length-1],r._color===g){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var i=0;i<e.length;++i)e[i]._count--;return new s(this.tree._compare,e[0])}if(r.left||r.right){r.left?f(r,r.left):r.right&&f(r,r.right),r._color=v;for(var i=0;i<e.length-1;++i)e[i]._count--;return new s(this.tree._compare,e[0])}if(1===e.length)return new s(this.tree._compare,null);for(var i=0;i<e.length;++i)e[i]._count--;var u=e[e.length-2];return d(e),u.left===r?u.left=null:u.right=null,new s(this.tree._compare,e[0])},Object.defineProperty(b,\"key\",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(b,\"value\",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(b,\"index\",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),b.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,\"hasNext\",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error(\"Can't update empty node!\");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)i=e[a],i.left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},b.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,\"hasPrev\",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],136:[function(t,e,r){function n(t){if(t<0)return Number(\"0/0\");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],137:[function(t,e,r){function n(t){if(\"Polygon\"===t.type)return i(t.coordinates);if(\"MultiPolygon\"===t.type){for(var e=0,r=0;r<t.coordinates.length;r++)e+=i(t.coordinates[r]);return e}return null}function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(a(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(a(t[r]))}return e}function a(t){var e=0;if(t.length>2){for(var r,n,i=0;i<t.length-1;i++)r=t[i],n=t[i+1],e+=o(n[0]-r[0])*(2+Math.sin(o(r[1]))+Math.sin(o(n[1])));e=e*s.RADIUS*s.RADIUS/2}return e}function o(t){return t*Math.PI/180}var s=t(\"wgs84\");e.exports.geometry=n,e.exports.ring=a},{wgs84:565}],138:[function(t,e,r){function n(t,e){switch(t&&t.type||null){case\"FeatureCollection\":return t.features=t.features.map(i(n,e)),t;case\"Feature\":return t.geometry=n(t.geometry,e),t;case\"Polygon\":case\"MultiPolygon\":return a(t,e);default:return t}}function i(t,e){return function(r){return t(r,e)}}function a(t,e){return\"Polygon\"===t.type?t.coordinates=o(t.coordinates,e):\"MultiPolygon\"===t.type&&(t.coordinates=t.coordinates.map(i(o,e))),t}function o(t,e){e=!!e,t[0]=s(t[0],!e);for(var r=1;r<t.length;r++)t[r]=s(t[r],e);return t}function s(t,e){return l(t)===e?t:t.reverse()}function l(t){return u.ring(t)>=0}var u=t(\"geojson-area\");e.exports=n},{\"geojson-area\":137}],139:[function(t,e,r){\"use strict\";function n(t,e,r,n,o,l,u,c){if(r/=e,n/=e,u>=r&&c<=n)return t;if(u>n||c<r)return null;for(var h=[],f=0;f<t.length;f++){var d,p,m=t[f],g=m.geometry,v=m.type;if(d=m.min[o],p=m.max[o],d>=r&&p<=n)h.push(m);else if(!(d>n||p<r)){var y=1===v?i(g,r,n,o):a(g,r,n,o,l,3===v);y.length&&h.push(s(m.tags,v,y,m.id))}}return h.length?h:null}function i(t,e,r,n){for(var i=[],a=0;a<t.length;a++){var o=t[a],s=o[n];s>=e&&s<=r&&i.push(o)}return i}function a(t,e,r,n,i,a){for(var s=[],l=0;l<t.length;l++){var u,c,h,f=0,d=0,p=null,m=t[l],g=m.area,v=m.dist,y=m.outer,b=m.length,x=[];for(c=0;c<b-1;c++)u=p||m[c],p=m[c+1],f=d||u[n],d=p[n],f<e?d>r?(x.push(i(u,p,e),i(u,p,r)),a||(x=o(s,x,g,v,y))):d>=e&&x.push(i(u,p,e)):f>r?d<e?(x.push(i(u,p,r),i(u,p,e)),a||(x=o(s,x,g,v,y))):d<=r&&x.push(i(u,p,r)):(x.push(u),d<e?(x.push(i(u,p,e)),a||(x=o(s,x,g,v,y))):d>r&&(x.push(i(u,p,r)),a||(x=o(s,x,g,v,y))));u=m[b-1],f=u[n],f>=e&&f<=r&&x.push(u),h=x[x.length-1],a&&h&&(x[0][0]!==h[0]||x[0][1]!==h[1])&&x.push(x[0]),o(s,x,g,v,y)}return s}function o(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t(\"./feature\")},{\"./feature\":141}],140:[function(t,e,r){\"use strict\";function n(t,e){var r=[];if(\"FeatureCollection\"===t.type)for(var n=0;n<t.features.length;n++)i(r,t.features[n],e);else\"Feature\"===t.type?i(r,t,e):i(r,{geometry:t},e);return r}function i(t,e,r){if(null!==e.geometry){var n,s,l,c,h=e.geometry,f=h.type,d=h.coordinates,p=e.properties,m=e.id;if(\"Point\"===f)t.push(u(p,1,[o(d)],m));else if(\"MultiPoint\"===f)t.push(u(p,1,a(d),m));else if(\"LineString\"===f)t.push(u(p,2,[a(d,r)],m));else if(\"MultiLineString\"===f||\"Polygon\"===f){for(l=[],n=0;n<d.length;n++)c=a(d[n],r),\"Polygon\"===f&&(c.outer=0===n),l.push(c);t.push(u(p,\"Polygon\"===f?3:2,l,m))}else if(\"MultiPolygon\"===f){for(l=[],n=0;n<d.length;n++)for(s=0;s<d[n].length;s++)c=a(d[n][s],r),c.outer=0===s,l.push(c);t.push(u(p,3,l,m))}else{if(\"GeometryCollection\"!==f)throw new Error(\"Input data is not a valid GeoJSON object.\");for(n=0;n<h.geometries.length;n++)i(t,{geometry:h.geometries[n],properties:p},r)}}}function a(t,e){for(var r=[],n=0;n<t.length;n++)r.push(o(t[n]));return e&&(l(r,e),s(r)),r}function o(t){var e=Math.sin(t[1]*Math.PI/180),r=t[0]/360+.5,n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n=n<0?0:n>1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,a=0;a<t.length-1;a++)e=r||t[a],r=t[a+1],n+=e[0]*r[1]-r[0]*e[1],i+=Math.abs(r[0]-e[0])+Math.abs(r[1]-e[1]);t.area=Math.abs(n/2),t.dist=i}e.exports=n;var l=t(\"./simplify\"),u=t(\"./feature\")},{\"./feature\":141,\"./simplify\":143}],141:[function(t,e,r){\"use strict\";function n(t,e,r,n){var a={id:n||null,type:e,geometry:r,tags:t||null,min:[1/0,1/0],max:[-1/0,-1/0]};return i(a),a}function i(t){var e=t.geometry,r=t.min,n=t.max;if(1===t.type)a(r,n,e);else for(var i=0;i<e.length;i++)a(r,n,e[i]);return t}function a(t,e,r){for(var n,i=0;i<r.length;i++)n=r[i],t[0]=Math.min(n[0],t[0]),e[0]=Math.max(n[0],e[0]),t[1]=Math.min(n[1],t[1]),e[1]=Math.max(n[1],e[1])}e.exports=n},{}],142:[function(t,e,r){\"use strict\";function n(t,e){return new i(t,e)}function i(t,e){e=this.options=l(Object.create(this.options),e);var r=e.debug;r&&console.time(\"preprocess data\");var n=1<<e.maxZoom,i=c(t,e.tolerance/(n*e.extent));this.tiles={},this.tileCoords=[],r&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",e.indexMaxZoom,e.indexMaxPoints),console.time(\"generate tiles\"),this.stats={},this.total=0),i=d(i,e.buffer/e.extent,o),i.length&&this.splitTile(i,0,0,0),r&&(i.length&&console.log(\"features: %d, points: %d\",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd(\"generate tiles\"),console.log(\"tiles generated:\",this.total,JSON.stringify(this.stats)))}function a(t,e,r){return 32*((1<<t)*r+e)+t}function o(t,e,r){return[r,(r-t[0])*(e[1]-t[1])/(e[0]-t[0])+t[1],1]}function s(t,e,r){return[(r-t[1])*(e[0]-t[0])/(e[1]-t[1])+t[0],r,1]}function l(t,e){for(var r in e)t[r]=e[r];return t}function u(t,e,r){var n=t.source;if(1!==n.length)return!1;var i=n[0];if(3!==i.type||i.geometry.length>1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o<a;o++){var s=h.point(i.geometry[0][o],e,t.z2,t.x,t.y);if(s[0]!==-r&&s[0]!==e+r||s[1]!==-r&&s[1]!==e+r)return!1}return!0}e.exports=n;var c=t(\"./convert\"),h=t(\"./transform\"),f=t(\"./clip\"),d=t(\"./wrap\"),p=t(\"./tile\");i.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},i.prototype.splitTile=function(t,e,r,n,i,l,c){for(var h=[t,e,r,n],d=this.options,m=d.debug,g=null;h.length;){n=h.pop(),r=h.pop(),e=h.pop(),t=h.pop();var v=1<<e,y=a(e,r,n),b=this.tiles[y],x=e===d.maxZoom?0:d.tolerance/(v*d.extent);if(!b&&(m>1&&console.time(\"creation\"),b=this.tiles[y]=p(t,v,r,n,x,e===d.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",e,r,n,b.numFeatures,b.numPoints,b.numSimplified),console.timeEnd(\"creation\"));var _=\"z\"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(b.source=t,i){if(e===d.maxZoom||e===i)continue;var w=1<<i-e;if(r!==Math.floor(l/w)||n!==Math.floor(c/w))continue}else if(e===d.indexMaxZoom||b.numPoints<=d.indexMaxPoints)continue;if(d.solidChildren||!u(b,d.extent,d.buffer)){b.source=null,m>1&&console.time(\"clipping\");var M,k,A,T,S,E,L=.5*d.buffer/d.extent,C=.5-L,I=.5+L,z=1+L;M=k=A=T=null,S=f(t,v,r-L,r+I,0,o,b.min[0],b.max[0]),E=f(t,v,r+C,r+z,0,o,b.min[0],b.max[0]),S&&(M=f(S,v,n-L,n+I,1,s,b.min[1],b.max[1]),k=f(S,v,n+C,n+z,1,s,b.min[1],b.max[1])),E&&(A=f(E,v,n-L,n+I,1,s,b.min[1],b.max[1]),T=f(E,v,n+C,n+z,1,s,b.min[1],b.max[1])),m>1&&console.timeEnd(\"clipping\"),t.length&&(h.push(M||[],e+1,2*r,2*n),h.push(k||[],e+1,2*r,2*n+1),h.push(A||[],e+1,2*r+1,2*n),h.push(T||[],e+1,2*r+1,2*n+1))}else i&&(g=e)}return g},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug,s=1<<t;e=(e%s+s)%s;var l=a(t,e,r);if(this.tiles[l])return h.tile(this.tiles[l],i);o>1&&console.log(\"drilling down to z%d-%d-%d\",t,e,r);for(var c,f=t,d=e,p=r;!c&&f>0;)f--,d=Math.floor(d/2),p=Math.floor(p/2),c=this.tiles[a(f,d,p)];if(!c||!c.source)return null;if(o>1&&console.log(\"found parent tile z%d-%d-%d\",f,d,p),u(c,i,n.buffer))return h.tile(c,i);o>1&&console.time(\"drilling down\");var m=this.splitTile(c.source,f,d,p,t,e,r);if(o>1&&console.timeEnd(\"drilling down\"),null!==m){var g=1<<t-m;l=a(m,Math.floor(e/g),Math.floor(r/g))}return this.tiles[l]?h.tile(this.tiles[l],i):null}},{\"./clip\":139,\"./convert\":140,\"./tile\":144,\"./transform\":145,\"./wrap\":146}],143:[function(t,e,r){\"use strict\";function n(t,e){var r,n,a,o,s=e*e,l=t.length,u=0,c=l-1,h=[];for(t[u][2]=1,t[c][2]=1;c;){for(n=0,r=u+1;r<c;r++)(a=i(t[r],t[u],t[c]))>n&&(o=r,n=a);n>s?(t[o][2]=n,h.push(u),h.push(o),u=o):(c=h.pop(),u=h.pop())}}function i(t,e,r){var n=e[0],i=e[1],a=r[0],o=r[1],s=t[0],l=t[1],u=a-n,c=o-i;if(0!==u||0!==c){var h=((s-n)*u+(l-i)*c)/(u*u+c*c);h>1?(n=a,i=o):h>0&&(n+=u*h,i+=c*h)}return u=s-n,c=l-i,u*u+c*c}e.exports=n},{}],144:[function(t,e,r){\"use strict\";function n(t,e,r,n,a,o){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;l<t.length;l++){s.numFeatures++,i(s,t[l],a,o);var u=t[l].min,c=t[l].max;u[0]<s.min[0]&&(s.min[0]=u[0]),u[1]<s.min[1]&&(s.min[1]=u[1]),c[0]>s.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,o,s,l,u=e.geometry,c=e.type,h=[],f=r*r;if(1===c)for(i=0;i<u.length;i++)h.push(u[i]),t.numPoints++,t.numSimplified++;else for(i=0;i<u.length;i++)if(s=u[i],n||!(2===c&&s.dist<r||3===c&&s.area<f)){var d=[];for(o=0;o<s.length;o++)l=s[o],(n||l[2]>f)&&(d.push(l),t.numSimplified++),t.numPoints++;3===c&&a(d,s.outer),h.push(d)}else t.numPoints+=s.length;if(h.length){var p={geometry:h,type:c,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function a(t,e){o(t)<0===e&&t.reverse()}function o(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],r=t[o],n+=(r[0]-e[0])*(e[1]+r[1]);return n}e.exports=n},{}],145:[function(t,e,r){\"use strict\";function n(t,e){if(t.transformed)return t;var r,n,a,o=t.z2,s=t.x,l=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],c=u.geometry;if(1===u.type)for(n=0;n<c.length;n++)c[n]=i(c[n],e,o,s,l);else for(n=0;n<c.length;n++){var h=c[n];for(a=0;a<h.length;a++)h[a]=i(h[a],e,o,s,l)}}return t.transformed=!0,t}function i(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=n,r.point=i},{}],146:[function(t,e,r){\"use strict\";function n(t,e,r){var n=t,a=o(t,1,-1-e,e,0,r,-1,2),s=o(t,1,1-e,2+e,0,r,-1,2);return(a||s)&&(n=o(t,1,-e,1+e,0,r,-1,2)||[],a&&(n=i(a,1).concat(n)),s&&(n=n.concat(i(s,-1)))),n}function i(t,e){for(var r=[],n=0;n<t.length;n++){var i,o=t[n],l=o.type;if(1===l)i=a(o.geometry,e);else{i=[];for(var u=0;u<o.geometry.length;u++)i.push(a(o.geometry[u],e))}r.push(s(o.tags,l,i,o.id))}return r}function a(t,e){var r=[];r.area=t.area,r.dist=t.dist;for(var n=0;n<t.length;n++)r.push([t[n][0]+e,t[n][1],t[n][2]]);return r}var o=t(\"./clip\"),s=t(\"./feature\");e.exports=n},{\"./clip\":139,\"./feature\":141}],147:[function(t,e,r){function n(t,e){if(\"string\"!=typeof t)throw new TypeError(\"must specify type string\");if(e=e||{},\"undefined\"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement(\"canvas\");\"number\"==typeof e.width&&(r.width=e.width),\"number\"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf(\"webgl\")&&a.push(\"experimental-\"+t);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch(t){n=null}return n||null}e.exports=n},{}],148:[function(t,e,r){\"use strict\";function n(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function i(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=[\"sans-serif\",\"sans-serif\",\"sans-serif\"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=[\"x\",\"y\",\"z\"],this.labelEnable=[!0,!0,!0],this.labelFont=\"sans-serif\",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=c(t)}function a(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}function o(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;c<3;++c)if(e!==c){var h=a,f=s,d=o,p=l\n", | |
";u&1<<c&&(h=s,f=a,d=l,p=o),h[c]=r[0][c],f[c]=r[1][c],i[c]>0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}function s(t,e){var r=new i(t);return r.update(e),r}e.exports=s;var l=t(\"./lib/text.js\"),u=t(\"./lib/lines.js\"),c=t(\"./lib/background.js\"),h=t(\"./lib/cube.js\"),f=t(\"./lib/ticks.js\"),d=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),p=i.prototype;p.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),s=!1,c=!1;if(\"bounds\"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(c=!0),this.bounds[d][p]=h[d][p];if(\"ticks\"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(var d=0;d<3;++d)this.tickSpacing[d]=0}else n(\"tickSpacing\")&&(this.autoTicks=!0,c=!0);if(this._firstInit&&(\"ticks\"in t||\"tickSpacing\"in t||(this.autoTicks=!0),c=!0,s=!0,this._firstInit=!1),c&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),s=!0),s){for(var d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?s=!1:this.ticks=r}i(\"tickEnable\"),a(\"tickFont\")&&(s=!0),n(\"tickSize\"),n(\"tickAngle\"),n(\"tickPad\"),o(\"tickColor\");var m=a(\"labels\");a(\"labelFont\")&&(m=!0),i(\"labelEnable\"),n(\"labelSize\"),n(\"labelPad\"),o(\"labelColor\"),i(\"lineEnable\"),i(\"lineMirror\"),n(\"lineWidth\"),o(\"lineColor\"),i(\"lineTickEnable\"),i(\"lineTickMirror\"),n(\"lineTickLength\"),n(\"lineTickWidth\"),o(\"lineTickColor\"),i(\"gridEnable\"),n(\"gridWidth\"),o(\"gridColor\"),i(\"zeroEnable\"),o(\"zeroLineColor\"),n(\"zeroLineWidth\"),i(\"backgroundEnable\"),o(\"backgroundColor\"),this._text?this._text&&(m||s)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=l(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&s&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=u(this.gl,this.bounds,this.ticks))};var m=[new a,new a,new a],g=[0,0,0],v={model:d,view:d,projection:d};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(t){};var y=[0,0,0],b=[0,0,0],x=[0,0,0];p.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||d,i=t.view||d,a=t.projection||d,s=this.bounds,l=h(r,i,a,s),u=l.cubeEdges,c=l.axis,f=i[12],p=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*f+a[7]*p+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=c[k];for(var A=m,k=0;k<3;++k)o(m[k],k,this.bounds,u,c);for(var e=this.gl,T=g,k=0;k<3;++k)this.backgroundEnable[k]?T[k]=c[k]:T[k]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(var k=0;k<3;++k){var S=[0,0,0];c[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(var k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);for(var I=n(y,A[k].primalMinor),z=n(b,A[k].mirrorMinor),D=this.lineTickLength,E=0;E<3;++E){var P=M/r[5*E];I[E]*=D[E]*P,z[E]*=D[E]*P}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,I,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(var k=0;k<3;++k){for(var O=A[k].primalMinor,R=n(x,A[k].primalOffset),E=0;E<3;++E)this.lineTickEnable[k]&&(R[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[k]){for(var E=0;E<3;++E)R[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],R,this.tickColor[k])}if(this.labelEnable[k]){for(var E=0;E<3;++E)R[E]+=M*O[E]*this.labelPad[E]/r[5*E];R[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],R,this.labelColor[k])}}},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{\"./lib/background.js\":149,\"./lib/cube.js\":150,\"./lib/lines.js\":151,\"./lib/text.js\":153,\"./lib/ticks.js\":154}],149:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}function i(t){for(var e=[],r=[],i=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,h=[0,0,0],f=[0,0,0],d=-1;d<=1;d+=2){r.push(i,i+2,i+1,i+1,i+2,i+3),h[l]=d,f[l]=d;for(var p=-1;p<=1;p+=2){h[u]=p;for(var m=-1;m<=1;m+=2)h[c]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),i+=1}var g=u;u=c,c=g}var v=a(t,new Float32Array(e)),y=a(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=o(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=s(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new n(t,v,b,x)}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-vao\"),s=t(\"./shaders\").bg,l=n.prototype;l.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{\"./shaders\":152,\"gl-buffer\":156,\"gl-vao\":271}],150:[function(t,e,r){\"use strict\";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;e<m.length;++e)if(t=l.positive(t,m[e]),t.length<3)return 0;for(var r=t[0],n=r[0]/r[3],i=r[1]/r[3],a=0,e=1;e+1<t.length;++e){var o=t[e],s=t[e+1],u=o[0]/o[3],c=o[1]/o[3],h=s[0]/s[3],f=s[1]/s[3],d=u-n,p=c-i,g=h-n,v=f-i;a+=Math.abs(d*v-p*g)}return a}function a(t,e,r,a){s(c,e,t),s(c,r,c);for(var l=0,m=0;m<2;++m){d[2]=a[m][2];for(var b=0;b<2;++b){d[1]=a[b][1];for(var x=0;x<2;++x)d[0]=a[x][0],n(h[l],d,c),l+=1}}for(var _=-1,m=0;m<8;++m){for(var w=h[m][3],M=0;M<3;++M)f[m][M]=h[m][M]/w;w<0&&(_<0?_=m:f[m][2]<f[_][2]&&(_=m))}if(_<0){_=0;for(var k=0;k<3;++k){for(var A=(k+2)%3,T=(k+1)%3,S=-1,E=-1,L=0;L<2;++L){var C=L<<k,I=C+(L<<A)+(1-L<<T),z=C+(1-L<<A)+(L<<T);u(f[C],f[I],f[z],p)<0||(L?S=1:E=1)}if(S<0||E<0)E>S&&(_|=1<<k);else{for(var L=0;L<2;++L){var C=L<<k,I=C+(L<<A)+(1-L<<T),z=C+(1-L<<A)+(L<<T),D=i([h[C],h[I],h[z],h[C+(1<<A)+(1<<T)]]);L?S=D:E=D}E>S&&(_|=1<<k)}}}for(var P=7^_,O=-1,m=0;m<8;++m)m!==_&&m!==P&&(O<0?O=m:f[O][1]>f[m][1]&&(O=m));for(var R=-1,m=0;m<3;++m){var F=O^1<<m;if(F!==_&&F!==P){R<0&&(R=F);var T=f[F];T[0]<f[R][0]&&(R=F)}}for(var j=-1,m=0;m<3;++m){var F=O^1<<m;if(F!==_&&F!==P&&F!==R){j<0&&(j=F);var T=f[F];T[0]>f[j][0]&&(j=F)}}var N=g;N[0]=N[1]=N[2]=0,N[o.log2(R^O)]=O&R,N[o.log2(O^j)]=O&j;var B=7^j;B===_||B===P?(B=7^R,N[o.log2(j^B)]=B&j):N[o.log2(R^B)]=B&R;for(var U=v,V=_,k=0;k<3;++k)U[k]=V&1<<k?-1:1;return y}e.exports=a;var o=t(\"bit-twiddle\"),s=t(\"gl-mat4/multiply\"),l=(t(\"gl-mat4/invert\"),t(\"split-polygon\")),u=t(\"robust-orientation\"),c=new Array(16),h=(new Array(16),new Array(8)),f=new Array(8),d=new Array(3),p=[0,0,0];!function(){for(var t=0;t<8;++t)h[t]=[1,1,1,1],f[t]=[1,1,1]}();var m=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]],g=[1,1,1],v=[0,0,0],y={cubeEdges:g,axis:v}},{\"bit-twiddle\":67,\"gl-mat4/invert\":181,\"gl-mat4/multiply\":183,\"robust-orientation\":508,\"split-polygon\":526}],151:[function(t,e,r){\"use strict\";function n(t){return t[0]=t[1]=t[2]=0,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function a(t,e,r,n,i,a,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}function o(t,e,r){var n=[],i=[0,0,0],o=[0,0,0],c=[0,0,0],h=[0,0,0];n.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var f=0;f<3;++f){for(var d=n.length/3|0,p=0;p<r[f].length;++p){var m=+r[f][p].x;n.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var g=n.length/3|0;i[f]=d,o[f]=g-d;for(var d=n.length/3|0,v=0;v<r[f].length;++v){var m=+r[f][v].x;n.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var g=n.length/3|0;c[f]=d,h[f]=g-d}var y=s(t,new Float32Array(n)),b=l(t,[{buffer:y,type:t.FLOAT,size:3,stride:0,offset:0}]),x=u(t);return x.attributes.position.location=0,new a(t,y,b,x,o,i,h,c)}e.exports=o;var s=t(\"gl-buffer\"),l=t(\"gl-vao\"),u=t(\"./shaders\").line,c=[0,0,0],h=[0,0,0],f=[0,0,0],d=[0,0,0],p=[1,1],m=a.prototype;m.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=p,this.vao.bind()},m.drawAxisLine=function(t,e,r,a,o){var s=n(h);this.shader.uniforms.majorAxis=h,s[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=s;var l=i(d,r);l[t]+=e[0][t],this.shader.uniforms.offset=l,this.shader.uniforms.lineWidth=o,this.shader.uniforms.color=a;var u=n(f);u[(t+2)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6);var u=n(f);u[(t+1)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6)},m.drawAxisTicks=function(t,e,r,i,a){if(this.tickCount[t]){var o=n(c);o[t]=1,this.shader.uniforms.majorAxis=o,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=i,this.shader.uniforms.lineWidth=a;var s=n(f);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},m.drawGrid=function(t,e,r,a,o,s){if(this.gridCount[t]){var l=n(h);l[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=l;var u=i(d,a);u[e]+=r[0][e],this.shader.uniforms.offset=u;var p=n(c);p[t]=1,this.shader.uniforms.majorAxis=p;var m=n(f);m[t]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=o,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},m.drawZero=function(t,e,r,a,o,s){var l=n(h);this.shader.uniforms.majorAxis=l,l[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=l;var u=i(d,a);u[t]+=r[0][t],this.shader.uniforms.offset=u;var c=n(f);c[e]=1,this.shader.uniforms.screenAxis=c,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=o,this.vao.draw(this.gl.TRIANGLES,6)},m.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{\"./shaders\":152,\"gl-buffer\":156,\"gl-vao\":271}],152:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\");r.line=function(t){return n(t,\"#define GLSLIFY 1\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\\nuniform float lineWidth;\\nuniform vec2 screenShape;\\n\\nvec3 project(vec3 p) {\\n vec4 pp = projection * view * model * vec4(p, 1.0);\\n return pp.xyz / max(pp.w, 0.0001);\\n}\\n\\nvoid main() {\\n vec3 major = position.x * majorAxis;\\n vec3 minor = position.y * minorAxis;\\n\\n vec3 vPosition = major + minor + offset;\\n vec3 pPosition = project(vPosition);\\n vec3 offset = project(vPosition + screenAxis * position.z);\\n\\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\\n\\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\\n}\\n\",\"precision mediump float;\\n#define GLSLIFY 1\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = color;\\n}\",null,[{name:\"position\",type:\"vec3\"}])};r.text=function(t){return n(t,\"#define GLSLIFY 1\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 offset, axis;\\nuniform float scale, angle, pixelScale;\\nuniform vec2 resolution;\\n\\nvoid main() { \\n //Compute plane offset\\n vec2 planeCoord = position.xy * pixelScale;\\n mat2 planeXform = scale * mat2(cos(angle), sin(angle),\\n -sin(angle), cos(angle));\\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\\n\\n //Compute world offset\\n float axisDistance = position.z;\\n vec3 dataPosition = axisDistance * axis + offset;\\n vec4 worldPosition = model * vec4(dataPosition, 1);\\n \\n //Compute clip position\\n vec4 viewPosition = view * worldPosition;\\n vec4 clipPosition = projection * viewPosition;\\n clipPosition /= clipPosition.w;\\n\\n //Apply text offset in clip coordinates\\n clipPosition += vec4(viewOffset, 0, 0);\\n\\n //Done\\n gl_Position = clipPosition;\\n}\",\"precision mediump float;\\n#define GLSLIFY 1\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = color;\\n}\",null,[{name:\"position\",type:\"vec3\"}])};r.bg=function(t){return n(t,\"#define GLSLIFY 1\\nattribute vec3 position;\\nattribute vec3 normal;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 enable;\\nuniform vec3 bounds[2];\\n\\nvarying vec3 colorChannel;\\n\\nvoid main() {\\n if(dot(normal, enable) > 0.0) {\\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\\n } else {\\n gl_Position = vec4(0,0,0,0);\\n }\\n colorChannel = abs(normal);\\n}\",\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 colors[3];\\n\\nvarying vec3 colorChannel;\\n\\nvoid main() {\\n gl_FragColor = colorChannel.x * colors[0] + \\n colorChannel.y * colors[1] +\\n colorChannel.z * colors[2];\\n}\",null,[{name:\"position\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}])}},{\"gl-shader\":255}],153:[function(t,e,r){(function(r){\"use strict\";function n(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}function i(t,e){try{return l(t,e)}catch(t){return console.warn(\"error vectorizing text:\",t),{cells:[],positions:[]}}}function a(t,e,r,i,a,l){var c=o(t),h=s(t,[{buffer:c,size:3}]),f=u(t);f.attributes.position.location=0;var d=new n(t,f,c,h);return d.update(e,r,i,a,l),d}e.exports=a;var o=t(\"gl-buffer\"),s=t(\"gl-vao\"),l=t(\"vectorize-text\"),u=t(\"./shaders\").text,c=window||r.global||{},h=c.__TEXT_CACHE||{};c.__TEXT_CACHE={};var f=n.prototype,d=[0,0];f.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,d[0]=this.gl.drawingBufferWidth,d[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=d},f.update=function(t,e,r,n,a){function o(t,e,r,n){var a=h[r];a||(a=h[r]={});var o=a[e];o||(o=a[e]=i(e,{triangles:!0,font:r,textAlign:\"center\",textBaseline:\"middle\"}));for(var l=(n||12)/12,u=o.positions,c=o.cells,f=0,d=c.length;f<d;++f)for(var p=c[f],m=2;m>=0;--m){var g=u[p[m]];s.push(l*g[0],-l*g[1],t)}}for(var s=(this.gl,[]),l=[0,0,0],u=[0,0,0],c=[0,0,0],f=[0,0,0],d=0;d<3;++d){c[d]=s.length/3|0,o(.5*(t[0][d]+t[1][d]),e[d],r),f[d]=(s.length/3|0)-c[d],l[d]=s.length/3|0;for(var p=0;p<n[d].length;++p)n[d][p].text&&o(n[d][p].x,n[d][p].text,n[d][p].font||a,n[d][p].fontSize||12);u[d]=(s.length/3|0)-l[d]}this.buffer.update(s),this.tickOffset=l,this.tickCount=u,this.labelOffset=c,this.labelCount=f};var p=[0,0,0];f.drawTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=p;a[0]=a[1]=a[2]=0,a[t]=1,this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}};var m=[0,0,0];f.drawLabel=function(t,e,r,n,i){this.labelCount[t]&&(this.shader.uniforms.axis=m,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t]))},f.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t(\"_process\"))},{\"./shaders\":152,_process:487,\"gl-buffer\":156,\"gl-vao\":271,\"vectorize-text\":554}],154:[function(t,e,r){\"use strict\";function n(t,e){var r=t+\"\",n=r.indexOf(\".\"),i=0;n>=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+\"\";if(s.indexOf(\"e\")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=\"\"+l;if(o<0&&(c=\"-\"+c),i){for(var h=\"\"+u;h.length<i;)h=\"0\"+h;return c+\".\"+h}return c}function i(t,e){for(var r=[],i=0;i<3;++i){for(var a=[],o=(t[0][i],t[1][i],0);o*e[i]<=t[1][i];++o)a.push({x:o*e[i],text:n(e[i],o)});for(var o=-1;o*e[i]>=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r}function a(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;++n){var i=t[r][n],a=e[r][n];if(i.x!==a.x||i.text!==a.text||i.font!==a.font||i.fontColor!==a.fontColor||i.fontSize!==a.fontSize||i.dx!==a.dx||i.dy!==a.dy)return!1}}return!0}r.create=i,r.equal=a},{}],155:[function(t,e,r){\"use strict\";function n(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}function i(t,e,r,n,i){for(var a=0;a<3;++a){for(var o=p,s=m,l=0;l<3;++l)s[l]=o[l]=r[l];s[3]=o[3]=1,s[a]+=1,h(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,h(o,o,e),o[3]<0&&(t[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,c=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+c*c)}return t}function a(t,e,r,n,a){var h=e.model||f,p=e.view||f,m=e.projection||f,y=t.bounds,a=a||l(h,p,m,y),b=a.axis;a.edges;u(d,p,h),u(d,m,d);for(var x=g,_=0;_<3;++_)x[_].lo=1/0,x[_].hi=-1/0,x[_].pixelsPerDataUnit=1/0;var w=o(c(d,d));c(d,d);for(var M=0;M<3;++M){var k=(M+1)%3,A=(M+2)%3,T=v;t:for(var _=0;_<2;++_){var S=[];if(b[M]<0!=!!_){T[M]=y[_][M];for(var E=0;E<2;++E){T[k]=y[E^_][k];for(var L=0;L<2;++L)T[A]=y[L^E^_][A],S.push(T.slice())}for(var E=0;E<w.length;++E){if(0===S.length)continue t;S=s.positive(S,w[E])}for(var E=0;E<S.length;++E)for(var A=S[E],C=i(v,d,A,r,n),L=0;L<3;++L)x[L].lo=Math.min(x[L].lo,A[L]),x[L].hi=Math.max(x[L].hi,A[L]),L!==M&&(x[L].pixelsPerDataUnit=Math.min(x[L].pixelsPerDataUnit,Math.abs(C[L])))}}}return x}e.exports=a;var o=t(\"extract-frustum-planes\"),s=t(\"split-polygon\"),l=t(\"./lib/cube.js\"),u=t(\"gl-mat4/multiply\"),c=t(\"gl-mat4/transpose\"),h=t(\"gl-vec4/transformMat4\"),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=new Float32Array(16),p=[0,0,0,1],m=[0,0,0,1],g=[new n(1/0,-1/0,1/0),new n(1/0,-1/0,1/0),new n(1/0,-1/0,1/0)],v=[0,0,0]},{\"./lib/cube.js\":150,\"extract-frustum-planes\":130,\"gl-mat4/multiply\":183,\"gl-mat4/transpose\":191,\"gl-vec4/transformMat4\":277,\"split-polygon\":526}],156:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}function i(t,e,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)return t.bufferData(e,i,n),o;if(o+a>r)throw new Error(\"gl-buffer: If resizing buffer, must not specify offset\");return t.bufferSubData(e,a,i),r}function a(t,e){for(var r=l.malloc(t.length,e),n=t.length,i=0;i<n;++i)r[i]=t[i];return r}function o(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}function s(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error(\"gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER\");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error(\"gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW\");var a=t.createBuffer(),o=new n(t,r,a,0,i);return o.update(e),o}var l=t(\"typedarray-pool\"),u=t(\"ndarray-ops\"),c=t(\"ndarray\"),h=[\"uint8\",\"uint8_clamped\",\"uint16\",\"uint32\",\"int8\",\"int16\",\"int32\",\"float32\"],f=n.prototype;f.bind=function(){this.gl.bindBuffer(this.type,this.handle)},f.unbind=function(){this.gl.bindBuffer(this.type,null)},f.dispose=function(){this.gl.deleteBuffer(this.handle)},f.update=function(t,e){if(\"number\"!=typeof e&&(e=-1),this.bind(),\"object\"==typeof t&&void 0!==t.shape){var r=t.dtype;if(h.indexOf(r)<0&&(r=\"float32\"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){r=gl.getExtension(\"OES_element_index_uint\")&&\"uint16\"!==r?\"uint32\":\"uint16\"}if(r===t.dtype&&o(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=l.malloc(t.size,r),s=c(n,t.shape);u.assign(s,t),this.length=e<0?i(this.gl,this.type,this.length,this.usage,n,e):i(this.gl,this.type,this.length,this.usage,n.subarray(0,t.size),e),l.free(n)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,\"uint16\"):a(t,\"float32\"),this.length=e<0?i(this.gl,this.type,this.length,this.usage,f,e):i(this.gl,this.type,this.length,this.usage,f.subarray(0,t.length),e),l.free(f)}else if(\"object\"==typeof t&&\"number\"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if(\"number\"!=typeof t&&void 0!==t)throw new Error(\"gl-buffer: Invalid data type\");if(e>=0)throw new Error(\"gl-buffer: Cannot specify offset when resizing buffer\");t|=0,t<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:467,\"ndarray-ops\":461,\"typedarray-pool\":541}],157:[function(t,e,r){e.exports={0:\"NONE\",1:\"ONE\",2:\"LINE_LOOP\",3:\"LINE_STRIP\",4:\"TRIANGLES\",5:\"TRIANGLE_STRIP\",6:\"TRIANGLE_FAN\",256:\"DEPTH_BUFFER_BIT\",512:\"NEVER\",513:\"LESS\",514:\"EQUAL\",515:\"LEQUAL\",516:\"GREATER\",517:\"NOTEQUAL\",518:\"GEQUAL\",519:\"ALWAYS\",768:\"SRC_COLOR\",769:\"ONE_MINUS_SRC_COLOR\",770:\"SRC_ALPHA\",771:\"ONE_MINUS_SRC_ALPHA\",772:\"DST_ALPHA\",773:\"ONE_MINUS_DST_ALPHA\",774:\"DST_COLOR\",775:\"ONE_MINUS_DST_COLOR\",776:\"SRC_ALPHA_SATURATE\",1024:\"STENCIL_BUFFER_BIT\",1028:\"FRONT\",1029:\"BACK\",1032:\"FRONT_AND_BACK\",1280:\"INVALID_ENUM\",1281:\"INVALID_VALUE\",1282:\"INVALID_OPERATION\",1285:\"OUT_OF_MEMORY\",1286:\"INVALID_FRAMEBUFFER_OPERATION\",2304:\"CW\",2305:\"CCW\",2849:\"LINE_WIDTH\",2884:\"CULL_FACE\",2885:\"CULL_FACE_MODE\",2886:\"FRONT_FACE\",2928:\"DEPTH_RANGE\",2929:\"DEPTH_TEST\",2930:\"DEPTH_WRITEMASK\",2931:\"DEPTH_CLEAR_VALUE\",2932:\"DEPTH_FUNC\",2960:\"STENCIL_TEST\",2961:\"STENCIL_CLEAR_VALUE\",2962:\"STENCIL_FUNC\",2963:\"STENCIL_VALUE_MASK\",2964:\"STENCIL_FAIL\",2965:\"STENCIL_PASS_DEPTH_FAIL\",2966:\"STENCIL_PASS_DEPTH_PASS\",2967:\"STENCIL_REF\",2968:\"STENCIL_WRITEMASK\",2978:\"VIEWPORT\",3024:\"DITHER\",3042:\"BLEND\",3088:\"SCISSOR_BOX\",3089:\"SCISSOR_TEST\",3106:\"COLOR_CLEAR_VALUE\",3107:\"COLOR_WRITEMASK\",3317:\"UNPACK_ALIGNMENT\",3333:\"PACK_ALIGNMENT\",3379:\"MAX_TEXTURE_SIZE\",3386:\"MAX_VIEWPORT_DIMS\",3408:\"SUBPIXEL_BITS\",3410:\"RED_BITS\",3411:\"GREEN_BITS\",3412:\"BLUE_BITS\",3413:\"ALPHA_BITS\",3414:\"DEPTH_BITS\",3415:\"STENCIL_BITS\",3553:\"TEXTURE_2D\",4352:\"DONT_CARE\",4353:\"FASTEST\",4354:\"NICEST\",5120:\"BYTE\",5121:\"UNSIGNED_BYTE\",5122:\"SHORT\",5123:\"UNSIGNED_SHORT\",5124:\"INT\",5125:\"UNSIGNED_INT\",5126:\"FLOAT\",5386:\"INVERT\",5890:\"TEXTURE\",6401:\"STENCIL_INDEX\",6402:\"DEPTH_COMPONENT\",6406:\"ALPHA\",6407:\"RGB\",6408:\"RGBA\",6409:\"LUMINANCE\",6410:\"LUMINANCE_ALPHA\",7680:\"KEEP\",7681:\"REPLACE\",7682:\"INCR\",7683:\"DECR\",7936:\"VENDOR\",7937:\"RENDERER\",7938:\"VERSION\",9728:\"NEAREST\",9729:\"LINEAR\",9984:\"NEAREST_MIPMAP_NEAREST\",9985:\"LINEAR_MIPMAP_NEAREST\",9986:\"NEAREST_MIPMAP_LINEAR\",9987:\"LINEAR_MIPMAP_LINEAR\",10240:\"TEXTURE_MAG_FILTER\",10241:\"TEXTURE_MIN_FILTER\",10242:\"TEXTURE_WRAP_S\",10243:\"TEXTURE_WRAP_T\",10497:\"REPEAT\",10752:\"POLYGON_OFFSET_UNITS\",16384:\"COLOR_BUFFER_BIT\",32769:\"CONSTANT_COLOR\",32770:\"ONE_MINUS_CONSTANT_COLOR\",32771:\"CONSTANT_ALPHA\",32772:\"ONE_MINUS_CONSTANT_ALPHA\",32773:\"BLEND_COLOR\",32774:\"FUNC_ADD\",32777:\"BLEND_EQUATION_RGB\",32778:\"FUNC_SUBTRACT\",32779:\"FUNC_REVERSE_SUBTRACT\",32819:\"UNSIGNED_SHORT_4_4_4_4\",32820:\"UNSIGNED_SHORT_5_5_5_1\",32823:\"POLYGON_OFFSET_FILL\",32824:\"POLYGON_OFFSET_FACTOR\",32854:\"RGBA4\",32855:\"RGB5_A1\",32873:\"TEXTURE_BINDING_2D\",32926:\"SAMPLE_ALPHA_TO_COVERAGE\",32928:\"SAMPLE_COVERAGE\",32936:\"SAMPLE_BUFFERS\",32937:\"SAMPLES\",32938:\"SAMPLE_COVERAGE_VALUE\",32939:\"SAMPLE_COVERAGE_INVERT\",32968:\"BLEND_DST_RGB\",32969:\"BLEND_SRC_RGB\",32970:\"BLEND_DST_ALPHA\",32971:\"BLEND_SRC_ALPHA\",33071:\"CLAMP_TO_EDGE\",33170:\"GENERATE_MIPMAP_HINT\",33189:\"DEPTH_COMPONENT16\",33306:\"DEPTH_STENCIL_ATTACHMENT\",33635:\"UNSIGNED_SHORT_5_6_5\",33648:\"MIRRORED_REPEAT\",33901:\"ALIASED_POINT_SIZE_RANGE\",33902:\"ALIASED_LINE_WIDTH_RANGE\",33984:\"TEXTURE0\",33985:\"TEXTURE1\",33986:\"TEXTURE2\",33987:\"TEXTURE3\",33988:\"TEXTURE4\",33989:\"TEXTURE5\",33990:\"TEXTURE6\",33991:\"TEXTURE7\",33992:\"TEXTURE8\",33993:\"TEXTURE9\",33994:\"TEXTURE10\",33995:\"TEXTURE11\",33996:\"TEXTURE12\",33997:\"TEXTURE13\",33998:\"TEXTURE14\",33999:\"TEXTURE15\",34e3:\"TEXTURE16\",34001:\"TEXTURE17\",34002:\"TEXTURE18\",34003:\"TEXTURE19\",34004:\"TEXTURE20\",34005:\"TEXTURE21\",34006:\"TEXTURE22\",34007:\"TEXTURE23\",34008:\"TEXTURE24\",34009:\"TEXTURE25\",34010:\"TEXTURE26\",34011:\"TEXTURE27\",34012:\"TEXTURE28\",34013:\"TEXTURE29\",34014:\"TEXTURE30\",34015:\"TEXTURE31\",34016:\"ACTIVE_TEXTURE\",34024:\"MAX_RENDERBUFFER_SIZE\",34041:\"DEPTH_STENCIL\",34055:\"INCR_WRAP\",34056:\"DECR_WRAP\",34067:\"TEXTURE_CUBE_MAP\",34068:\"TEXTURE_BINDING_CUBE_MAP\",34069:\"TEXTURE_CUBE_MAP_POSITIVE_X\",34070:\"TEXTURE_CUBE_MAP_NEGATIVE_X\",34071:\"TEXTURE_CUBE_MAP_POSITIVE_Y\",34072:\"TEXTURE_CUBE_MAP_NEGATIVE_Y\",34073:\"TEXTURE_CUBE_MAP_POSITIVE_Z\",34074:\"TEXTURE_CUBE_MAP_NEGATIVE_Z\",34076:\"MAX_CUBE_MAP_TEXTURE_SIZE\",34338:\"VERTEX_ATTRIB_ARRAY_ENABLED\",34339:\"VERTEX_ATTRIB_ARRAY_SIZE\",34340:\"VERTEX_ATTRIB_ARRAY_STRIDE\",34341:\"VERTEX_ATTRIB_ARRAY_TYPE\",34342:\"CURRENT_VERTEX_ATTRIB\",34373:\"VERTEX_ATTRIB_ARRAY_POINTER\",34466:\"NUM_COMPRESSED_TEXTURE_FORMATS\",34467:\"COMPRESSED_TEXTURE_FORMATS\",34660:\"BUFFER_SIZE\",34661:\"BUFFER_USAGE\",34816:\"STENCIL_BACK_FUNC\",34817:\"STENCIL_BACK_FAIL\",34818:\"STENCIL_BACK_PASS_DEPTH_FAIL\",34819:\"STENCIL_BACK_PASS_DEPTH_PASS\",34877:\"BLEND_EQUATION_ALPHA\",34921:\"MAX_VERTEX_ATTRIBS\",34922:\"VERTEX_ATTRIB_ARRAY_NORMALIZED\",34930:\"MAX_TEXTURE_IMAGE_UNITS\",34962:\"ARRAY_BUFFER\",34963:\"ELEMENT_ARRAY_BUFFER\",34964:\"ARRAY_BUFFER_BINDING\",34965:\"ELEMENT_ARRAY_BUFFER_BINDING\",34975:\"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\",35040:\"STREAM_DRAW\",35044:\"STATIC_DRAW\",35048:\"DYNAMIC_DRAW\",35632:\"FRAGMENT_SHADER\",35633:\"VERTEX_SHADER\",35660:\"MAX_VERTEX_TEXTURE_IMAGE_UNITS\",35661:\"MAX_COMBINED_TEXTURE_IMAGE_UNITS\",35663:\"SHADER_TYPE\",35664:\"FLOAT_VEC2\",35665:\"FLOAT_VEC3\",35666:\"FLOAT_VEC4\",35667:\"INT_VEC2\",35668:\"INT_VEC3\",35669:\"INT_VEC4\",35670:\"BOOL\",35671:\"BOOL_VEC2\",35672:\"BOOL_VEC3\",35673:\"BOOL_VEC4\",35674:\"FLOAT_MAT2\",35675:\"FLOAT_MAT3\",35676:\"FLOAT_MAT4\",35678:\"SAMPLER_2D\",35680:\"SAMPLER_CUBE\",35712:\"DELETE_STATUS\",35713:\"COMPILE_STATUS\",35714:\"LINK_STATUS\",35715:\"VALIDATE_STATUS\",35716:\"INFO_LOG_LENGTH\",35717:\"ATTACHED_SHADERS\",35718:\"ACTIVE_UNIFORMS\",35719:\"ACTIVE_UNIFORM_MAX_LENGTH\",35720:\"SHADER_SOURCE_LENGTH\",35721:\"ACTIVE_ATTRIBUTES\",35722:\"ACTIVE_ATTRIBUTE_MAX_LENGTH\",35724:\"SHADING_LANGUAGE_VERSION\",35725:\"CURRENT_PROGRAM\",36003:\"STENCIL_BACK_REF\",36004:\"STENCIL_BACK_VALUE_MASK\",36005:\"STENCIL_BACK_WRITEMASK\",36006:\"FRAMEBUFFER_BINDING\",36007:\"RENDERBUFFER_BINDING\",36048:\"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\",36049:\"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\",36050:\"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\",36051:\"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\",36053:\"FRAMEBUFFER_COMPLETE\",36054:\"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\",36055:\"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\",36057:\"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\",36061:\"FRAMEBUFFER_UNSUPPORTED\",36064:\"COLOR_ATTACHMENT0\",36096:\"DEPTH_ATTACHMENT\",36128:\"STENCIL_ATTACHMENT\",36160:\"FRAMEBUFFER\",36161:\"RENDERBUFFER\",36162:\"RENDERBUFFER_WIDTH\",36163:\"RENDERBUFFER_HEIGHT\",36164:\"RENDERBUFFER_INTERNAL_FORMAT\",36168:\"STENCIL_INDEX8\",36176:\"RENDERBUFFER_RED_SIZE\",36177:\"RENDERBUFFER_GREEN_SIZE\",36178:\"RENDERBUFFER_BLUE_SIZE\",36179:\"RENDERBUFFER_ALPHA_SIZE\",36180:\"RENDERBUFFER_DEPTH_SIZE\",36181:\"RENDERBUFFER_STENCIL_SIZE\",36194:\"RGB565\",36336:\"LOW_FLOAT\",36337:\"MEDIUM_FLOAT\",36338:\"HIGH_FLOAT\",36339:\"LOW_INT\",36340:\"MEDIUM_INT\",36341:\"HIGH_INT\",36346:\"SHADER_COMPILER\",36347:\"MAX_VERTEX_UNIFORM_VECTORS\",36348:\"MAX_VARYING_VECTORS\",36349:\"MAX_FRAGMENT_UNIFORM_VECTORS\",37440:\"UNPACK_FLIP_Y_WEBGL\",37441:\"UNPACK_PREMULTIPLY_ALPHA_WEBGL\",37442:\"CONTEXT_LOST_WEBGL\",37443:\"UNPACK_COLORSPACE_CONVERSION_WEBGL\",37444:\"BROWSER_DEFAULT_WEBGL\"}},{}],158:[function(t,e,r){var n=t(\"./1.0/numbers\");e.exports=function(t){return n[t]}},{\"./1.0/numbers\":157}],159:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.plot=t,this.shader=e,this.bufferHi=r,this.bufferLo=n,this.bounds=[1/0,1/0,-1/0,-1/0],this.numPoints=0,this.color=[0,0,0,1]}function i(t,e){var r=a(t.gl,l.vertex,l.fragment),i=o(t.gl),s=o(t.gl),u=new n(t,r,i,s);return u.update(e),t.addObject(u),u}var a=t(\"gl-shader\"),o=t(\"gl-buffer\"),s=t(\"typedarray-pool\"),l=t(\"./lib/shaders\");e.exports=i;var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],c=n.prototype;c.draw=function(){var t=new Float32Array([0,0]),e=new Float32Array([0,0]),r=new Float32Array([0,0]),n=new Float32Array([0,0]),i=[1,1];return function(){var a=this.plot,o=this.shader,s=this.bounds,l=this.numPoints;if(l){var c=a.gl,h=a.dataBox,f=a.viewBox,d=a.pixelRatio,p=s[2]-s[0],m=s[3]-s[1],g=h[2]-h[0],v=h[3]-h[1],y=2*p/g,b=2*m/v,x=(s[0]-h[0]-.5*g)/p,_=(s[1]-h[1]-.5*v)/m;t[0]=y,t[1]=b,e[0]=y-t[0],e[1]=b-t[1],r[0]=x,r[1]=_,n[0]=x-r[0],n[1]=_-r[1];var w=f[2]-f[0],M=f[3]-f[1];i[0]=2*d/w,i[1]=2*d/M,o.bind(),o.uniforms.scaleHi=t,o.uniforms.scaleLo=e,o.uniforms.translateHi=r,o.uniforms.translateLo=n,o.uniforms.pixelScale=i,o.uniforms.color=this.color,this.bufferLo.bind(),o.attributes.positionLo.pointer(c.FLOAT,!1,16,0),this.bufferHi.bind(),o.attributes.positionHi.pointer(c.FLOAT,!1,16,0),o.attributes.pixelOffset.pointer(c.FLOAT,!1,16,8),c.drawArrays(c.TRIANGLES,0,l*u.length)}}}(),c.drawPick=function(t){return t},c.pick=function(){return null},c.update=function(t){t=t||{};var e,r,n,i=t.positions||[],a=t.errors||[],o=1;\"lineWidth\"in t&&(o=+t.lineWidth);var l=5;\"capSize\"in t&&(l=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();var c=this.bounds=[1/0,1/0,-1/0,-1/0],h=this.numPoints=i.length>>1;for(e=0;e<h;++e)r=i[2*e],n=i[2*e+1],c[0]=Math.min(r,c[0]),c[1]=Math.min(n,c[1]),c[2]=Math.max(r,c[2]),c[3]=Math.max(n,c[3]);c[2]===c[0]&&(c[2]+=1),c[3]===c[1]&&(c[3]+=1);var f=1/(c[2]-c[0]),d=1/(c[3]-c[1]),p=c[0],m=c[1],g=s.mallocFloat64(h*u.length*4),v=s.mallocFloat32(h*u.length*4),y=s.mallocFloat32(h*u.length*4),b=0;for(e=0;e<h;++e){r=i[2*e],n=i[2*e+1];for(var x=a[4*e],_=a[4*e+1],w=a[4*e+2],M=a[4*e+3],k=0;k<u.length;++k){var A=u[k],T=A[0],S=A[1];T<0?T*=x:T>0&&(T*=_),S<0?S*=w:S>0&&(S*=M),g[b++]=f*(r-p+T),g[b++]=d*(n-m+S),g[b++]=o*A[2]+(l+o)*A[4],g[b++]=o*A[3]+(l+o)*A[5]}}for(e=0;e<g.length;e++)v[e]=g[e],y[e]=g[e]-v[e];this.bufferHi.update(v),this.bufferLo.update(y),s.free(g)},c.dispose=function(){this.plot.removeObject(this),this.shader.dispose(),this.bufferHi.dispose(),this.bufferLo.dispose()}},{\"./lib/shaders\":160,\"gl-buffer\":156,\"gl-shader\":255,\"typedarray-pool\":541}],160:[function(t,e,r){e.exports={\n", | |
"vertex:\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 positionHi;\\nattribute vec2 positionLo;\\nattribute vec2 pixelOffset;\\n\\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo, pixelScale;\\n\\nvec2 project(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\\n return (posHi + trHi) * scHi\\n + (posLo + trLo) * scHi\\n + (posHi + trHi) * scLo\\n + (posLo + trLo) * scLo;\\n}\\n\\nvoid main() {\\n vec3 scrPosition = vec3(\\n project(scaleHi, translateHi, scaleLo, translateLo, positionHi, positionLo),\\n 1);\\n gl_Position = vec4(\\n scrPosition.xy + scrPosition.z * pixelScale * pixelOffset,\\n 0,\\n scrPosition.z);\\n}\\n\",fragment:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n gl_FragColor = vec4(color.rgb * color.a, color.a);\\n}\\n\"}},{}],161:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function i(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function a(t,e,r,n){for(var i=f[n],a=0;a<i.length;++a){var o=i[a];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}function o(t){var e=t.gl,r=s(e),i=l(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),a=u(e);a.attributes.position.location=0,a.attributes.color.location=1,a.attributes.offset.location=2;var o=new n(e,r,i,a);return o.update(t),o}e.exports=o;var s=t(\"gl-buffer\"),l=t(\"gl-vao\"),u=t(\"./shaders/index\"),c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h=n.prototype;h.isOpaque=function(){return this.opacity>=1},h.isTransparent=function(){return this.opacity<1},h.drawTransparent=h.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var f=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=(n+e)%3,o=[0,0,0];o[a]=i,r.push(o)}t[e]=r}return t}();h.update=function(t){t=t||{},\"lineWidth\"in t&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),\"capSize\"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),\"opacity\"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var u=0;u<3;++u){this.lineOffset[u]=l;t:for(var c=0;c<s;++c){for(var h=r[c],f=0;f<3;++f)if(isNaN(h[f])||!isFinite(h[f]))continue t;var d=n[c],p=e[u];if(Array.isArray(p[0])&&(p=e[c]),3===p.length&&(p=[p[0],p[1],p[2],1]),!isNaN(d[0][u])&&!isNaN(d[1][u])){if(d[0][u]<0){var m=h.slice();m[u]+=d[0][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)}if(d[1][u]>0){var m=h.slice();m[u]+=d[1][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)}}}this.lineCount[u]=l-this.lineOffset[u]}this.buffer.update(o)}},h.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{\"./shaders/index\":163,\"gl-buffer\":156,\"gl-vao\":271}],162:[function(t,e,r){e.exports=function(t){\"string\"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||\"\");return r.push(t[n]),r.join(\"\")}},{}],163:[function(t,e,r){\"use strict\";var n=t(\"glslify\"),i=t(\"gl-shader\"),a=n([\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, offset;\\nattribute vec4 color;\\nuniform mat4 model, view, projection;\\nuniform float capSize;\\nvarying vec4 fragColor;\\nvarying vec3 fragPosition;\\n\\nvoid main() {\\n vec4 worldPosition = model * vec4(position, 1.0);\\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\\n gl_Position = projection * view * worldPosition;\\n fragColor = color;\\n fragPosition = position;\\n}\"]),o=n([\"precision mediump float;\\n#define GLSLIFY 1\\nuniform vec3 clipBounds[2];\\nuniform float opacity;\\nvarying vec3 fragPosition;\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n if(any(lessThan(fragPosition, clipBounds[0])) || any(greaterThan(fragPosition, clipBounds[1]))) {\\n discard;\\n }\\n gl_FragColor = opacity * fragColor;\\n}\"]);e.exports=function(t){return i(t,a,o,null,[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"offset\",type:\"vec3\"}])}},{\"gl-shader\":255,glslify:162}],164:[function(t,e,r){\"use strict\";function n(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function i(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function a(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);y=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(var a=n;a<r;++a)i[a]=t.NONE;y[n]=i}}function o(t){switch(t){case p:throw new Error(\"gl-fbo: Framebuffer unsupported\");case m:throw new Error(\"gl-fbo: Framebuffer incomplete attachment\");case g:throw new Error(\"gl-fbo: Framebuffer incomplete dimensions\");case v:throw new Error(\"gl-fbo: Framebuffer incomplete missing attachment\");default:throw new Error(\"gl-fbo: Framebuffer failed for unspecified reason\")}}function s(t,e,r,n,i,a){if(!n)return null;var o=d(t,e,r,i,n);return o.magFilter=t.NEAREST,o.minFilter=t.NEAREST,o.mipSamples=1,o.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,a,t.TEXTURE_2D,o.handle,0),o}function l(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function u(t){var e=n(t.gl),r=t.gl,a=t.handle=r.createFramebuffer(),u=t._shape[0],c=t._shape[1],h=t.color.length,f=t._ext,d=t._useStencil,p=t._useDepth,m=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,a);for(var g=0;g<h;++g)t.color[g]=s(r,u,c,m,r.RGBA,r.COLOR_ATTACHMENT0+g);0===h?(t._color_rb=l(r,u,c,r.RGBA4,r.COLOR_ATTACHMENT0),f&&f.drawBuffersWEBGL(y[0])):h>1&&f.drawBuffersWEBGL(y[h]);var v=r.getExtension(\"WEBGL_depth_texture\");v?d?t.depth=s(r,u,c,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=s(r,u,c,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=l(r,u,c,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=l(r,u,c,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=l(r,u,c,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var g=0;g<t.color.length;++g)t.color[g].dispose(),t.color[g]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),i(r,e),o(b)}i(r,e)}function c(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var l=0;l<i;++l)this.color[l]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var c=this,h=[0|e,0|r];Object.defineProperties(h,{0:{get:function(){return c._shape[0]},set:function(t){return c.width=t}},1:{get:function(){return c._shape[1]},set:function(t){return c.height=t}}}),this._shapeVector=h,u(this)}function h(t,e,r){if(t._destroyed)throw new Error(\"gl-fbo: Can't resize destroyed FBO\");if(t._shape[0]!==e||t._shape[1]!==r){var a=t.gl,s=a.getParameter(a.MAX_RENDERBUFFER_SIZE);if(e<0||e>s||r<0||r>s)throw new Error(\"gl-fbo: Can't resize FBO, invalid dimensions\");t._shape[0]=e,t._shape[1]=r;for(var l=n(a),u=0;u<t.color.length;++u)t.color[u].shape=t._shape;t._color_rb&&(a.bindRenderbuffer(a.RENDERBUFFER,t._color_rb),a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(a.bindRenderbuffer(a.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&a.renderbufferStorage(a.RENDERBUFFER,a.STENCIL_INDEX,t._shape[0],t._shape[1])),a.bindFramebuffer(a.FRAMEBUFFER,t.handle);var c=a.checkFramebufferStatus(a.FRAMEBUFFER);c!==a.FRAMEBUFFER_COMPLETE&&(t.dispose(),i(a,l),o(c)),i(a,l)}}function f(t,e,r,n){p||(p=t.FRAMEBUFFER_UNSUPPORTED,m=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,g=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,v=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var i=t.getExtension(\"WEBGL_draw_buffers\");if(!y&&i&&a(t,i),Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]),\"number\"!=typeof e)throw new Error(\"gl-fbo: Missing shape parameter\");var o=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>o||r<0||r>o)throw new Error(\"gl-fbo: Parameters are too large for FBO\");n=n||{};var s=1;if(\"color\"in n){if((s=Math.max(0|n.color,0))<0)throw new Error(\"gl-fbo: Must specify a nonnegative number of colors\");if(s>1){if(!i)throw new Error(\"gl-fbo: Multiple draw buffer extension not supported\");if(s>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error(\"gl-fbo: Context does not support \"+s+\" draw buffers\")}}var l=t.UNSIGNED_BYTE,u=t.getExtension(\"OES_texture_float\");if(n.float&&s>0){if(!u)throw new Error(\"gl-fbo: Context does not support floating point textures\");l=t.FLOAT}else n.preferFloat&&s>0&&u&&(l=t.FLOAT);var h=!0;\"depth\"in n&&(h=!!n.depth);var f=!1;return\"stencil\"in n&&(f=!!n.stencil),new c(t,e,r,l,s,h,f,i)}var d=t(\"gl-texture2d\");e.exports=f;var p,m,g,v,y=null,b=c.prototype;Object.defineProperties(b,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error(\"gl-fbo: Shape vector must be length 2\");var e=0|t[0],r=0|t[1];return h(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,h(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t},enumerable:!1}}),b.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},b.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e<this.color.length;++e)this.color[e].dispose(),this.color[e]=null;this._color_rb&&(t.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},{\"gl-texture2d\":267}],165:[function(t,e,r){function n(t,e,r){\"use strict\";var n=o(e)||\"of unknown name (see npm glsl-shader-name)\",l=\"unknown type\";void 0!==r&&(l=r===a.FRAGMENT_SHADER?\"fragment\":\"vertex\");for(var u=i(\"Error compiling %s shader %s:\\n\",l,n),c=i(\"%s%s\",u,t),h=t.split(\"\\n\"),f={},d=0;d<h.length;d++){var p=h[d];if(\"\"!==p){var m=parseInt(p.split(\":\")[2]);if(isNaN(m))throw new Error(i(\"Could not parse error: %s\",p));f[m]=p}}for(var g=s(e).split(\"\\n\"),d=0;d<g.length;d++)if(f[d+3]||f[d+2]||f[d+1]){var v=g[d];if(u+=v+\"\\n\",f[d+1]){var y=f[d+1];y=y.substr(y.split(\":\",3).join(\":\").length+1).trim(),u+=i(\"^^^ %s\\n\\n\",y)}}return{long:u.trim(),short:c.trim()}}var i=t(\"sprintf-js\").sprintf,a=t(\"gl-constants/lookup\"),o=t(\"glsl-shader-name\"),s=t(\"add-line-numbers\");e.exports=n},{\"add-line-numbers\":40,\"gl-constants/lookup\":158,\"glsl-shader-name\":279,\"sprintf-js\":527}],166:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.weightBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0}function i(t,e){var r=t.gl,i=l(r,c.vertex,c.fragment),a=l(r,c.pickVertex,c.pickFragment),o=u(r),s=u(r),h=u(r),f=u(r),d=new n(t,i,a,o,s,h,f);return d.update(e),t.addObject(d),d}e.exports=i;var a=t(\"binary-search-bounds\"),o=t(\"iota-array\"),s=t(\"typedarray-pool\"),l=t(\"gl-shader\"),u=t(\"gl-buffer\"),c=t(\"./lib/shaders\"),h=n.prototype,f=[0,0,1,0,0,1,1,0,1,1,0,1];h.draw=function(){var t=[1,0,0,0,1,0,0,0,1];return function(){var e=this.plot,r=this.shader,n=this.bounds,i=this.numVertices;if(!(i<=0)){var a=e.gl,o=e.dataBox,s=n[2]-n[0],l=n[3]-n[1],u=o[2]-o[0],c=o[3]-o[1];t[0]=2*s/u,t[4]=2*l/c,t[6]=2*(n[0]-o[0])/u-1,t[7]=2*(n[1]-o[1])/c-1,r.bind();var h=r.uniforms;h.viewTransform=t,h.shape=this.shape;var f=r.attributes;this.positionBuffer.bind(),f.position.pointer(),this.weightBuffer.bind(),f.weight.pointer(a.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),f.color.pointer(a.UNSIGNED_BYTE,!0),a.drawArrays(a.TRIANGLES,0,i)}}}(),h.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=this.plot,i=this.pickShader,a=this.bounds,o=this.numVertices;if(!(o<=0)){var s=n.gl,l=n.dataBox,u=a[2]-a[0],c=a[3]-a[1],h=l[2]-l[0],f=l[3]-l[1];t[0]=2*u/h,t[4]=2*c/f,t[6]=2*(a[0]-l[0])/h-1,t[7]=2*(a[1]-l[1])/f-1;for(var d=0;d<4;++d)e[d]=r>>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),h.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r<n||r>=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},h.update=function(t){t=t||{};var e=t.shape||[0,0],r=t.x||o(e[0]),n=t.y||o(e[1]),i=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],u=t.colorValues||[0,0,0,1],c=l.length,h=this.bounds,d=h[0]=r[0],p=h[1]=n[0],m=h[2]=r[r.length-1],g=h[3]=n[n.length-1],v=1/(m-d),y=1/(g-p),b=e[0],x=e[1];this.shape=[b,x];var _=(b-1)*(x-1)*(f.length>>>1);this.numVertices=_;for(var w=s.mallocUint8(4*_),M=s.mallocFloat32(2*_),k=s.mallocUint8(2*_),A=s.mallocUint32(_),T=0,S=0;S<x-1;++S)for(var E=y*(n[S]-p),L=y*(n[S+1]-p),C=0;C<b-1;++C)for(var I=v*(r[C]-d),z=v*(r[C+1]-d),D=0;D<f.length;D+=2){var P,O,R,F,j=f[D],N=f[D+1],B=(S+N)*b+(C+j),U=i[B],V=a.le(l,U);if(V<0)P=u[0],O=u[1],R=u[2],F=u[3];else if(V===c-1)P=u[4*c-4],O=u[4*c-3],R=u[4*c-2],F=u[4*c-1];else{var H=(U-l[V])/(l[V+1]-l[V]),q=1-H,G=4*V,Y=4*(V+1);P=q*u[G]+H*u[Y],O=q*u[G+1]+H*u[Y+1],R=q*u[G+2]+H*u[Y+2],F=q*u[G+3]+H*u[Y+3]}w[4*T]=255*P,w[4*T+1]=255*O,w[4*T+2]=255*R,w[4*T+3]=255*F,M[2*T]=.5*I+.5*z,M[2*T+1]=.5*E+.5*L,k[2*T]=j,k[2*T+1]=N,A[T]=S*b+C,T+=1}this.positionBuffer.update(M),this.weightBuffer.update(k),this.colorBuffer.update(w),this.idBuffer.update(A),s.free(M),s.free(w),s.free(k),s.free(A)},h.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.weightBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{\"./lib/shaders\":167,\"binary-search-bounds\":168,\"gl-buffer\":156,\"gl-shader\":255,\"iota-array\":293,\"typedarray-pool\":541}],167:[function(t,e,r){\"use strict\";e.exports={fragment:\"precision lowp float;\\n#define GLSLIFY 1\\nvarying vec4 fragColor;\\nvoid main() {\\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\\n}\\n\",vertex:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 color;\\nattribute vec2 weight;\\n\\nuniform vec2 shape;\\nuniform mat3 viewTransform;\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\\n fragColor = color;\\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\\n}\\n\",pickFragment:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragId;\\nvarying vec2 vWeight;\\n\\nuniform vec2 shape;\\nuniform vec4 pickOffset;\\n\\nvoid main() {\\n vec2 d = step(.5, vWeight);\\n vec4 id = fragId + pickOffset;\\n id.x += d.x + d.y*shape.x;\\n\\n id.y += floor(id.x / 256.0);\\n id.x -= floor(id.x / 256.0) * 256.0;\\n\\n id.z += floor(id.y / 256.0);\\n id.y -= floor(id.y / 256.0) * 256.0;\\n\\n id.w += floor(id.z / 256.0);\\n id.z -= floor(id.z / 256.0) * 256.0;\\n\\n gl_FragColor = id/255.;\\n}\\n\",pickVertex:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 pickId;\\nattribute vec2 weight;\\n\\nuniform vec2 shape;\\nuniform mat3 viewTransform;\\n\\nvarying vec4 fragId;\\nvarying vec2 vWeight;\\n\\nvoid main() {\\n vWeight = weight;\\n\\n fragId = pickId;\\n\\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\\n}\\n\"}},{}],168:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84}],169:[function(t,e,r){r.lineVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 aHi, aLo, dHi, dLo;\\n\\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, screenShape;\\nuniform float width;\\n\\nvarying vec2 direction;\\n\\n\\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\\n return (posHi + trHi) * scHi\\n + (posLo + trLo) * scHi\\n + (posHi + trHi) * scLo\\n + (posLo + trLo) * scLo;\\n}\\n\\n\\nvec2 project_2_1(vec2 scHi, vec2 scLo, vec2 posHi, vec2 posLo) {\\n return scHi * posHi\\n + scLo * posHi\\n + scHi * posLo\\n + scLo * posLo;\\n}\\n\\nvoid main() {\\n vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\\n vec2 dir = project_2_1(scaleHi, scaleLo, dHi, dLo);\\n vec2 n = 0.5 * width * normalize(screenShape.yx * vec2(dir.y, -dir.x)) / screenShape.xy;\\n vec2 tangent = normalize(screenShape.xy * dir);\\n if(dir.x < 0.0 || (dir.x == 0.0 && dir.y < 0.0)) {\\n direction = -tangent;\\n } else {\\n direction = tangent;\\n }\\n gl_Position = vec4(p + n, 0.0, 1.0);\\n}\",r.lineFragment=\"precision highp float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\nuniform vec2 screenShape;\\nuniform sampler2D dashPattern;\\nuniform float dashLength;\\n\\nvarying vec2 direction;\\n\\nvoid main() {\\n float t = fract(dot(direction, gl_FragCoord.xy) / dashLength);\\n vec4 pcolor = color * texture2D(dashPattern, vec2(t, 0.0)).r;\\n gl_FragColor = vec4(pcolor.rgb * pcolor.a, pcolor.a);\\n}\",r.mitreVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 aHi, aLo;\\n\\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo;\\nuniform float radius;\\n\\n\\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\\n return (posHi + trHi) * scHi\\n + (posLo + trLo) * scHi\\n + (posHi + trHi) * scLo\\n + (posLo + trLo) * scLo;\\n}\\n\\n\\nvoid main() {\\n vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\\n gl_Position = vec4(p, 0.0, 1.0);\\n gl_PointSize = radius;\\n}\",r.mitreFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n if(length(gl_PointCoord.xy - 0.5) > 0.25) {\\n discard;\\n }\\n gl_FragColor = vec4(color.rgb, color.a);\\n}\",r.pickVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 aHi, aLo, dHi;\\nattribute vec4 pick0, pick1;\\n\\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, screenShape;\\nuniform float width;\\n\\nvarying vec4 pickA, pickB;\\n\\n\\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\\n return (posHi + trHi) * scHi\\n + (posLo + trLo) * scHi\\n + (posHi + trHi) * scLo\\n + (posLo + trLo) * scLo;\\n}\\n\\n\\nvoid main() {\\n vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\\n vec2 n = width * normalize(screenShape.yx * vec2(dHi.y, -dHi.x)) / screenShape.xy;\\n gl_Position = vec4(p + n, 0, 1);\\n pickA = pick0;\\n pickB = pick1;\\n}\",r.pickFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 pickOffset;\\n\\nvarying vec4 pickA, pickB;\\n\\nvoid main() {\\n vec4 fragId = vec4(pickA.xyz, 0.0);\\n if(pickB.w > pickA.w) {\\n fragId.xyz = pickB.xyz;\\n }\\n\\n fragId += pickOffset;\\n\\n fragId.y += floor(fragId.x / 256.0);\\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\\n\\n fragId.z += floor(fragId.y / 256.0);\\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\\n\\n fragId.w += floor(fragId.z / 256.0);\\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\\n\\n gl_FragColor = fragId / 255.0;\\n}\",r.fillVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 aHi, aLo, dHi;\\n\\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, projectAxis;\\nuniform float projectValue, depth;\\n\\n\\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\\n return (posHi + trHi) * scHi\\n + (posLo + trLo) * scHi\\n + (posHi + trHi) * scLo\\n + (posLo + trLo) * scLo;\\n}\\n\\n\\nvoid main() {\\n vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\\n if(dHi.y < 0.0 || (dHi.y == 0.0 && dHi.x < 0.0)) {\\n if(dot(p, projectAxis) < projectValue) {\\n p = p * (1.0 - abs(projectAxis)) + projectAxis * projectValue;\\n }\\n }\\n gl_Position = vec4(p, depth, 1);\\n}\",r.fillFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n gl_FragColor = vec4(color.rgb * color.a, color.a);\\n}\"},{}],170:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s,l){this.plot=t,this.dashPattern=e,this.lineBufferHi=r,this.lineBufferLo=n,this.pickBuffer=i,this.lineShader=a,this.mitreShader=o,this.fillShader=s,this.pickShader=l,this.usingDashes=!1,this.bounds=[1/0,1/0,-1/0,-1/0],this.width=1,this.color=[0,0,1,1],this.fill=[!1,!1,!1,!1],this.fillColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.data=null,this.numPoints=0,this.vertCount=0,this.pickOffset=0}function i(t){return t.map(function(t){return t.slice()})}function a(t,e){var r=t.gl,i=s(r),a=s(r),u=s(r),c=l(r,[1,1]),f=o(r,h.lineVertex,h.lineFragment),d=o(r,h.mitreVertex,h.mitreFragment),p=o(r,h.fillVertex,h.fillFragment),m=o(r,h.pickVertex,h.pickFragment),g=new n(t,c,i,a,u,f,d,p,m);return t.addObject(g),g.update(e),g}e.exports=a;var o=t(\"gl-shader\"),s=t(\"gl-buffer\"),l=t(\"gl-texture2d\"),u=t(\"ndarray\"),c=t(\"typedarray-pool\"),h=t(\"./lib/shaders\"),f=n.prototype;f.setProjectionModel=function(){var t={scaleHi:new Float32Array([0,0]),scaleLo:new Float32Array([0,0]),translateHi:new Float32Array([0,0]),translateLo:new Float32Array([0,0]),screenShape:[0,0]};return function(){var e=this.bounds,r=this.plot.viewBox,n=this.plot.dataBox,i=e[2]-e[0],a=e[3]-e[1],o=n[2]-n[0],s=n[3]-n[1],l=r[2]-r[0],u=r[3]-r[1],c=2*i/o,h=2*a/s,f=(e[0]-n[0]-.5*o)/i,d=(e[1]-n[1]-.5*s)/a;return t.scaleHi[0]=c,t.scaleHi[1]=h,t.scaleLo[0]=c-t.scaleHi[0],t.scaleLo[1]=h-t.scaleHi[1],t.translateHi[0]=f,t.translateHi[1]=d,t.translateLo[0]=f-t.translateHi[0],t.translateLo[1]=d-t.translateHi[1],t.screenShape[0]=l,t.screenShape[1]=u,t}}(),f.setProjectionUniforms=function(t,e){t.scaleHi=e.scaleHi,t.scaleLo=e.scaleLo,t.translateHi=e.translateHi,t.translateLo=e.translateLo,t.screenShape=e.screenShape},f.draw=function(){var t=[1,0],e=[-1,0],r=[0,1],n=[0,-1];return function(){var i=this.vertCount;if(i){var a=this.setProjectionModel(),o=this.plot,s=this.width,l=o.gl,u=o.pixelRatio,c=this.color,h=this.fillShader.attributes;this.lineBufferLo.bind(),h.aLo.pointer(l.FLOAT,!1,16,0),this.lineBufferHi.bind();var f=this.fill;if(f[0]||f[1]||f[2]||f[3]){var d=this.fillShader;d.bind();var p=d.uniforms;this.setProjectionUniforms(p,a),p.depth=o.nextDepthValue(),h.aHi.pointer(l.FLOAT,!1,16,0),h.dHi.pointer(l.FLOAT,!1,16,8),l.depthMask(!0),l.enable(l.DEPTH_TEST);var m=this.fillColor;f[0]&&(p.color=m[0],p.projectAxis=e,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[1]&&(p.color=m[1],p.projectAxis=n,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[2]&&(p.color=m[2],p.projectAxis=t,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[3]&&(p.color=m[3],p.projectAxis=r,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),l.depthMask(!1),l.disable(l.DEPTH_TEST)}var g=this.lineShader;g.bind(),this.lineBufferLo.bind(),g.attributes.aLo.pointer(l.FLOAT,!1,16,0),g.attributes.dLo.pointer(l.FLOAT,!1,16,8),this.lineBufferHi.bind();var v=g.uniforms;this.setProjectionUniforms(v,a),v.color=c,v.width=s*u,v.dashPattern=this.dashPattern.bind(),v.dashLength=this.dashLength*u;var y=g.attributes;if(y.aHi.pointer(l.FLOAT,!1,16,0),y.dHi.pointer(l.FLOAT,!1,16,8),l.drawArrays(l.TRIANGLES,0,i),s>2&&!this.usingDashes){var b=this.mitreShader;this.lineBufferLo.bind(),b.attributes.aLo.pointer(l.FLOAT,!1,48,0),this.lineBufferHi.bind(),b.bind();var x=b.uniforms;this.setProjectionUniforms(x,a),x.color=c,x.radius=s*u,b.attributes.aHi.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,i/3|0)}}}}(),f.drawPick=function(){var t=[0,0,0,0];return function(e){var r=this.vertCount,n=this.numPoints;if(this.pickOffset=e,!r)return e+n;var i=this.setProjectionModel(),a=this.plot,o=this.width,s=a.gl,l=a.pickPixelRatio,u=this.pickShader,c=this.pickBuffer;t[0]=255&e,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24,u.bind();var h=u.uniforms;this.setProjectionUniforms(h,i),h.width=o*l,h.pickOffset=t;var f=u.attributes;return this.lineBufferHi.bind(),f.aHi.pointer(s.FLOAT,!1,16,0),f.dHi.pointer(s.FLOAT,!1,16,8),this.lineBufferLo.bind(),f.aLo.pointer(s.FLOAT,!1,16,0),c.bind(),f.pick0.pointer(s.UNSIGNED_BYTE,!1,8,0),f.pick1.pointer(s.UNSIGNED_BYTE,!1,8,4),s.drawArrays(s.TRIANGLES,0,r),e+n}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(r<n||r>=n+i)return null;var a=r-n,o=this.data;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},f.update=function(t){t=t||{};var e,r,n,a,o,s=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=i(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var h=t.dashes||[1],f=0;for(e=0;e<h.length;++e)f+=h[e];var d=c.mallocUint8(f);n=0;var p=255;for(e=0;e<h.length;++e){for(r=0;r<h[e];++r)d[n++]=p;p^=255}this.dashPattern.dispose(),this.usingDashes=h.length>1,this.dashPattern=l(s,u(d,[f,1,4],[1,0,0])),this.dashPattern.minFilter=s.NEAREST,this.dashPattern.magFilter=s.NEAREST,this.dashLength=f,c.free(d);var m=t.positions;this.data=m;var g=this.bounds;g[0]=g[1]=1/0,g[2]=g[3]=-1/0;var v=this.numPoints=m.length>>>1;if(0!==v){for(e=0;e<v;++e)a=m[2*e],o=m[2*e+1],isNaN(a)||isNaN(o)||(g[0]=Math.min(g[0],a),g[1]=Math.min(g[1],o),g[2]=Math.max(g[2],a),g[3]=Math.max(g[3],o));g[0]===g[2]&&(g[2]+=1),g[3]===g[1]&&(g[3]+=1);var y=c.mallocFloat64(24*(v-1)),b=c.mallocFloat32(24*(v-1)),x=c.mallocFloat32(24*(v-1)),_=c.mallocUint32(12*(v-1)),w=b.length,M=_.length;n=v;for(var k=0;n>1;){var A=--n;a=m[2*n],o=m[2*n+1];var T=A-1,S=m[2*T],E=m[2*T+1];if(!(isNaN(a)||isNaN(o)||isNaN(S)||isNaN(E))){k+=1,a=(a-g[0])/(g[2]-g[0]),o=(o-g[1])/(g[3]-g[1]),S=(S-g[0])/(g[2]-g[0]),E=(E-g[1])/(g[3]-g[1]);var L=S-a,C=E-o,I=A|1<<24,z=A-1,D=A,P=A-1|1<<24;y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=I,_[--M]=z,y[--w]=C,y[--w]=L,y[--w]=E,y[--w]=S,_[--M]=D,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=E,y[--w]=S,_[--M]=D,_[--M]=P,y[--w]=C,y[--w]=L,y[--w]=E,y[--w]=S,_[--M]=D,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=I,_[--M]=z,y[--w]=C,y[--w]=L,y[--w]=o,y[--w]=a,_[--M]=I,_[--M]=z}}for(e=0;e<y.length;e++)b[e]=y[e],x[e]=y[e]-b[e];this.vertCount=6*k,this.lineBufferHi.update(b.subarray(w)),this.lineBufferLo.update(x.subarray(w)),this.pickBuffer.update(_.subarray(M)),c.free(y),c.free(b),c.free(x),c.free(_)}},f.dispose=function(){this.plot.removeObject(this),this.lineBufferLo.dispose(),this.lineBufferHi.dispose(),this.pickBuffer.dispose(),this.lineShader.dispose(),this.mitreShader.dispose(),this.fillShader.dispose(),this.pickShader.dispose(),this.dashPattern.dispose()}},{\"./lib/shaders\":169,\"gl-buffer\":156,\"gl-shader\":255,\"gl-texture2d\":267,ndarray:467,\"typedarray-pool\":541}],171:[function(t,e,r){var n=t(\"gl-shader\"),i=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, nextPosition;\\nattribute float arcLength, lineWidth;\\nattribute vec4 color;\\n\\nuniform vec2 screenShape;\\nuniform float pixelRatio;\\nuniform mat4 model, view, projection;\\n\\nvarying vec4 fragColor;\\nvarying vec3 worldPosition;\\nvarying float pixelArcLength;\\n\\nvoid main() {\\n vec4 projected = projection * view * model * vec4(position, 1.0);\\n vec4 tangentClip = projection * view * model * vec4(nextPosition - position, 0.0);\\n vec2 tangent = normalize(screenShape * tangentClip.xy);\\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(tangent.y, -tangent.x) / screenShape;\\n\\n gl_Position = vec4(projected.xy + projected.w * offset, projected.zw);\\n\\n worldPosition = position;\\n pixelArcLength = arcLength;\\n fragColor = color;\\n}\\n\",a=[{name:\"position\",type:\"vec3\"},{name:\"nextPosition\",type:\"vec3\"},{name:\"arcLength\",type:\"float\"},{name:\"lineWidth\",type:\"float\"},{name:\"color\",type:\"vec4\"}];r.createShader=function(t){return n(t,i,\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 clipBounds[2];\\nuniform sampler2D dashTexture;\\nuniform float dashScale;\\nuniform float opacity;\\n\\nvarying vec3 worldPosition;\\nvarying float pixelArcLength;\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\\n discard;\\n }\\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\\n if(dashWeight < 0.5) {\\n discard;\\n }\\n gl_FragColor = fragColor * opacity;\\n}\\n\",null,a)},r.createPickShader=function(t){return n(t,i,\"precision mediump float;\\n#define GLSLIFY 1\\n\\n#define FLOAT_MAX 1.70141184e38\\n#define FLOAT_MIN 1.17549435e-38\\n\\nlowp vec4 encode_float_1_0(highp float v) {\\n highp float av = abs(v);\\n\\n //Handle special cases\\n if(av < FLOAT_MIN) {\\n return vec4(0.0, 0.0, 0.0, 0.0);\\n } else if(v > FLOAT_MAX) {\\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\\n } else if(v < -FLOAT_MAX) {\\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\\n }\\n\\n highp vec4 c = vec4(0,0,0,0);\\n\\n //Compute exponent and mantissa\\n highp float e = floor(log2(av));\\n highp float m = av * pow(2.0, -e) - 1.0;\\n \\n //Unpack mantissa\\n c[1] = floor(128.0 * m);\\n m -= c[1] / 128.0;\\n c[2] = floor(32768.0 * m);\\n m -= c[2] / 32768.0;\\n c[3] = floor(8388608.0 * m);\\n \\n //Unpack exponent\\n highp float ebias = e + 127.0;\\n c[0] = floor(ebias / 2.0);\\n ebias -= c[0] * 2.0;\\n c[1] += floor(ebias) * 128.0; \\n\\n //Unpack sign bit\\n c[0] += 128.0 * step(0.0, -v);\\n\\n //Scale back to range\\n return c / 255.0;\\n}\\n\\n\\n\\nuniform float pickId;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec3 worldPosition;\\nvarying float pixelArcLength;\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\\n discard;\\n }\\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\\n}\",null,a)}},{\"gl-shader\":255}],172:[function(t,e,r){\"use strict\";function n(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function i(t){\n", | |
"for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}function s(t){var e=t.gl||t.scene&&t.scene.gl,r=m(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var n=g(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=l(e),a=u(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),s=d(new Array(1024),[256,1,4]),h=0;h<1024;++h)s.data[h]=255;var f=c(e,s);f.wrap=e.REPEAT;var p=new o(e,r,n,i,a,f);return p.update(t),p}e.exports=s;var l=t(\"gl-buffer\"),u=t(\"gl-vao\"),c=t(\"gl-texture2d\"),h=t(\"glsl-read-float\"),f=t(\"binary-search-bounds\"),d=t(\"ndarray\"),p=t(\"./lib/shaders\"),m=p.createShader,g=p.createPickShader,v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=o.prototype;y.isTransparent=function(){return this.opacity<1},y.isOpaque=function(){return this.opacity>=1},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||v,view:t.view||v,projection:t.projection||v,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;\"dashScale\"in t&&(this.dashScale=t.dashScale),\"opacity\"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],u=[],c=[],h=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=!1;t:for(e=1;e<a.length;++e){var v=a[e-1],y=a[e];for(u.push(h),c.push(v.slice()),r=0;r<3;++r){if(isNaN(v[r])||isNaN(y[r])||!isFinite(v[r])||!isFinite(y[r])){if(!i&&l.length>0){for(var b=0;b<24;++b)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var x,_;Array.isArray(o[0])?(x=o[e-1],_=o[e]):x=_=o,3===x.length&&(x=[x[0],x[1],x[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=h;if(h+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],v[0],v[1],v[2],h,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],h,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),u.push(h),c.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=c,this.arcLength=u,\"dashes\"in t){var k=t.dashes,A=k.slice();for(A.unshift(0),e=1;e<A.length;++e)A[e]=A[e-1]+A[e];var T=d(new Array(1024),[256,1,4]);for(e=0;e<256;++e){for(r=0;r<4;++r)T.set(e,0,r,0);1&f.le(A,A[A.length-1]*e/255)?T.set(e,0,0,0):T.set(e,0,0,255)}this.texture.setPixels(T)}}},y.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=h(t.value[0],t.value[1],t.value[2],0),r=f.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new a(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],o=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),s=1-o,l=[0,0,0],u=0;u<3;++u)l[u]=s*n[u]+o*i[u];var c=Math.min(o<.5?r:r+1,this.points.length-1);return new a(e,l,c,this.points[c])}},{\"./lib/shaders\":171,\"binary-search-bounds\":66,\"gl-buffer\":156,\"gl-texture2d\":267,\"gl-vao\":271,\"glsl-read-float\":278,ndarray:467}],173:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}e.exports=n},{}],174:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,f=-c*a+s*l,d=u*a-o*l,p=r*h+n*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null}e.exports=n},{}],175:[function(t,e,r){function n(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}e.exports=n},{}],176:[function(t,e,r){function n(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],177:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*a)*(h*g-f*m)-(e*s-n*a)*(c*g-f*p)+(e*l-i*a)*(c*m-h*p)+(r*s-n*o)*(u*g-f*d)-(r*l-i*o)*(u*m-h*d)+(n*l-i*s)*(u*p-c*d)}e.exports=n},{}],178:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],179:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,d=i*l,p=i*u,m=a*u,g=o*s,v=o*l,y=o*u;return t[0]=1-(d+m),t[1]=h+y,t[2]=f-v,t[3]=0,t[4]=h-y,t[5]=1-(c+m),t[6]=p+g,t[7]=0,t[8]=f+v,t[9]=p-g,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}e.exports=n},{}],180:[function(t,e,r){function n(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],181:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,k=c*m-h*p,A=c*g-f*p,T=c*v-d*p,S=h*g-f*m,E=h*v-d*m,L=f*v-d*g,C=y*L-b*E+x*S+_*T-w*A+M*k;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(i*E-n*L-a*S)*C,t[2]=(m*M-g*w+v*_)*C,t[3]=(f*w-h*M-d*_)*C,t[4]=(l*T-o*L-u*A)*C,t[5]=(r*L-i*T+a*A)*C,t[6]=(g*x-p*M-v*b)*C,t[7]=(c*M-f*x+d*b)*C,t[8]=(o*E-s*T+u*k)*C,t[9]=(n*T-r*E-a*k)*C,t[10]=(p*w-m*x+v*y)*C,t[11]=(h*x-c*w-d*y)*C,t[12]=(s*A-o*S-l*k)*C,t[13]=(r*S-n*A+i*k)*C,t[14]=(m*b-p*_-g*y)*C,t[15]=(c*_-h*b+f*y)*C,t):null}e.exports=n},{}],182:[function(t,e,r){function n(t,e,r,n){var a,o,s,l,u,c,h,f,d,p,m=e[0],g=e[1],v=e[2],y=n[0],b=n[1],x=n[2],_=r[0],w=r[1],M=r[2];return Math.abs(m-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(v-M)<1e-6?i(t):(h=m-_,f=g-w,d=v-M,p=1/Math.sqrt(h*h+f*f+d*d),h*=p,f*=p,d*=p,a=b*d-x*f,o=x*h-y*d,s=y*f-b*h,p=Math.sqrt(a*a+o*o+s*s),p?(p=1/p,a*=p,o*=p,s*=p):(a=0,o=0,s=0),l=f*s-d*o,u=d*a-h*s,c=h*o-f*a,p=Math.sqrt(l*l+u*u+c*c),p?(p=1/p,l*=p,u*=p,c*=p):(l=0,u=0,c=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=s,t[9]=c,t[10]=d,t[11]=0,t[12]=-(a*m+o*g+s*v),t[13]=-(l*m+u*g+c*v),t[14]=-(h*m+f*g+d*v),t[15]=1,t)}var i=t(\"./identity\");e.exports=n},{\"./identity\":180}],183:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*h+w*m,t[1]=b*i+x*l+_*f+w*g,t[2]=b*a+x*u+_*d+w*v,t[3]=b*o+x*c+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*h+w*m,t[5]=b*i+x*l+_*f+w*g,t[6]=b*a+x*u+_*d+w*v,t[7]=b*o+x*c+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*h+w*m,t[9]=b*i+x*l+_*f+w*g,t[10]=b*a+x*u+_*d+w*v,t[11]=b*o+x*c+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*h+w*m,t[13]=b*i+x*l+_*f+w*g,t[14]=b*a+x*u+_*d+w*v,t[15]=b*o+x*c+_*p+w*y,t}e.exports=n},{}],184:[function(t,e,r){function n(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}e.exports=n},{}],185:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u,c,h,f,d,p,m,g,v,y,b,x,_,w,M,k,A,T,S,E=n[0],L=n[1],C=n[2],I=Math.sqrt(E*E+L*L+C*C);return Math.abs(I)<1e-6?null:(I=1/I,E*=I,L*=I,C*=I,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],u=e[2],c=e[3],h=e[4],f=e[5],d=e[6],p=e[7],m=e[8],g=e[9],v=e[10],y=e[11],b=E*E*o+a,x=L*E*o+C*i,_=C*E*o-L*i,w=E*L*o-C*i,M=L*L*o+a,k=C*L*o+E*i,A=E*C*o+L*i,T=L*C*o-E*i,S=C*C*o+a,t[0]=s*b+h*x+m*_,t[1]=l*b+f*x+g*_,t[2]=u*b+d*x+v*_,t[3]=c*b+p*x+y*_,t[4]=s*w+h*M+m*k,t[5]=l*w+f*M+g*k,t[6]=u*w+d*M+v*k,t[7]=c*w+p*M+y*k,t[8]=s*A+h*T+m*S,t[9]=l*A+f*T+g*S,t[10]=u*A+d*T+v*S,t[11]=c*A+p*T+y*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}e.exports=n},{}],186:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t}e.exports=n},{}],187:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t}e.exports=n},{}],188:[function(t,e,r){function n(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t}e.exports=n},{}],189:[function(t,e,r){function n(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}e.exports=n},{}],190:[function(t,e,r){function n(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+s*g+h*v+e[12],t[13]=i*m+l*g+f*v+e[13],t[14]=a*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t}e.exports=n},{}],191:[function(t,e,r){function n(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}e.exports=n},{}],192:[function(t,e,r){\"use strict\";function n(t,e){switch(e.length){case 0:break;case 1:t[0]=1/e[0];break;case 4:i(t,e);break;case 9:a(t,e);break;case 16:o(t,e);break;default:throw new Error(\"currently supports matrices up to 4x4\")}return t}e.exports=n;var i=t(\"gl-mat2/invert\"),a=t(\"gl-mat3/invert\"),o=t(\"gl-mat4/invert\")},{\"gl-mat2/invert\":173,\"gl-mat3/invert\":174,\"gl-mat4/invert\":181}],193:[function(t,e,r){r.glMatrix=t(\"./gl-matrix/common.js\"),r.mat2=t(\"./gl-matrix/mat2.js\"),r.mat2d=t(\"./gl-matrix/mat2d.js\"),r.mat3=t(\"./gl-matrix/mat3.js\"),r.mat4=t(\"./gl-matrix/mat4.js\"),r.quat=t(\"./gl-matrix/quat.js\"),r.vec2=t(\"./gl-matrix/vec2.js\"),r.vec3=t(\"./gl-matrix/vec3.js\"),r.vec4=t(\"./gl-matrix/vec4.js\")},{\"./gl-matrix/common.js\":194,\"./gl-matrix/mat2.js\":195,\"./gl-matrix/mat2d.js\":196,\"./gl-matrix/mat3.js\":197,\"./gl-matrix/mat4.js\":198,\"./gl-matrix/quat.js\":199,\"./gl-matrix/vec2.js\":200,\"./gl-matrix/vec3.js\":201,\"./gl-matrix/vec4.js\":202}],194:[function(t,e,r){var n={};n.EPSILON=1e-6,n.ARRAY_TYPE=\"undefined\"!=typeof Float32Array?Float32Array:Array,n.RANDOM=Math.random,n.ENABLE_SIMD=!1,n.SIMD_AVAILABLE=n.ARRAY_TYPE===Float32Array&&\"SIMD\"in this,n.USE_SIMD=n.ENABLE_SIMD&&n.SIMD_AVAILABLE,n.setMatrixArrayType=function(t){n.ARRAY_TYPE=t};var i=Math.PI/180;n.toRadian=function(t){return t*i},n.equals=function(t,e){return Math.abs(t-e)<=n.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))},e.exports=n},{}],195:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.transpose=function(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null},i.adjoint=function(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t},i.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},i.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*s+a*l,t[1]=i*s+o*l,t[2]=n*u+a*c,t[3]=i*u+o*c,t},i.mul=i.multiply,i.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},i.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*l,t[3]=o*l,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},i.str=function(t){return\"mat2(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},i.LDU=function(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},e.exports=i},{\"./common.js\":194}],196:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},i.fromValues=function(t,e,r,i,a,o){var s=new n.ARRAY_TYPE(6);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s[4]=a,s[5]=o,s},i.set=function(t,e,r,n,i,a,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=r*a-n*i;return l?(l=1/l,t[0]=a*l,t[1]=-n*l,t[2]=-i*l,t[3]=r*l,t[4]=(i*s-a*o)*l,t[5]=(n*o-r*s)*l,t):null},i.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},i.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1],h=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+a*c,t[1]=i*u+o*c,t[2]=n*h+a*f,t[3]=i*h+o*f,t[4]=n*d+a*p+s,t[5]=i*d+o*p+l,t},i.mul=i.multiply,i.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+a*u,t[1]=i*c+o*u,t[2]=n*-u+a*c,t[3]=i*-u+o*c,t[4]=s,t[5]=l,t},i.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=a*c,t[3]=o*c,t[4]=s,t[5]=l,t},i.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=n*u+a*c+s,t[5]=i*u+o*c+l,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},i.str=function(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=e[0],c=e[1],h=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-u)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-h)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(l-p)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(p))},e.exports=i},{\"./common.js\":194}],197:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},i.clone=function(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},i.fromValues=function(t,e,r,i,a,o,s,l,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=a,c[5]=o,c[6]=s,c[7]=l,c[8]=u,c},i.set=function(t,e,r,n,i,a,o,s,l,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,f=-c*a+s*l,d=u*a-o*l,p=r*h+n*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null},i.adjoint=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t[0]=o*c-s*u,t[1]=i*u-n*c,t[2]=n*s-i*o,t[3]=s*l-a*c,t[4]=r*c-i*l,t[5]=i*a-r*s,t[6]=a*u-o*l,t[7]=n*l-r*u,t[8]=r*o-n*a,t},i.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8];return e*(u*a-o*l)+r*(-u*i+o*s)+n*(l*i-a*s)},i.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=r[0],d=r[1],p=r[2],m=r[3],g=r[4],v=r[5],y=r[6],b=r[7],x=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*s+p*c,t[2]=f*a+d*l+p*h,t[3]=m*n+g*o+v*u,t[4]=m*i+g*s+v*c,t[5]=m*a+g*l+v*h,t[6]=y*n+b*o+x*u,t[7]=y*i+b*s+x*c,t[8]=y*a+b*l+x*h,t},i.mul=i.multiply,i.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=f*n+d*o+u,t[7]=f*i+d*s+c,t[8]=f*a+d*l+h,t},i.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*s,t[2]=d*a+f*l,t[3]=d*o-f*n,t[4]=d*s-f*i,t[5]=d*l-f*a,t[6]=u,t[7]=c,t[8]=h,t},i.scale=function(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[3]=c-v,t[6]=f+g,t[1]=c+v,t[4]=1-u-p,t[7]=d-m,t[2]=f-g,t[5]=d+m,t[8]=1-u-h,t},i.normalFromMat4=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,k=c*m-h*p,A=c*g-f*p,T=c*v-d*p,S=h*g-f*m,E=h*v-d*m,L=f*v-d*g,C=y*L-b*E+x*S+_*T-w*A+M*k;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(l*T-o*L-u*A)*C,t[2]=(o*E-s*T+u*k)*C,t[3]=(i*E-n*L-a*S)*C,t[4]=(r*L-i*T+a*A)*C,t[5]=(n*T-r*E-a*k)*C,t[6]=(m*M-g*w+v*_)*C,t[7]=(g*x-p*M-v*b)*C,t[8]=(p*w-m*x+v*y)*C,t):null},i.str=function(t){return\"mat3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\")\"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=e[0],d=e[1],p=e[2],m=e[3],g=e[4],v=e[5],y=t[6],b=e[7],x=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-p)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-g)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-v)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(v))&&Math.abs(u-y)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(h-x)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(x))},e.exports=i},{\"./common.js\":194}],198:[function(t,e,r){var n=t(\"./common.js\"),i={scalar:{},SIMD:{}};i.create=function(){var t=new n.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.clone=function(t){var e=new n.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.fromValues=function(t,e,r,i,a,o,s,l,u,c,h,f,d,p,m,g){var v=new n.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=i,v[4]=a,v[5]=o,v[6]=s,v[7]=l,v[8]=u,v[9]=c,v[10]=h,v[11]=f,v[12]=d,v[13]=p,v[14]=m,v[15]=g,v},i.set=function(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=g,t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.scalar.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},i.SIMD.transpose=function(t,e){var r,n,i,a,o,s,l,u,c,h;return r=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),i=SIMD.Float32x4.load(e,8),a=SIMD.Float32x4.load(e,12),o=SIMD.Float32x4.shuffle(r,n,0,1,4,5),s=SIMD.Float32x4.shuffle(i,a,0,1,4,5),l=SIMD.Float32x4.shuffle(o,s,0,2,4,6),u=SIMD.Float32x4.shuffle(o,s,1,3,5,7),SIMD.Float32x4.store(t,0,l),SIMD.Float32x4.store(t,4,u),o=SIMD.Float32x4.shuffle(r,n,2,3,6,7),s=SIMD.Float32x4.shuffle(i,a,2,3,6,7),c=SIMD.Float32x4.shuffle(o,s,0,2,4,6),h=SIMD.Float32x4.shuffle(o,s,1,3,5,7),SIMD.Float32x4.store(t,8,c),SIMD.Float32x4.store(t,12,h),t},i.transpose=n.USE_SIMD?i.SIMD.transpose:i.scalar.transpose,i.scalar.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,k=c*m-h*p,A=c*g-f*p,T=c*v-d*p,S=h*g-f*m,E=h*v-d*m,L=f*v-d*g,C=y*L-b*E+x*S+_*T-w*A+M*k;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(i*E-n*L-a*S)*C,t[2]=(m*M-g*w+v*_)*C,t[3]=(f*w-h*M-d*_)*C,t[4]=(l*T-o*L-u*A)*C,t[5]=(r*L-i*T+a*A)*C,t[6]=(g*x-p*M-v*b)*C,t[7]=(c*M-f*x+d*b)*C,t[8]=(o*E-s*T+u*k)*C,t[9]=(n*T-r*E-a*k)*C,t[10]=(p*w-m*x+v*y)*C,t[11]=(h*x-c*w-d*y)*C,t[12]=(s*A-o*S-l*k)*C,t[13]=(r*S-n*A+i*k)*C,t[14]=(m*b-p*_-g*y)*C,t[15]=(c*_-h*b+f*y)*C,t):null},i.SIMD.invert=function(t,e){var r,n,i,a,o,s,l,u,c,h,f=SIMD.Float32x4.load(e,0),d=SIMD.Float32x4.load(e,4),p=SIMD.Float32x4.load(e,8),m=SIMD.Float32x4.load(e,12);return o=SIMD.Float32x4.shuffle(f,d,0,1,4,5),n=SIMD.Float32x4.shuffle(p,m,0,1,4,5),r=SIMD.Float32x4.shuffle(o,n,0,2,4,6),n=SIMD.Float32x4.shuffle(n,o,1,3,5,7),o=SIMD.Float32x4.shuffle(f,d,2,3,6,7),a=SIMD.Float32x4.shuffle(p,m,2,3,6,7),i=SIMD.Float32x4.shuffle(o,a,0,2,4,6),a=SIMD.Float32x4.shuffle(a,o,1,3,5,7),o=SIMD.Float32x4.mul(i,a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),s=SIMD.Float32x4.mul(n,o),l=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,o),s),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),o=SIMD.Float32x4.mul(n,i),o=SIMD.Float32x4.swizzle(o,1,0,3,2),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),s),c=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(a,o)),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),o=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(n,2,3,0,1),a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),i=SIMD.Float32x4.swizzle(i,2,3,0,1),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,o),s),u=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(i,o)),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),o=SIMD.Float32x4.mul(r,n),o=SIMD.Float32x4.swizzle(o,1,0,3,2),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),u),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,o),c),o=SIMD.Float32x4.swizzle(o,2,3,0,1),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,o),u),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(i,o)),o=SIMD.Float32x4.mul(r,a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(i,o)),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,o),u),o=SIMD.Float32x4.swizzle(o,2,3,0,1),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,o),l),u=SIMD.Float32x4.sub(u,SIMD.Float32x4.mul(n,o)),o=SIMD.Float32x4.mul(r,i),o=SIMD.Float32x4.swizzle(o,1,0,3,2),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),l),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(n,o)),o=SIMD.Float32x4.swizzle(o,2,3,0,1),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(a,o)),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,o),c),h=SIMD.Float32x4.mul(r,s),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,2,3,0,1),h),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,1,0,3,2),h),o=SIMD.Float32x4.reciprocalApproximation(h),h=SIMD.Float32x4.sub(SIMD.Float32x4.add(o,o),SIMD.Float32x4.mul(h,SIMD.Float32x4.mul(o,o))),(h=SIMD.Float32x4.swizzle(h,0,0,0,0))?(SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(h,s)),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(h,l)),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(h,u)),SIMD.Float32x4.store(t,12,SIMD.Float32x4.mul(h,c)),t):null},i.invert=n.USE_SIMD?i.SIMD.invert:i.scalar.invert,i.scalar.adjoint=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=s*(f*v-d*g)-h*(l*v-u*g)+m*(l*d-u*f),t[1]=-(n*(f*v-d*g)-h*(i*v-a*g)+m*(i*d-a*f)),t[2]=n*(l*v-u*g)-s*(i*v-a*g)+m*(i*u-a*l),t[3]=-(n*(l*d-u*f)-s*(i*d-a*f)+h*(i*u-a*l)),t[4]=-(o*(f*v-d*g)-c*(l*v-u*g)+p*(l*d-u*f)),t[5]=r*(f*v-d*g)-c*(i*v-a*g)+p*(i*d-a*f),t[6]=-(r*(l*v-u*g)-o*(i*v-a*g)+p*(i*u-a*l)),t[7]=r*(l*d-u*f)-o*(i*d-a*f)+c*(i*u-a*l),t[8]=o*(h*v-d*m)-c*(s*v-u*m)+p*(s*d-u*h),t[9]=-(r*(h*v-d*m)-c*(n*v-a*m)+p*(n*d-a*h)),t[10]=r*(s*v-u*m)-o*(n*v-a*m)+p*(n*u-a*s),t[11]=-(r*(s*d-u*h)-o*(n*d-a*h)+c*(n*u-a*s)),t[12]=-(o*(h*g-f*m)-c*(s*g-l*m)+p*(s*f-l*h)),t[13]=r*(h*g-f*m)-c*(n*g-i*m)+p*(n*f-i*h),t[14]=-(r*(s*g-l*m)-o*(n*g-i*m)+p*(n*l-i*s)),t[15]=r*(s*f-l*h)-o*(n*f-i*h)+c*(n*l-i*s),t},i.SIMD.adjoint=function(t,e){var r,n,i,a,o,s,l,u,c,h,f,d,p,r=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),i=SIMD.Float32x4.load(e,8),a=SIMD.Float32x4.load(e,12)\n", | |
";return c=SIMD.Float32x4.shuffle(r,n,0,1,4,5),s=SIMD.Float32x4.shuffle(i,a,0,1,4,5),o=SIMD.Float32x4.shuffle(c,s,0,2,4,6),s=SIMD.Float32x4.shuffle(s,c,1,3,5,7),c=SIMD.Float32x4.shuffle(r,n,2,3,6,7),u=SIMD.Float32x4.shuffle(i,a,2,3,6,7),l=SIMD.Float32x4.shuffle(c,u,0,2,4,6),u=SIMD.Float32x4.shuffle(u,c,1,3,5,7),c=SIMD.Float32x4.mul(l,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.mul(s,c),f=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,c),h),f=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),f),f=SIMD.Float32x4.swizzle(f,2,3,0,1),c=SIMD.Float32x4.mul(s,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),h),p=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),p),p=SIMD.Float32x4.swizzle(p,2,3,0,1),c=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,3,0,1),u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),l=SIMD.Float32x4.swizzle(l,2,3,0,1),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),h),d=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),d),d=SIMD.Float32x4.swizzle(d,2,3,0,1),c=SIMD.Float32x4.mul(o,s),c=SIMD.Float32x4.swizzle(c,1,0,3,2),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(l,c),p),c=SIMD.Float32x4.swizzle(c,2,3,0,1),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(l,c)),c=SIMD.Float32x4.mul(o,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(s,c),d),c=SIMD.Float32x4.swizzle(c,2,3,0,1),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),f),d=SIMD.Float32x4.sub(d,SIMD.Float32x4.mul(s,c)),c=SIMD.Float32x4.mul(o,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),f),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(s,c)),c=SIMD.Float32x4.swizzle(c,2,3,0,1),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(s,c),p),SIMD.Float32x4.store(t,0,h),SIMD.Float32x4.store(t,4,f),SIMD.Float32x4.store(t,8,d),SIMD.Float32x4.store(t,12,p),t},i.adjoint=n.USE_SIMD?i.SIMD.adjoint:i.scalar.adjoint,i.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],g=t[15];return(e*o-r*a)*(h*g-f*m)-(e*s-n*a)*(c*g-f*p)+(e*l-i*a)*(c*m-h*p)+(r*s-n*o)*(u*g-f*d)-(r*l-i*o)*(u*m-h*d)+(n*l-i*s)*(u*p-c*d)},i.SIMD.multiply=function(t,e,r){var n=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),a=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4.load(r,0),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,3,3,3,3),o))));SIMD.Float32x4.store(t,0,l);var u=SIMD.Float32x4.load(r,4),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,3,3,3,3),o))));SIMD.Float32x4.store(t,4,c);var h=SIMD.Float32x4.load(r,8),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,3,3,3,3),o))));SIMD.Float32x4.store(t,8,f);var d=SIMD.Float32x4.load(r,12),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,3,3,3,3),o))));return SIMD.Float32x4.store(t,12,p),t},i.scalar.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*h+w*m,t[1]=b*i+x*l+_*f+w*g,t[2]=b*a+x*u+_*d+w*v,t[3]=b*o+x*c+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*h+w*m,t[5]=b*i+x*l+_*f+w*g,t[6]=b*a+x*u+_*d+w*v,t[7]=b*o+x*c+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*h+w*m,t[9]=b*i+x*l+_*f+w*g,t[10]=b*a+x*u+_*d+w*v,t[11]=b*o+x*c+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*h+w*m,t[13]=b*i+x*l+_*f+w*g,t[14]=b*a+x*u+_*d+w*v,t[15]=b*o+x*c+_*p+w*y,t},i.multiply=n.USE_SIMD?i.SIMD.multiply:i.scalar.multiply,i.mul=i.multiply,i.scalar.translate=function(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+s*g+h*v+e[12],t[13]=i*m+l*g+f*v+e[13],t[14]=a*m+u*g+d*v+e[14],t[15]=o*m+c*g+p*v+e[15]),t},i.SIMD.translate=function(t,e,r){var n=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),a=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4(r[0],r[1],r[2],0);e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11]),n=SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(s,0,0,0,0)),i=SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(s,1,1,1,1)),a=SIMD.Float32x4.mul(a,SIMD.Float32x4.swizzle(s,2,2,2,2));var l=SIMD.Float32x4.add(n,SIMD.Float32x4.add(i,SIMD.Float32x4.add(a,o)));return SIMD.Float32x4.store(t,12,l),t},i.translate=n.USE_SIMD?i.SIMD.translate:i.scalar.translate,i.scalar.scale=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.SIMD.scale=function(t,e,r){var n,i,a,o=SIMD.Float32x4(r[0],r[1],r[2],0);return n=SIMD.Float32x4.load(e,0),SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(o,0,0,0,0))),i=SIMD.Float32x4.load(e,4),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(o,1,1,1,1))),a=SIMD.Float32x4.load(e,8),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(a,SIMD.Float32x4.swizzle(o,2,2,2,2))),t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.scale=n.USE_SIMD?i.SIMD.scale:i.scalar.scale,i.rotate=function(t,e,r,i){var a,o,s,l,u,c,h,f,d,p,m,g,v,y,b,x,_,w,M,k,A,T,S,E,L=i[0],C=i[1],I=i[2],z=Math.sqrt(L*L+C*C+I*I);return Math.abs(z)<n.EPSILON?null:(z=1/z,L*=z,C*=z,I*=z,a=Math.sin(r),o=Math.cos(r),s=1-o,l=e[0],u=e[1],c=e[2],h=e[3],f=e[4],d=e[5],p=e[6],m=e[7],g=e[8],v=e[9],y=e[10],b=e[11],x=L*L*s+o,_=C*L*s+I*a,w=I*L*s-C*a,M=L*C*s-I*a,k=C*C*s+o,A=I*C*s+L*a,T=L*I*s+C*a,S=C*I*s-L*a,E=I*I*s+o,t[0]=l*x+f*_+g*w,t[1]=u*x+d*_+v*w,t[2]=c*x+p*_+y*w,t[3]=h*x+m*_+b*w,t[4]=l*M+f*k+g*A,t[5]=u*M+d*k+v*A,t[6]=c*M+p*k+y*A,t[7]=h*M+m*k+b*A,t[8]=l*T+f*S+g*E,t[9]=u*T+d*S+v*E,t[10]=c*T+p*S+y*E,t[11]=h*T+m*S+b*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},i.scalar.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t},i.SIMD.rotateX=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var a=SIMD.Float32x4.load(e,4),o=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(a,n))),t},i.rotateX=n.USE_SIMD?i.SIMD.rotateX:i.scalar.rotateX,i.scalar.rotateY=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t},i.SIMD.rotateY=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var a=SIMD.Float32x4.load(e,0),o=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,n),SIMD.Float32x4.mul(o,i))),t},i.rotateY=n.USE_SIMD?i.SIMD.rotateY:i.scalar.rotateY,i.scalar.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t},i.SIMD.rotateZ=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var a=SIMD.Float32x4.load(e,0),o=SIMD.Float32x4.load(e,4);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(a,n))),t},i.rotateZ=n.USE_SIMD?i.SIMD.rotateZ:i.scalar.rotateZ,i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromRotation=function(t,e,r){var i,a,o,s=r[0],l=r[1],u=r[2],c=Math.sqrt(s*s+l*l+u*u);return Math.abs(c)<n.EPSILON?null:(c=1/c,s*=c,l*=c,u*=c,i=Math.sin(e),a=Math.cos(e),o=1-a,t[0]=s*s*o+a,t[1]=l*s*o+u*i,t[2]=u*s*o-l*i,t[3]=0,t[4]=s*l*o-u*i,t[5]=l*l*o+a,t[6]=u*l*o+s*i,t[7]=0,t[8]=s*u*o+l*i,t[9]=l*u*o-s*i,t[10]=u*u*o+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},i.fromXRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromYRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromZRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromRotationTranslation=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,d=i*l,p=i*u,m=a*u,g=o*s,v=o*l,y=o*u;return t[0]=1-(d+m),t[1]=h+y,t[2]=f-v,t[3]=0,t[4]=h-y,t[5]=1-(c+m),t[6]=p+g,t[7]=0,t[8]=f+v,t[9]=p-g,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},i.getRotation=function(t,e){var r=e[0]+e[5]+e[10],n=0;return r>0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,u=a+a,c=o+o,h=i*l,f=i*u,d=i*c,p=a*u,m=a*c,g=o*c,v=s*l,y=s*u,b=s*c,x=n[0],_=n[1],w=n[2];return t[0]=(1-(p+g))*x,t[1]=(f+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(f-b)*_,t[5]=(1-(h+g))*_,t[6]=(m+v)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,c=o+o,h=s+s,f=a*u,d=a*c,p=a*h,m=o*c,g=o*h,v=s*h,y=l*u,b=l*c,x=l*h,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+v))*_,t[1]=(d+x)*_,t[2]=(p-b)*_,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(f+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+b)*M,t[9]=(g-y)*M,t[10]=(1-(f+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*A+t[8]*T),t[13]=r[1]+A-(t[1]*k+t[5]*A+t[9]*T),t[14]=r[2]+T-(t[2]*k+t[6]*A+t[10]*T),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[1]=c+v,t[2]=f-g,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,u,c,h,f,d,p,m,g=e[0],v=e[1],y=e[2],b=a[0],x=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(g-w)<n.EPSILON&&Math.abs(v-M)<n.EPSILON&&Math.abs(y-k)<n.EPSILON?i.identity(t):(f=g-w,d=v-M,p=y-k,m=1/Math.sqrt(f*f+d*d+p*p),f*=m,d*=m,p*=m,o=x*p-_*d,s=_*f-b*p,l=b*d-x*f,m=Math.sqrt(o*o+s*s+l*l),m?(m=1/m,o*=m,s*=m,l*=m):(o=0,s=0,l=0),u=d*l-p*s,c=p*o-f*l,h=f*s-d*o,m=Math.sqrt(u*u+c*c+h*h),m?(m=1/m,u*=m,c*=m,h*=m):(u=0,c=0,h=0),t[0]=o,t[1]=u,t[2]=f,t[3]=0,t[4]=s,t[5]=c,t[6]=d,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=-(o*g+s*v+l*y),t[13]=-(u*g+c*v+h*y),t[14]=-(f*g+d*v+p*y),t[15]=1,t)},i.str=function(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=t[9],d=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],b=e[0],x=e[1],_=e[2],w=e[3],M=e[4],k=e[5],A=e[6],T=e[7],S=e[8],E=e[9],L=e[10],C=e[11],I=e[12],z=e[13],D=e[14],P=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-w)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-k)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-A)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-T)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-E)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(d-L)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(L))&&Math.abs(p-C)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(m-I)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(g-z)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(z))&&Math.abs(v-D)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(y-P)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(P))},e.exports=i},{\"./common.js\":194}],199:[function(t,e,r){var n=t(\"./common.js\"),i=t(\"./mat3.js\"),a=t(\"./vec3.js\"),o=t(\"./vec4.js\"),s={};s.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.rotationTo=function(){var t=a.create(),e=a.fromValues(1,0,0),r=a.fromValues(0,1,0);return function(n,i,o){var l=a.dot(i,o);return l<-.999999?(a.cross(t,e,i),a.length(t)<1e-6&&a.cross(t,r,i),a.normalize(t,t),s.setAxisAngle(n,t,Math.PI),n):l>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*c+o*s+i*u-a*l,t[1]=i*c+o*l+a*s-n*u,t[2]=a*c+o*u+n*l-i*s,t[3]=o*c-n*s-i*l-a*u,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return a=u*d+c*p+h*m+f*g,a<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return\"quat(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{\"./common.js\":194,\"./mat3.js\":197,\"./vec3.js\":201,\"./vec4.js\":202}],200:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],a(t,t,o),e[s]=t[0],e[s+1]=t[1];return e}}(),i.str=function(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},i.equals=function(t,e){var r=t[0],i=t[1],a=e[0],o=e[1];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))},e.exports=i},{\"./common.js\":194}],201:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},i.fromValues=function(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},i.set=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,u=o*(a-1),c=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*u+i[0]*c,t[1]=e[1]*s+r[1]*l+n[1]*u+i[1]*c,t[2]=e[2]*s+r[2]*l+n[2]*u+i[2]*c,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,u=s*o,c=3*a*s,h=3*l*o,f=l*a;return t[0]=e[0]*u+r[0]*c+n[0]*h+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*h+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*h+i[2]*f,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}(),i.angle=function(t,e){var r=i.fromValues(t[0],t[1],t[2]),n=i.fromValues(e[0],e[1],e[2]);i.normalize(r,r),i.normalize(n,n);var a=i.dot(r,n);return a>1?0:Math.acos(a)},i.str=function(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{\"./common.js\":194}],202:[function(t,e,r){var n=t(\"./common.js\"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],\n", | |
"t[3]=1/e[3],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}(),i.str=function(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},e.exports=i},{\"./common.js\":194}],203:[function(t,e,r){\"use strict\";function n(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=t[4*n+i]*e[n];return r}function i(t,e,r,i,a){for(var o=n(i,n(r,n(e,[t[0],t[1],t[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*a[0]*(1+o[0]),.5*a[1]*(1-o[1])]}function a(t,e){if(2===t.length){for(var r=0,n=0,i=0;i<2;++i)r+=Math.pow(e[i]-t[0][i],2),n+=Math.pow(e[i]-t[1][i],2);return r=Math.sqrt(r),n=Math.sqrt(n),r+n<1e-6?[1,0]:[n/(r+n),r/(n+r)]}if(3===t.length){var a=[0,0];return u(t[0],t[1],t[2],e,a),l(t,a)}return[]}function o(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],a=e[n],o=0;o<3;++o)r[o]+=a*i[o];return r}function s(t,e,r,n,s,l){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),c=0;c<t.length;++c)u[c]=i(t[c],r,n,s,l);for(var h=0,f=1/0,c=0;c<u.length;++c){for(var d=0,p=0;p<2;++p)d+=Math.pow(u[c][p]-e[p],2);d<f&&(f=d,h=c)}for(var m=a(u,e),g=0,c=0;c<3;++c){if(m[c]<-.001||m[c]>1.0001)return null;g+=m[c]}return Math.abs(g-1)>.001?null:[h,o(t,m),m]}var l=t(\"barycentric\"),u=t(\"polytope-closest-point/lib/closest_point_2d.js\");e.exports=s},{barycentric:49,\"polytope-closest-point/lib/closest_point_2d.js\":486}],204:[function(t,e,r){var n=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 clipBounds[2];\\nuniform float pickId;\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n if(any(lessThan(f_position, clipBounds[0])) || \\n any(greaterThan(f_position, clipBounds[1]))) {\\n discard;\\n }\\n gl_FragColor = vec4(pickId, f_id.xyz);\\n}\";r.meshShader={vertex:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, normal;\\nattribute vec4 color;\\nattribute vec2 uv;\\n\\nuniform mat4 model\\n , view\\n , projection;\\nuniform vec3 eyePosition\\n , lightPosition;\\n\\nvarying vec3 f_normal\\n , f_lightDirection\\n , f_eyeDirection\\n , f_data;\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n vec4 m_position = model * vec4(position, 1.0);\\n vec4 t_position = view * m_position;\\n gl_Position = projection * t_position;\\n f_color = color;\\n f_normal = normal;\\n f_data = position;\\n f_eyeDirection = eyePosition - position;\\n f_lightDirection = lightPosition - position;\\n f_uv = uv;\\n}\",fragment:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nfloat beckmannDistribution_2_0(float x, float roughness) {\\n float NdotH = max(x, 0.0001);\\n float cos2Alpha = NdotH * NdotH;\\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\\n float roughness2 = roughness * roughness;\\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\\n return exp(tan2Alpha / roughness2) / denom;\\n}\\n\\n\\n\\nfloat cookTorranceSpecular_1_1(\\n vec3 lightDirection,\\n vec3 viewDirection,\\n vec3 surfaceNormal,\\n float roughness,\\n float fresnel) {\\n\\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\\n\\n //Half angle vector\\n vec3 H = normalize(lightDirection + viewDirection);\\n\\n //Geometric term\\n float NdotH = max(dot(surfaceNormal, H), 0.0);\\n float VdotH = max(dot(viewDirection, H), 0.000001);\\n float LdotH = max(dot(lightDirection, H), 0.000001);\\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\\n float G = min(1.0, min(G1, G2));\\n \\n //Distribution term\\n float D = beckmannDistribution_2_0(NdotH, roughness);\\n\\n //Fresnel term\\n float F = pow(1.0 - VdotN, fresnel);\\n\\n //Multiply terms and done\\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\\n}\\n\\n\\n\\nuniform vec3 clipBounds[2];\\nuniform float roughness\\n , fresnel\\n , kambient\\n , kdiffuse\\n , kspecular\\n , opacity;\\nuniform sampler2D texture;\\n\\nvarying vec3 f_normal\\n , f_lightDirection\\n , f_eyeDirection\\n , f_data;\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n if(any(lessThan(f_data, clipBounds[0])) || \\n any(greaterThan(f_data, clipBounds[1]))) {\\n discard;\\n }\\n\\n vec3 N = normalize(f_normal);\\n vec3 L = normalize(f_lightDirection);\\n vec3 V = normalize(f_eyeDirection);\\n \\n if(!gl_FrontFacing) {\\n N = -N;\\n }\\n\\n float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\\n\\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\\n\\n gl_FragColor = litColor * opacity;\\n}\",attributes:[{name:\"position\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"}]},r.wireShader={vertex:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 uv;\\n\\nuniform mat4 model, view, projection;\\n\\nvarying vec4 f_color;\\nvarying vec3 f_data;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n f_color = color;\\n f_data = position;\\n f_uv = uv;\\n}\",fragment:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 clipBounds[2];\\nuniform sampler2D texture;\\nuniform float opacity;\\n\\nvarying vec4 f_color;\\nvarying vec3 f_data;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n if(any(lessThan(f_data, clipBounds[0])) || \\n any(greaterThan(f_data, clipBounds[1]))) {\\n discard;\\n }\\n\\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\\n}\",attributes:[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"}]},r.pointShader={vertex:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 uv;\\nattribute float pointSize;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) || \\n any(greaterThan(position, clipBounds[1]))) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n }\\n gl_PointSize = pointSize;\\n f_color = color;\\n f_uv = uv;\\n}\",fragment:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform sampler2D texture;\\nuniform float opacity;\\n\\nvarying vec4 f_color;\\nvarying vec2 f_uv;\\n\\nvoid main() {\\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\\n if(dot(pointR, pointR) > 0.25) {\\n discard;\\n }\\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\\n}\",attributes:[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"uv\",type:\"vec2\"},{name:\"pointSize\",type:\"float\"}]},r.pickShader={vertex:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n f_id = id;\\n f_position = position;\\n}\",fragment:n,attributes:[{name:\"position\",type:\"vec3\"},{name:\"id\",type:\"vec4\"}]},r.pointPickShader={vertex:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute float pointSize;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec3 f_position;\\nvarying vec4 f_id;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) || \\n any(greaterThan(position, clipBounds[1]))) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n gl_PointSize = pointSize;\\n }\\n f_id = id;\\n f_position = position;\\n}\",fragment:n,attributes:[{name:\"position\",type:\"vec3\"},{name:\"pointSize\",type:\"float\"},{name:\"id\",type:\"vec4\"}]},r.contourShader={vertex:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\n\\nuniform mat4 model, view, projection;\\n\\nvoid main() {\\n gl_Position = projection * view * model * vec4(position, 1.0);\\n}\",fragment:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 contourColor;\\n\\nvoid main() {\\n gl_FragColor = vec4(contourColor,1);\\n}\\n\",attributes:[{name:\"position\",type:\"vec3\"}]}},{}],205:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,g,v,y,b,x,_,w,M,k,A,T){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=M,this.pointIds=x,this.pointVAO=k,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=T,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=D,this._view=D,this._projection=D,this._resolution=[1,1]}function i(t){for(var e=w({colormap:t,nshades:256,format:\"rgba\"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return _(r,[256,256,4],[4,0,1])}function a(t,e,r){for(var n=new Array(e),i=0;i<e;++i)n[i]=0;for(var a=t.length,i=0;i<a;++i)for(var o=t[i],s=0;s<o.length;++s)n[o[s]]=r[i];return n}function o(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}function s(t){var e=p(t,S.vertex,S.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function l(t){var e=p(t,E.vertex,E.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function u(t){var e=p(t,L.vertex,L.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function c(t){var e=p(t,C.vertex,C.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function h(t){var e=p(t,I.vertex,I.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function f(t){var e=p(t,z.vertex,z.fragment);return e.attributes.position.location=0,e}function d(t,e){1===arguments.length&&(e=t,t=e.gl);var r=s(t),i=l(t),a=u(t),o=c(t),d=h(t),p=f(t),y=v(t,_(new Uint8Array([255,255,255,255]),[1,1,4]));y.generateMipmap(),y.minFilter=t.LINEAR_MIPMAP_LINEAR,y.magFilter=t.LINEAR;var b=m(t),x=m(t),w=m(t),M=m(t),k=m(t),A=g(t,[{buffer:b,type:t.FLOAT,size:3},{buffer:k,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:x,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2},{buffer:M,type:t.FLOAT,size:3}]),T=m(t),S=m(t),E=m(t),L=m(t),C=g(t,[{buffer:T,type:t.FLOAT,size:3},{buffer:L,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:S,type:t.FLOAT,size:4},{buffer:E,type:t.FLOAT,size:2}]),I=m(t),z=m(t),D=m(t),P=m(t),O=m(t),R=g(t,[{buffer:I,type:t.FLOAT,size:3},{buffer:O,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:z,type:t.FLOAT,size:4},{buffer:D,type:t.FLOAT,size:2},{buffer:P,type:t.FLOAT,size:1}]),F=m(t),j=g(t,[{buffer:F,type:t.FLOAT,size:3}]),N=new n(t,y,r,i,a,o,d,p,b,k,x,w,M,A,T,L,S,E,C,I,O,z,D,P,R,F,j);return N.update(e),N}var p=t(\"gl-shader\"),m=t(\"gl-buffer\"),g=t(\"gl-vao\"),v=t(\"gl-texture2d\"),y=t(\"normals\"),b=t(\"gl-mat4/multiply\"),x=t(\"gl-mat4/invert\"),_=t(\"ndarray\"),w=t(\"colormap\"),M=t(\"simplicial-complex-contour\"),k=t(\"typedarray-pool\"),A=t(\"./lib/shaders\"),T=t(\"./lib/closest-point\"),S=A.meshShader,E=A.wireShader,L=A.pointShader,C=A.pickShader,I=A.pointPickShader,z=A.contourShader,D=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=n.prototype;P.isOpaque=function(){return this.opacity>=1},P.isTransparent=function(){return this.opacity<1},P.pickSlots=1,P.setPickBase=function(t){this.pickId=t},P.highlight=function(t){if(!t||!this.contourEnable)return void(this.contourCount=0);for(var e=M(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=k.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var u=r[l],c=0;c<2;++c){var h=u[0];2===u.length&&(h=u[c]);for(var f=n[h][0],d=n[h][1],p=i[h],m=1-p,g=this.positions[f],v=this.positions[d],y=0;y<3;++y)o[s++]=p*g[y]+m*v[y]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),k.free(o)},P.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,\"contourEnable\"in t&&(this.contourEnable=t.contourEnable),\"contourColor\"in t&&(this.contourColor=t.contourColor),\"lineWidth\"in t&&(this.lineWidth=t.lineWidth),\"lightPosition\"in t&&(this.lightPosition=t.lightPosition),\"opacity\"in t&&(this.opacity=t.opacity),\"ambient\"in t&&(this.ambientLight=t.ambient),\"diffuse\"in t&&(this.diffuseLight=t.diffuse),\"specular\"in t&&(this.specularLight=t.specular),\"roughness\"in t&&(this.roughness=t.roughness),\"fresnel\"in t&&(this.fresnel=t.fresnel),t.texture?(this.texture.dispose(),this.texture=v(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(i(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var s=[],l=[],u=[],c=[],h=[],f=[],d=[],p=[],m=[],g=[],b=[],x=[],_=[],w=[];this.cells=r,this.positions=n;var M=t.vertexNormals,k=t.cellNormals,A=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,T=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!k&&(k=y.faceNormals(r,n,T)),k||M||(M=y.vertexNormals(r,n,A));var S=t.vertexColors,E=t.cellColors,L=t.meshColor||[1,1,1,1],C=t.vertexUVs,I=t.vertexIntensity,z=t.cellUVs,D=t.cellIntensity,P=1/0,O=-1/0;if(!C&&!z)if(I)if(t.vertexIntensityBounds)P=+t.vertexIntensityBounds[0],O=+t.vertexIntensityBounds[1];else for(var R=0;R<I.length;++R){var F=I[R];P=Math.min(P,F),O=Math.max(O,F)}else if(D)for(var R=0;R<D.length;++R){var F=D[R];P=Math.min(P,F),O=Math.max(O,F)}else for(var R=0;R<n.length;++R){var F=n[R][2];P=Math.min(P,F),O=Math.max(O,F)}this.intensity=I||(D?a(r,n.length,D):o(n));var j=t.pointSizes,N=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var R=0;R<n.length;++R)for(var B=n[R],U=0;U<3;++U)!isNaN(B[U])&&isFinite(B[U])&&(this.bounds[0][U]=Math.min(this.bounds[0][U],B[U]),this.bounds[1][U]=Math.max(this.bounds[1][U],B[U]));var V=0,H=0,q=0;t:for(var R=0;R<r.length;++R){var G=r[R];switch(G.length){case 1:for(var Y=G[0],B=n[Y],U=0;U<3;++U)if(isNaN(B[U])||!isFinite(B[U]))continue t;g.push(B[0],B[1],B[2]);var W;W=S?S[Y]:E?E[R]:L,3===W.length?b.push(W[0],W[1],W[2],1):b.push(W[0],W[1],W[2],W[3]);var X;X=C?C[Y]:I?[(I[Y]-P)/(O-P),0]:z?z[R]:D?[(D[R]-P)/(O-P),0]:[(B[2]-P)/(O-P),0],x.push(X[0],X[1]),j?_.push(j[Y]):_.push(N),w.push(R),q+=1;break;case 2:for(var U=0;U<2;++U)for(var Y=G[U],B=n[Y],Z=0;Z<3;++Z)if(isNaN(B[Z])||!isFinite(B[Z]))continue t;for(var U=0;U<2;++U){var Y=G[U],B=n[Y];f.push(B[0],B[1],B[2]);var W;W=S?S[Y]:E?E[R]:L,3===W.length?d.push(W[0],W[1],W[2],1):d.push(W[0],W[1],W[2],W[3]);var X;X=C?C[Y]:I?[(I[Y]-P)/(O-P),0]:z?z[R]:D?[(D[R]-P)/(O-P),0]:[(B[2]-P)/(O-P),0],p.push(X[0],X[1]),m.push(R)}H+=1;break;case 3:for(var U=0;U<3;++U)for(var Y=G[U],B=n[Y],Z=0;Z<3;++Z)if(isNaN(B[Z])||!isFinite(B[Z]))continue t;for(var U=0;U<3;++U){var Y=G[U],B=n[Y];s.push(B[0],B[1],B[2]);var W;W=S?S[Y]:E?E[R]:L,3===W.length?l.push(W[0],W[1],W[2],1):l.push(W[0],W[1],W[2],W[3]);var X;X=C?C[Y]:I?[(I[Y]-P)/(O-P),0]:z?z[R]:D?[(D[R]-P)/(O-P),0]:[(B[2]-P)/(O-P),0],c.push(X[0],X[1]);var J;J=M?M[Y]:k[R],u.push(J[0],J[1],J[2]),h.push(R)}V+=1}}this.pointCount=q,this.edgeCount=H,this.triangleCount=V,this.pointPositions.update(g),this.pointColors.update(b),this.pointUVs.update(x),this.pointSizes.update(_),this.pointIds.update(new Uint32Array(w)),this.edgePositions.update(f),this.edgeColors.update(d),this.edgeUVs.update(p),this.edgeIds.update(new Uint32Array(m)),this.trianglePositions.update(s),this.triangleColors.update(l),this.triangleUVs.update(c),this.triangleNormals.update(u),this.triangleIds.update(new Uint32Array(h))}},P.drawTransparent=P.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||D,n=t.view||D,i=t.projection||D,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:i,clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,contourColor:this.contourColor,texture:0};this.texture.bind(0);var l=new Array(16);b(l,s.view,s.model),b(l,s.projection,l),x(l,l);for(var o=0;o<3;++o)s.eyePosition[o]=l[12+o]/l[15];for(var u=l[15],o=0;o<3;++o)u+=this.lightPosition[o]*l[4*o+3];for(var o=0;o<3;++o){for(var c=l[12+o],h=0;h<3;++h)c+=l[4*h+o]*this.lightPosition[h];s.lightPosition[o]=c/u}if(this.triangleCount>0){var f=this.triShader;f.bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var f=this.lineShader;f.bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var f=this.pointShader;f.bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var f=this.contourShader;f.bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},P.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||D,n=t.view||D,i=t.projection||D,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},P.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;a<r.length;++a)i[a]=n[r[a]];var o=T(i,[t.coord[0],this._resolution[1]-t.coord[1]],this._model,this._view,this._projection,this._resolution);if(!o)return null;for(var s=o[2],l=0,a=0;a<r.length;++a)l+=s[a]*this.intensity[r[a]];return{position:o[1],index:r[o[0]],cell:r,cellId:e,intensity:l,dataCoordinate:this.positions[r[o[0]]]}},P.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},e.exports=d},{\"./lib/closest-point\":203,\"./lib/shaders\":204,colormap:99,\"gl-buffer\":156,\"gl-mat4/invert\":181,\"gl-mat4/multiply\":183,\"gl-shader\":255,\"gl-texture2d\":267,\"gl-vao\":271,ndarray:467,normals:469,\"simplicial-complex-contour\":517,\"typedarray-pool\":541}],206:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl;return new n(t,a(e,[0,0,0,1,1,0,1,1]),o(e,s.boxVert,s.lineFrag))}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-shader\"),s=t(\"./shaders\"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawBox=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o){var s=this.plot,l=this.shader,u=s.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,l.uniforms.lo=t,l.uniforms.hi=e,l.uniforms.color=o,u.drawArrays(u.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":209,\"gl-buffer\":156,\"gl-shader\":212}],207:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function i(t,e){return t-e}function a(t){var e=t.gl;return new n(t,o(e),s(e,u.gridVert,u.gridFrag),s(e,u.tickVert,u.gridFrag))}e.exports=a;var o=t(\"gl-buffer\"),s=t(\"gl-shader\"),l=t(\"binary-search-bounds\"),u=t(\"./shaders\"),c=n.prototype;c.draw=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){for(var n=this.plot,i=this.vbo,a=this.shader,o=this.ticks,s=n.gl,l=n._tickBounds,u=n.dataBox,c=n.viewBox,h=n.gridLineWidth,f=n.gridLineColor,d=n.gridLineEnable,p=n.pixelRatio,m=0;m<2;++m){var g=l[m],v=l[m+2],y=v-g,b=.5*(u[m+2]+u[m]),x=u[m+2]-u[m];e[m]=2*y/x,t[m]=2*(g-b)/x}a.bind(),i.bind(),a.attributes.dataCoord.pointer(),a.uniforms.dataShift=t,a.uniforms.dataScale=e;for(var _=0,m=0;m<2;++m){r[0]=r[1]=0,r[m]=1,a.uniforms.dataAxis=r,a.uniforms.lineWidth=h[m]/(c[m+2]-c[m])*p,a.uniforms.color=f[m];var w=6*o[m].length;d[m]&&w&&s.drawArrays(s.TRIANGLES,_,w),_+=w}}}(),c.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],a=[0,0],o=[0,0];return function(){for(var s=this.plot,u=this.vbo,c=this.tickShader,h=this.ticks,f=s.gl,d=s._tickBounds,p=s.dataBox,m=s.viewBox,g=s.pixelRatio,v=s.screenBox,y=v[2]-v[0],b=v[3]-v[1],x=m[2]-m[0],_=m[3]-m[1],w=0;w<2;++w){var M=d[w],k=d[w+2],A=k-M,T=.5*(p[w+2]+p[w]),S=p[w+2]-p[w];e[w]=2*A/S,t[w]=2*(M-T)/S}e[0]*=x/y,t[0]*=x/y,e[1]*=_/b,t[1]*=_/b,c.bind(),u.bind(),c.attributes.dataCoord.pointer();var E=c.uniforms;E.dataShift=t,E.dataScale=e;var L=s.tickMarkLength,C=s.tickMarkWidth,I=s.tickMarkColor,z=6*h[0].length,D=Math.min(l.ge(h[0],(p[0]-d[0])/(d[2]-d[0]),i),h[0].length),P=Math.min(l.gt(h[0],(p[2]-d[0])/(d[2]-d[0]),i),h[0].length),O=0+6*D,R=6*Math.max(0,P-D),F=Math.min(l.ge(h[1],(p[1]-d[1])/(d[3]-d[1]),i),h[1].length),j=Math.min(l.gt(h[1],(p[3]-d[1])/(d[3]-d[1]),i),h[1].length),N=z+6*F,B=6*Math.max(0,j-F);a[0]=2*(m[0]-L[1])/y-1,a[1]=(m[3]+m[1])/b-1,o[0]=L[1]*g/y,o[1]=C[1]*g/b,B&&(E.color=I[1],E.tickScale=o,E.dataAxis=n,E.screenOffset=a,f.drawArrays(f.TRIANGLES,N,B)),a[0]=(m[2]+m[0])/y-1,a[1]=2*(m[1]-L[0])/b-1,o[0]=C[0]*g/y,o[1]=L[0]*g/b,R&&(E.color=I[0],E.tickScale=o,E.dataAxis=r,E.screenOffset=a,f.drawArrays(f.TRIANGLES,O,R)),a[0]=2*(m[2]+L[3])/y-1,a[1]=(m[3]+m[1])/b-1,o[0]=L[3]*g/y,o[1]=C[3]*g/b,B&&(E.color=I[3],E.tickScale=o,E.dataAxis=n,E.screenOffset=a,f.drawArrays(f.TRIANGLES,N,B)),a[0]=(m[2]+m[0])/y-1,a[1]=2*(m[3]+L[2])/b-1,o[0]=C[2]*g/y,o[1]=L[2]*g/b,R&&(E.color=I[2],E.tickScale=o,E.dataAxis=r,E.screenOffset=a,f.drawArrays(f.TRIANGLES,O,R))}}(),c.update=function(){var t=[1,1,-1,-1,1,-1],e=[1,-1,1,1,-1,-1];return function(r){for(var n=r.ticks,i=r.bounds,a=new Float32Array(18*(n[0].length+n[1].length)),o=(this.plot.zeroLineEnable,0),s=[[],[]],l=0;l<2;++l)for(var u=s[l],c=n[l],h=i[l],f=i[l+2],d=0;d<c.length;++d){var p=(c[d].x-h)/(f-h);u.push(p);for(var m=0;m<6;++m)a[o++]=p,a[o++]=t[m],a[o++]=e[m]}this.ticks=s,this.vbo.update(a)}}(),c.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{\"./shaders\":209,\"binary-search-bounds\":211,\"gl-buffer\":156,\"gl-shader\":212}],208:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl;return new n(t,a(e,[-1,-1,-1,1,1,-1,1,1]),o(e,s.lineVert,s.lineFrag))}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-shader\"),s=t(\"./shaders\"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawLine=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o,s){var l=this.plot,u=this.shader,c=l.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,u.uniforms.start=t,u.uniforms.end=e,u.uniforms.width=o*l.pixelRatio,u.uniforms.color=s,c.drawArrays(c.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":209,\"gl-buffer\":156,\"gl-shader\":212}],209:[function(t,e,r){\"use strict\";var n=\"precision lowp float;\\n#define GLSLIFY 1\\nuniform vec4 color;\\nvoid main() {\\n gl_FragColor = vec4(color.xyz * color.w, color.w);\\n}\\n\";e.exports={lineVert:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 coord;\\n\\nuniform vec4 screenBox;\\nuniform vec2 start, end;\\nuniform float width;\\n\\nvec2 perp(vec2 v) {\\n return vec2(v.y, -v.x);\\n}\\n\\nvec2 screen(vec2 v) {\\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\\n}\\n\\nvoid main() {\\n vec2 delta = normalize(perp(start - end));\\n vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\\n gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\\n}\\n\",lineFrag:n,textVert:\"#define GLSLIFY 1\\nattribute vec3 textCoordinate;\\n\\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\\nuniform float angle;\\n\\nvoid main() {\\n float dataOffset = textCoordinate.z;\\n vec2 glyphOffset = textCoordinate.xy;\\n mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\\n vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\\n glyphMatrix * glyphOffset * textScale + screenOffset;\\n gl_Position = vec4(screenCoordinate, 0, 1);\\n}\\n\",textFrag:n,gridVert:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 dataCoord;\\n\\nuniform vec2 dataAxis, dataShift, dataScale;\\nuniform float lineWidth;\\n\\nvoid main() {\\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\\n pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\\n gl_Position = vec4(pos, 0, 1);\\n}\\n\",gridFrag:n,boxVert:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 coord;\\n\\nuniform vec4 screenBox;\\nuniform vec2 lo, hi;\\n\\nvec2 screen(vec2 v) {\\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\\n}\\n\\nvoid main() {\\n gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\\n}\\n\",tickVert:\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 dataCoord;\\n\\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\\n\\nvoid main() {\\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\\n gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\\n}\\n\"}},{}],210:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}function i(t){var e=t.gl;return new n(t,a(e),o(e,u.textVert,u.textFrag))}e.exports=i;var a=t(\"gl-buffer\"),o=t(\"gl-shader\"),s=t(\"text-cache\"),l=t(\"binary-search-bounds\"),u=t(\"./shaders\"),c=n.prototype;c.drawTicks=function(){var t=[0,0],e=[0,0],r=[0,0];return function(n){var i=this.plot,a=this.shader,o=this.tickX[n],s=this.tickOffset[n],u=i.gl,c=i.viewBox,h=i.dataBox,f=i.screenBox,d=i.pixelRatio,p=i.tickEnable,m=i.tickPad,g=i.tickColor,v=i.tickAngle,y=i.labelEnable,b=i.labelPad,x=i.labelColor,_=i.labelAngle,w=this.labelOffset[n],M=this.labelCount[n],k=l.lt(o,h[n]),A=l.le(o,h[n+2]);t[0]=t[1]=0,t[n]=1,e[n]=(c[2+n]+c[n])/(f[2+n]-f[n])-1;var T=2/f[2+(1^n)]-f[1^n];e[1^n]=T*c[1^n]-1,p[n]&&(e[1^n]-=T*d*m[n],k<A&&s[A]>s[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],u.drawArrays(u.TRIANGLES,s[k],s[A]-s[k]))),y[n]&&M&&(e[1^n]-=T*d*b[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n],a.uniforms.angle=_[n],u.drawArrays(u.TRIANGLES,w,M)),e[1^n]=T*c[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],k<A&&s[A]>s[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],u.drawArrays(u.TRIANGLES,s[k],s[A]-s[k]))),y[n+2]&&M&&(e[1^n]+=T*d*b[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n+2],a.uniforms.angle=_[n+2],u.drawArrays(u.TRIANGLES,w,M))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var u=0;u<2;++u){var c=a[u],h=a[u+2],f=h-c,d=.5*(o[u+2]+o[u]),p=o[u+2]-o[u],m=l[u],g=l[u+2],v=g-m,y=s[u],b=s[u+2],x=b-y;e[u]=2*f/p*v/x,t[u]=2*(c-d)/p*v/x}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,o=[],l=t.ticks,u=t.bounds;for(a=0;a<2;++a){var c=[Math.floor(o.length/3)],h=[-1/0],f=l[a];for(e=0;e<f.length;++e){var d=f[e],p=d.x,m=d.text,g=d.font||\"sans-serif\";i=d.fontSize||12;for(var v=1/(u[a+2]-u[a]),y=u[a],b=m.split(\"\\n\"),x=0;x<b.length;x++)for(n=s(g,b[x]).data,r=0;r<n.length;r+=2)o.push(n[r]*i,-n[r+1]*i-x*i*1.2,(p-y)*v);c.push(Math.floor(o.length/3)),h.push(p)}this.tickOffset[a]=c,this.tickX[a]=h}for(a=0;a<2;++a){for(this.labelOffset[a]=Math.floor(o.length/3),n=s(t.labelFont[a],t.labels[a],{textAlign:\"center\"}).data,\n", | |
"i=t.labelSize[a],e=0;e<n.length;e+=2)o.push(n[e]*i,-n[e+1]*i,0);this.labelCount[a]=Math.floor(o.length/3)-this.labelOffset[a]}for(this.titleOffset=Math.floor(o.length/3),n=s(t.titleFont,t.title).data,i=t.titleSize,e=0;e<n.length;e+=2)o.push(n[e]*i,-n[e+1]*i,0);this.titleCount=Math.floor(o.length/3)-this.titleOffset,this.vbo.update(o)},c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{\"./shaders\":209,\"binary-search-bounds\":211,\"gl-buffer\":156,\"gl-shader\":212,\"text-cache\":532}],211:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84}],212:[function(t,e,r){\"use strict\";function n(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name<e.name?-1:1}function a(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}var o=t(\"./lib/create-uniforms\"),s=t(\"./lib/create-attributes\"),l=t(\"./lib/reflect\"),u=t(\"./lib/shader-cache\"),c=t(\"./lib/runtime-reflect\"),h=t(\"./lib/GLError\"),f=n.prototype;f.bind=function(){this.program||this._relink();var t,e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},f.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},f.update=function(t,e,r,n){function a(){d.program=u.program(p,d._vref,d._fref,_,w);for(var t=0;t<r.length;++t)E[t]=p.getUniformLocation(d.program,r[t].name)}if(!e||1===arguments.length){var f=t;t=f.vertex,e=f.fragment,r=f.uniforms,n=f.attributes}var d=this,p=d.gl,m=d._vref;d._vref=u.shader(p,p.VERTEX_SHADER,t),m&&m.dispose(),d.vertShader=d._vref.shader;var g=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),g&&g.dispose(),d.fragShader=d._fref.shader,!r||!n){var v=p.createProgram();if(p.attachShader(v,d.fragShader),p.attachShader(v,d.vertShader),p.linkProgram(v),!p.getProgramParameter(v,p.LINK_STATUS)){var y=p.getProgramInfoLog(v);throw new h(y,\"Error linking program:\"+y)}r=r||c.uniforms(p,v),n=n||c.attributes(p,v),p.deleteProgram(v)}n=n.slice(),n.sort(i);var b,x=[],_=[],w=[];for(b=0;b<n.length;++b){var M=n[b];if(M.type.indexOf(\"mat\")>=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T<k;++T)A[T]=w.length,_.push(M.name+\"[\"+T+\"]\"),\"number\"==typeof M.location?w.push(M.location+T):Array.isArray(M.location)&&M.location.length===k&&\"number\"==typeof M.location[T]?w.push(0|M.location[T]):w.push(-1);x.push({name:M.name,type:M.type,locations:A})}else x.push({name:M.name,type:M.type,locations:[w.length]}),_.push(M.name),\"number\"==typeof M.location?w.push(0|M.location):w.push(-1)}var S=0;for(b=0;b<w.length;++b)if(w[b]<0){for(;w.indexOf(S)>=0;)S+=1;w[b]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,x,w),Object.defineProperty(d,\"uniforms\",o(p,d,r,E))},e.exports=a},{\"./lib/GLError\":213,\"./lib/create-attributes\":214,\"./lib/create-uniforms\":215,\"./lib/reflect\":216,\"./lib/runtime-reflect\":217,\"./lib/shader-cache\":218}],213:[function(t,e,r){function n(t,e,r){this.shortMessage=e||\"\",this.longMessage=r||\"\",this.rawError=t||\"\",this.message=\"gl-shader: \"+(e||t||\"\")+(r?\"\\n\"+r:\"\"),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name=\"GLError\",n.prototype.constructor=n,e.exports=n},{}],214:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=[\"gl\",\"v\"],u=[],c=0;c<a;++c)l.push(\"x\"+c),u.push(\"x\"+c);l.push(\"if(x0.length===void 0){return gl.vertexAttrib\"+a+\"f(v,\"+u.join()+\")}else{return gl.vertexAttrib\"+a+\"fv(v,x0)}\");var h=Function.apply(null,l),f=new n(t,e,r,i,a,h);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(i[r]),h(t,i[r],e),e},get:function(){return f},enumerable:!0})}function a(t,e,r,n,a,o,s){for(var l=new Array(a),u=new Array(a),c=0;c<a;++c)i(t,e,r[c],n,a,l,c),u[c]=l[c];Object.defineProperty(l,\"location\",{set:function(t){if(Array.isArray(t))for(var e=0;e<a;++e)u[e].location=t[e];else for(var e=0;e<a;++e)u[e].location=t+e;return t},get:function(){for(var t=new Array(a),e=0;e<a;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,i,o,s){e=e||t.FLOAT,i=!!i,o=o||a*a,s=s||0;for(var l=0;l<a;++l){var u=n[r[l]];t.vertexAttribPointer(u,a,e,i,o,s+l*a),t.enableVertexAttribArray(u)}};var h=new Array(a),f=t[\"vertexAttrib\"+a+\"fv\"];Object.defineProperty(o,s,{set:function(e){for(var i=0;i<a;++i){var o=n[r[i]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))f.call(t,o,e[i]);else{for(var s=0;s<a;++s)h[s]=e[a*i+s];f.call(t,o,h)}}return e},get:function(){return l},enumerable:!0})}function o(t,e,r,n){for(var o={},l=0,u=r.length;l<u;++l){var c=r[l],h=c.name,f=c.type,d=c.locations;switch(f){case\"bool\":case\"int\":case\"float\":i(t,e,d[0],n,1,o,h);break;default:if(f.indexOf(\"vec\")>=0){var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s(\"\",\"Invalid data type for attribute \"+h+\": \"+f);i(t,e,d[0],n,p,o,h)}else{if(!(f.indexOf(\"mat\")>=0))throw new s(\"\",\"Unknown data type for attribute \"+h+\": \"+f);var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s(\"\",\"Invalid data type for attribute \"+h+\": \"+f);a(t,e,d,n,p,o,h)}}}return o}e.exports=o;var s=t(\"./GLError\"),l=n.prototype;l.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,\"location\",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{\"./GLError\":213}],215:[function(t,e,r){\"use strict\";function n(t){return new Function(\"y\",\"return function(){return y}\")(t)}function i(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function a(t,e,r,a){function l(r){return new Function(\"gl\",\"wrapper\",\"locations\",\"return function(){return gl.getUniform(wrapper.program,locations[\"+r+\"])}\")(t,e,a)}function u(t,e,r){switch(r){case\"bool\":case\"int\":case\"sampler2D\":case\"samplerCube\":return\"gl.uniform1i(locations[\"+e+\"],obj\"+t+\")\";case\"float\":return\"gl.uniform1f(locations[\"+e+\"],obj\"+t+\")\";default:var n=r.indexOf(\"vec\");if(!(0<=n&&n<=1&&r.length===4+n)){if(0===r.indexOf(\"mat\")&&4===r.length){var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s(\"\",\"Invalid uniform dimension type for matrix \"+name+\": \"+r);return\"gl.uniformMatrix\"+i+\"fv(locations[\"+e+\"],false,obj\"+t+\")\"}throw new s(\"\",\"Unknown uniform data type for \"+name+\": \"+r)}var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s(\"\",\"Invalid data type\");switch(r.charAt(0)){case\"b\":case\"i\":return\"gl.uniform\"+i+\"iv(locations[\"+e+\"],obj\"+t+\")\";case\"v\":return\"gl.uniform\"+i+\"fv(locations[\"+e+\"],obj\"+t+\")\";default:throw new s(\"\",\"Unrecognized data type for vector \"+name+\": \"+r)}}}function c(t,e){if(\"object\"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+\"\"===n?a+=\"[\"+n+\"]\":a+=\".\"+n,\"object\"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function h(e){for(var n=[\"return function updateProperty(obj){\"],i=c(\"\",e),o=0;o<i.length;++o){var s=i[o],l=s[0],h=s[1];a[h]&&n.push(u(l,h,r[h].type))}return n.push(\"return obj}\"),new Function(\"gl\",\"locations\",n.join(\"\\n\"))(t,a)}function f(t){switch(t){case\"bool\":return!1;case\"int\":case\"sampler2D\":case\"samplerCube\":case\"float\":return 0;default:var e=t.indexOf(\"vec\");if(0<=e&&e<=1&&t.length===4+e){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s(\"\",\"Invalid data type\");return\"b\"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf(\"mat\")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s(\"\",\"Invalid uniform dimension type for matrix \"+name+\": \"+t);return i(r*r,0)}throw new s(\"\",\"Unknown uniform data type for \"+name+\": \"+t)}}function d(t,e,i){if(\"object\"==typeof i){var o=p(i);Object.defineProperty(t,e,{get:n(o),set:h(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:l(i),set:h(i),enumerable:!0,configurable:!1}):t[e]=f(r[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)d(e,r,t[r])}else{e={};for(var n in t)d(e,n,t[n])}return e}var m=o(r,!0);return{get:n(p(m)),set:h(m),enumerable:!0,configurable:!0}}var o=t(\"./reflect\"),s=t(\"./GLError\");e.exports=a},{\"./GLError\":213,\"./reflect\":216}],216:[function(t,e,r){\"use strict\";function n(t,e){for(var r={},n=0;n<t.length;++n)for(var i=t[n].name,a=i.split(\".\"),o=r,s=0;s<a.length;++s){var l=a[s].split(\"[\");if(l.length>1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u<l.length;++u){var c=parseInt(l[u]);u<l.length-1||s<a.length-1?(c in o||(u<l.length-1?o[c]=[]:o[c]={}),o=o[c]):o[c]=e?n:t[n].type}}else s<a.length-1?(l[0]in o||(o[l[0]]={}),o=o[l[0]]):o[l[0]]=e?n:t[n].type}return r}e.exports=n},{}],217:[function(t,e,r){\"use strict\";function n(t,e){if(!s){var r=Object.keys(o);s={};for(var n=0;n<r.length;++n){var i=r[n];s[t[i]]=o[i]}}return s[e]}function i(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),i=[],a=0;a<r;++a){var o=t.getActiveUniform(e,a);if(o){var s=n(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)i.push({name:o.name.replace(\"[0]\",\"[\"+l+\"]\"),type:s});else i.push({name:o.name,type:s})}}return i}function a(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=[],a=0;a<r;++a){var o=t.getActiveAttrib(e,a);o&&i.push({name:o.name,type:n(t,o.type)})}return i}r.uniforms=i,r.attributes=a;var o={FLOAT:\"float\",FLOAT_VEC2:\"vec2\",FLOAT_VEC3:\"vec3\",FLOAT_VEC4:\"vec4\",INT:\"int\",INT_VEC2:\"ivec2\",INT_VEC3:\"ivec3\",INT_VEC4:\"ivec4\",BOOL:\"bool\",BOOL_VEC2:\"bvec2\",BOOL_VEC3:\"bvec3\",BOOL_VEC4:\"bvec4\",FLOAT_MAT2:\"mat2\",FLOAT_MAT3:\"mat3\",FLOAT_MAT4:\"mat4\",SAMPLER_2D:\"sampler2D\",SAMPLER_CUBE:\"samplerCube\"},s=null},{}],218:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function i(t){this.gl=t,this.shaders=[{},{}],this.programs={}}function a(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(n);try{var a=h(i,r,e)}catch(t){throw console.warn(\"Failed to format compiler error: \"+t),new c(i,\"Error compiling shader:\\n\"+i)}throw new c(i,a.short,a.long)}return n}function o(t,e,r,n,i){var a=t.createProgram();t.attachShader(a,e),t.attachShader(a,r);for(var o=0;o<n.length;++o)t.bindAttribLocation(a,i[o],n[o]);if(t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS)){var s=t.getProgramInfoLog(a);throw new c(s,\"Error linking program: \"+s)}return a}function s(t){var e=d.get(t);return e||(e=new i(t),d.set(t,e)),e}function l(t,e,r){return s(t).getShaderReference(e,r)}function u(t,e,r,n,i){return s(t).getProgram(e,r,n,i)}r.shader=l,r.program=u;var c=t(\"./GLError\"),h=t(\"gl-format-compiler-error\"),f=\"undefined\"==typeof WeakMap?t(\"weakmap-shim\"):WeakMap,d=new f,p=0;n.prototype.dispose=function(){if(0==--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;n<i;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var m=i.prototype;m.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],o=i[e];if(o&&r.isShader(o.shader))o.count+=1;else{var s=a(r,t,e);o=i[e]=new n(p++,e,t,s,[],1,this)}return o},m.getProgram=function(t,e,r,n){var i=[t.id,e.id,r.join(\":\"),n.join(\":\")].join(\"@\"),a=this.programs[i];return a&&this.gl.isProgram(a)||(this.programs[i]=a=o(this.gl,t.shader,e.shader,r,n),t.programs.push(i),e.programs.push(i)),a}},{\"./GLError\":213,\"gl-format-compiler-error\":165,\"weakmap-shim\":562}],219:[function(t,e,r){\"use strict\";function n(t,e){this.gl=t,this.pickBuffer=e,this.screenBox=[0,0,t.drawingBufferWidth,t.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-1/0,-1/0],this.static=!1,this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}function i(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function a(t,e){return t.x-e.x}function o(t){var e=t.gl,r=s(e,[e.drawingBufferWidth,e.drawingBufferHeight]),i=new n(e,r);return i.grid=l(i),i.text=u(i),i.line=c(i),i.box=h(i),i.update(t),i}e.exports=o;var s=t(\"gl-select-static\"),l=t(\"./lib/grid\"),u=t(\"./lib/text\"),c=t(\"./lib/line\"),h=t(\"./lib/box\"),f=n.prototype;f.setDirty=function(){this.dirty=this.pickDirty=!0},f.setOverlayDirty=function(){this.dirty=!0},f.nextDepthValue=function(){return this._depthCounter++/65536},f.draw=function(){return function(){var t=this.gl,e=this.screenBox,r=this.viewBox,n=this.dataBox,i=this.pixelRatio,a=this.grid,o=this.line,s=this.text,l=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){this.dirty=!1,t.bindFramebuffer(t.FRAMEBUFFER,null),t.enable(t.SCISSOR_TEST),t.disable(t.DEPTH_TEST),t.depthFunc(t.LESS),t.depthMask(!1),t.enable(t.BLEND),t.blendEquation(t.FUNC_ADD,t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]);var u=this.borderColor;t.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.scissor(r[0],r[1],r[2]-r[0],r[3]-r[1]),t.viewport(r[0],r[1],r[2]-r[0],r[3]-r[1]);var c=this.backgroundColor;t.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[3]),t.clear(t.COLOR_BUFFER_BIT),a.draw();var h=this.zeroLineEnable,f=this.zeroLineColor,d=this.zeroLineWidth;if(h[0]||h[1]){o.bind();for(var p=0;p<2;++p)if(h[p]&&n[p]<=0&&n[p+2]>=0){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],f[p]):o.drawLine(e[0],m,e[2],m,d[p],f[p])}}for(var p=0;p<l.length;++p)l[p].draw();t.viewport(e[0],e[1],e[2]-e[0],e[3]-e[1]),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]),this.grid.drawTickMarks(),o.bind();var g=this.borderLineEnable,v=this.borderLineWidth,y=this.borderLineColor;g[1]&&o.drawLine(r[0],r[1]-.5*v[1]*i,r[0],r[3]+.5*v[3]*i,v[1],y[1]),g[0]&&o.drawLine(r[0]-.5*v[0]*i,r[1],r[2]+.5*v[2]*i,r[1],v[0],y[0]),g[3]&&o.drawLine(r[2],r[1]-.5*v[1]*i,r[2],r[3]+.5*v[3]*i,v[3],y[3]),g[2]&&o.drawLine(r[0]-.5*v[0]*i,r[3],r[2]+.5*v[2]*i,r[3],v[2],y[2]),s.bind();for(var p=0;p<2;++p)s.drawTicks(p);this.titleEnable&&s.drawTitle();for(var b=this.overlays,p=0;p<b.length;++p)b[p].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}}}(),f.drawPick=function(){return function(){if(!this.static){var t=this.pickBuffer;this.gl;this._pickTimeout=null,t.begin();for(var e=1,r=this.objects,n=0;n<r.length;++n)e=r[n].drawPick(e);t.end()}}}(),f.pick=function(){return function(t,e){if(!this.static){var r=this.pixelRatio,n=this.pickPixelRatio,i=this.viewBox,a=0|Math.round((t-i[0]/r)*n),o=0|Math.round((e-i[1]/r)*n),s=this.pickBuffer.query(a,o,this.pickRadius);if(!s)return null;for(var l=s.id+(s.value[0]<<8)+(s.value[1]<<16)+(s.value[2]<<24),u=this.objects,c=0;c<u.length;++c){var h=u[c].pick(a,o,l);if(h)return h}return null}}}(),f.setScreenBox=function(t){var e=this.screenBox,r=this.pixelRatio;e[0]=0|Math.round(t[0]*r),e[1]=0|Math.round(t[1]*r),e[2]=0|Math.round(t[2]*r),e[3]=0|Math.round(t[3]*r),this.setDirty()},f.setDataBox=function(t){var e=this.dataBox;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3])&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this.setDirty())},f.setViewBox=function(t){var e=this.pixelRatio,r=this.viewBox;r[0]=0|Math.round(t[0]*e),r[1]=0|Math.round(t[1]*e),r[2]=0|Math.round(t[2]*e),r[3]=0|Math.round(t[3]*e);var n=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((t[2]-t[0])*n),0|Math.round((t[3]-t[1])*n)],this.setDirty()},f.update=function(t){t=t||{};var e=this.gl;this.pixelRatio=t.pixelRatio||1;var r=this.pixelRatio;this.pickPixelRatio=Math.max(r,1),this.setScreenBox(t.screenBox||[0,0,e.drawingBufferWidth/r,e.drawingBufferHeight/r]);this.screenBox;this.setViewBox(t.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/r,.125*(this.screenBox[3]-this.screenBox[1])/r,.875*(this.screenBox[2]-this.screenBox[0])/r,.875*(this.screenBox[3]-this.screenBox[1])/r]);var n=this.viewBox,o=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/o,10,10/o]),this.borderColor=(t.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(t.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(t.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(t.gridLineWidth||[1,1]).slice(),this.gridLineColor=i(t.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(t.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(t.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=i(t.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(t.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(t.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=i(t.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(t.titleCenter||[.5*(n[0]+n[2])/r,(n[3]+120)/r]).slice(),this.titleEnable=!(\"titleEnable\"in t&&!t.titleEnable),this.titleAngle=t.titleAngle||0,this.titleColor=(t.titleColor||[0,0,0,1]).slice(),this.labelPad=(t.labelPad||[15,15,15,15]).slice(),this.labelAngle=(t.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(t.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=i(t.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(t.tickPad||[15,15,15,15]).slice(),this.tickAngle=(t.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(t.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=i(t.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(t.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(t.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=i(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var s=t.ticks||[[],[]],l=this._tickBounds;l[0]=l[1]=1/0,l[2]=l[3]=-1/0;for(var u=0;u<2;++u){var c=s[u].slice(0);0!==c.length&&(c.sort(a),l[u]=Math.min(l[u],c[0].x),l[u+2]=Math.max(l[u+2],c[c.length-1].x))}this.grid.update({bounds:l,ticks:s}),this.text.update({bounds:l,ticks:s,labels:t.labels||[\"x\",\"y\"],labelSize:t.labelSize||[12,12],labelFont:t.labelFont||[\"sans-serif\",\"sans-serif\"],title:t.title||\"\",titleSize:t.titleSize||18,titleFont:t.titleFont||\"sans-serif\"}),this.static=!!t.static,this.setDirty()},f.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var t=this.objects.length-1;t>=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setDirty();break}},f.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},f.removeOverlay=function(t){for(var e=this.overlays,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setOverlayDirty();break}}},{\"./lib/box\":206,\"./lib/grid\":207,\"./lib/line\":208,\"./lib/text\":210,\"gl-select-static\":254}],220:[function(t,e,r){var n=t(\"gl-shader\");e.exports=function(t){return n(t,\"precision mediump float;\\n#define GLSLIFY 1\\nattribute vec2 position;\\nvarying vec2 uv;\\nvoid main() {\\n uv = position;\\n gl_Position = vec4(position, 0, 1);\\n}\",\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform sampler2D accumBuffer;\\nvarying vec2 uv;\\n\\nvoid main() {\\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\\n gl_FragColor = min(vec4(1,1,1,1), accum);\\n}\",null,[{name:\"position\",type:\"vec2\"}])}},{\"gl-shader\":255}],221:[function(t,e,r){\"use strict\";function n(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function i(t,e){var r=null;try{r=t.getContext(\"webgl\",e),r||(r=t.getContext(\"experimental-webgl\",e))}catch(t){return null}return r}function a(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function o(t){return\"boolean\"!=typeof t||t}function s(t){function e(){if(!w&&G.autoResize){var t=M.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*G.pixelRatio),i=0|Math.ceil(r*G.pixelRatio);if(n!==M.width||i!==M.height){M.width=n,M.height=i;var a=M.style;a.position=a.position||\"absolute\",a.left=\"0px\",a.top=\"0px\",a.width=e+\"px\",a.height=r+\"px\",N=!0}}}function r(){for(var t=O.length,e=j.length,r=0;r<e;++r)F[r]=0;t:for(var r=0;r<t;++r){var n=O[r],i=n.pickSlots;if(i){for(var a=0;a<e;++a)if(F[a]+i<255){R[r]=a,n.setPickBase(F[a]+1),F[a]+=i;continue t}var o=f(A,q);R[r]=e,j.push(o),F.push(i),n.setPickBase(1),e+=1}else R[r]=-1}for(;e>0&&0===F[e-1];)F.pop(),j.pop().dispose()}function s(){if(G.contextLost)return!0;A.isContextLost()&&(G.contextLost=!0,G.mouseListener.enabled=!1,G.selection.object=null,G.oncontextloss&&G.oncontextloss())}function b(){if(!s()){A.colorMask(!0,!0,!0,!0),A.depthMask(!0),A.disable(A.BLEND),A.enable(A.DEPTH_TEST);for(var t=O.length,e=j.length,r=0;r<e;++r){var n=j[r];n.shape=Y,n.begin();for(var i=0;i<t;++i)if(R[i]===r){var a=O[i];a.drawPick&&(a.pixelRatio=1,a.drawPick(H))}n.end()}}}function x(){if(!s()){e();var t=G.camera.tick();H.view=G.camera.matrix,N=N||t,B=B||t,z.pixelRatio=G.pixelRatio,P.pixelRatio=G.pixelRatio;var r=O.length,n=Z[0],i=Z[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-1/0;for(var o=0;o<r;++o){var l=O[o];l.pixelRatio=G.pixelRatio,l.axes=G.axes,N=N||!!l.dirty,B=B||!!l.dirty;var u=l.bounds;if(u)for(var h=u[0],f=u[1],d=0;d<3;++d)n[d]=Math.min(n[d],h[d]),i[d]=Math.max(i[d],f[d])}var m=G.bounds;if(G.autoBounds)for(var d=0;d<3;++d){if(i[d]<n[d])n[d]=-1,i[d]=1;else{n[d]===i[d]&&(n[d]-=1,i[d]+=1);var v=.05*(i[d]-n[d]);n[d]=n[d]-v,i[d]=i[d]+v}m[0][d]=n[d],m[1][d]=i[d]}for(var y=!1,d=0;d<3;++d)y=y||J[0][d]!==m[0][d]||J[1][d]!==m[1][d],J[0][d]=m[0][d],J[1][d]=m[1][d];if(B=B||y,N=N||y){if(y){for(var x=[0,0,0],o=0;o<3;++o)x[o]=a((m[1][o]-m[0][o])/10);z.autoTicks?z.update({bounds:m,tickSpacing:x}):z.update({bounds:m})}var _=A.drawingBufferWidth,w=A.drawingBufferHeight;q[0]=_,q[1]=w,Y[0]=0|Math.max(_/G.pixelRatio,1),Y[1]=0|Math.max(w/G.pixelRatio,1),g(U,G.fovy,_/w,G.zNear,G.zFar);for(var o=0;o<16;++o)V[o]=0;V[15]=1;for(var M=0,o=0;o<3;++o)M=Math.max(M,m[1][o]-m[0][o]);for(var o=0;o<3;++o)G.autoScale?V[5*o]=G.aspect[o]/(m[1][o]-m[0][o]):V[5*o]=1/M,G.autoCenter&&(V[12+o]=.5*-V[5*o]*(m[0][o]+m[1][o]));for(var o=0;o<r;++o){var l=O[o];l.axesBounds=m,G.clipToBounds&&(l.clipBounds=m)}S.object&&(G.snapToData?P.position=S.dataCoordinate:P.position=S.dataPosition,P.bounds=m),B&&(B=!1,b()),G.axesPixels=c(G.axes,H,_,w),G.onrender&&G.onrender(),A.bindFramebuffer(A.FRAMEBUFFER,null),A.viewport(0,0,_,w);var k=G.clearColor;A.clearColor(k[0],k[1],k[2],k[3]),A.clear(A.COLOR_BUFFER_BIT|A.DEPTH_BUFFER_BIT),A.depthMask(!0),A.colorMask(!0,!0,!0,!0),A.enable(A.DEPTH_TEST),A.depthFunc(A.LEQUAL),A.disable(A.BLEND),A.disable(A.CULL_FACE);var T=!1;z.enable&&(T=T||z.isTransparent(),z.draw(H)),P.axes=z,S.object&&P.draw(H),A.disable(A.CULL_FACE);for(var o=0;o<r;++o){var l=O[o];l.axes=z,l.pixelRatio=G.pixelRatio,l.isOpaque&&l.isOpaque()&&l.draw(H),l.isTransparent&&l.isTransparent()&&(T=!0)}if(T){E.shape=q,E.bind(),A.clear(A.DEPTH_BUFFER_BIT),A.colorMask(!1,!1,!1,!1),A.depthMask(!0),A.depthFunc(A.LESS),z.enable&&z.isTransparent()&&z.drawTransparent(H);for(var o=0;o<r;++o){var l=O[o];l.isOpaque&&l.isOpaque()&&l.draw(H)}A.enable(A.BLEND),A.blendEquation(A.FUNC_ADD),A.blendFunc(A.ONE,A.ONE_MINUS_SRC_ALPHA),A.colorMask(!0,!0,!0,!0),A.depthMask(!1),A.clearColor(0,0,0,0),A.clear(A.COLOR_BUFFER_BIT),z.isTransparent()&&z.drawTransparent(H);for(var o=0;o<r;++o){var l=O[o];l.isTransparent&&l.isTransparent()&&l.drawTransparent(H)}A.bindFramebuffer(A.FRAMEBUFFER,null),A.blendFunc(A.ONE,A.ONE_MINUS_SRC_ALPHA),A.disable(A.DEPTH_TEST),L.bind(),E.color[0].bind(0),L.uniforms.accumBuffer=0,p(A),A.disable(A.BLEND)}N=!1;for(var o=0;o<r;++o)O[o].dirty=!1}}}function _(){w||G.contextLost||(requestAnimationFrame(_),x())}t=t||{};var w=!1,M=(t.pixelRatio||parseFloat(window.devicePixelRatio),t.canvas);if(!M)if(M=document.createElement(\"canvas\"),t.container){var k=t.container;k.appendChild(M)}else document.body.appendChild(M);var A=t.gl;if(A||(A=i(M,t.glOptions||{premultipliedAlpha:!0,antialias:!0})),!A)throw new Error(\"webgl not supported\");var T=t.bounds||[[-10,-10,-10],[10,10,10]],S=new n,E=d(A,[A.drawingBufferWidth,A.drawingBufferHeight],{preferFloat:!y}),L=v(A),C=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:\"turntable\"},I=t.axes||{},z=u(A,I);z.enable=!I.disable;var D=t.spikes||{},P=h(A,D),O=[],R=[],F=[],j=[],N=!0,B=!0,U=new Array(16),V=new Array(16),H={view:null,projection:U,model:V},B=!0,q=[A.drawingBufferWidth,A.drawingBufferHeight],G={gl:A,contextLost:!1,pixelRatio:t.pixelRatio||parseFloat(window.devicePixelRatio),canvas:M,selection:S,camera:l(M,C),axes:z,axesPixels:null,spikes:P,bounds:T,objects:O,shape:q,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:o(t.autoResize),autoBounds:o(t.autoBounds),autoScale:!!t.autoScale,autoCenter:o(t.autoCenter),clipToBounds:o(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:H,oncontextloss:null,mouseListener:null},Y=[A.drawingBufferWidth/G.pixelRatio|0,A.drawingBufferHeight/G.pixelRatio|0];G.autoResize&&e(),window.addEventListener(\"resize\",e),G.update=function(t){w||(t=t||{},N=!0,B=!0)},G.add=function(t){w||(t.axes=z,O.push(t),R.push(-1),N=!0,B=!0,r())},G.remove=function(t){if(!w){var e=O.indexOf(t);e<0||(O.splice(e,1),R.pop(),N=!0,B=!0,r())}},G.dispose=function(){if(!w&&(w=!0,window.removeEventListener(\"resize\",e),M.removeEventListener(\"webglcontextlost\",s),G.mouseListener.enabled=!1,!G.contextLost)){z.dispose(),P.dispose();for(var t=0;t<O.length;++t)O[t].dispose();E.dispose();for(var t=0;t<j.length;++t)j[t].dispose();L.dispose(),A=null,z=null,P=null,O=[]}};var W=!1,X=0;G.mouseListener=m(M,function(t,e,r){if(!w){var n=j.length,i=O.length,a=S.object;S.distance=1/0,S.mouse[0]=e,S.mouse[1]=r,S.object=null,S.screen=null,S.dataCoordinate=S.dataPosition=null;var o=!1;if(t&&X)W=!0;else{W&&(B=!0),W=!1;for(var s=0;s<n;++s){var l=j[s].query(e,Y[1]-r-1,G.pickRadius);if(l){if(l.distance>S.distance)continue;for(var u=0;u<i;++u){var c=O[u];if(R[u]===s){var h=c.pick(l);h&&(S.buttons=t,S.screen=l.coord,S.distance=l.distance,S.object=c,S.index=h.distance,S.dataPosition=h.position,S.dataCoordinate=h.dataCoordinate,S.data=h,o=!0)}}}}}a&&a!==S.object&&(a.highlight&&a.highlight(null),N=!0),S.object&&(S.object.highlight&&S.object.highlight(S.data),N=!0),o=o||S.object!==a,o&&G.onselect&&G.onselect(S),1&t&&!(1&X)&&G.onclick&&G.onclick(S),X=t}}),M.addEventListener(\"webglcontextlost\",s);var Z=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],J=[Z[0].slice(),Z[1].slice()];return _(),G.redraw=function(){w||(N=!0,x())},G}e.exports=s;var l=t(\"3d-view-controls\"),u=t(\"gl-axes3d\"),c=t(\"gl-axes3d/properties\"),h=t(\"gl-spikes3d\"),f=t(\"gl-select-static\"),d=t(\"gl-fbo\"),p=t(\"a-big-triangle\"),m=t(\"mouse-change\"),g=t(\"gl-mat4/perspective\"),v=t(\"./lib/shader\"),y=t(\"is-mobile\")()},{\"./lib/shader\":220,\"3d-view-controls\":36,\"a-big-triangle\":39,\"gl-axes3d\":148,\"gl-axes3d/properties\":155,\"gl-fbo\":164,\"gl-mat4/perspective\":184,\"gl-select-static\":254,\"gl-spikes3d\":264,\"is-mobile\":296,\"mouse-change\":452}],222:[function(t,e,r){r.pointVertex=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\n\\nuniform mat3 matrix;\\nuniform float pointSize;\\nuniform float pointCloud;\\n\\nhighp float rand(vec2 co) {\\n highp float a = 12.9898;\\n highp float b = 78.233;\\n highp float c = 43758.5453;\\n highp float d = dot(co.xy, vec2(a, b));\\n highp float e = mod(d, 3.14);\\n return fract(sin(e) * c);\\n}\\n\\nvoid main() {\\n vec3 hgPosition = matrix * vec3(position, 1);\\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\\n // if we don't jitter the point size a bit, overall point cloud\\n // saturation 'jumps' on zooming, which is disturbing and confusing\\n gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);\\n if(pointCloud != 0.0) { // pointCloud is truthy\\n // get the same square surface as circle would be\\n gl_PointSize *= 0.886;\\n }\\n}\",r.pointFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color, borderColor;\\nuniform float centerFraction;\\nuniform float pointCloud;\\n\\nvoid main() {\\n float radius;\\n vec4 baseColor;\\n if(pointCloud != 0.0) { // pointCloud is truthy\\n if(centerFraction == 1.0) {\\n gl_FragColor = color;\\n } else {\\n gl_FragColor = mix(borderColor, color, centerFraction);\\n }\\n } else {\\n radius = length(2.0 * gl_PointCoord.xy - 1.0);\\n if(radius > 1.0) {\\n discard;\\n }\\n baseColor = mix(borderColor, color, step(radius, centerFraction));\\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\\n }\\n}\\n\",r.pickVertex=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 position;\\nattribute vec4 pickId;\\n\\nuniform mat3 matrix;\\nuniform float pointSize;\\nuniform vec4 pickOffset;\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n vec3 hgPosition = matrix * vec3(position, 1);\\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\\n gl_PointSize = pointSize;\\n\\n vec4 id = pickId + pickOffset;\\n id.y += floor(id.x / 256.0);\\n id.x -= floor(id.x / 256.0) * 256.0;\\n\\n id.z += floor(id.y / 256.0);\\n id.y -= floor(id.y / 256.0) * 256.0;\\n\\n id.w += floor(id.z / 256.0);\\n id.z -= floor(id.z / 256.0) * 256.0;\\n\\n fragId = id;\\n}\\n\",r.pickFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\\n if(radius > 1.0) {\\n discard;\\n }\\n gl_FragColor = fragId / 255.0;\\n}\\n\"},{}],223:[function(t,e,r){arguments[4][212][0].apply(r,arguments)},{\"./lib/GLError\":224,\"./lib/create-attributes\":225,\"./lib/create-uniforms\":226,\"./lib/reflect\":227,\"./lib/runtime-reflect\":228,\"./lib/shader-cache\":229,dup:212}],224:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{dup:213}],225:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{\n", | |
"\"./GLError\":224,dup:214}],226:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{\"./GLError\":224,\"./reflect\":227,dup:215}],227:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{dup:216}],228:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],229:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{\"./GLError\":224,dup:218,\"gl-format-compiler-error\":165,\"weakmap-shim\":562}],230:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}function i(t,e){var r,n=0,i=t.length>>>1;for(r=0;r<i;r++){var a=t[2*r],o=t[2*r+1];a>=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}function a(t,e){var r=t.gl,i=s(r),a=s(r),l=o(r,u.pointVertex,u.pointFragment),c=o(r,u.pickVertex,u.pickFragment),h=new n(t,i,a,l,c);return h.update(e),t.addObject(h),h}var o=t(\"gl-shader\"),s=t(\"gl-buffer\"),l=t(\"typedarray-pool\"),u=t(\"./lib/shader\");e.exports=a;var c=n.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){function e(e,r){return e in t?t[e]:r}var r;t=t||{},this.sizeMin=e(\"sizeMin\",.5),this.sizeMax=e(\"sizeMax\",20),this.color=e(\"color\",[1,0,0,1]).slice(),this.areaRatio=e(\"areaRatio\",1),this.borderColor=e(\"borderColor\",[0,0,0,1]).slice(),this.blend=e(\"blend\",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,o=t.positions,s=i?o:l.mallocFloat32(o.length),u=a?t.idToIndex:l.mallocInt32(n);if(i||s.set(o),!a)for(s.set(o),r=0;r<n;r++)u[r]=r;this.points=o,this.offsetBuffer.update(s),this.pickBuffer.update(u),i||l.free(s),a||l.free(u),this.pointCount=n,this.pickOffset=0},c.unifiedDraw=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=void 0!==r,a=n?this.pickShader:this.shader,o=this.plot.gl,s=this.plot.dataBox;if(0===this.pointCount)return r;var l=s[2]-s[0],u=s[3]-s[1],c=i(this.points,s),h=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/l,t[4]=2/u,t[6]=-2*s[0]/l-1,t[7]=-2*s[1]/u-1,this.offsetBuffer.bind(),a.bind(),a.attributes.position.pointer(),a.uniforms.matrix=t,a.uniforms.color=this.color,a.uniforms.borderColor=this.borderColor,a.uniforms.pointCloud=h<5,a.uniforms.pointSize=h,a.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),a.attributes.pickId.pointer(o.UNSIGNED_BYTE),a.uniforms.pickOffset=e,this.pickOffset=r);var f=o.getParameter(o.BLEND),d=o.getParameter(o.DITHER);return f&&!this.blend&&o.disable(o.BLEND),d&&o.disable(o.DITHER),o.drawArrays(o.POINTS,0,this.pointCount),f&&!this.blend&&o.enable(o.BLEND),d&&o.enable(o.DITHER),r+this.pointCount}}(),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r<n||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{\"./lib/shader\":222,\"gl-buffer\":156,\"gl-shader\":223,\"typedarray-pool\":541}],231:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return a=u*d+c*p+h*m+f*g,a<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t}e.exports=n},{}],232:[function(t,e,r){\"use strict\";e.exports={vertex:\"precision highp float;\\n#define GLSLIFY 1\\n\\n\\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\\n return vec4((posHi + trHi) * scHi\\n \\t\\t\\t//FIXME: this thingy does not give noticeable precision gain, need test\\n + (posLo + trLo) * scHi\\n + (posHi + trHi) * scLo\\n + (posLo + trLo) * scLo\\n , 0, 1);\\n}\\n\\n\\nattribute vec2 positionHi, positionLo;\\nattribute float size, border;\\nattribute vec2 char, color;\\n\\n//this is 64-bit form of scale and translate\\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\\nuniform float pixelRatio;\\nuniform vec4 viewBox;\\nuniform sampler2D palette;\\n\\nvarying vec4 charColor, borderColor;\\nvarying vec2 charId;\\nvarying vec2 pointCoord;\\nvarying float pointSize;\\nvarying float borderWidth;\\n\\n\\nvoid main() {\\n charColor = texture2D(palette, vec2(color.x / 255., 0));\\n borderColor = texture2D(palette, vec2(color.y / 255., 0));\\n\\n gl_PointSize = size * pixelRatio;\\n pointSize = size * pixelRatio;\\n\\n charId = char;\\n borderWidth = border;\\n\\n gl_Position = computePosition_1_0(\\n positionHi, positionLo,\\n scaleHi, scaleLo,\\n translateHi, translateLo);\\n\\n pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\\n}\\n\",fragment:\"precision highp float;\\n#define GLSLIFY 1\\n\\nuniform sampler2D chars;\\nuniform vec2 charsShape;\\nuniform float charsStep, pixelRatio, charOffset;\\n\\nvarying vec4 borderColor;\\nvarying vec4 charColor;\\nvarying vec2 charId;\\nvarying vec2 pointCoord;\\nvarying float pointSize;\\nvarying float borderWidth;\\n\\nvoid main() {\\n\\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\\n\\tpointUV.x = 1. - pointUV.x;\\n\\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\\n\\tfloat dist = texture2D(chars, texCoord).r;\\n\\n\\t//max-distance alpha\\n\\tif (dist < 1e-2)\\n\\t\\tdiscard;\\n\\n\\tfloat gamma = .0045 * charsStep / pointSize;\\n\\n //null-border case\\n \\tif (borderWidth * borderColor.a == 0.) {\\n\\t\\tfloat charAmt = smoothstep(.748 - gamma, .748 + gamma, dist);\\n\\t\\tgl_FragColor = vec4(charColor.rgb, charAmt*charColor.a);\\n\\t\\treturn;\\n\\t}\\n\\n\\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\\n\\tfloat borderLevel = .748 - dif * .5;\\n\\tfloat charLevel = .748 + dif * .5;\\n\\n\\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\\n\\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\\n\\n\\tvec4 color = borderColor;\\n\\tcolor.a *= borderAmt;\\n\\n\\tgl_FragColor = mix(color, charColor, charAmt);\\n}\\n\",pickVertex:\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 positionHi, positionLo;\\nattribute vec4 id;\\nattribute float size;\\n\\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\\nuniform vec4 pickOffset;\\nuniform float pixelRatio;\\n\\nvarying vec4 fragColor;\\n\\n\\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\\n return vec4((posHi + trHi) * scHi\\n \\t\\t\\t//FIXME: this thingy does not give noticeable precision gain, need test\\n + (posLo + trLo) * scHi\\n + (posHi + trHi) * scLo\\n + (posLo + trLo) * scLo\\n , 0, 1);\\n}\\n\\n\\nvoid main() {\\n vec4 fragId = id + pickOffset;\\n\\n fragId.y += floor(fragId.x / 256.0);\\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\\n\\n fragId.z += floor(fragId.y / 256.0);\\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\\n\\n fragId.w += floor(fragId.z / 256.0);\\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\\n\\n fragColor = fragId / 255.0;\\n\\n gl_PointSize = size * .25 * pixelRatio;\\n\\n gl_Position = computePosition_1_0(\\n positionHi, positionLo,\\n scaleHi, scaleLo,\\n translateHi, translateLo);\\n}\\n\",pickFragment:\"precision lowp float;\\n#define GLSLIFY 1\\nvarying vec4 fragColor;\\nvoid main() {\\n gl_FragColor = fragColor;\\n}\\n\"}},{}],233:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84}],234:[function(t,e,r){arguments[4][212][0].apply(r,arguments)},{\"./lib/GLError\":235,\"./lib/create-attributes\":236,\"./lib/create-uniforms\":237,\"./lib/reflect\":238,\"./lib/runtime-reflect\":239,\"./lib/shader-cache\":240,dup:212}],235:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{dup:213}],236:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{\"./GLError\":235,dup:214}],237:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{\"./GLError\":235,\"./reflect\":238,dup:215}],238:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{dup:216}],239:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],240:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{\"./GLError\":235,dup:218,\"gl-format-compiler-error\":165,\"weakmap-shim\":562}],241:[function(t,e,r){\"use strict\";function n(t,e,r,n,a){a<=4*f?i(0,a-1,t,e,r,n):h(0,a-1,t,e,r,n)}function i(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],u=n[2*o+1],c=i[o],h=a[o],f=o;f>t;){var d=r[f-1],p=n[2*(f-1)];if((d-s||l-p)>=0)break;r[f]=d,n[2*f]=p,n[2*f+1]=n[2*f-1],i[f]=i[f-1],a[f]=a[f-1],f-=1}r[f]=s,n[2*f]=l,n[2*f+1]=u,i[f]=c,a[f]=h}}function a(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],u=i[t],c=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=u,a[e]=c}function o(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function s(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],u=i[2*t+1],c=a[t],h=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=u,a[r]=c,o[r]=h}function l(t,e,r,n,i,a,o,s,l,u,c){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],u[t]=u[e],c[t]=c[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,u[e]=a,c[e]=o}function u(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function h(t,e,r,n,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,b=y-m,x=y+m,_=g,w=b,M=y,k=x,A=v,T=t+1,S=e-1,E=0;u(_,w,r,n,d,p)&&(E=_,_=w,w=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E),u(_,M,r,n,d,p)&&(E=_,_=M,M=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(_,k,r,n,d,p)&&(E=_,_=k,k=E),u(M,k,r,n,d,p)&&(E=M,M=k,k=E),u(w,A,r,n,d,p)&&(E=w,w=A,A=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E);var L=r[w],C=n[2*w],I=n[2*w+1],z=d[w],D=p[w],P=r[k],O=n[2*k],R=n[2*k+1],F=d[k],j=p[k],N=_,B=M,U=A,V=g,H=y,q=v,G=r[N],Y=r[B],W=r[U];r[V]=G,r[H]=Y,r[q]=W;for(var X=0;X<2;++X){var Z=n[2*N+X],J=n[2*B+X],K=n[2*U+X];n[2*V+X]=Z,n[2*H+X]=J,n[2*q+X]=K}var Q=d[N],$=d[B],tt=d[U];d[V]=Q,d[H]=$,d[q]=tt;var et=p[N],rt=p[B],nt=p[U];p[V]=et,p[H]=rt,p[q]=nt,o(b,t,r,n,d,p),o(x,e,r,n,d,p);for(var it=T;it<=S;++it)if(c(it,L,C,I,z,r,n,d))it!==T&&a(it,T,r,n,d,p),++T;else if(!c(it,P,O,R,F,r,n,d))for(;;){if(c(S,P,O,R,F,r,n,d)){c(S,L,C,I,z,r,n,d)?(s(it,T,S,r,n,d,p),++T,--S):(a(it,S,r,n,d,p),--S);break}if(--S<it)break}l(t,T-1,L,C,I,z,D,r,n,d,p),l(e,S+1,P,O,R,F,j,r,n,d,p),T-2-t<=f?i(t,T-2,r,n,d,p):h(t,T-2,r,n,d,p),e-(S+2)<=f?i(S+2,e,r,n,d,p):h(S+2,e,r,n,d,p),S-T<=f?i(T,S,r,n,d,p):h(T,S,r,n,d,p)}e.exports=n;var f=32},{}],242:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s){for(var l=r,u=r;u<n;++u){var c=t[2*u],h=t[2*u+1],f=e[u];i<=c&&c<=o&&a<=h&&h<=s&&(u===l?l+=1:(t[2*u]=t[2*l],t[2*u+1]=t[2*l+1],e[u]=e[l],t[2*l]=c,t[2*l+1]=h,e[l]=f,l+=1))}return l}function i(t,e,r){this.pixelSize=t,this.offset=e,this.count=r}function a(t,e,r,a){function l(i,a,o,s,u,c){var h=.5*o,f=s+1,d=u-s;r[_]=d,x[_++]=c;for(var p=0;p<2;++p)for(var m=0;m<2;++m){var g=i+p*h,v=a+m*h,y=n(t,e,f,u,g,v,g+h,v+h);if(y!==f){if(y-f>=Math.max(.9*d,32)){var b=u+s>>>1;l(g,v,h,f,b,c+1),f=b}l(g,v,h,f,y,c+1),f=y}}}var u=t.length>>>1;if(u<1)return[];for(var c=1/0,h=1/0,f=-1/0,d=-1/0,p=0;p<u;++p){var m=t[2*p],g=t[2*p+1];c=Math.min(c,m),f=Math.max(f,m),h=Math.min(h,g),d=Math.max(d,g),e[p]=p}c===f&&(f+=1+Math.abs(f)),h===d&&(d+=1+Math.abs(f));var v=1/(f-c),y=1/(d-h),b=Math.max(f-c,d-h);a=a||[0,0,0,0],a[0]=c,a[1]=h,a[2]=f,a[3]=d;var x=o.mallocInt32(u),_=0;l(c,h,b,0,u,0),s(x,t,e,r,u);for(var w=[],M=0,k=u,_=u-1;_>=0;--_){t[2*_]=(t[2*_]-c)*v,t[2*_+1]=(t[2*_+1]-h)*y;var A=x[_];A!==M&&(w.push(new i(b*Math.pow(.5,A),_+1,k-(_+1))),k=_+1,M=A)}return w.push(new i(b*Math.pow(.5,A+1),0,k)),o.free(x),w}var o=t(\"typedarray-pool\"),s=t(\"./lib/sort\");e.exports=a},{\"./lib/sort\":241,\"typedarray-pool\":541}],243:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.sizeBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement(\"canvas\"),this.charTexture=m(this.plot.gl,this.charCanvas),this.charStep=400,this.charFit=.255,this.snapThreshold=1e4,this.paletteTexture=m(this.plot.gl,[256,1])}function i(){var t=this.plot,e=t.viewBox,r=t.dataBox,n=t.pixelRatio,i=r[2]-r[0],a=r[3]-r[1],u=2/i,c=2/a,h=-r[0]-.5*i,f=-r[1]-.5*a;_[0]=u,w[0]=u-_[0],_[1]=c,w[1]=c-_[1],M[0]=h,k[0]=h-M[0],M[1]=f,k[1]=f-M[1];var d=e[2]-e[0],p=e[3]-e[1];o=Math.min(i/d,a/p),A[0]=2*n/d,A[1]=2*n/p,s=r[0],l=r[2]}function a(t,e){var r=t.gl,i=u(r,f.vertex,f.fragment),a=u(r,f.pickVertex,f.pickFragment),o=c(r),s=c(r),l=c(r),h=c(r),d=c(r),p=new n(t,i,a,o,s,l,h,d);return p.update(e),t.addObject(p),p}e.exports=a;var o,s,l,u=t(\"gl-shader\"),c=t(\"gl-buffer\"),h=t(\"typedarray-pool\"),f=t(\"./lib/shaders\"),d=t(\"snap-points-2d\"),p=t(\"font-atlas-sdf\"),m=t(\"gl-texture2d\"),g=t(\"color-id\"),v=t(\"ndarray\"),y=t(\"clamp\"),b=t(\"binary-search-bounds\"),x=n.prototype,_=new Float32Array([0,0]),w=new Float32Array([0,0]),M=new Float32Array([0,0]),k=new Float32Array([0,0]),A=[0,0],T=[0,0,0,0];x.drawPick=function(t){var e=void 0!==t,r=this.plot,n=this.pointCount,a=n>this.snapThreshold;if(!n)return t;i.call(this);var u=r.gl,c=e?this.pickShader:this.shader,h=u.isEnabled(u.BLEND);if(c.bind(),e){this.pickOffset=t;for(var f=0;f<4;++f)T[f]=t>>8*f&255;c.uniforms.pickOffset=T,this.idBuffer.bind(),c.attributes.id.pointer(u.UNSIGNED_BYTE,!1)}else u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA),u.blendColor(0,0,0,1),h||u.enable(u.BLEND),this.colorBuffer.bind(),c.attributes.color.pointer(u.UNSIGNED_BYTE,!1),this.charBuffer.bind(),c.attributes.char.pointer(u.UNSIGNED_BYTE,!1),c.uniforms.chars=this.charTexture.bind(0),c.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],c.uniforms.charsStep=this.charStep,c.uniforms.palette=this.paletteTexture.bind(1);this.sizeBuffer.bind(),c.attributes.size.pointer(u.FLOAT,!1,8,0),e||c.attributes.border.pointer(u.FLOAT,!1,8,4),this.positionBuffer.bind(),c.attributes.positionHi.pointer(u.FLOAT,!1,16,0),c.attributes.positionLo.pointer(u.FLOAT,!1,16,8),c.uniforms.pixelRatio=r.pixelRatio,c.uniforms.scaleHi=_,c.uniforms.scaleLo=w,c.uniforms.translateHi=M,c.uniforms.translateLo=k,c.uniforms.viewBox=r.viewBox;var d=this.scales;if(a)for(var p=d.length-1;p>=0;p--){var m=d[p];if(!(m.pixelSize&&m.pixelSize<1.25*o&&p>1)){var g=m.offset,v=m.count+g,y=b.ge(this.xCoords,s,g,v-1),x=b.lt(this.xCoords,l,y,v-1)+1;x>y&&u.drawArrays(u.POINTS,y,x-y)}}else u.drawArrays(u.POINTS,0,n);if(e)return t+n;h?u.blendFunc(u.ONE,u.ONE_MINUS_SRC_ALPHA):u.disable(u.BLEND)},x.draw=x.drawPick,x.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r<n||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},x.update=function(t){t=t||{};var e=t.positions||[],r=t.colors||[],n=t.glyphs||[],i=t.sizes||[],a=t.borderWidths||[],o=t.borderColors||[],s=this.plot.gl,l=this.pointCount,u=l>this.snapThreshold;if(null!=t.positions){this.points=e,l=this.points.length/2,u=l>this.snapThreshold;var c=h.mallocFloat32(2*l),f=h.mallocFloat64(2*l),m=h.mallocUint32(l),b=h.mallocFloat32(4*l);f.set(this.points),u&&(this.i2idx&&h.free(this.i2idx),this.i2idx=h.mallocInt32(l),this.scales=d(f,this.i2idx,c)),this.pointCount=l;for(var x=0;x<l;++x){var _=u?this.i2idx[x]:x;m[x]=_;var w=e[2*_],M=e[2*_+1];b[4*x]=w,b[4*x+1]=M,b[4*x+2]=w-b[4*x],b[4*x+3]=M-b[4*x+1],this.xCoords[x]=w}this.idBuffer.update(m),this.positionBuffer.update(b),h.free(b),h.free(m),h.free(f),h.free(c)}for(var k=h.mallocFloat32(2*l),A=h.mallocUint8(2*l),T=h.mallocUint8(2*l),S={},E=[],L=[],C=[],x=0,I=l,z=0;x<I;++x){var D=[255*r[4*x],255*r[4*x+1],255*r[4*x+2],255*r[4*x+3]],P=g(D,!1);null==S[P]&&(S[P]=z++,L.push(D[0]),L.push(D[1]),L.push(D[2]),L.push(D[3])),E.push(P),o&&o.length&&(D=[255*o[4*x],255*o[4*x+1],255*o[4*x+2],255*o[4*x+3]],P=g(D,!1),null==S[P]&&(S[P]=z++,L.push(D[0]),L.push(D[1]),L.push(D[2]),L.push(D[3])),C.push(P))}for(var O={},x=0,I=l,z=0;x<I;x++){var R=n[x];null==O[R]&&(O[R]=z++)}for(var F=0,x=0,I=i.length;x<I;++x)i[x]>F&&(F=i[x]);var j=this.charStep;this.charStep=y(Math.ceil(4*F),128,768);var N=Object.keys(O),B=this.charStep,U=Math.floor(B/2),V=s.getParameter(s.MAX_TEXTURE_SIZE),H=V/B*(V/B),q=Math.min(V,B*N.length),G=Math.min(V,B*Math.ceil(B*N.length/V)),Y=Math.floor(q/B);N.length>H&&console.warn(\"gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it.\"),this.chars&&this.chars+\"\"==N+\"\"&&this.charStep==j||(this.charCanvas=p({canvas:this.charCanvas,family:\"sans-serif\",size:U,shape:[q,G],step:[B,B],chars:N,align:!0,fit:this.charFit}),this.chars=N);for(var x=0;x<l;++x){var _=u?this.i2idx[x]:x,W=i[_],X=a[_];k[2*x]=2*W,k[2*x+1]=X;var P=E[_],Z=S[P];A[2*x]=Z;var J=C[_],K=S[J];A[2*x+1]=K;var R=n[_],Q=O[R];T[2*x+1]=Math.floor(Q/Y),T[2*x]=Q%Y}this.sizeBuffer.update(k),this.colorBuffer.update(A),this.charBuffer.update(T),this.charTexture.shape=[this.charCanvas.width,this.charCanvas.height],this.charCanvas&&this.charCanvas.width&&this.charTexture.setPixels(this.charCanvas),this.paletteTexture.setPixels(v(L.slice(0,1024),[256,1,4])),h.free(k),h.free(A),h.free(T)},x.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.sizeBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.charBuffer.dispose(),this.plot.removeObject(this)}},{\"./lib/shaders\":232,\"binary-search-bounds\":233,clamp:88,\"color-id\":92,\"font-atlas-sdf\":134,\"gl-buffer\":156,\"gl-shader\":234,\"gl-texture2d\":267,ndarray:467,\"snap-points-2d\":242,\"typedarray-pool\":541}],244:[function(t,e,r){r.pointVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nattribute vec2 positionHi, positionLo;\\nattribute float weight;\\n\\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\\nuniform float pointSize, useWeight;\\n\\nvarying float fragWeight;\\n\\n\\nvec4 pfx_1_0(vec2 scaleHi, vec2 scaleLo, vec2 translateHi, vec2 translateLo, vec2 positionHi, vec2 positionLo) {\\n return vec4((positionHi + translateHi) * scaleHi\\n + (positionLo + translateLo) * scaleHi\\n + (positionHi + translateHi) * scaleLo\\n + (positionLo + translateLo) * scaleLo, 0.0, 1.0);\\n}\\n\\nvoid main() {\\n gl_Position = pfx_1_0(scaleHi, scaleLo, translateHi, translateLo, positionHi, positionLo);\\n gl_PointSize = pointSize;\\n fragWeight = mix(1.0, weight, useWeight);\\n}\",r.pointFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color, borderColor;\\nuniform float centerFraction;\\n\\nvarying float fragWeight;\\n\\nfloat smoothStep(float x, float y) {\\n return 1.0 / (1.0 + exp(50.0*(x - y)));\\n}\\n\\nvoid main() {\\n float radius = length(2.0*gl_PointCoord.xy-1.0);\\n if(radius > 1.0) {\\n discard;\\n }\\n vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\\n float alpha = 1.0 - pow(1.0 - baseColor.a, fragWeight);\\n gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\\n}\\n\",r.pickVertex=\"precision highp float;\\n#define GLSLIFY 1\\n\\nvec4 pfx_1_0(vec2 scaleHi, vec2 scaleLo, vec2 translateHi, vec2 translateLo, vec2 positionHi, vec2 positionLo) {\\n return vec4((positionHi + translateHi) * scaleHi\\n + (positionLo + translateLo) * scaleHi\\n + (positionHi + translateHi) * scaleLo\\n + (positionLo + translateLo) * scaleLo, 0.0, 1.0);\\n}\\n\\nattribute vec2 positionHi, positionLo;\\nattribute vec4 pickId;\\n\\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\\nuniform float pointSize;\\nuniform vec4 pickOffset;\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n\\n vec4 id = pickId + pickOffset;\\n id.y += floor(id.x / 256.0);\\n id.x -= floor(id.x / 256.0) * 256.0;\\n\\n id.z += floor(id.y / 256.0);\\n id.y -= floor(id.y / 256.0) * 256.0;\\n\\n id.w += floor(id.z / 256.0);\\n id.z -= floor(id.z / 256.0) * 256.0;\\n\\n gl_Position = pfx_1_0(scaleHi, scaleLo, translateHi, translateLo, positionHi, positionLo);\\n gl_PointSize = pointSize;\\n fragId = id;\\n}\",r.pickFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragId;\\n\\nvoid main() {\\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\\n if(radius > 1.0) {\\n discard;\\n }\\n gl_FragColor = fragId / 255.0;\\n}\"},{}],245:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84}],246:[function(t,e,r){arguments[4][241][0].apply(r,arguments)},{dup:241}],247:[function(t,e,r){arguments[4][242][0].apply(r,arguments)},{\"./lib/sort\":246,dup:242,\"typedarray-pool\":541}],248:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){this.plot=t,this.positionBufferHi=e,this.positionBufferLo=r,this.pickBuffer=n,this.weightBuffer=i,this.shader=a,this.pickShader=o,this.scales=[],this.size=12,this.borderSize=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0,this.points=null,this.xCoords=null,this.snapPoints=!0}function i(t,e){var r=t.gl,i=o(r),s=o(r),l=o(r),u=o(r),h=a(r,c.pointVertex,c.pointFragment),f=a(r,c.pickVertex,c.pickFragment),d=new n(t,i,s,l,u,h,f);return d.update(e),t.addObject(d),d}var a=t(\"gl-shader\"),o=t(\"gl-buffer\"),s=t(\"binary-search-bounds\"),l=t(\"snap-points-2d\"),u=t(\"typedarray-pool\"),c=t(\"./lib/shader\"),h=t(\"array-normalize\"),f=t(\"array-bounds\");e.exports=i;var d=n.prototype,p=new Float32Array(2),m=new Float32Array(2),g=new Float32Array(2),v=new Float32Array(2),y=[0,0,0,0];d.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBufferHi.dispose(),this.positionBufferLo.dispose(),this.pickBuffer.dispose(),this.xCoords&&u.free(this.xCoords),this.plot.removeObject(this)},d.update=function(t){function e(e,r){return e in t?t[e]:r}if(t=t||{},this.size=e(\"size\",12),this.color=e(\"color\",[1,0,0,1]).slice(),this.borderSize=e(\"borderSize\",1),this.borderColor=e(\"borderColor\",[0,0,0,1]).slice(),this.snapPoints=e(\"snapPoints\",!0),null!=t.positions){this.xCoords&&u.free(this.xCoords),this.points=t.positions;var r=this.points.length>>>1,n=u.mallocInt32(r),i=u.mallocFloat32(r),a=u.mallocFloat64(2*r);if(a.set(this.points),this.snapPoints)this.scales=l(a,n,i,this.bounds);else{this.bounds=f(a,2),h(a,2,this.bounds);for(var o=0;o<r;o++)n[o]=o,i[o]=1}var s=u.mallocFloat64(r),c=u.mallocFloat32(2*r),d=u.mallocFloat32(2*r);c.set(a);for(var o=0,p=0;o<r;o++,p+=2)d[p]=a[p]-c[p],d[p+1]=a[p+1]-c[p+1],s[o]=a[p];this.positionBufferHi.update(c),this.positionBufferLo.update(d),this.pickBuffer.update(n),this.weightBuffer.update(i),u.free(c),u.free(d),u.free(i),u.free(a),u.free(n),this.xCoords=s,this.pointCount=r,this.pickOffset=0}},d.draw=function(t){var e=void 0!==t,r=this.plot,n=e?this.pickShader:this.shader,i=this.scales,a=this.positionBufferHi,o=this.positionBufferLo,s=this.pickBuffer,l=this.bounds,u=this.size,c=this.borderSize,h=r.gl,f=e?r.pickPixelRatio:r.pixelRatio,d=r.viewBox,b=r.dataBox;if(0===this.pointCount)return t;var x=l[2]-l[0],_=l[3]-l[1],w=b[2]-b[0],M=b[3]-b[1],k=(d[2]-d[0])*f/r.pixelRatio,A=(d[3]-d[1])*f/r.pixelRatio,T=this.pixelSize=Math.min(w/k,M/A),S=2*x/w,E=2*_/M;p[0]=S,p[1]=E,m[0]=S-p[0],m[1]=E-p[1];var L=(l[0]-b[0]-.5*w)/x,C=(l[1]-b[1]-.5*M)/_;g[0]=L,g[1]=C,v[0]=L-g[0],v[1]=C-g[1],n.bind(),n.uniforms.scaleHi=p,n.uniforms.scaleLo=m,n.uniforms.translateHi=g,n.uniforms.translateLo=v,n.uniforms.color=this.color,n.uniforms.borderColor=this.borderColor,n.uniforms.pointSize=f*(u+c),n.uniforms.centerFraction=0===this.borderSize?2:u/(u+c+1.25),a.bind(),n.attributes.positionHi.pointer(),o.bind(),n.attributes.positionLo.pointer(),e?(this.pickOffset=t,y[0]=255&t,y[1]=t>>8&255,y[2]=t>>16&255,y[3]=t>>24&255,n.uniforms.pickOffset=y,s.bind(),n.attributes.pickId.pointer(h.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());var I=!0;if(this.snapPoints)for(var z=i.length-1;z>=0;z--){var D=i[z];if(!(D.pixelSize<T&&z>1)){var P=this.getVisibleRange(D),O=P[0],R=P[1];R>O&&h.drawArrays(h.POINTS,O,R-O),!e&&I&&(I=!1,n.uniforms.useWeight=0)}}else h.drawArrays(h.POINTS,0,this.pointCount);return t+this.pointCount},d.getVisibleRange=function(t){var e=this.plot.dataBox,r=this.bounds,n=this.pixelSize,i=this.size,a=this.plot.pixelRatio,o=r[2]-r[0];r[3],r[1];if(!t)for(var t,l=this.scales.length-1;l>=0&&(t=this.scales[l],t.pixelSize<n&&l>1);l--);var u=this.xCoords,c=(e[0]-r[0]-n*i*a)/o,h=(e[2]-r[0]+n*i*a)/o,f=t.offset,d=t.count+f,p=s.ge(u,c,f,d-1);return[p,s.lt(u,h,p,d-1)+1]},d.drawPick=d.draw,d.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{\"./lib/shader\":244,\"array-bounds\":44,\"array-normalize\":45,\"binary-search-bounds\":245,\"gl-buffer\":156,\"gl-shader\":255,\"snap-points-2d\":247,\"typedarray-pool\":541}],249:[function(t,e,r){\"use strict\";function n(t,e){var r=a[e];if(r||(r=a[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:\"center\",textBaseline:\"middle\",lineHeight:1,font:e}),o=i(t,{triangles:!0,textAlign:\"center\",textBaseline:\"middle\",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;l<n.positions.length;++l)for(var u=n.positions[l],c=0;c<2;++c)s[0][c]=Math.min(s[0][c],u[c]),s[1][c]=Math.max(s[1][c],u[c]);return r[t]=[o,n,s]}var i=t(\"vectorize-text\");e.exports=n;var a={}},{\"vectorize-text\":554}],250:[function(t,e,r){function n(t,e){var r=i(t,e),n=r.attributes;return n.position.location=0,n.color.location=1,n.glyph.location=2,n.id.location=3,r}var i=t(\"gl-shader\"),a=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\n\\nuniform vec4 highlightId;\\nuniform float highlightScale;\\nuniform mat4 model, view, projection;\\nuniform vec3 clipBounds[2];\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) || \\n any(greaterThan(position, clipBounds[1])) ) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n float scale = 1.0;\\n if(distance(highlightId, id) < 0.0001) {\\n scale = highlightScale;\\n }\\n\\n vec4 worldPosition = model * vec4(position, 1);\\n vec4 viewPosition = view * worldPosition;\\n viewPosition = viewPosition / viewPosition.w;\\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\\n \\n gl_Position = clipPosition;\\n interpColor = color;\\n pickId = id;\\n dataCoordinate = position;\\n }\\n}\",o=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\nuniform mat4 model, view, projection;\\nuniform vec2 screenSize;\\nuniform vec3 clipBounds[2];\\nuniform float highlightScale, pixelRatio;\\nuniform vec4 highlightId;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n float scale = pixelRatio;\\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\\n scale *= highlightScale;\\n }\\n\\n vec4 worldPosition = model * vec4(position, 1.0);\\n vec4 viewPosition = view * worldPosition;\\n vec4 clipPosition = projection * viewPosition;\\n clipPosition /= clipPosition.w;\\n \\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\\n interpColor = color;\\n pickId = id;\\n dataCoordinate = position;\\n }\\n}\",s=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position;\\nattribute vec4 color;\\nattribute vec2 glyph;\\nattribute vec4 id;\\n\\nuniform float highlightScale;\\nuniform vec4 highlightId;\\nuniform vec3 axes[2];\\nuniform mat4 model, view, projection;\\nuniform vec2 screenSize;\\nuniform vec3 clipBounds[2];\\nuniform float scale, pixelRatio;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(position, clipBounds[0])) ||\\n any(greaterThan(position, clipBounds[1])) ) {\\n gl_Position = vec4(0,0,0,0);\\n } else {\\n float lscale = pixelRatio * scale;\\n if(distance(highlightId, id) < 0.0001) {\\n lscale *= highlightScale;\\n }\\n\\n vec4 clipCenter = projection * view * model * vec4(position, 1);\\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\\n\\n gl_Position = clipPosition;\\n interpColor = color;\\n pickId = id;\\n dataCoordinate = dataPosition;\\n }\\n}\\n\",l=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 fragClipBounds[2];\\nuniform float opacity;\\n\\nvarying vec4 interpColor;\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) ||\\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\\n discard;\\n } else {\\n gl_FragColor = interpColor * opacity;\\n }\\n}\\n\",u=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec3 fragClipBounds[2];\\nuniform float pickGroup;\\n\\nvarying vec4 pickId;\\nvarying vec3 dataCoordinate;\\n\\nvoid main() {\\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) || \\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\\n discard;\\n } else {\\n gl_FragColor = vec4(pickGroup, pickId.bgr);\\n }\\n}\",c=[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec4\"},{name:\"glyph\",type:\"vec2\"},{name:\"id\",type:\"vec4\"}],h={vertex:a,fragment:l,attributes:c},f={vertex:o,fragment:l,attributes:c},d={vertex:s,fragment:l,attributes:c},p={vertex:a,fragment:u,attributes:c},m={vertex:o,fragment:u,attributes:c},g={vertex:s,fragment:u,attributes:c};r.createPerspective=function(t){return n(t,h)},r.createOrtho=function(t){return n(t,f)},r.createProject=function(t){return n(t,d)},r.createPickPerspective=function(t){return n(t,p)},r.createPickOrtho=function(t){return n(t,m)},r.createPickProject=function(t){return n(t,g)}},{\"gl-shader\":255}],251:[function(t,e,r){\"use strict\";function n(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function i(t,e,r,i){return n(i,i,r),n(i,i,e),n(i,i,t)}function a(t,e){this.index=t,this.dataCoordinate=this.position=e}function o(t,e,r,n,i,o,s,l,u,c,h,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=o,this.glyphBuffer=s,this.idBuffer=l,this.vao=u,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=h,this.pickProjectShader=f,this.points=[],this._selectResult=new a(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}function s(t){return t[0]=t[1]=t[2]=0,t}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function u(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function c(t){for(var e=L,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}function h(t,e,r,n,a){var o,h=e.axesProject,f=e.gl,d=t.uniforms,p=r.model||x,m=r.view||x,g=r.projection||x,y=e.axesBounds,b=c(e.clipBounds);o=e.axes?e.axes.lastCubeProps.axis:[1,1,1],w[0]=2/f.drawingBufferWidth,w[1]=2/f.drawingBufferHeight,t.bind(),d.view=m,d.projection=g,d.screenSize=w,d.highlightId=e.highlightId,d.highlightScale=e.highlightScale,d.clipBounds=b,\n", | |
"d.pickGroup=e.pickId/255,d.pixelRatio=e.pixelRatio;for(var _=0;_<3;++_)if(h[_]&&e.projectOpacity[_]<1===n){d.scale=e.projectScale[_],d.opacity=e.projectOpacity[_];for(var L=S,C=0;C<16;++C)L[C]=0;for(var C=0;C<4;++C)L[5*C]=1;L[5*_]=0,o[_]<0?L[12+_]=y[0][_]:L[12+_]=y[1][_],v(L,p,L),d.model=L;var I=(_+1)%3,z=(_+2)%3,D=s(M),P=s(k);D[I]=1,P[z]=1;var O=i(g,m,p,l(A,D)),R=i(g,m,p,l(T,P));if(Math.abs(O[1])>Math.abs(R[1])){var F=O;O=R,R=F,F=D,D=P,P=F;var j=I;I=z,z=j}O[0]<0&&(D[I]=-1),R[1]>0&&(P[z]=-1);for(var N=0,B=0,C=0;C<4;++C)N+=Math.pow(p[4*I+C],2),B+=Math.pow(p[4*z+C],2);D[I]/=Math.sqrt(N),P[z]/=Math.sqrt(B),d.axes[0]=D,d.axes[1]=P,d.fragClipBounds[0]=u(E,b[0],_,-1e8),d.fragClipBounds[1]=u(E,b[1],_,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function f(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=z,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}h(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),h=p(e),f=p(e),d=m(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:h,size:2,type:e.FLOAT},{buffer:f,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new o(e,r,n,i,u,c,h,f,d,a,s,l);return g.update(t),g}var p=t(\"gl-buffer\"),m=t(\"gl-vao\"),g=t(\"typedarray-pool\"),v=t(\"gl-mat4/multiply\"),y=t(\"./lib/shaders\"),b=t(\"./lib/glyphs\"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],k=[0,0,0],A=[0,0,0,1],T=[0,0,0,1],S=x.slice(),E=[0,0,0],L=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],I=[1e8,1e8,1e8],z=[C,I];_.draw=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){f(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(t=t||{},\"perspective\"in t&&(this.useOrtho=!t.perspective),\"orthographic\"in t&&(this.useOrtho=!!t.orthographic),\"lineWidth\"in t&&(this.lineWidth=t.lineWidth),\"project\"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if(\"projectScale\"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(\"projectOpacity\"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}\"opacity\"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||\"normal\",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,u=t.color,c=t.size,h=t.angle,f=t.lineColor,d=0,p=0,m=0,v=n.length;t:for(var y=0;y<v;++y){for(var x=n[y],_=0;_<3;++_)if(isNaN(x[_])||!isFinite(x[_]))continue t;var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b(\"\\u25cf\",i);var M=w[0],k=w[1],A=w[2];p+=3*M.cells.length,m+=2*k.edges.length}var T=p+m,S=g.mallocFloat(3*T),E=g.mallocFloat(4*T),L=g.mallocFloat(2*T),C=g.mallocUint32(T),I=[0,a[1]],z=0,D=p,P=[0,0,0,1],O=[0,0,0,1],R=Array.isArray(u)&&Array.isArray(u[0]),F=Array.isArray(f)&&Array.isArray(f[0]);t:for(var y=0;y<v;++y){for(var x=n[y],_=0;_<3;++_){if(isNaN(x[_])||!isFinite(x[_])){d+=1;continue t}s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_])}var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b(\"\\u25cf\",i);var M=w[0],k=w[1],A=w[2];if(Array.isArray(u)){var j;if(j=R?u[y]:u,3===j.length){for(var _=0;_<3;++_)P[_]=j[_];P[3]=1}else if(4===j.length)for(var _=0;_<4;++_)P[_]=j[_]}else P[0]=P[1]=P[2]=0,P[3]=1;if(Array.isArray(f)){var j;if(j=F?f[y]:f,3===j.length){for(var _=0;_<3;++_)O[_]=j[_];O[_]=1}else if(4===j.length)for(var _=0;_<4;++_)O[_]=j[_]}else O[0]=O[1]=O[2]=0,O[3]=1;var N=.5;Array.isArray(c)?N=+c[y]:c?N=+c:this.useOrtho&&(N=12);var B=0;Array.isArray(h)?B=+h[y]:h&&(B=+h);for(var U=Math.cos(B),V=Math.sin(B),x=n[y],_=0;_<3;++_)s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_]);a[0]<0?I[0]=a[0]*(1+A[1][0]):a[0]>0&&(I[0]=-a[0]*(1+A[0][0]));for(var H=M.cells,q=M.positions,_=0;_<H.length;++_)for(var G=H[_],Y=0;Y<3;++Y){for(var W=0;W<3;++W)S[3*z+W]=x[W];for(var W=0;W<4;++W)E[4*z+W]=P[W];C[z]=d;var X=q[G[Y]];L[2*z]=N*(U*X[0]-V*X[1]+I[0]),L[2*z+1]=N*(V*X[0]+U*X[1]+I[1]),z+=1}for(var H=k.edges,q=k.positions,_=0;_<H.length;++_)for(var G=H[_],Y=0;Y<2;++Y){for(var W=0;W<3;++W)S[3*D+W]=x[W];for(var W=0;W<4;++W)E[4*D+W]=O[W];C[D]=d;var X=q[G[Y]];L[2*D]=N*(U*X[0]-V*X[1]+I[0]),L[2*D+1]=N*(V*X[0]+U*X[1]+I[1]),D+=1}d+=1}this.vertexCount=p,this.lineVertexCount=m,this.pointBuffer.update(S),this.colorBuffer.update(E),this.glyphBuffer.update(L),this.idBuffer.update(new Uint32Array(C)),g.free(S),g.free(E),g.free(L),g.free(C),this.bounds=[o,s],this.points=n,this.pointCount=n.length}},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{\"./lib/glyphs\":249,\"./lib/shaders\":250,\"gl-buffer\":156,\"gl-mat4/multiply\":183,\"gl-vao\":271,\"typedarray-pool\":541}],252:[function(t,e,r){\"use strict\";r.boxVertex=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec2 vertex;\\n\\nuniform vec2 cornerA, cornerB;\\n\\nvoid main() {\\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\\n}\\n\",r.boxFragment=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n gl_FragColor = color;\\n}\\n\"},{}],253:[function(t,e,r){\"use strict\";function n(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}function i(t,e){var r=t.gl,i=o(r,[0,0,0,1,1,0,1,1]),l=a(r,s.boxVertex,s.boxFragment),u=new n(t,i,l);return u.update(e),t.addOverlay(u),u}var a=t(\"gl-shader\"),o=t(\"gl-buffer\"),s=t(\"./lib/shaders\");e.exports=i;var l=n.prototype;l.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),i=(this.outerFill,this.outerColor),a=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,h=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],f=(e[1]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1],d=(e[2]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],p=(e[3]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1];if(h=Math.max(h,u[0]),f=Math.max(f,u[1]),d=Math.min(d,u[2]),p=Math.min(p,u[3]),!(d<h||p<f)){o.bind();var m=s[2]-s[0],g=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,m,f,i),o.drawBox(0,f,h,p,i),o.drawBox(0,p,m,g,i),o.drawBox(d,f,m,p,i)),this.innerFill&&o.drawBox(h,f,d,p,n),r>0){var v=r*c;o.drawBox(h-v,f-v,d+v,f+v,a),o.drawBox(h-v,p-v,d+v,p+v,a),o.drawBox(h-v,f-v,h+v,p+v,a),o.drawBox(d-v,f-v,d+v,p+v,a)}}}},l.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{\"./lib/shaders\":252,\"gl-buffer\":156,\"gl-shader\":255}],254:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function i(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}function a(t,e){return new i(t,o(t,e),s.mallocUint8(e[0]*e[1]*4))}e.exports=a;var o=t(\"gl-fbo\"),s=t(\"typedarray-pool\"),l=t(\"ndarray\"),u=t(\"bit-twiddle\").nextPow2,c=t(\"cwise/lib/wrapper\")({args:[\"array\",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},\"scalar\",\"scalar\",\"index\"],pre:{body:\"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}\",args:[],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[]},body:{body:\"{if(_inline_49_arg0_<255||_inline_49_arg1_<255||_inline_49_arg2_<255||_inline_49_arg3_<255){var _inline_49_l=_inline_49_arg4_-_inline_49_arg6_[0],_inline_49_a=_inline_49_arg5_-_inline_49_arg6_[1],_inline_49_f=_inline_49_l*_inline_49_l+_inline_49_a*_inline_49_a;_inline_49_f<this_closestD2&&(this_closestD2=_inline_49_f,this_closestX=_inline_49_arg6_[0],this_closestY=_inline_49_arg6_[1])}}\",args:[{name:\"_inline_49_arg0_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_49_arg1_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_49_arg2_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_49_arg3_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_49_arg4_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_49_arg5_\",lvalue:!1,rvalue:!0,count:1},{name:\"_inline_49_arg6_\",lvalue:!1,rvalue:!0,count:4}],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[\"_inline_49_a\",\"_inline_49_f\",\"_inline_49_l\"]},post:{body:\"{return[this_closestX,this_closestY,this_closestD2]}\",args:[],thisVars:[\"this_closestD2\",\"this_closestX\",\"this_closestY\"],localVars:[]},debug:!1,funcName:\"cwise\",blockSize:64}),h=i.prototype;Object.defineProperty(h,\"shape\",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;i<r*e*4;++i)n[i]=255}return t}}}),h.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},h.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},h.query=function(t,e,r){if(!this.gl)return null;var i=this.fbo.shape.slice();t|=0,e|=0,\"number\"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),i[0]),o=0|Math.min(Math.max(t+r,0),i[0]),s=0|Math.min(Math.max(e-r,0),i[1]),u=0|Math.min(Math.max(e+r,0),i[1]);if(o<=a||u<=s)return null;var h=[o-a,u-s],f=l(this.buffer,[h[0],h[1],4],[4,4*i[0],1],4*(a+i[0]*s)),d=c(f.hi(h[0],h[1],1),r,r),p=d[0],m=d[1];return p<0||Math.pow(this.radius,2)<d[2]?null:new n(p+a|0,m+s|0,f.get(p,m,0),[f.get(p,m,1),f.get(p,m,2),f.get(p,m,3)],Math.sqrt(d[2]))},h.dispose=function(){this.gl&&(this.fbo.dispose(),s.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{\"bit-twiddle\":67,\"cwise/lib/wrapper\":113,\"gl-fbo\":164,ndarray:467,\"typedarray-pool\":541}],255:[function(t,e,r){\"use strict\";function n(t){this.gl=t,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name<e.name?-1:1}function a(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}var o=t(\"./lib/create-uniforms\"),s=t(\"./lib/create-attributes\"),l=t(\"./lib/reflect\"),u=t(\"./lib/shader-cache\"),c=t(\"./lib/runtime-reflect\"),h=t(\"./lib/GLError\"),f=n.prototype;f.bind=function(){this.program||this._relink(),this.gl.useProgram(this.program)},f.dispose=function(){this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},f.update=function(t,e,r,n){function a(){d.program=u.program(p,d._vref,d._fref,x,_);for(var t=0;t<r.length;++t)E[t]=p.getUniformLocation(d.program,r[t].name)}if(!e||1===arguments.length){var f=t;t=f.vertex,e=f.fragment,r=f.uniforms,n=f.attributes}var d=this,p=d.gl,m=d._vref;d._vref=u.shader(p,p.VERTEX_SHADER,t),m&&m.dispose(),d.vertShader=d._vref.shader;var g=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),g&&g.dispose(),d.fragShader=d._fref.shader,!r||!n){var v=p.createProgram();if(p.attachShader(v,d.fragShader),p.attachShader(v,d.vertShader),p.linkProgram(v),!p.getProgramParameter(v,p.LINK_STATUS)){var y=p.getProgramInfoLog(v);throw new h(y,\"Error linking program:\"+y)}r=r||c.uniforms(p,v),n=n||c.attributes(p,v),p.deleteProgram(v)}n=n.slice(),n.sort(i);for(var b=[],x=[],_=[],w=0;w<n.length;++w){var M=n[w];if(M.type.indexOf(\"mat\")>=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T<k;++T)A[T]=_.length,x.push(M.name+\"[\"+T+\"]\"),\"number\"==typeof M.location?_.push(M.location+T):Array.isArray(M.location)&&M.location.length===k&&\"number\"==typeof M.location[T]?_.push(0|M.location[T]):_.push(-1);b.push({name:M.name,type:M.type,locations:A})}else b.push({name:M.name,type:M.type,locations:[_.length]}),x.push(M.name),\"number\"==typeof M.location?_.push(0|M.location):_.push(-1)}for(var S=0,w=0;w<_.length;++w)if(_[w]<0){for(;_.indexOf(S)>=0;)S+=1;_[w]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,\"uniforms\",o(p,d,r,E))},e.exports=a},{\"./lib/GLError\":256,\"./lib/create-attributes\":257,\"./lib/create-uniforms\":258,\"./lib/reflect\":259,\"./lib/runtime-reflect\":260,\"./lib/shader-cache\":261}],256:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{dup:213}],257:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{\"./GLError\":256,dup:214}],258:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{\"./GLError\":256,\"./reflect\":259,dup:215}],259:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{dup:216}],260:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],261:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{\"./GLError\":256,dup:218,\"gl-format-compiler-error\":165,\"weakmap-shim\":562}],262:[function(t,e,r){\"use strict\";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function i(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=i;var a=n.prototype;a.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&a.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&a.drawLine(l,u,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],263:[function(t,e,r){\"use strict\";var n=t(\"gl-shader\");e.exports=function(t){return n(t,\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec3 position, color;\\nattribute float weight;\\n\\nuniform mat4 model, view, projection;\\nuniform vec3 coordinates[3];\\nuniform vec4 colors[3];\\nuniform vec2 screenShape;\\nuniform float lineWidth;\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n vec3 vertexPosition = mix(coordinates[0],\\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\\n\\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\\n vec2 delta = weight * clipOffset * screenShape;\\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\\n\\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\\n}\\n\",\"precision mediump float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n gl_FragColor = fragColor;\\n}\",null,[{name:\"position\",type:\"vec3\"},{name:\"color\",type:\"vec3\"},{name:\"weight\",type:\"float\"}])}},{\"gl-shader\":255}],264:[function(t,e,r){\"use strict\";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function i(t,e){function r(t,e,r,n,a,o){var s=[t,e,r,0,0,0,1];s[n+3]=1,s[n]=a,i.push.apply(i,s),s[6]=-1,i.push.apply(i,s),s[n]=o,i.push.apply(i,s),i.push.apply(i,s),s[6]=1,i.push.apply(i,s),s[n]=a,i.push.apply(i,s)}var i=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=a(t,i),u=o(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=s(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var h=new n(t,l,u,c);return h.update(e),h}var a=t(\"gl-buffer\"),o=t(\"gl-vao\"),s=t(\"./shaders/index\");e.exports=i;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=n.prototype,c=[0,0,0],h=[0,0,0],f=[0,0];u.isTransparent=function(){return!1},u.drawTransparent=function(t){},u.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||l,o=t.view||l,s=t.projection||l;this.axes&&(i=this.axes.lastCubeProps.axis);for(var u=c,d=h,p=0;p<3;++p)i&&i[p]<0?(u[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(u[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,u,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(var p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},u.update=function(t){t&&(\"bounds\"in t&&(this.bounds=t.bounds),\"position\"in t&&(this.position=t.position),\"lineWidth\"in t&&(this.lineWidth=t.lineWidth),\"colors\"in t&&(this.colors=t.colors),\"enabled\"in t&&(this.enabled=t.enabled),\"drawSides\"in t&&(this.drawSides=t.drawSides))},u.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{\"./shaders/index\":263,\"gl-buffer\":156,\"gl-vao\":271}],265:[function(t,e,r){var n=t(\"gl-shader\"),i=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec4 uv;\\nattribute vec3 f;\\nattribute vec3 normal;\\n\\nuniform mat4 model, view, projection, inverseModel;\\nuniform vec3 lightPosition, eyePosition;\\nuniform sampler2D colormap;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n worldCoordinate = vec3(uv.zw, f.x);\\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\\n vec4 clipPosition = projection * view * worldPosition;\\n gl_Position = clipPosition;\\n kill = f.y;\\n value = f.z;\\n planeCoordinate = uv.xy;\\n\\n vColor = texture2D(colormap, vec2(value, value));\\n\\n //Lighting geometry parameters\\n vec4 cameraCoordinate = view * worldPosition;\\n cameraCoordinate.xyz /= cameraCoordinate.w;\\n lightDirection = lightPosition - cameraCoordinate.xyz;\\n eyeDirection = eyePosition - cameraCoordinate.xyz;\\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\\n}\\n\",a=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nfloat beckmannDistribution_2_0(float x, float roughness) {\\n float NdotH = max(x, 0.0001);\\n float cos2Alpha = NdotH * NdotH;\\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\\n float roughness2 = roughness * roughness;\\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\\n return exp(tan2Alpha / roughness2) / denom;\\n}\\n\\n\\n\\nfloat beckmannSpecular_1_1(\\n vec3 lightDirection,\\n vec3 viewDirection,\\n vec3 surfaceNormal,\\n float roughness) {\\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\\n}\\n\\n\\n\\nuniform vec3 lowerBound, upperBound;\\nuniform float contourTint;\\nuniform vec4 contourColor;\\nuniform sampler2D colormap;\\nuniform vec3 clipBounds[2];\\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\\nuniform float vertexColor;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n if (kill > 0.0 ||\\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\\n discard;\\n }\\n\\n vec3 N = normalize(surfaceNormal);\\n vec3 V = normalize(eyeDirection);\\n vec3 L = normalize(lightDirection);\\n\\n if(gl_FrontFacing) {\\n N = -N;\\n }\\n\\n float specular = max(beckmannSpecular_1_1(L, V, N, roughness), 0.);\\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\\n\\n //decide how to interpolate color \\u2014 in vertex or in fragment\\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\\n\\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\\n\\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\\n}\\n\",o=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nattribute vec4 uv;\\nattribute float f;\\n\\nuniform mat3 permutation;\\nuniform mat4 model, view, projection;\\nuniform float height, zOffset;\\nuniform sampler2D colormap;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\\nvarying vec4 vColor;\\n\\nvoid main() {\\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\\n\\n vec4 clipPosition = projection * view * worldPosition;\\n clipPosition.z = clipPosition.z + zOffset;\\n\\n gl_Position = clipPosition;\\n value = f;\\n kill = -1.0;\\n worldCoordinate = dataCoordinate;\\n planeCoordinate = uv.zw;\\n\\n vColor = texture2D(colormap, vec2(value, value));\\n\\n //Don't do lighting for contours\\n surfaceNormal = vec3(1,0,0);\\n eyeDirection = vec3(0,1,0);\\n lightDirection = vec3(0,0,1);\\n}\\n\",s=\"precision mediump float;\\n#define GLSLIFY 1\\n\\nuniform vec2 shape;\\nuniform vec3 clipBounds[2];\\nuniform float pickId;\\n\\nvarying float value, kill;\\nvarying vec3 worldCoordinate;\\nvarying vec2 planeCoordinate;\\nvarying vec3 surfaceNormal;\\n\\nvec2 splitFloat(float v) {\\n float vh = 255.0 * v;\\n float upper = floor(vh);\\n float lower = fract(vh);\\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\\n}\\n\\nvoid main() {\\n if(kill > 0.0 ||\\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\\n discard;\\n }\\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\\n}\\n\";r.createShader=function(t){var e=n(t,i,a,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"vec3\"},{name:\"normal\",type:\"vec3\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"float\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:\"uv\",type:\"vec4\"},{name:\"f\",type:\"float\"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{\"gl-shader\":255}],266:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}function i(t){var e=x([y({colormap:t,nshades:R,format:\"rgba\"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return b.divseq(e,255),e}function a(t,e,r,i,a,o,s,l,u,c,h,f,d,p){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=i,this._pickShader=a,this._coordinateBuffer=o,this._vao=s,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new n([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=p,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[_(v.mallocFloat(1024),[0,0]),_(v.mallocFloat(1024),[0,0]),_(v.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}function o(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||j,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=N.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],M(l,t.model,l);var u=N.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return N.showSurface=o,N.showContour=s,N}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||D,n.view=t.view||D,n.projection=t.projection||D,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=k(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],s=0;s<3;++s)a[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=V,n.vertexColor=this.vertexColor;var l=U;for(M(l,n.view,n.model),M(l,n.projection,l),k(l,l),i=0;i<3;++i)n.eyePosition[i]=l[12+i]/l[15];var u=l[15];for(i=0;i<3;++i)u+=this.lightPosition[i]*l[4*i+3];for(i=0;i<3;++i){var c=l[12+i];for(s=0;s<3;++s)c+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=c/u}var h=o(n,this);if(h.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=h.projections[i],this._shader.uniforms.clipBounds=h.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(f.uniforms.permutation=O[i],r.lineWidth(this.contourWidth[i]),s=0;s<this.contourLevels[i].length;++s)this._contourCounts[i][s]&&(s===this.highlightLevel[i]?(f.uniforms.contourColor=this.highlightColor[i],f.uniforms.contourTint=this.highlightTint[i]):0!==s&&s-1!==this.highlightLevel[i]||(f.uniforms.contourColor=this.contourColor[i],f.uniforms.contourTint=this.contourTint[i]),f.uniforms.height=this.contourLevels[i][s],d.draw(r.LINES,this._contourCounts[i][s],this._contourOffsets[i][s]));for(i=0;i<3;++i)for(f.uniforms.model=h.projections[i],f.uniforms.clipBounds=h.clipBounds[i],s=0;s<3;++s)if(this.contourProject[i][s]){f.uniforms.permutation=O[s],r.lineWidth(this.contourWidth[s]);for(var p=0;p<this.contourLevels[s].length;++p)p===this.highlightLevel[s]?(f.uniforms.contourColor=this.highlightColor[s],f.uniforms.contourTint=this.highlightTint[s]):0!==p&&p-1!==this.highlightLevel[s]||(f.uniforms.contourColor=this.contourColor[s],f.uniforms.contourTint=this.contourTint[s]),f.uniforms.height=this.contourLevels[s][p],d.draw(r.LINES,this._contourCounts[s][p],this._contourOffsets[s][p])}for(d=this._dynamicVAO,d.bind(),i=0;i<3;++i)if(0!==this._dynamicCounts[i])for(f.uniforms.model=n.model,f.uniforms.clipBounds=n.clipBounds,f.uniforms.permutation=O[i],r.lineWidth(this.dynamicWidth[i]),f.uniforms.contourColor=this.dynamicColor[i],f.uniforms.contourTint=this.dynamicTint[i],f.uniforms.height=this.dynamicLevel[i],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),s=0;s<3;++s)this.contourProject[s][i]&&(f.uniforms.model=h.projections[s],f.uniforms.clipBounds=h.clipBounds[s],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));d.unbind()}}function l(t,e){var r=e.shape.slice(),n=t.shape.slice();b.assign(t.lo(1,1).hi(r[0],r[1]),e),b.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),b.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),b.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),b.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))}function u(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function c(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function h(t){if(Array.isArray(t)){if(Array.isArray(t))return[c(t[0]),c(t[1]),c(t[2])];var e=c(t);return[e.slice(),e.slice(),e.slice()]}}function f(t){var e=t.gl,r=E(e),n=C(e),i=L(e),o=I(e),s=p(e),l=m(e,[{buffer:s,size:4,stride:z,offset:0},{buffer:s,size:3,stride:z,offset:16},{buffer:s,size:3,stride:z,offset:28}]),u=p(e),c=m(e,[{buffer:u,size:4,stride:20,offset:0},{buffer:u,size:1,stride:20,offset:16}]),h=p(e),f=m(e,[{buffer:h,size:2,type:e.FLOAT}]),d=g(e,1,R,e.RGBA,e.UNSIGNED_BYTE);d.minFilter=e.LINEAR,d.magFilter=e.LINEAR;var v=new a(e,[0,0],[[0,0,0],[0,0,0]],r,n,s,l,d,i,o,u,c,h,f),y={levels:[[],[],[]]};for(var b in t)y[b]=t[b];return y.colormap=y.colormap||\"jet\",v.update(y),v}e.exports=f\n", | |
";var d=t(\"bit-twiddle\"),p=t(\"gl-buffer\"),m=t(\"gl-vao\"),g=t(\"gl-texture2d\"),v=t(\"typedarray-pool\"),y=t(\"colormap\"),b=t(\"ndarray-ops\"),x=t(\"ndarray-pack\"),_=t(\"ndarray\"),w=t(\"surface-nets\"),M=t(\"gl-mat4/multiply\"),k=t(\"gl-mat4/invert\"),A=t(\"binary-search-bounds\"),T=t(\"ndarray-gradient\"),S=t(\"./lib/shaders\"),E=S.createShader,L=S.createContourShader,C=S.createPickShader,I=S.createPickContourShader,z=40,D=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],O=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var t=0;t<3;++t){var e=O[t],r=(t+1)%3,n=(t+2)%3;e[r+0]=1,e[n+3]=1,e[t+6]=1}}();var R=256,F=a.prototype;F.isTransparent=function(){return this.opacity<1},F.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},F.pickSlots=1,F.setPickBase=function(t){this.pickId=t};var j=[0,0,0],N={showSurface:!1,showContour:!1,projections:[D.slice(),D.slice(),D.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:D,view:D,projection:D,inverseModel:D.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},U=D.slice(),V=[1,0,0,0,1,0,0,0,1];F.draw=function(t){return s.call(this,t,!1)},F.drawTransparent=function(t){return s.call(this,t,!0)};var H={model:D,view:D,projection:D,inverseModel:D,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};F.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=H;r.model=t.model||D,r.view=t.view||D,r.projection=t.projection||D,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=V;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var u=this._contourVAO;for(u.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=O[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(l.uniforms.height=this.contourLevels[a][n],u.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(l.uniforms.model=s.projections[n],l.uniforms.clipBounds=s.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){l.uniforms.permutation=O[a],e.lineWidth(this.contourWidth[a]);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(l.uniforms.height=this.contourLevels[a][c],u.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}u.unbind()}},F.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var h=c?a:1-a,f=0;f<2;++f)for(var d=f?l:1-l,p=i+c,m=s+f,g=h*d,v=0;v<3;++v)u[v]+=this._field[v].get(p,m)*g;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=A.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]<this.contourLevels[b].length-1){var x=this.contourLevels[b][y[b]],_=this.contourLevels[b][y[b]+1];Math.abs(x-u[b])>Math.abs(_-u[b])&&(y[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},F.update=function(t){t=t||{},this.dirty=!0,\"contourWidth\"in t&&(this.contourWidth=u(t.contourWidth,Number)),\"showContour\"in t&&(this.showContour=u(t.showContour,Boolean)),\"showSurface\"in t&&(this.showSurface=!!t.showSurface),\"contourTint\"in t&&(this.contourTint=u(t.contourTint,Boolean)),\"contourColor\"in t&&(this.contourColor=h(t.contourColor)),\"contourProject\"in t&&(this.contourProject=u(t.contourProject,function(t){return u(t,Boolean)})),\"surfaceProject\"in t&&(this.surfaceProject=t.surfaceProject),\"dynamicColor\"in t&&(this.dynamicColor=h(t.dynamicColor)),\"dynamicTint\"in t&&(this.dynamicTint=u(t.dynamicTint,Number)),\"dynamicWidth\"in t&&(this.dynamicWidth=u(t.dynamicWidth,Number)),\"opacity\"in t&&(this.opacity=t.opacity),\"colorBounds\"in t&&(this.colorBounds=t.colorBounds),\"vertexColor\"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),\"field\"in t||\"coords\"in t){var n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(v.freeFloat(this._field[2].data),this._field[2].data=v.mallocFloat(d.nextPow2(n))),this._field[2]=_(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(v.freeFloat(this._field[o].data),this._field[o].data=v.mallocFloat(this._field[2].size)),this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var s=t.coords;if(!Array.isArray(s)||3!==s.length)throw new Error(\"gl-surface: invalid coordinates for x/y\");for(o=0;o<2;++o){var c=s[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error(\"gl-surface: coords have incorrect shape\");l(this._field[o],c)}}else if(t.ticks){var f=t.ticks;if(!Array.isArray(f)||2!==f.length)throw new Error(\"gl-surface: invalid ticks\");for(o=0;o<2;++o){var p=f[o];if((Array.isArray(p)||p.length)&&(p=_(p)),p.shape[0]!==a[o])throw new Error(\"gl-surface: invalid tick length\");var m=_(p.data,a);m.stride[o]=p.stride[0],m.stride[1^o]=0,l(this._field[o],m)}}else{for(o=0;o<2;++o){var g=[0,0];g[o]=1,this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2],g,0)}this._field[0].set(0,0,0);for(var y=0;y<a[0];++y)this._field[0].set(y+1,0,y);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),y=0;y<a[1];++y)this._field[1].set(0,y+1,y);this._field[1].set(0,a[1]+1,a[1]-1)}var b=this._field,x=_(v.mallocFloat(3*b[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)T(x.pick(o),b[o],\"mirror\");var M=_(v.mallocFloat(3*b[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(y=0;y<a[1]+2;++y){var k=x.get(0,o,y,0),A=x.get(0,o,y,1),S=x.get(1,o,y,0),E=x.get(1,o,y,1),L=x.get(2,o,y,0),C=x.get(2,o,y,1),I=S*C-E*L,z=L*A-C*k,D=k*E-A*S,O=Math.sqrt(I*I+z*z+D*D);O<1e-8?(O=Math.max(Math.abs(I),Math.abs(z),Math.abs(D)),O<1e-8?(D=1,z=I=0,O=1):O=1/O):O=1/Math.sqrt(O),M.set(o,y,0,I*O),M.set(o,y,1,z*O),M.set(o,y,2,D*O)}v.free(x.data);var R=[1/0,1/0,1/0],F=[-1/0,-1/0,-1/0],j=1/0,N=-1/0,B=(a[0]-1)*(a[1]-1)*6,U=v.mallocFloat(d.nextPow2(10*B)),V=0,H=0;for(o=0;o<a[0]-1;++o)t:for(y=0;y<a[1]-1;++y){for(var q=0;q<2;++q)for(var G=0;G<2;++G)for(var Y=0;Y<3;++Y){var W=this._field[Y].get(1+o+q,1+y+G);if(isNaN(W)||!isFinite(W))continue t}for(Y=0;Y<6;++Y){var X=o+P[Y][0],Z=y+P[Y][1],J=this._field[0].get(X+1,Z+1),K=this._field[1].get(X+1,Z+1);W=this._field[2].get(X+1,Z+1);var Q=W;I=M.get(X+1,Z+1,0),z=M.get(X+1,Z+1,1),D=M.get(X+1,Z+1,2),t.intensity&&(Q=t.intensity.get(X,Z)),U[V++]=X,U[V++]=Z,U[V++]=J,U[V++]=K,U[V++]=W,U[V++]=0,U[V++]=Q,U[V++]=I,U[V++]=z,U[V++]=D,R[0]=Math.min(R[0],J),R[1]=Math.min(R[1],K),R[2]=Math.min(R[2],W),j=Math.min(j,Q),F[0]=Math.max(F[0],J),F[1]=Math.max(F[1],K),F[2]=Math.max(F[2],W),N=Math.max(N,Q),H+=1}}for(t.intensityBounds&&(j=+t.intensityBounds[0],N=+t.intensityBounds[1]),o=6;o<V;o+=10)U[o]=(U[o]-j)/(N-j);this._vertexCount=H,this._coordinateBuffer.update(U.subarray(0,V)),v.freeFloat(U),v.free(M.data),this.bounds=[R,F],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===j&&this.intensityBounds[1]===N||(r=!0),this.intensityBounds=[j,N]}if(\"levels\"in t){var $=t.levels;for($=Array.isArray($[0])?$.slice():[[],[],$],o=0;o<3;++o)$[o]=$[o].slice(),$.sort(function(t,e){return t-e});t:for(o=0;o<3;++o){if($[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;y<$[o].length;++y)if($[o][y]!==this.contourLevels[o][y]){r=!0;break t}}this.contourLevels=$}if(r){b=this._field,a=this.shape;for(var tt=[],et=0;et<3;++et){$=this.contourLevels[et];var rt=[],nt=[],it=[0,0,0];for(o=0;o<$.length;++o){var at=w(this._field[et],$[o]);rt.push(tt.length/5|0),H=0;t:for(y=0;y<at.cells.length;++y){var ot=at.cells[y];for(Y=0;Y<2;++Y){var st=at.positions[ot[Y]],lt=st[0],ut=0|Math.floor(lt),ct=lt-ut,ht=st[1],ft=0|Math.floor(ht),dt=ht-ft,pt=!1;e:for(var mt=0;mt<3;++mt){it[mt]=0;var gt=(et+mt+1)%3;for(q=0;q<2;++q){var vt=q?ct:1-ct;for(X=0|Math.min(Math.max(ut+q,0),a[0]),G=0;G<2;++G){var yt=G?dt:1-dt;if(Z=0|Math.min(Math.max(ft+G,0),a[1]),W=mt<2?this._field[gt].get(X,Z):(this.intensity.get(X,Z)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(W)||isNaN(W)){pt=!0;break e}var bt=vt*yt;it[mt]+=bt*W}}}if(pt){if(Y>0){for(var xt=0;xt<5;++xt)tt.pop();H-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),H+=1}}nt.push(H)}this._contourOffsets[et]=rt,this._contourCounts[et]=nt}var _t=v.mallocFloat(tt.length);for(o=0;o<tt.length;++o)_t[o]=tt[o];this._contourBuffer.update(_t),v.freeFloat(_t)}t.colormap&&this._colorMap.setPixels(i(t.colormap))},F.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;t<3;++t)v.freeFloat(this._field[t].data)},F.highlight=function(t){if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(var e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;var r;if(r=this.snapToData?t.dataCoordinate:t.position,this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=v.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var s=(o+1)%3,l=(o+2)%3,u=this._field[o],c=this._field[s],h=this._field[l],f=(this.intensity,w(u,r[o])),d=f.cells,p=f.positions;for(this._dynamicOffsets[o]=n,e=0;e<d.length;++e)for(var m=d[e],g=0;g<2;++g){var y=p[m[g]],b=+y[0],x=0|b,_=0|Math.min(x+1,i[0]),M=b-x,k=1-M,A=+y[1],T=0|A,S=0|Math.min(T+1,i[1]),E=A-T,L=1-E,C=k*L,I=k*E,z=M*L,D=M*E,P=C*c.get(x,T)+I*c.get(x,S)+z*c.get(_,T)+D*c.get(_,S),O=C*h.get(x,T)+I*h.get(x,S)+z*h.get(_,T)+D*h.get(_,S);if(isNaN(P)||isNaN(O)){g&&(n-=1);break}a[2*n+0]=P,a[2*n+1]=O,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),v.freeFloat(a)}}},{\"./lib/shaders\":265,\"binary-search-bounds\":66,\"bit-twiddle\":67,colormap:99,\"gl-buffer\":156,\"gl-mat4/invert\":181,\"gl-mat4/multiply\":183,\"gl-texture2d\":267,\"gl-vao\":271,ndarray:467,\"ndarray-gradient\":458,\"ndarray-ops\":461,\"ndarray-pack\":462,\"surface-nets\":531,\"typedarray-pool\":541}],267:[function(t,e,r){\"use strict\";function n(t){v=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],y=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],b=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function i(t){return\"undefined\"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||\"undefined\"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||\"undefined\"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||\"undefined\"!=typeof ImageData&&t instanceof ImageData}function a(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error(\"gl-texture2d: Invalid texture size\");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function o(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function s(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function l(t,e,r,n,i,a,o,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error(\"gl-texture2d: Invalid ndarray, must be 2d or 3d\");var h=0,f=0,d=s(c,l.stride.slice());\"float32\"===u?h=t.FLOAT:\"float64\"===u?(h=t.FLOAT,d=!1,u=\"float32\"):\"uint8\"===u?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,d=!1,u=\"uint8\");if(2===c.length)f=t.LUMINANCE,c=[c[0],c[1],1],l=p(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error(\"gl-texture2d: Invalid shape for texture\");if(1===c[2])f=t.ALPHA;else if(2===c[2])f=t.LUMINANCE_ALPHA;else if(3===c[2])f=t.RGB;else{if(4!==c[2])throw new Error(\"gl-texture2d: Invalid shape for pixel coords\");f=t.RGBA}c[2]}if(f!==t.LUMINANCE&&f!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(f=i),f!==i)throw new Error(\"gl-texture2d: Incompatible texture format for setPixels\");var v=l.size,y=o.indexOf(n)<0;if(y&&o.push(n),h===a&&d)0===l.offset&&l.data.length===v?y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data):y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data.subarray(l.offset,l.offset+v)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data.subarray(l.offset,l.offset+v));else{var b;b=a===t.FLOAT?g.mallocFloat32(v):g.mallocUint8(v);var _=p(b,c,[c[2],c[2]*c[0],1]);h===t.FLOAT&&a===t.UNSIGNED_BYTE?x(_,l):m.assign(_,l),y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,b.subarray(0,v)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,b.subarray(0,v)),a===t.FLOAT?g.freeFloat32(b):g.freeUint8(b)}}function u(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function c(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error(\"gl-texture2d: Invalid texture shape\");if(i===t.FLOAT&&!t.getExtension(\"OES_texture_float\"))throw new Error(\"gl-texture2d: Floating point textures not supported on this platform\");var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new o(t,s,e,r,n,i)}function h(t,e,r,n,i,a){var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new o(t,s,r,n,i,a)}function f(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error(\"gl-texture2d: Invalid texture size\");var a=s(n,e.stride.slice()),l=0;\"float32\"===r?l=t.FLOAT:\"float64\"===r?(l=t.FLOAT,a=!1,r=\"float32\"):\"uint8\"===r?l=t.UNSIGNED_BYTE:(l=t.UNSIGNED_BYTE,a=!1,r=\"uint8\");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=p(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error(\"gl-texture2d: Invalid shape for texture\");if(1===n[2])c=t.ALPHA;else if(2===n[2])c=t.LUMINANCE_ALPHA;else if(3===n[2])c=t.RGB;else{if(4!==n[2])throw new Error(\"gl-texture2d: Invalid shape for pixel coords\");c=t.RGBA}}l!==t.FLOAT||t.getExtension(\"OES_texture_float\")||(l=t.UNSIGNED_BYTE,a=!1);var h,f,d=e.size;if(a)h=0===e.offset&&e.data.length===d?e.data:e.data.subarray(e.offset,e.offset+d);else{var v=[n[2],n[2]*n[0],1];f=g.malloc(d,r);var y=p(f,n,v,0);\"float32\"!==r&&\"float64\"!==r||l!==t.UNSIGNED_BYTE?m.assign(y,e):x(y,e),h=f.subarray(0,d)}var b=u(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,l,h),a||g.free(f),new o(t,b,n[0],n[1],c,l)}function d(t){if(arguments.length<=1)throw new Error(\"gl-texture2d: Missing arguments for texture2d constructor\");if(v||n(t),\"number\"==typeof arguments[1])return c(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return c(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(\"object\"==typeof arguments[1]){var e=arguments[1],r=i(e)?e:e.raw;if(r)return h(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return f(t,e)}throw new Error(\"gl-texture2d: Invalid arguments for texture2d constructor\")}var p=t(\"ndarray\"),m=t(\"ndarray-ops\"),g=t(\"typedarray-pool\");e.exports=d;var v=null,y=null,b=null,x=function(t,e){m.muls(t,e,255)},_=o.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension(\"OES_texture_float_linear\")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown filter mode \"+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension(\"OES_texture_float_linear\")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown filter mode \"+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension(\"EXT_texture_filter_anisotropic\");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown wrap mode \"+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error(\"gl-texture2d: Unknown wrap mode \"+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error(\"gl-texture2d: Must specify wrap mode for rows and columns\");for(var e=0;e<2;++e)if(b.indexOf(t[e])<0)throw new Error(\"gl-texture2d: Unknown wrap mode \"+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error(\"gl-texture2d: Invalid texture shape\")}else t=[0|t,0|t];return a(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,a(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,a(this,this._shape[0],t),t}}}),_.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},_.setPixels=function(t,e,r,n){var a=this.gl;this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0;var o=i(t)?t:t.raw;if(o){this._mipLevels.indexOf(n)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,o),this._mipLevels.push(n)):a.texSubImage2D(a.TEXTURE_2D,n,e,r,this.format,this.type,o)}else{if(!(t.shape&&t.stride&&t.data))throw new Error(\"gl-texture2d: Unsupported data type\");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>n||r+t.shape[0]>this._shape[0]>>>n||e<0||r<0)throw new Error(\"gl-texture2d: Texture dimensions are out of bounds\");l(a,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:467,\"ndarray-ops\":461,\"typedarray-pool\":541}],268:[function(t,e,r){\"use strict\";function n(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error(\"gl-vao: Too many vertex attributes\");for(var i=0;i<r.length;++i){var a=r[i];if(a.buffer){var o=a.buffer,s=a.size||4,l=a.type||t.FLOAT,u=!!a.normalized,c=a.stride||0,h=a.offset||0;o.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,u,c,h)}else{if(\"number\"==typeof a)t.vertexAttrib1f(i,a);else if(1===a.length)t.vertexAttrib1f(i,a[0]);else if(2===a.length)t.vertexAttrib2f(i,a[0],a[1]);else if(3===a.length)t.vertexAttrib3f(i,a[0],a[1],a[2]);else{if(4!==a.length)throw new Error(\"gl-vao: Invalid vertex attribute\");t.vertexAttrib4f(i,a[0],a[1],a[2],a[3])}t.disableVertexAttribArray(i)}}for(;i<n;++i)t.disableVertexAttribArray(i)}else{t.bindBuffer(t.ARRAY_BUFFER,null);for(var i=0;i<n;++i)t.disableVertexAttribArray(i)}}e.exports=n},{}],269:[function(t,e,r){\"use strict\";function n(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}function i(t){return new n(t)}var a=t(\"./do-bind.js\");n.prototype.bind=function(){a(this.gl,this._elements,this._attributes)},n.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=i},{\"./do-bind.js\":268}],270:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=a}function i(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}function a(t,e){return new i(t,e,e.createVertexArrayOES())}var o=t(\"./do-bind.js\");n.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},i.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},i.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},i.prototype.update=function(t,e,r){if(this.bind(),o(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var i=0;i<t.length;++i){var a=t[i];\"number\"==typeof a?this._attribs.push(new n(i,1,a)):Array.isArray(a)&&this._attribs.push(new n(i,a.length,a[0],a[1],a[2],a[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=a},{\"./do-bind.js\":268}],271:[function(t,e,r){\"use strict\";function n(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}function i(t,e,r,i){var s,l=t.createVertexArray?new n(t):t.getExtension(\"OES_vertex_array_object\");return s=l?a(t,l):o(t),s.update(e,r,i),s}var a=t(\"./lib/vao-native.js\"),o=t(\"./lib/vao-emulated.js\");e.exports=i},{\"./lib/vao-emulated.js\":269,\"./lib/vao-native.js\":270}],272:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}e.exports=n},{}],273:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],274:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],275:[function(t,e,r){function n(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}e.exports=n},{}],276:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],277:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}e.exports=n},{}],278:[function(t,e,r){function n(t,e,r,n){return i[0]=n,i[1]=r,i[2]=e,i[3]=t,a[0]}e.exports=n;var i=new Uint8Array(4),a=new Float32Array(i.buffer)},{}],279:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:i(t),r=0;r<e.length;r++){var n=e[r];if(\"preprocessor\"===n.type){var o=n.data.match(/\\#define\\s+SHADER_NAME(_B64)?\\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?a(l):l).trim()}}}}var i=t(\"glsl-tokenizer\"),a=t(\"atob-lite\");e.exports=n},{\"atob-lite\":48,\"glsl-tokenizer\":286}],280:[function(t,e,r){function n(t){function e(t){t.length&&V.push({type:M[B],data:t,position:G,line:H,column:q})}function r(t){j=0,X+=t,F=X.length;for(var e;O=X[j],j<F;){switch(e=j,B){case h:j=E();break;case f:j=S();break;case d:j=T();break;case p:j=L();break;case m:j=z();break;case w:j=I();break;case g:j=D();break;case c:j=P();break;case x:j=A();break;case u:j=k()}if(e!==j)switch(X[e]){case\"\\n\":q=0,++H;break;default:++q}}return N+=j,X=X.slice(j),V}function n(t){return U.length&&e(U.join(\"\")),B=_,e(\"(eof)\"),V}function k(){return U=U.length?[]:U,\"/\"===R&&\"*\"===O?(G=N+j-1,B=h,R=O,j+1):\"/\"===R&&\"/\"===O?(G=N+j-1,B=f,R=O,j+1):\"#\"===O?(B=d,G=N+j,j):/\\s/.test(O)?(B=x,G=N+j,j):(Y=/\\d/.test(O),W=/[^\\w_]/.test(O),G=N+j,B=Y?m:W?p:c,j)}function A(){return/[^\\s]/g.test(O)?(e(U.join(\"\")),B=u,j):(U.push(O),R=O,j+1)}function T(){return\"\\r\"!==O&&\"\\n\"!==O||\"\\\\\"===R?(U.push(O),R=O,j+1):(e(U.join(\"\")),B=u,j)}function S(){return T()}function E(){return\"/\"===O&&\"*\"===R?(U.push(O),e(U.join(\"\")),B=u,j+1):(U.push(O),R=O,j+1)}function L(){if(\".\"===R&&/\\d/.test(O))return B=g,j;if(\"/\"===R&&\"*\"===O)return B=h,j;if(\"/\"===R&&\"/\"===O)return B=f,j;if(\".\"===O&&U.length){for(;C(U););return B=g,j}if(\";\"===O||\")\"===O||\"(\"===O){if(U.length)for(;C(U););return e(O),B=u,j+1}var t=2===U.length&&\"=\"!==O;if(/[\\w_\\d\\s]/.test(O)||t){for(;C(U););return B=u,j}return U.push(O),R=O,j+1}function C(t){for(var r,n,i=0;;){if(r=a.indexOf(t.slice(0,t.length+i).join(\"\")),n=a[r],-1===r){if(i--+t.length>0)continue;n=t.slice(0,1).join(\"\")}return e(n),G+=n.length,U=U.slice(n.length),U.length}}function I(){return/[^a-fA-F0-9]/.test(O)?(e(U.join(\"\")),B=u,j):(U.push(O),R=O,j+1)}function z(){return\".\"===O?(U.push(O),B=g,R=O,j+1):/[eE]/.test(O)?(U.push(O),B=g,R=O,j+1):\"x\"===O&&1===U.length&&\"0\"===U[0]?(B=w,U.push(O),R=O,j+1):/[^\\d]/.test(O)?(e(U.join(\"\")),B=u,j):(U.push(O),R=O,j+1)}function D(){return\"f\"===O&&(U.push(O),R=O,j+=1),/[eE]/.test(O)?(U.push(O),R=O,j+1):\"-\"===O&&/[eE]/.test(R)?(U.push(O),R=O,j+1):/[^\\d]/.test(O)?(e(U.join(\"\")),B=u,j):(U.push(O),R=O,j+1)}function P(){if(/[^\\d\\w_]/.test(O)){var t=U.join(\"\");return B=J.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:v,e(U.join(\"\")),B=u,j}return U.push(O),R=O,j+1}var O,R,F,j=0,N=0,B=u,U=[],V=[],H=1,q=0,G=0,Y=!1,W=!1,X=\"\";t=t||{};var Z=o,J=i;return\"300 es\"===t.version&&(Z=l,J=s),function(t){return V=[],null!==t?r(t.replace?t.replace(/\\r\\n/g,\"\\n\"):t):n()}}e.exports=n;var i=t(\"./lib/literals\"),a=t(\"./lib/operators\"),o=t(\"./lib/builtins\"),s=t(\"./lib/literals-300es\"),l=t(\"./lib/builtins-300es\"),u=999,c=9999,h=0,f=1,d=2,p=3,m=4,g=5,v=6,y=7,b=8,x=9,_=10,w=11,M=[\"block-comment\",\"line-comment\",\"preprocessor\",\"operator\",\"integer\",\"float\",\"ident\",\"builtin\",\"keyword\",\"whitespace\",\"eof\",\"integer\"]},{\"./lib/builtins\":282,\"./lib/builtins-300es\":281,\"./lib/literals\":284,\"./lib/literals-300es\":283,\"./lib/operators\":285}],281:[function(t,e,r){var n=t(\"./builtins\");n=n.slice().filter(function(t){return!/^(gl\\_|texture)/.test(t)}),e.exports=n.concat([\"gl_VertexID\",\"gl_InstanceID\",\"gl_Position\",\"gl_PointSize\",\"gl_FragCoord\",\"gl_FrontFacing\",\"gl_FragDepth\",\"gl_PointCoord\",\"gl_MaxVertexAttribs\",\"gl_MaxVertexUniformVectors\",\"gl_MaxVertexOutputVectors\",\"gl_MaxFragmentInputVectors\",\"gl_MaxVertexTextureImageUnits\",\"gl_MaxCombinedTextureImageUnits\",\"gl_MaxTextureImageUnits\",\"gl_MaxFragmentUniformVectors\",\"gl_MaxDrawBuffers\",\"gl_MinProgramTexelOffset\",\"gl_MaxProgramTexelOffset\",\"gl_DepthRangeParameters\",\"gl_DepthRange\",\"trunc\",\"round\",\"roundEven\",\"isnan\",\"isinf\",\"floatBitsToInt\",\"floatBitsToUint\",\"intBitsToFloat\",\"uintBitsToFloat\",\"packSnorm2x16\",\"unpackSnorm2x16\",\"packUnorm2x16\",\"unpackUnorm2x16\",\"packHalf2x16\",\"unpackHalf2x16\",\"outerProduct\",\"transpose\",\"determinant\",\"inverse\",\"texture\",\"textureSize\",\"textureProj\",\"textureLod\",\"textureOffset\",\"texelFetch\",\"texelFetchOffset\",\"textureProjOffset\",\"textureLodOffset\",\"textureProjLod\",\"textureProjLodOffset\",\"textureGrad\",\"textureGradOffset\",\"textureProjGrad\",\"textureProjGradOffset\"])},{\"./builtins\":282}],282:[function(t,e,r){\n", | |
"e.exports=[\"abs\",\"acos\",\"all\",\"any\",\"asin\",\"atan\",\"ceil\",\"clamp\",\"cos\",\"cross\",\"dFdx\",\"dFdy\",\"degrees\",\"distance\",\"dot\",\"equal\",\"exp\",\"exp2\",\"faceforward\",\"floor\",\"fract\",\"gl_BackColor\",\"gl_BackLightModelProduct\",\"gl_BackLightProduct\",\"gl_BackMaterial\",\"gl_BackSecondaryColor\",\"gl_ClipPlane\",\"gl_ClipVertex\",\"gl_Color\",\"gl_DepthRange\",\"gl_DepthRangeParameters\",\"gl_EyePlaneQ\",\"gl_EyePlaneR\",\"gl_EyePlaneS\",\"gl_EyePlaneT\",\"gl_Fog\",\"gl_FogCoord\",\"gl_FogFragCoord\",\"gl_FogParameters\",\"gl_FragColor\",\"gl_FragCoord\",\"gl_FragData\",\"gl_FragDepth\",\"gl_FragDepthEXT\",\"gl_FrontColor\",\"gl_FrontFacing\",\"gl_FrontLightModelProduct\",\"gl_FrontLightProduct\",\"gl_FrontMaterial\",\"gl_FrontSecondaryColor\",\"gl_LightModel\",\"gl_LightModelParameters\",\"gl_LightModelProducts\",\"gl_LightProducts\",\"gl_LightSource\",\"gl_LightSourceParameters\",\"gl_MaterialParameters\",\"gl_MaxClipPlanes\",\"gl_MaxCombinedTextureImageUnits\",\"gl_MaxDrawBuffers\",\"gl_MaxFragmentUniformComponents\",\"gl_MaxLights\",\"gl_MaxTextureCoords\",\"gl_MaxTextureImageUnits\",\"gl_MaxTextureUnits\",\"gl_MaxVaryingFloats\",\"gl_MaxVertexAttribs\",\"gl_MaxVertexTextureImageUnits\",\"gl_MaxVertexUniformComponents\",\"gl_ModelViewMatrix\",\"gl_ModelViewMatrixInverse\",\"gl_ModelViewMatrixInverseTranspose\",\"gl_ModelViewMatrixTranspose\",\"gl_ModelViewProjectionMatrix\",\"gl_ModelViewProjectionMatrixInverse\",\"gl_ModelViewProjectionMatrixInverseTranspose\",\"gl_ModelViewProjectionMatrixTranspose\",\"gl_MultiTexCoord0\",\"gl_MultiTexCoord1\",\"gl_MultiTexCoord2\",\"gl_MultiTexCoord3\",\"gl_MultiTexCoord4\",\"gl_MultiTexCoord5\",\"gl_MultiTexCoord6\",\"gl_MultiTexCoord7\",\"gl_Normal\",\"gl_NormalMatrix\",\"gl_NormalScale\",\"gl_ObjectPlaneQ\",\"gl_ObjectPlaneR\",\"gl_ObjectPlaneS\",\"gl_ObjectPlaneT\",\"gl_Point\",\"gl_PointCoord\",\"gl_PointParameters\",\"gl_PointSize\",\"gl_Position\",\"gl_ProjectionMatrix\",\"gl_ProjectionMatrixInverse\",\"gl_ProjectionMatrixInverseTranspose\",\"gl_ProjectionMatrixTranspose\",\"gl_SecondaryColor\",\"gl_TexCoord\",\"gl_TextureEnvColor\",\"gl_TextureMatrix\",\"gl_TextureMatrixInverse\",\"gl_TextureMatrixInverseTranspose\",\"gl_TextureMatrixTranspose\",\"gl_Vertex\",\"greaterThan\",\"greaterThanEqual\",\"inversesqrt\",\"length\",\"lessThan\",\"lessThanEqual\",\"log\",\"log2\",\"matrixCompMult\",\"max\",\"min\",\"mix\",\"mod\",\"normalize\",\"not\",\"notEqual\",\"pow\",\"radians\",\"reflect\",\"refract\",\"sign\",\"sin\",\"smoothstep\",\"sqrt\",\"step\",\"tan\",\"texture2D\",\"texture2DLod\",\"texture2DProj\",\"texture2DProjLod\",\"textureCube\",\"textureCubeLod\",\"texture2DLodEXT\",\"texture2DProjLodEXT\",\"textureCubeLodEXT\",\"texture2DGradEXT\",\"texture2DProjGradEXT\",\"textureCubeGradEXT\"]},{}],283:[function(t,e,r){var n=t(\"./literals\");e.exports=n.slice().concat([\"layout\",\"centroid\",\"smooth\",\"case\",\"mat2x2\",\"mat2x3\",\"mat2x4\",\"mat3x2\",\"mat3x3\",\"mat3x4\",\"mat4x2\",\"mat4x3\",\"mat4x4\",\"uint\",\"uvec2\",\"uvec3\",\"uvec4\",\"samplerCubeShadow\",\"sampler2DArray\",\"sampler2DArrayShadow\",\"isampler2D\",\"isampler3D\",\"isamplerCube\",\"isampler2DArray\",\"usampler2D\",\"usampler3D\",\"usamplerCube\",\"usampler2DArray\",\"coherent\",\"restrict\",\"readonly\",\"writeonly\",\"resource\",\"atomic_uint\",\"noperspective\",\"patch\",\"sample\",\"subroutine\",\"common\",\"partition\",\"active\",\"filter\",\"image1D\",\"image2D\",\"image3D\",\"imageCube\",\"iimage1D\",\"iimage2D\",\"iimage3D\",\"iimageCube\",\"uimage1D\",\"uimage2D\",\"uimage3D\",\"uimageCube\",\"image1DArray\",\"image2DArray\",\"iimage1DArray\",\"iimage2DArray\",\"uimage1DArray\",\"uimage2DArray\",\"image1DShadow\",\"image2DShadow\",\"image1DArrayShadow\",\"image2DArrayShadow\",\"imageBuffer\",\"iimageBuffer\",\"uimageBuffer\",\"sampler1DArray\",\"sampler1DArrayShadow\",\"isampler1D\",\"isampler1DArray\",\"usampler1D\",\"usampler1DArray\",\"isampler2DRect\",\"usampler2DRect\",\"samplerBuffer\",\"isamplerBuffer\",\"usamplerBuffer\",\"sampler2DMS\",\"isampler2DMS\",\"usampler2DMS\",\"sampler2DMSArray\",\"isampler2DMSArray\",\"usampler2DMSArray\"])},{\"./literals\":284}],284:[function(t,e,r){e.exports=[\"precision\",\"highp\",\"mediump\",\"lowp\",\"attribute\",\"const\",\"uniform\",\"varying\",\"break\",\"continue\",\"do\",\"for\",\"while\",\"if\",\"else\",\"in\",\"out\",\"inout\",\"float\",\"int\",\"void\",\"bool\",\"true\",\"false\",\"discard\",\"return\",\"mat2\",\"mat3\",\"mat4\",\"vec2\",\"vec3\",\"vec4\",\"ivec2\",\"ivec3\",\"ivec4\",\"bvec2\",\"bvec3\",\"bvec4\",\"sampler1D\",\"sampler2D\",\"sampler3D\",\"samplerCube\",\"sampler1DShadow\",\"sampler2DShadow\",\"struct\",\"asm\",\"class\",\"union\",\"enum\",\"typedef\",\"template\",\"this\",\"packed\",\"goto\",\"switch\",\"default\",\"inline\",\"noinline\",\"volatile\",\"public\",\"static\",\"extern\",\"external\",\"interface\",\"long\",\"short\",\"double\",\"half\",\"fixed\",\"unsigned\",\"input\",\"output\",\"hvec2\",\"hvec3\",\"hvec4\",\"dvec2\",\"dvec3\",\"dvec4\",\"fvec2\",\"fvec3\",\"fvec4\",\"sampler2DRect\",\"sampler3DRect\",\"sampler2DRectShadow\",\"sizeof\",\"cast\",\"namespace\",\"using\"]},{}],285:[function(t,e,r){e.exports=[\"<<=\",\">>=\",\"++\",\"--\",\"<<\",\">>\",\"<=\",\">=\",\"==\",\"!=\",\"&&\",\"||\",\"+=\",\"-=\",\"*=\",\"/=\",\"%=\",\"&=\",\"^^\",\"^=\",\"|=\",\"(\",\")\",\"[\",\"]\",\".\",\"!\",\"~\",\"*\",\"/\",\"%\",\"+\",\"-\",\"<\",\">\",\"&\",\"^\",\"|\",\"?\",\":\",\"=\",\",\",\";\",\"{\",\"}\"]},{}],286:[function(t,e,r){function n(t,e){var r=i(e),n=[];return n=n.concat(r(t)),n=n.concat(r(null))}var i=t(\"./index\");e.exports=n},{\"./index\":280}],287:[function(t,e,r){\"use strict\";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o<this.d*this.d;o++){var s=a[i+o],l=a[i+o+1];n.push(s===l?null:a.subarray(s,l))}var u=a[i+n.length],c=a[i+n.length+1];this.keys=a.subarray(u,c),this.bboxes=a.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var h=0;h<this.d*this.d;h++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var f=r/e*t;this.min=-f,this.max=t+f}e.exports=n;var i=3;n.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},n.prototype._insertReadonly=function(){throw\"Cannot insert into a GridIndex created from an ArrayBuffer.\"},n.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},n.prototype.query=function(t,e,r,n){var i=this.min,a=this.max;if(t<=i&&e<=i&&a<=r&&a<=n)return Array.prototype.slice.call(this.keys);var o=[],s={};return this._forEachCell(t,e,r,n,this._queryCell,o,s),o},n.prototype._queryCell=function(t,e,r,n,i,a,o){var s=this.cells[i];if(null!==s)for(var l=this.keys,u=this.bboxes,c=0;c<s.length;c++){var h=s[c];if(void 0===o[h]){var f=4*h;t<=u[f+2]&&e<=u[f+3]&&r>=u[f+0]&&n>=u[f+1]?(o[h]=!0,a.push(l[h])):o[h]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=s;h<=u;h++)for(var f=l;f<=c;f++){var d=this.d*f+h;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var a=new Int32Array(e+r+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;for(var o=e,s=0;s<t.length;s++){var l=t[s];a[i+s]=o,a.set(l,o),o+=l.length}return a[i+t.length]=o,a.set(this.keys,o),o+=this.keys.length,a[i+t.length+1]=o,a.set(this.bboxes,o),o+=this.bboxes.length,a.buffer}},{}],288:[function(t,e,r){(function(r){\"use strict\";var n,i=t(\"is-browser\");n=\"function\"==typeof r.matchMedia?!r.matchMedia(\"(hover: none)\").matches:i,e.exports=n}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{\"is-browser\":294}],289:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*m}},{}],290:[function(t,e,r){\"use strict\";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return c(t.vertices,e.vertices)}function o(t){for(var e=[\"function orient(){var tuple=this.tuple;return test(\"],r=0;r<=t;++r)r>0&&e.push(\",\"),e.push(\"tuple[\",r,\"]\");e.push(\")}return orient\");var n=new Function(\"test\",e.join(\"\")),i=u[t+1];return i||(i=u),n(i)}function s(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=h[t];i||(i=h[t]=o(t)),this.orient=i}function l(t,e){var r=t.length;if(0===r)throw new Error(\"Must have at least d+1 points\");var i=t[0].length;if(r<=i)throw new Error(\"Must input at least d+1 points\");var a=t.slice(0,i+1),o=u.apply(void 0,a);if(0===o)throw new Error(\"Input not in general position\");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;o<0&&(l[0]=1,l[1]=0);for(var h=new n(l,new Array(i+1),!1),f=h.adjacent,d=new Array(i+2),c=0;c<=i;++c){for(var p=l.slice(),m=0;m<=i;++m)m===c&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);f[c]=v,d[c]=v}d[i+1]=h;for(var c=0;c<=i;++c)for(var p=f[c].vertices,y=f[c].adjacent,m=0;m<=i;++m){var b=p[m];if(b<0)y[m]=h;else for(var x=0;x<=i;++x)f[x].vertices.indexOf(b)<0&&(y[m]=f[x])}for(var _=new s(i,a,d),w=!!e,c=i+1;c<r;++c)_.insert(t[c],w);return _.boundary()}e.exports=l;var u=t(\"robust-orientation\"),c=t(\"simplicial-complex\").compareCells;n.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var h=[],f=s.prototype;f.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){t=o.pop();for(var s=(t.vertices,t.adjacent),l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,h=0;h<=r;++h){var f=c[h];i[h]=f<0?e:a[f]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}}return null},f.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(var c=0;c<=n;++c){var h=u[c];if(!(h.lastVisited>=r)){var f=a[c];a[c]=t;var d=this.orient();if(a[c]=f,d<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},f.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var f=[];h.length>0;){var e=h.pop(),d=e.vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=o;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var b=0,x=0;x<=o;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];var _=this.orient();if(_>0){y[b]=r,v.boundary=!1,u.push(v),h.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var w=v.adjacent,M=d.slice(),k=p.slice(),A=new n(M,k,!0);c.push(A);var T=w.indexOf(e);if(!(T<0)){w[T]=A,k[m]=v,M[g]=-1,k[g]=e,p[g]=A,A.flip();for(var x=0;x<=o;++x){var S=M[x];if(!(S<0||S===r)){for(var E=new Array(o-1),L=0,C=0;C<=o;++C){var I=M[C];I<0||C===x||(E[L++]=I)}f.push(new i(E,A,x))}}}}}}f.sort(a);for(var g=0;g+1<f.length;g+=2){var z=f[g],D=f[g+1],P=z.index,O=D.index;P<0||O<0||(z.cell.adjacent[z.index]=D.cell,D.cell.adjacent[D.index]=z.cell)}},f.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,a=this.tuple,o=0;o<=i;++o){var s=n.vertices[o];a[o]=s<0?t:r[s]}var l=this.orient(a);l<0||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},f.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;i<n;++i){var a=r[i];if(a.boundary){for(var o=new Array(t),s=a.vertices,l=0,u=0,c=0;c<=t;++c)s[c]>=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{\"robust-orientation\":508,\"simplicial-complex\":519}],291:[function(t,e,r){\"use strict\";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?y:(r.splice(n,1),a(t,r),b)}function l(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var i=r(t[n]);if(i)return i}}function u(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function c(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function h(t,e){return t-e}function f(t,e){var r=t[0]-e[0];return r||t[1]-e[1]}function d(t,e){var r=t[1]-e[1];return r||t[0]-e[0]}function p(t){if(0===t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t[r][0],t[r][1]);e.sort(h);for(var i=e[e.length>>1],a=[],o=[],s=[],r=0;r<t.length;++r){var l=t[r];l[1]<i?a.push(l):i<l[0]?o.push(l):s.push(l)}var u=s,c=s.slice();return u.sort(f),c.sort(d),new n(i,p(a),p(o),u,c)}function m(t){this.root=t}function g(t){return new m(t&&0!==t.length?p(t):null)}var v=t(\"binary-search-bounds\"),y=0,b=1;e.exports=g;var x=n.prototype;x.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},x.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=v.ge(this.leftPoints,t,f),n=v.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){if(!this.left)return y;if(4*(this.right?this.right.count:0)>3*(e-1))return s(this,t);var r=this.left.remove(t);return 2===r?(this.left=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(t[0]>this.mid){if(!this.right)return y;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);var r=this.right.remove(t);return 2===r?(this.right=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(1===this.count)return this.leftPoints[0]===t?2:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,a=this.left;a.right;)n=a,a=a.right;if(n===this)a.right=this.right;else{var o=this.left,r=this.right;n.count-=a.count,n.right=a.left,a.left=o,a.right=r}i(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return b}for(var o=v.ge(this.leftPoints,t,f);o<this.leftPoints.length&&this.leftPoints[o][0]===t[0];++o)if(this.leftPoints[o]===t){this.count-=1,this.leftPoints.splice(o,1);for(var r=v.ge(this.rightPoints,t,d);r<this.rightPoints.length&&this.rightPoints[r][1]===t[1];++r)if(this.rightPoints[r]===t)return this.rightPoints.splice(r,1),b}return y},x.queryPoint=function(t,e){if(t<this.mid){if(this.left){var r=this.left.queryPoint(t,e);if(r)return r}return l(this.leftPoints,t,e)}if(t>this.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(t<this.mid&&this.left){var n=this.left.queryInterval(t,e,r);if(n)return n}if(e>this.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return e<this.mid?l(this.leftPoints,e,r):t>this.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var _=m.prototype;_.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},_.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==y}return!1},_.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},_.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(_,\"count\",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(_,\"intervals\",{get:function(){return this.root?this.root.intervals([]):[]}})},{\"binary-search-bounds\":66}],292:[function(t,e,r){\"use strict\";function n(t,e){e=e||new Array(t.length);for(var r=0;r<t.length;++r)e[t[r]]=r;return e}e.exports=n},{}],293:[function(t,e,r){\"use strict\";function n(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}e.exports=n},{}],294:[function(t,e,r){e.exports=!0},{}],295:[function(t,e,r){function n(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function i(t){return\"function\"==typeof t.readFloatLE&&\"function\"==typeof t.slice&&n(t.slice(0,0))}e.exports=function(t){return null!=t&&(n(t)||i(t)||!!t._isBuffer)}},{}],296:[function(t,e,r){function n(t){return t||\"undefined\"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&\"string\"==typeof t.headers[\"user-agent\"]&&(t=t.headers[\"user-agent\"]),\"string\"==typeof t&&(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(t.substr(0,4)))}e.exports=n},{}],297:[function(t,e,r){\"use strict\";var n=Object.prototype.toString;e.exports=function(t){var e;return\"[object Object]\"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],298:[function(t,e,r){\"use strict\";function n(t,e,r,n,a){return new i(t,e,r,n,a)}function i(t,e,r,n,i){e=e||a,r=r||o,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var l=0;l<t.length;l++)this.ids[l]=l,this.coords[2*l]=e(t[l]),this.coords[2*l+1]=r(t[l]);s(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function a(t){return t[0]}function o(t){return t[1]}var s=t(\"./sort\"),l=t(\"./range\"),u=t(\"./within\");e.exports=n,i.prototype={range:function(t,e,r,n){return l(this.ids,this.coords,t,e,r,n,this.nodeSize)},within:function(t,e,r){return u(this.ids,this.coords,t,e,r,this.nodeSize)}}},{\"./range\":299,\"./sort\":300,\"./within\":301}],299:[function(t,e,r){\"use strict\";function n(t,e,r,n,i,a,o){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var h=u.pop(),f=u.pop(),d=u.pop();if(f-d<=o)for(var p=d;p<=f;p++)s=e[2*p],l=e[2*p+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[p]);else{var m=Math.floor((d+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(u.push(d),u.push(m-1),u.push(g)),(0===h?i>=s:a>=l)&&(u.push(m+1),u.push(f),u.push(g))}}return c}e.exports=n},{}],300:[function(t,e,r){\"use strict\";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,u=r-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-u*h/l+f)),Math.min(o,Math.floor(r+(l-u)*h/l+f)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);p<m;){for(a(t,e,p,m),p++,m--;e[2*p+s]<d;)p++;for(;e[2*m+s]>d;)m--}e[2*n+s]===d?a(t,e,n,m):(m++,a(t,e,m,o)),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],301:[function(t,e,r){\"use strict\";function n(t,e,r,n,a,o){for(var s=[0,t.length-1,0],l=[],u=a*a;s.length;){var c=s.pop(),h=s.pop(),f=s.pop();if(h-f<=o)for(var d=f;d<=h;d++)i(e[2*d],e[2*d+1],r,n)<=u&&l.push(t[d]);else{var p=Math.floor((f+h)/2),m=e[2*p],g=e[2*p+1];i(m,g,r,n)<=u&&l.push(t[p]);var v=(c+1)%2;(0===c?r-a<=m:n-a<=g)&&(s.push(f),s.push(p-1),s.push(v)),(0===c?r+a>=m:n+a>=g)&&(s.push(p+1),s.push(h),s.push(v))}}return l}function i(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=n},{}],302:[function(t,e,r){\"use strict\";function n(t,e){var r;if(h(t)){var l,u=t.stops&&\"object\"==typeof t.stops[0][0],c=u||void 0!==t.property,f=u||!c,d=t.type||e||\"exponential\";if(\"exponential\"===d)l=o;else if(\"interval\"===d)l=a;else if(\"categorical\"===d)l=i;else{if(\"identity\"!==d)throw new Error('Unknown function type \"'+d+'\"');l=s}if(u){for(var p={},m=[],g=0;g<t.stops.length;g++){var v=t.stops[g];void 0===p[v[0].zoom]&&(p[v[0].zoom]={zoom:v[0].zoom,type:t.type,property:t.property,stops:[]}),p[v[0].zoom].stops.push([v[0].value,v[1]])}for(var y in p)m.push([p[y].zoom,n(p[y])]);r=function(e,r){return o({stops:m,base:t.base},e)(e,r)},r.isFeatureConstant=!1,r.isZoomConstant=!1}else f?(r=function(e){return l(t,e)},r.isFeatureConstant=!0,r.isZoomConstant=!1):(r=function(e,r){return l(t,r[t.property])},r.isFeatureConstant=!1,r.isZoomConstant=!0)}else r=function(){return t},r.isFeatureConstant=!0,r.isZoomConstant=!0;return r}function i(t,e){for(var r=0;r<t.stops.length;r++)if(e===t.stops[r][0])return t.stops[r][1];return t.stops[0][1]}function a(t,e){for(var r=0;r<t.stops.length&&!(e<t.stops[r][0]);r++);return t.stops[Math.max(r-1,0)][1]}function o(t,e){for(var r=void 0!==t.base?t.base:1,n=0;;){if(n>=t.stops.length)break;if(e<=t.stops[n][0])break;n++}return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return\"function\"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?c(t,e,r,n,i,a):u(t,e,r,n,i,a)}function u(t,e,r,n,i,a){var o,s=n-r,l=t-r;return o=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1),i*(1-o)+a*o}function c(t,e,r,n,i,a){for(var o=[],s=0;s<i.length;s++)o[s]=u(t,e,r,n,i[s],a[s]);return o}function h(t){return\"object\"==typeof t&&(t.stops||\"identity\"===t.type)}e.exports.isFunctionDefinition=h,e.exports.interpolated=function(t){return n(t,\"exponential\")},e.exports[\"piecewise-constant\"]=function(t){return n(t,\"interval\")}},{}],303:[function(t,e,r){t(\"path\");e.exports={debug:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform lowp vec4 u_color;\\n\\nvoid main() {\\n gl_FragColor = u_color;\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nattribute vec2 a_pos;\\n\\nuniform mat4 u_matrix;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);\\n}\\n\"},fill:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n#pragma mapbox: define lowp vec4 color\\n#pragma mapbox: define lowp float opacity\\n\\nvoid main() {\\n #pragma mapbox: initialize lowp vec4 color\\n #pragma mapbox: initialize lowp float opacity\\n\\n gl_FragColor = color * opacity;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nattribute vec2 a_pos;\\n\\nuniform mat4 u_matrix;\\n\\n#pragma mapbox: define lowp vec4 color\\n#pragma mapbox: define lowp float opacity\\n\\nvoid main() {\\n #pragma mapbox: initialize lowp vec4 color\\n #pragma mapbox: initialize lowp float opacity\\n\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n}\\n\"},circle:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n#pragma mapbox: define lowp vec4 color\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n\\nvarying vec2 v_extrude;\\nvarying lowp float v_antialiasblur;\\n\\nvoid main() {\\n #pragma mapbox: initialize lowp vec4 color\\n #pragma mapbox: initialize lowp float blur\\n #pragma mapbox: initialize lowp float opacity\\n\\n float t = smoothstep(1.0 - max(blur, v_antialiasblur), 1.0, length(v_extrude));\\n gl_FragColor = color * (1.0 - t) * opacity;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform mat4 u_matrix;\\nuniform bool u_scale_with_map;\\nuniform vec2 u_extrude_scale;\\nuniform float u_devicepixelratio;\\n\\nattribute vec2 a_pos;\\n\\n#pragma mapbox: define lowp vec4 color\\n#pragma mapbox: define mediump float radius\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n\\nvarying vec2 v_extrude;\\nvarying lowp float v_antialiasblur;\\n\\nvoid main(void) {\\n #pragma mapbox: initialize lowp vec4 color\\n #pragma mapbox: initialize mediump float radius\\n #pragma mapbox: initialize lowp float blur\\n #pragma mapbox: initialize lowp float opacity\\n\\n // unencode the extrusion vector that we snuck into the a_pos vector\\n v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\\n\\n vec2 extrude = v_extrude * radius * u_extrude_scale;\\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\\n // in extrusion data\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\\n\\n if (u_scale_with_map) {\\n gl_Position.xy += extrude;\\n } else {\\n gl_Position.xy += extrude * gl_Position.w;\\n }\\n\\n // This is a minimum blur distance that serves as a faux-antialiasing for\\n // the circle. since blur is a ratio of the circle's size and the intent is\\n // to keep the blur at roughly 1px, the two are inversely related.\\n v_antialiasblur = 1.0 / u_devicepixelratio / radius;\\n}\\n\"},line:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform lowp vec4 u_color;\\nuniform lowp float u_opacity;\\nuniform float u_blur;\\n\\nvarying vec2 v_linewidth;\\nvarying vec2 v_normal;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n // Calculate the distance of the pixel from the line in pixels.\\n float dist = length(v_normal) * v_linewidth.s;\\n\\n // Calculate the antialiasing fade factor. This is either when fading in\\n // the line in case of an offset line (v_linewidth.t) or when fading out\\n // (v_linewidth.s)\\n float blur = u_blur * v_gamma_scale;\\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\\n\\n gl_FragColor = u_color * (alpha * u_opacity);\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n// floor(127 / 2) == 63.0\\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\\n// there are also \\\"special\\\" normals that have a bigger length (of up to 126 in\\n// this case).\\n// #define scale 63.0\\n#define scale 0.015873016\\n\\nattribute vec2 a_pos;\\nattribute vec4 a_data;\\n\\nuniform mat4 u_matrix;\\nuniform mediump float u_ratio;\\nuniform mediump float u_linewidth;\\nuniform mediump float u_gapwidth;\\nuniform mediump float u_antialiasing;\\nuniform mediump float u_extra;\\nuniform mat2 u_antialiasingmatrix;\\nuniform mediump float u_offset;\\nuniform mediump float u_blur;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_linewidth;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_extrude = a_data.xy - 128.0;\\n float a_direction = mod(a_data.z, 4.0) - 1.0;\\n\\n // We store the texture normals in the most insignificant bit\\n // transform y so that 0 => -1 and 1 => 1\\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\\n // y is 1 if the normal points up, and -1 if it points down\\n mediump vec2 normal = mod(a_pos, 2.0);\\n normal.y = sign(normal.y - 0.5);\\n v_normal = normal;\\n\\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\\n\\n // Scale the extrusion vector down to a normal and then up by the line width\\n // of this vertex.\\n mediump vec2 dist = outset * a_extrude * scale;\\n\\n // Calculate the offset when drawing a line that is to the side of the actual line.\\n // We do this by creating a vector that points towards the extrude, but rotate\\n // it when we're drawing round end points (a_direction = -1 or 1) since their\\n // extrude vector points in another direction.\\n mediump float u = 0.5 * a_direction;\\n mediump float t = 1.0 - abs(u);\\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\\n\\n // Remove the texture normal bit of the position before scaling it with the\\n // model/view matrix.\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\\n\\n // position of y on the screen\\n float y = gl_Position.y / gl_Position.w;\\n\\n // how much features are squished in the y direction by the tilt\\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\\n\\n // how much features are squished in all directions by the perspectiveness\\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\\n\\n v_linewidth = vec2(outset, inset);\\n v_gamma_scale = perspective_scale * squish_scale;\\n}\\n\"},linepattern:{\n", | |
"fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform float u_blur;\\n\\nuniform vec2 u_pattern_size_a;\\nuniform vec2 u_pattern_size_b;\\nuniform vec2 u_pattern_tl_a;\\nuniform vec2 u_pattern_br_a;\\nuniform vec2 u_pattern_tl_b;\\nuniform vec2 u_pattern_br_b;\\nuniform float u_fade;\\nuniform float u_opacity;\\n\\nuniform sampler2D u_image;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_linewidth;\\nvarying float v_linesofar;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n // Calculate the distance of the pixel from the line in pixels.\\n float dist = length(v_normal) * v_linewidth.s;\\n\\n // Calculate the antialiasing fade factor. This is either when fading in\\n // the line in case of an offset line (v_linewidth.t) or when fading out\\n // (v_linewidth.s)\\n float blur = u_blur * v_gamma_scale;\\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\\n\\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\\n\\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\\n\\n alpha *= u_opacity;\\n\\n gl_FragColor = color * alpha;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n// floor(127 / 2) == 63.0\\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\\n// there are also \\\"special\\\" normals that have a bigger length (of up to 126 in\\n// this case).\\n// #define scale 63.0\\n#define scale 0.015873016\\n\\n// We scale the distance before adding it to the buffers so that we can store\\n// long distances for long segments. Use this value to unscale the distance.\\n#define LINE_DISTANCE_SCALE 2.0\\n\\nattribute vec2 a_pos;\\nattribute vec4 a_data;\\n\\nuniform mat4 u_matrix;\\nuniform mediump float u_ratio;\\nuniform mediump float u_linewidth;\\nuniform mediump float u_gapwidth;\\nuniform mediump float u_antialiasing;\\nuniform mediump float u_extra;\\nuniform mat2 u_antialiasingmatrix;\\nuniform mediump float u_offset;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_linewidth;\\nvarying float v_linesofar;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_extrude = a_data.xy - 128.0;\\n float a_direction = mod(a_data.z, 4.0) - 1.0;\\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\\n\\n // We store the texture normals in the most insignificant bit\\n // transform y so that 0 => -1 and 1 => 1\\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\\n // y is 1 if the normal points up, and -1 if it points down\\n mediump vec2 normal = mod(a_pos, 2.0);\\n normal.y = sign(normal.y - 0.5);\\n v_normal = normal;\\n\\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\\n\\n // Scale the extrusion vector down to a normal and then up by the line width\\n // of this vertex.\\n mediump vec2 dist = outset * a_extrude * scale;\\n\\n // Calculate the offset when drawing a line that is to the side of the actual line.\\n // We do this by creating a vector that points towards the extrude, but rotate\\n // it when we're drawing round end points (a_direction = -1 or 1) since their\\n // extrude vector points in another direction.\\n mediump float u = 0.5 * a_direction;\\n mediump float t = 1.0 - abs(u);\\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\\n\\n // Remove the texture normal bit of the position before scaling it with the\\n // model/view matrix.\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\\n v_linesofar = a_linesofar;\\n\\n // position of y on the screen\\n float y = gl_Position.y / gl_Position.w;\\n\\n // how much features are squished in the y direction by the tilt\\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\\n\\n // how much features are squished in all directions by the perspectiveness\\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\\n\\n v_linewidth = vec2(outset, inset);\\n v_gamma_scale = perspective_scale * squish_scale;\\n}\\n\"},linesdfpattern:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform lowp vec4 u_color;\\nuniform lowp float u_opacity;\\n\\nuniform float u_blur;\\nuniform sampler2D u_image;\\nuniform float u_sdfgamma;\\nuniform float u_mix;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_linewidth;\\nvarying vec2 v_tex_a;\\nvarying vec2 v_tex_b;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n // Calculate the distance of the pixel from the line in pixels.\\n float dist = length(v_normal) * v_linewidth.s;\\n\\n // Calculate the antialiasing fade factor. This is either when fading in\\n // the line in case of an offset line (v_linewidth.t) or when fading out\\n // (v_linewidth.s)\\n float blur = u_blur * v_gamma_scale;\\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\\n\\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\\n\\n gl_FragColor = u_color * (alpha * u_opacity);\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n// floor(127 / 2) == 63.0\\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\\n// there are also \\\"special\\\" normals that have a bigger length (of up to 126 in\\n// this case).\\n// #define scale 63.0\\n#define scale 0.015873016\\n\\n// We scale the distance before adding it to the buffers so that we can store\\n// long distances for long segments. Use this value to unscale the distance.\\n#define LINE_DISTANCE_SCALE 2.0\\n\\nattribute vec2 a_pos;\\nattribute vec4 a_data;\\n\\nuniform mat4 u_matrix;\\nuniform mediump float u_ratio;\\nuniform mediump float u_linewidth;\\nuniform mediump float u_gapwidth;\\nuniform mediump float u_antialiasing;\\nuniform vec2 u_patternscale_a;\\nuniform float u_tex_y_a;\\nuniform vec2 u_patternscale_b;\\nuniform float u_tex_y_b;\\nuniform float u_extra;\\nuniform mat2 u_antialiasingmatrix;\\nuniform mediump float u_offset;\\n\\nvarying vec2 v_normal;\\nvarying vec2 v_linewidth;\\nvarying vec2 v_tex_a;\\nvarying vec2 v_tex_b;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_extrude = a_data.xy - 128.0;\\n float a_direction = mod(a_data.z, 4.0) - 1.0;\\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\\n\\n // We store the texture normals in the most insignificant bit\\n // transform y so that 0 => -1 and 1 => 1\\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\\n // y is 1 if the normal points up, and -1 if it points down\\n mediump vec2 normal = mod(a_pos, 2.0);\\n normal.y = sign(normal.y - 0.5);\\n v_normal = normal;\\n\\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\\n\\n // Scale the extrusion vector down to a normal and then up by the line width\\n // of this vertex.\\n mediump vec2 dist = outset * a_extrude * scale;\\n\\n // Calculate the offset when drawing a line that is to the side of the actual line.\\n // We do this by creating a vector that points towards the extrude, but rotate\\n // it when we're drawing round end points (a_direction = -1 or 1) since their\\n // extrude vector points in another direction.\\n mediump float u = 0.5 * a_direction;\\n mediump float t = 1.0 - abs(u);\\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\\n\\n // Remove the texture normal bit of the position before scaling it with the\\n // model/view matrix.\\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\\n\\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\\n\\n // position of y on the screen\\n float y = gl_Position.y / gl_Position.w;\\n\\n // how much features are squished in the y direction by the tilt\\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\\n\\n // how much features are squished in all directions by the perspectiveness\\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\\n\\n v_linewidth = vec2(outset, inset);\\n v_gamma_scale = perspective_scale * squish_scale;\\n}\\n\"},outline:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\n#pragma mapbox: define lowp vec4 outline_color\\n#pragma mapbox: define lowp float opacity\\n\\nvarying vec2 v_pos;\\n\\nvoid main() {\\n #pragma mapbox: initialize lowp vec4 outline_color\\n #pragma mapbox: initialize lowp float opacity\\n\\n float dist = length(v_pos - gl_FragCoord.xy);\\n float alpha = smoothstep(1.0, 0.0, dist);\\n gl_FragColor = outline_color * (alpha * opacity);\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nattribute vec2 a_pos;\\n\\nuniform mat4 u_matrix;\\nuniform vec2 u_world;\\n\\nvarying vec2 v_pos;\\n\\n#pragma mapbox: define lowp vec4 outline_color\\n#pragma mapbox: define lowp float opacity\\n\\nvoid main() {\\n #pragma mapbox: initialize lowp vec4 outline_color\\n #pragma mapbox: initialize lowp float opacity\\n\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\\n}\\n\"},outlinepattern:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform float u_opacity;\\nuniform vec2 u_pattern_tl_a;\\nuniform vec2 u_pattern_br_a;\\nuniform vec2 u_pattern_tl_b;\\nuniform vec2 u_pattern_br_b;\\nuniform float u_mix;\\n\\nuniform sampler2D u_image;\\n\\nvarying vec2 v_pos_a;\\nvarying vec2 v_pos_b;\\nvarying vec2 v_pos;\\n\\nvoid main() {\\n vec2 imagecoord = mod(v_pos_a, 1.0);\\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\\n vec4 color1 = texture2D(u_image, pos);\\n\\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\\n vec4 color2 = texture2D(u_image, pos2);\\n\\n // find distance to outline for alpha interpolation\\n\\n float dist = length(v_pos - gl_FragCoord.xy);\\n float alpha = smoothstep(1.0, 0.0, dist);\\n \\n\\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform vec2 u_pattern_size_a;\\nuniform vec2 u_pattern_size_b;\\nuniform vec2 u_pixel_coord_upper;\\nuniform vec2 u_pixel_coord_lower;\\nuniform float u_scale_a;\\nuniform float u_scale_b;\\nuniform float u_tile_units_to_pixels;\\n\\nattribute vec2 a_pos;\\n\\nuniform mat4 u_matrix;\\nuniform vec2 u_world;\\n\\nvarying vec2 v_pos_a;\\nvarying vec2 v_pos_b;\\nvarying vec2 v_pos;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\\n\\n // the correct offset needs to be calculated.\\n //\\n // The offset depends on how many pixels are between the world origin and\\n // the edge of the tile:\\n // vec2 offset = mod(pixel_coord, size)\\n //\\n // At high zoom levels there are a ton of pixels between the world origin\\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\\n // precision for highp floats. We need more than that.\\n //\\n // The pixel_coord is passed in as two 16 bit values:\\n // pixel_coord_upper = floor(pixel_coord / 2^16)\\n // pixel_coord_lower = mod(pixel_coord, 2^16)\\n //\\n // The offset is calculated in a series of steps that should preserve this precision:\\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\\n\\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\\n\\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\\n}\\n\"},pattern:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform float u_opacity;\\nuniform vec2 u_pattern_tl_a;\\nuniform vec2 u_pattern_br_a;\\nuniform vec2 u_pattern_tl_b;\\nuniform vec2 u_pattern_br_b;\\nuniform float u_mix;\\n\\nuniform sampler2D u_image;\\n\\nvarying vec2 v_pos_a;\\nvarying vec2 v_pos_b;\\n\\nvoid main() {\\n\\n vec2 imagecoord = mod(v_pos_a, 1.0);\\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\\n vec4 color1 = texture2D(u_image, pos);\\n\\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\\n vec4 color2 = texture2D(u_image, pos2);\\n\\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform mat4 u_matrix;\\nuniform vec2 u_pattern_size_a;\\nuniform vec2 u_pattern_size_b;\\nuniform vec2 u_pixel_coord_upper;\\nuniform vec2 u_pixel_coord_lower;\\nuniform float u_scale_a;\\nuniform float u_scale_b;\\nuniform float u_tile_units_to_pixels;\\n\\nattribute vec2 a_pos;\\n\\nvarying vec2 v_pos_a;\\nvarying vec2 v_pos_b;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\\n\\n // the correct offset needs to be calculated.\\n //\\n // The offset depends on how many pixels are between the world origin and\\n // the edge of the tile:\\n // vec2 offset = mod(pixel_coord, size)\\n //\\n // At high zoom levels there are a ton of pixels between the world origin\\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\\n // precision for highp floats. We need more than that.\\n //\\n // The pixel_coord is passed in as two 16 bit values:\\n // pixel_coord_upper = floor(pixel_coord / 2^16)\\n // pixel_coord_lower = mod(pixel_coord, 2^16)\\n //\\n // The offset is calculated in a series of steps that should preserve this precision:\\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\\n\\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\\n}\\n\"},raster:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform float u_opacity0;\\nuniform float u_opacity1;\\nuniform sampler2D u_image0;\\nuniform sampler2D u_image1;\\nvarying vec2 v_pos0;\\nvarying vec2 v_pos1;\\n\\nuniform float u_brightness_low;\\nuniform float u_brightness_high;\\n\\nuniform float u_saturation_factor;\\nuniform float u_contrast_factor;\\nuniform vec3 u_spin_weights;\\n\\nvoid main() {\\n\\n // read and cross-fade colors from the main and parent tiles\\n vec4 color0 = texture2D(u_image0, v_pos0);\\n vec4 color1 = texture2D(u_image1, v_pos1);\\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\\n vec3 rgb = color.rgb;\\n\\n // spin\\n rgb = vec3(\\n dot(rgb, u_spin_weights.xyz),\\n dot(rgb, u_spin_weights.zxy),\\n dot(rgb, u_spin_weights.yzx));\\n\\n // saturation\\n float average = (color.r + color.g + color.b) / 3.0;\\n rgb += (average - rgb) * u_saturation_factor;\\n\\n // contrast\\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\\n\\n // brightness\\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\\n\\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform mat4 u_matrix;\\nuniform vec2 u_tl_parent;\\nuniform float u_scale_parent;\\nuniform float u_buffer_scale;\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_texture_pos;\\n\\nvarying vec2 v_pos0;\\nvarying vec2 v_pos1;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\\n}\\n\"},icon:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform sampler2D u_texture;\\nuniform sampler2D u_fadetexture;\\nuniform lowp float u_opacity;\\n\\nvarying vec2 v_tex;\\nvarying vec2 v_fade_tex;\\n\\nvoid main() {\\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_offset;\\nattribute vec2 a_texture_pos;\\nattribute vec4 a_data;\\n\\n\\n// matrix is for the vertex position.\\nuniform mat4 u_matrix;\\n\\nuniform mediump float u_zoom;\\nuniform bool u_rotate_with_map;\\nuniform vec2 u_extrude_scale;\\n\\nuniform vec2 u_texsize;\\n\\nvarying vec2 v_tex;\\nvarying vec2 v_fade_tex;\\n\\nvoid main() {\\n vec2 a_tex = a_texture_pos.xy;\\n mediump float a_labelminzoom = a_data[0];\\n mediump vec2 a_zoom = a_data.pq;\\n mediump float a_minzoom = a_zoom[0];\\n mediump float a_maxzoom = a_zoom[1];\\n\\n // u_zoom is the current zoom level adjusted for the change in font size\\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\\n\\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\\n if (u_rotate_with_map) {\\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\\n gl_Position.z += z * gl_Position.w;\\n } else {\\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\\n }\\n\\n v_tex = a_tex / u_texsize;\\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\\n}\\n\"},sdf:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform sampler2D u_texture;\\nuniform sampler2D u_fadetexture;\\nuniform lowp vec4 u_color;\\nuniform lowp float u_opacity;\\nuniform lowp float u_buffer;\\nuniform lowp float u_gamma;\\n\\nvarying vec2 v_tex;\\nvarying vec2 v_fade_tex;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n lowp float dist = texture2D(u_texture, v_tex).a;\\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\\n lowp float gamma = u_gamma * v_gamma_scale;\\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\\n\\n gl_FragColor = u_color * (alpha * u_opacity);\\n\\n#ifdef OVERDRAW_INSPECTOR\\n gl_FragColor = vec4(1.0);\\n#endif\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nconst float PI = 3.141592653589793;\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_offset;\\nattribute vec2 a_texture_pos;\\nattribute vec4 a_data;\\n\\n\\n// matrix is for the vertex position.\\nuniform mat4 u_matrix;\\n\\nuniform mediump float u_zoom;\\nuniform bool u_rotate_with_map;\\nuniform bool u_pitch_with_map;\\nuniform mediump float u_pitch;\\nuniform mediump float u_bearing;\\nuniform mediump float u_aspect_ratio;\\nuniform vec2 u_extrude_scale;\\n\\nuniform vec2 u_texsize;\\n\\nvarying vec2 v_tex;\\nvarying vec2 v_fade_tex;\\nvarying float v_gamma_scale;\\n\\nvoid main() {\\n vec2 a_tex = a_texture_pos.xy;\\n mediump float a_labelminzoom = a_data[0];\\n mediump vec2 a_zoom = a_data.pq;\\n mediump float a_minzoom = a_zoom[0];\\n mediump float a_maxzoom = a_zoom[1];\\n\\n // u_zoom is the current zoom level adjusted for the change in font size\\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\\n\\n // pitch-alignment: map\\n // rotation-alignment: map | viewport\\n if (u_pitch_with_map) {\\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\\n lowp float asin = sin(angle);\\n lowp float acos = cos(angle);\\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\\n vec2 offset = RotationMatrix * a_offset;\\n vec2 extrude = u_extrude_scale * (offset / 64.0);\\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\\n gl_Position.z += z * gl_Position.w;\\n // pitch-alignment: viewport\\n // rotation-alignment: map\\n } else if (u_rotate_with_map) {\\n // foreshortening factor to apply on pitched maps\\n // as a label goes from horizontal <=> vertical in angle\\n // it goes from 0% foreshortening to up to around 70% foreshortening\\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\\n\\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\\n\\n // use the lineangle to position points a,b along the line\\n // project the points and calculate the label angle in projected space\\n // this calculation allows labels to be rendered unskewed on pitched maps\\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\\n lowp float asin = sin(angle);\\n lowp float acos = cos(angle);\\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\\n\\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\\n vec2 extrude = u_extrude_scale * (offset / 64.0);\\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\\n gl_Position.z += z * gl_Position.w;\\n // pitch-alignment: viewport\\n // rotation-alignment: viewport\\n } else {\\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\\n }\\n\\n v_gamma_scale = (gl_Position.w - 0.5);\\n\\n v_tex = a_tex / u_texsize;\\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\\n}\\n\"},collisionbox:{fragmentSource:\"#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nuniform float u_zoom;\\nuniform float u_maxzoom;\\n\\nvarying float v_max_zoom;\\nvarying float v_placement_zoom;\\n\\nvoid main() {\\n\\n float alpha = 0.5;\\n\\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\\n\\n if (v_placement_zoom > u_zoom) {\\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\\n }\\n\\n if (u_zoom >= v_max_zoom) {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\\n }\\n\\n if (v_placement_zoom >= u_maxzoom) {\\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\\n }\\n}\\n\",vertexSource:\"#ifdef GL_ES\\nprecision highp float;\\n#else\\n#define lowp\\n#define mediump\\n#define highp\\n#endif\\n\\nattribute vec2 a_pos;\\nattribute vec2 a_extrude;\\nattribute vec2 a_data;\\n\\nuniform mat4 u_matrix;\\nuniform float u_scale;\\n\\nvarying float v_max_zoom;\\nvarying float v_placement_zoom;\\n\\nvoid main() {\\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\\n\\n v_max_zoom = a_data.x;\\n v_placement_zoom = a_data.y;\\n}\\n\"}},e.exports.util=\"float evaluate_zoom_function_1(const vec4 values, const float t) {\\n if (t < 1.0) {\\n return mix(values[0], values[1], t);\\n } else if (t < 2.0) {\\n return mix(values[1], values[2], t - 1.0);\\n } else {\\n return mix(values[2], values[3], t - 2.0);\\n }\\n}\\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\\n if (t < 1.0) {\\n return mix(value0, value1, t);\\n } else if (t < 2.0) {\\n return mix(value1, value2, t - 1.0);\\n } else {\\n return mix(value2, value3, t - 2.0);\\n }\\n}\\n\"},{path:476}],304:[function(t,e,r){\"use strict\";function n(t,e){this.message=(t?t+\": \":\"\")+i.apply(i,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var i=t(\"util\").format;e.exports=n},{util:549}],305:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}},{}],306:[function(t,e,r){\"use strict\";e.exports=function(t){return t instanceof Number?\"number\":t instanceof String?\"string\":t instanceof Boolean?\"boolean\":Array.isArray(t)?\"array\":null===t?\"null\":typeof t}},{}],307:[function(t,e,r){\"use strict\";e.exports=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}},{}],308:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"../util/extend\");e.exports=function(e){var r=t(\"./validate_function\"),o=t(\"./validate_object\"),s={\"*\":function(){return[]},array:t(\"./validate_array\"),boolean:t(\"./validate_boolean\"),number:t(\"./validate_number\"),color:t(\"./validate_color\"),constants:t(\"./validate_constants\"),enum:t(\"./validate_enum\"),filter:t(\"./validate_filter\"),function:t(\"./validate_function\"),layer:t(\"./validate_layer\"),object:t(\"./validate_object\"),source:t(\"./validate_source\"),string:t(\"./validate_string\")},l=e.value,u=e.valueSpec,c=e.key,h=e.styleSpec,f=e.style;if(\"string\"===i(l)&&\"@\"===l[0]){if(h.$version>7)return[new n(c,l,\"constants have been deprecated as of v8\")];if(!(l in f.constants))return[new n(c,l,'constant \"%s\" not found',l)];e=a({},e,{value:f.constants[l]})}return u.function&&\"object\"===i(l)?r(e):u.type&&s[u.type]?s[u.type](e):o(a({},e,{valueSpec:u.type?h[u.type]:u}))}},{\"../error/validation_error\":304,\"../util/extend\":305,\"../util/get_type\":306,\"./validate_array\":309,\"./validate_boolean\":310,\"./validate_color\":311,\"./validate_constants\":312,\"./validate_enum\":313,\"./validate_filter\":314,\"./validate_function\":315,\"./validate_layer\":317,\"./validate_number\":319,\"./validate_object\":320,\"./validate_source\":322,\"./validate_string\":323}],309:[function(t,e,r){\"use strict\";var n=t(\"../util/get_type\"),i=t(\"./validate\"),a=t(\"../error/validation_error\");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||i;if(\"array\"!==n(e))return[new a(l,e,\"array expected, %s found\",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,\"array length %d expected, length %d found\",r.length,e.length)];if(r[\"min-length\"]&&e.length<r[\"min-length\"])return[new a(l,e,\"array length at least %d expected, length %d found\",r[\"min-length\"],e.length)];var c={type:r.value};s.$version<7&&(c.function=r.function),\"object\"===n(r.value)&&(c=r.value);for(var h=[],f=0;f<e.length;f++)h=h.concat(u({array:e,arrayIndex:f,value:e[f],valueSpec:c,style:o,styleSpec:s,key:l+\"[\"+f+\"]\"}));return h}},{\"../error/validation_error\":304,\"../util/get_type\":306,\"./validate\":308}],310:[function(t,e,r){\"use strict\";var n=t(\"../util/get_type\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return\"boolean\"!==a?[new i(r,e,\"boolean expected, %s found\",a)]:[]}},{\"../error/validation_error\":304,\"../util/get_type\":306}],311:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"csscolorparser\").parseCSSColor;e.exports=function(t){var e=t.key,r=t.value,o=i(r);return\"string\"!==o?[new n(e,r,\"color expected, %s found\",o)]:null===a(r)?[new n(e,r,'color expected, \"%s\" found',r)]:[]}},{\"../error/validation_error\":304,\"../util/get_type\":306,csscolorparser:108}],312:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\");e.exports=function(t){var e=t.key,r=t.value;if(t.styleSpec.$version>7)return r?[new n(e,r,\"constants have been deprecated as of v8\")]:[];var a=i(r);if(\"object\"!==a)return[new n(e,r,\"object expected, %s found\",a)];var o=[];for(var s in r)\"@\"!==s[0]&&o.push(new n(e+\".\"+s,r[s],'constants must start with \"@\"'));return o}},{\"../error/validation_error\":304,\"../util/get_type\":306}],313:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/unbundle_jsonlint\");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,\"expected one of [%s], %s found\",a.values.join(\", \"),r)),o}},{\"../error/validation_error\":304,\"../util/unbundle_jsonlint\":307}],314:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"./validate_enum\"),a=t(\"../util/get_type\"),o=t(\"../util/unbundle_jsonlint\");e.exports=function t(e){var r,s=e.value,l=e.key,u=e.styleSpec,c=[];if(\"array\"!==a(s))return[new n(l,s,\"array expected, %s found\",a(s))];if(s.length<1)return[new n(l,s,\"filter array must have at least 1 element\")];switch(c=c.concat(i({key:l+\"[0]\",value:s[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case\"<\":case\"<=\":case\">\":case\">=\":s.length>=2&&\"$type\"==s[1]&&c.push(new n(l,s,'\"$type\" cannot be use with operator \"%s\"',s[0]));case\"==\":case\"!=\":3!=s.length&&c.push(new n(l,s,'filter array for operator \"%s\" must have 3 elements',s[0]));case\"in\":case\"!in\":s.length>=2&&(r=a(s[1]),\"string\"!==r?c.push(new n(l+\"[1]\",s[1],\"string expected, %s found\",r)):\"@\"===s[1][0]&&c.push(new n(l+\"[1]\",s[1],\"filter key cannot be a constant\")));for(var h=2;h<s.length;h++)r=a(s[h]),\"$type\"==s[1]?c=c.concat(i({key:l+\"[\"+h+\"]\",value:s[h],valueSpec:u.geometry_type,style:e.style,styleSpec:e.styleSpec})):\"string\"===r&&\"@\"===s[h][0]?c.push(new n(l+\"[\"+h+\"]\",s[h],\"filter value cannot be a constant\")):\"string\"!==r&&\"number\"!==r&&\"boolean\"!==r&&c.push(new n(l+\"[\"+h+\"]\",s[h],\"string, number, or boolean expected, %s found\",r));break;case\"any\":case\"all\":case\"none\":for(h=1;h<s.length;h++)c=c.concat(t({key:l+\"[\"+h+\"]\",value:s[h],style:e.style,styleSpec:e.styleSpec}));break;case\"has\":case\"!has\":r=a(s[1]),2!==s.length?c.push(new n(l,s,'filter array for \"%s\" operator must have 2 elements',s[0])):\"string\"!==r?c.push(new n(l+\"[1]\",s[1],\"string expected, %s found\",r)):\"@\"===s[1][0]&&c.push(new n(l+\"[1]\",s[1],\"filter key cannot be a constant\"))}return c}},{\"../error/validation_error\":304,\"../util/get_type\":306,\n", | |
"\"../util/unbundle_jsonlint\":307,\"./validate_enum\":313}],315:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"./validate\"),o=t(\"./validate_object\"),s=t(\"./validate_array\"),l=t(\"./validate_number\");e.exports=function(t){function e(t){var e=[],a=t.value;return e=e.concat(s({key:t.key,value:a,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:r})),\"array\"===i(a)&&0===a.length&&e.push(new n(t.key,a,\"array must have at least one stop\")),e}function r(t){var e=[],r=t.value,s=t.key;if(\"array\"!==i(r))return[new n(s,r,\"array expected, %s found\",i(r))];if(2!==r.length)return[new n(s,r,\"array length %d expected, length %d found\",2,r.length)];var f=i(r[0]);if(c||(c=f),f!==c)return[new n(s,r,\"%s stop key type must match previous stop key type %s\",f,c)];if(\"object\"===f){if(void 0===r[0].zoom)return[new n(s,r,\"object stop key must have zoom\")];if(void 0===r[0].value)return[new n(s,r,\"object stop key must have value\")];e=e.concat(o({key:s+\"[0]\",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:u}}))}else e=e.concat((d?l:u)({key:s+\"[0]\",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return e=e.concat(a({key:s+\"[1]\",value:r[1],valueSpec:h,style:t.style,styleSpec:t.styleSpec})),\"number\"===i(r[0])&&(\"piecewise-constant\"===h.function&&r[0]%1!=0&&e.push(new n(s+\"[0]\",r[0],\"zoom level for piecewise-constant functions must be an integer\")),0!==t.arrayIndex&&r[0]<t.array[t.arrayIndex-1][0]&&e.push(new n(s+\"[0]\",r[0],\"array stops must appear in ascending order\"))),e}function u(t){var e=[],r=i(t.value);return\"number\"!==r&&\"string\"!==r&&\"array\"!==r&&e.push(new n(t.key,t.value,\"property value must be a number, string or array\")),e}var c,h=t.valueSpec,f=void 0!==t.value.property||\"object\"===c,d=void 0===t.value.property||\"object\"===c,p=o({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:e}});return t.styleSpec.$version>=8&&(f&&!t.valueSpec[\"property-function\"]?p.push(new n(t.key,t.value,\"property functions not supported\")):d&&!t.valueSpec[\"zoom-function\"]&&p.push(new n(t.key,t.value,\"zoom functions not supported\"))),p}},{\"../error/validation_error\":304,\"../util/get_type\":306,\"./validate\":308,\"./validate_array\":309,\"./validate_number\":319,\"./validate_object\":320}],316:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"./validate_string\");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf(\"{fontstack}\")&&a.push(new n(r,e,'\"glyphs\" url must include a \"{fontstack}\" token')),-1===e.indexOf(\"{range}\")&&a.push(new n(r,e,'\"glyphs\" url must include a \"{range}\" token')),a)}},{\"../error/validation_error\":304,\"./validate_string\":323}],317:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/unbundle_jsonlint\"),a=t(\"./validate_object\"),o=t(\"./validate_filter\"),s=t(\"./validate_paint_property\"),l=t(\"./validate_layout_property\"),u=t(\"../util/extend\");e.exports=function(t){var e=[],r=t.value,c=t.key,h=t.style,f=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either \"type\" or \"ref\" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;m<t.arrayIndex;m++){var g=h.layers[m];i(g.id)===i(r.id)&&e.push(new n(c,r.id,'duplicate layer id \"%s\", previously used at line %d',r.id,g.id.__line__))}if(\"ref\"in r){[\"type\",\"source\",\"source-layer\",\"filter\",\"layout\"].forEach(function(t){t in r&&e.push(new n(c,r[t],'\"%s\" is prohibited for ref layers',t))});var v;h.layers.forEach(function(t){t.id==p&&(v=t)}),v?v.ref?e.push(new n(c,r.ref,\"ref cannot reference another ref layer\")):d=i(v.type):e.push(new n(c,r.ref,'ref layer \"%s\" not found',p))}else if(\"background\"!==d)if(r.source){var y=h.sources&&h.sources[r.source];y?\"vector\"==y.type&&\"raster\"==d?e.push(new n(c,r.source,'layer \"%s\" requires a raster source',r.id)):\"raster\"==y.type&&\"raster\"!=d?e.push(new n(c,r.source,'layer \"%s\" requires a vector source',r.id)):\"vector\"!=y.type||r[\"source-layer\"]||e.push(new n(c,r,'layer \"%s\" must specify a \"source-layer\"',r.id)):e.push(new n(c,r.source,'source \"%s\" not found',r.source))}else e.push(new n(c,r,'missing required property \"source\"'));return e=e.concat(a({key:c,value:r,valueSpec:f.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{filter:o,layout:function(t){return a({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{\"*\":function(t){return l(u({layerType:d},t))}}})},paint:function(t){return a({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{\"*\":function(t){return s(u({layerType:d},t))}}})}}}))}},{\"../error/validation_error\":304,\"../util/extend\":305,\"../util/unbundle_jsonlint\":307,\"./validate_filter\":314,\"./validate_layout_property\":318,\"./validate_object\":320,\"./validate_paint_property\":321}],318:[function(t,e,r){\"use strict\";var n=t(\"./validate\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a[\"layout_\"+t.layerType];if(t.valueSpec||l[s]){var u=[];return\"symbol\"===t.layerType&&(\"icon-image\"===s&&r&&!r.sprite?u.push(new i(e,o,'use of \"icon-image\" requires a style \"sprite\" property')):\"text-field\"===s&&r&&!r.glyphs&&u.push(new i(e,o,'use of \"text-field\" requires a style \"glyphs\" property'))),u.concat(n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}))}return[new i(e,o,'unknown property \"%s\"',s)]}},{\"../error/validation_error\":304,\"./validate\":308}],319:[function(t,e,r){\"use strict\";var n=t(\"../util/get_type\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=n(r);return\"number\"!==o?[new i(e,r,\"number expected, %s found\",o)]:\"minimum\"in a&&r<a.minimum?[new i(e,r,\"%s is less than the minimum value %s\",r,a.minimum)]:\"maximum\"in a&&r>a.maximum?[new i(e,r,\"%s is greater than the maximum value %s\",r,a.maximum)]:[]}},{\"../error/validation_error\":304,\"../util/get_type\":306}],320:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/get_type\"),a=t(\"./validate\");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],h=i(r);if(\"object\"!==h)return[new n(e,r,\"object expected, %s found\",h)];for(var f in r){var d=f.split(\".\")[0],p=o&&(o[d]||o[\"*\"]),m=s[d]||s[\"*\"];p||m?c=c.concat((m||a)({key:(e?e+\".\":e)+f,value:r[f],valueSpec:p,style:l,styleSpec:u,object:r,objectKey:f})):\"\"!==e&&1!==e.split(\".\").length&&c.push(new n(e,r[f],'unknown property \"%s\"',f))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&c.push(new n(e,r,'missing required property \"%s\"',d));return c}},{\"../error/validation_error\":304,\"../util/get_type\":306,\"./validate\":308}],321:[function(t,e,r){\"use strict\";var n=t(\"./validate\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a[\"paint_\"+t.layerType],u=s.match(/^(.*)-transition$/);return u&&l[u[1]]&&l[u[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property \"%s\"',s)]}},{\"../error/validation_error\":304,\"./validate\":308}],322:[function(t,e,r){\"use strict\";var n=t(\"../error/validation_error\"),i=t(\"../util/unbundle_jsonlint\"),a=t(\"./validate_object\"),o=t(\"./validate_enum\");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'\"type\" is required')];switch(i(e.type)){case\"vector\":case\"raster\":var u=[];if(u=u.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),\"url\"in e)for(var c in e)[\"type\",\"url\",\"tileSize\"].indexOf(c)<0&&u.push(new n(r+\".\"+c,e[c],'a source with a \"url\" property may not include a \"%s\" property',c));return u;case\"geojson\":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case\"video\":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case\"image\":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+\".type\",value:e.type,valueSpec:{values:[\"vector\",\"raster\",\"geojson\",\"video\",\"image\"]},style:l,styleSpec:s})}}},{\"../error/validation_error\":304,\"../util/unbundle_jsonlint\":307,\"./validate_enum\":313,\"./validate_object\":320}],323:[function(t,e,r){\"use strict\";var n=t(\"../util/get_type\"),i=t(\"../error/validation_error\");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return\"string\"!==a?[new i(r,e,\"string expected, %s found\",a)]:[]}},{\"../error/validation_error\":304,\"../util/get_type\":306}],324:[function(t,e,r){\"use strict\";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:\"\",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u}})),e.$version>7&&t.constants&&(r=r.concat(o({key:\"constants\",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t(\"./validate/validate_constants\"),s=t(\"./validate/validate\"),l=t(\"../reference/latest.min\"),u=t(\"./validate/validate_glyphs_url\");n.source=a(t(\"./validate/validate_source\")),n.layer=a(t(\"./validate/validate_layer\")),n.filter=a(t(\"./validate/validate_filter\")),n.paintProperty=a(t(\"./validate/validate_paint_property\")),n.layoutProperty=a(t(\"./validate/validate_layout_property\")),e.exports=n},{\"../reference/latest.min\":325,\"./validate/validate\":308,\"./validate/validate_constants\":312,\"./validate/validate_filter\":314,\"./validate/validate_glyphs_url\":316,\"./validate/validate_layer\":317,\"./validate/validate_layout_property\":318,\"./validate/validate_paint_property\":321,\"./validate/validate_source\":322}],325:[function(t,e,r){e.exports=t(\"./v8.min.json\")},{\"./v8.min.json\":326}],326:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:\"enum\",values:[8]},name:{type:\"string\"},metadata:{type:\"*\"},center:{type:\"array\",value:\"number\"},zoom:{type:\"number\"},bearing:{type:\"number\",default:0,period:360,units:\"degrees\"},pitch:{type:\"number\",default:0,units:\"degrees\"},sources:{required:!0,type:\"sources\"},sprite:{type:\"string\"},glyphs:{type:\"string\"},transition:{type:\"transition\"},layers:{required:!0,type:\"array\",value:\"layer\"}},sources:{\"*\":{type:\"source\"}},source:[\"source_tile\",\"source_geojson\",\"source_video\",\"source_image\"],source_tile:{type:{required:!0,type:\"enum\",values:[\"vector\",\"raster\"]},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},tileSize:{type:\"number\",default:512,units:\"pixels\"},\"*\":{type:\"*\"}},source_geojson:{type:{required:!0,type:\"enum\",values:[\"geojson\"]},data:{type:\"*\"},maxzoom:{type:\"number\",default:14},buffer:{type:\"number\",default:64},tolerance:{type:\"number\",default:3},cluster:{type:\"boolean\",default:!1},clusterRadius:{type:\"number\",default:400},clusterMaxZoom:{type:\"number\"}},source_video:{type:{required:!0,type:\"enum\",values:[\"video\"]},urls:{required:!0,type:\"array\",value:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},source_image:{type:{required:!0,type:\"enum\",values:[\"image\"]},url:{required:!0,type:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},layer:{id:{type:\"string\",required:!0},type:{type:\"enum\",values:[\"fill\",\"line\",\"symbol\",\"circle\",\"raster\",\"background\"]},metadata:{type:\"*\"},ref:{type:\"string\"},source:{type:\"string\"},\"source-layer\":{type:\"string\"},minzoom:{type:\"number\",minimum:0,maximum:22},maxzoom:{type:\"number\",minimum:0,maximum:22},interactive:{type:\"boolean\",default:!1},filter:{type:\"filter\"},layout:{type:\"layout\"},paint:{type:\"paint\"},\"paint.*\":{type:\"paint\"}},layout:[\"layout_fill\",\"layout_line\",\"layout_circle\",\"layout_symbol\",\"layout_raster\",\"layout_background\"],layout_background:{visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},layout_fill:{visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},layout_circle:{visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},layout_line:{\"line-cap\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"butt\",\"round\",\"square\"],default:\"butt\"},\"line-join\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"bevel\",\"round\",\"miter\"],default:\"miter\"},\"line-miter-limit\":{type:\"number\",default:2,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[{\"line-join\":\"miter\"}]},\"line-round-limit\":{type:\"number\",default:1.05,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[{\"line-join\":\"round\"}]},visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},layout_symbol:{\"symbol-placement\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"point\",\"line\"],default:\"point\"},\"symbol-spacing\":{type:\"number\",default:250,minimum:1,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,units:\"pixels\",requires:[{\"symbol-placement\":\"line\"}]},\"symbol-avoid-edges\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1},\"icon-allow-overlap\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"icon-image\"]},\"icon-ignore-placement\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"icon-image\"]},\"icon-optional\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"icon-image\",\"text-field\"]},\"icon-rotation-alignment\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"viewport\",requires:[\"icon-image\"]},\"icon-size\":{type:\"number\",default:1,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"icon-image\"]},\"icon-text-fit\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!1,values:[\"none\",\"both\",\"width\",\"height\"],default:\"none\",requires:[\"icon-image\",\"text-field\"]},\"icon-text-fit-padding\":{type:\"array\",value:\"number\",length:4,default:[0,0,0,0],units:\"pixels\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"icon-image\",\"icon-text-fit\",\"text-field\"]},\"icon-image\":{type:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,tokens:!0},\"icon-rotate\":{type:\"number\",default:0,period:360,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,units:\"degrees\",requires:[\"icon-image\"]},\"icon-padding\":{type:\"number\",default:2,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,units:\"pixels\",requires:[\"icon-image\"]},\"icon-keep-upright\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"icon-image\",{\"icon-rotation-alignment\":\"map\"},{\"symbol-placement\":\"line\"}]},\"icon-offset\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"icon-image\"]},\"text-pitch-alignment\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],requires:[\"text-field\"]},\"text-rotation-alignment\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"viewport\",requires:[\"text-field\"]},\"text-field\":{type:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:\"\",tokens:!0},\"text-font\":{type:\"array\",value:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:[\"Open Sans Regular\",\"Arial Unicode MS Regular\"],requires:[\"text-field\"]},\"text-size\":{type:\"number\",default:16,minimum:0,units:\"pixels\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-max-width\":{type:\"number\",default:10,minimum:0,units:\"em\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-line-height\":{type:\"number\",default:1.2,units:\"em\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-letter-spacing\":{type:\"number\",default:0,units:\"em\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-justify\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"left\",\"center\",\"right\"],default:\"center\",requires:[\"text-field\"]},\"text-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"center\",\"left\",\"right\",\"top\",\"bottom\",\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"],default:\"center\",requires:[\"text-field\"]},\"text-max-angle\":{type:\"number\",default:45,units:\"degrees\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\",{\"symbol-placement\":\"line\"}]},\"text-rotate\":{type:\"number\",default:0,period:360,units:\"degrees\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-padding\":{type:\"number\",default:2,minimum:0,units:\"pixels\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,requires:[\"text-field\"]},\"text-keep-upright\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!0,requires:[\"text-field\",{\"text-rotation-alignment\":\"map\"},{\"symbol-placement\":\"line\"}]},\"text-transform\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"none\",\"uppercase\",\"lowercase\"],default:\"none\",requires:[\"text-field\"]},\"text-offset\":{type:\"array\",value:\"number\",units:\"ems\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,length:2,default:[0,0],requires:[\"text-field\"]},\"text-allow-overlap\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"text-field\"]},\"text-ignore-placement\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"text-field\"]},\"text-optional\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!1,requires:[\"text-field\",\"icon-image\"]},visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},layout_raster:{visibility:{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,values:[\"visible\",\"none\"],default:\"visible\"}},filter:{type:\"array\",value:\"*\"},filter_operator:{type:\"enum\",values:[\"==\",\"!=\",\">\",\">=\",\"<\",\"<=\",\"in\",\"!in\",\"all\",\"any\",\"none\",\"has\",\"!has\"]},geometry_type:{type:\"enum\",values:[\"Point\",\"LineString\",\"Polygon\"]},color_operation:{type:\"enum\",values:[\"lighten\",\"saturate\",\"spin\",\"fade\",\"mix\"]},function:{stops:{type:\"array\",required:!0,value:\"function_stop\"},base:{type:\"number\",default:1,minimum:0},property:{type:\"string\",default:\"$zoom\"},type:{type:\"enum\",values:[\"exponential\",\"interval\",\"categorical\"],default:\"exponential\"}},function_stop:{type:\"array\",minimum:0,maximum:22,value:[\"number\",\"color\"],length:2},paint:[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_symbol\",\"paint_raster\",\"paint_background\"],paint_fill:{\"fill-antialias\":{type:\"boolean\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,default:!0},\"fill-opacity\":{type:\"number\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,default:1,minimum:0,maximum:1,transition:!0},\"fill-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[{\"!\":\"fill-pattern\"}]},\"fill-outline-color\":{type:\"color\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[{\"!\":\"fill-pattern\"},{\"fill-antialias\":!0}]},\"fill-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"fill-translate-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\",requires:[\"fill-translate\"]},\"fill-pattern\":{type:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,transition:!0}},paint_line:{\"line-opacity\":{type:\"number\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,default:1,minimum:0,maximum:1,transition:!0},\"line-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[{\"!\":\"line-pattern\"}]},\"line-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"line-translate-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\",requires:[\"line-translate\"]},\"line-width\":{type:\"number\",default:1,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"line-gap-width\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"line-offset\":{type:\"number\",default:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"line-blur\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"line-dasharray\":{type:\"array\",value:\"number\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,minimum:0,transition:!0,units:\"line widths\",requires:[{\"!\":\"line-pattern\"}]},\"line-pattern\":{type:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,transition:!0}},paint_circle:{\"circle-radius\":{type:\"number\",default:5,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"circle-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0},\"circle-blur\":{type:\"number\",default:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0},\"circle-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0},\"circle-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\"},\"circle-translate-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\",requires:[\"circle-translate\"]},\"circle-pitch-scale\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\"}},paint_symbol:{\"icon-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"icon-image\"]},\"icon-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"icon-image\"]},\"icon-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"icon-image\"]},\"icon-halo-width\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"icon-image\"]},\"icon-halo-blur\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"icon-image\"]},\"icon-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"icon-image\"]},\"icon-translate-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\",requires:[\"icon-image\",\"icon-translate\"]},\"text-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"text-field\"]},\"text-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"text-field\"]},\"text-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,requires:[\"text-field\"]},\"text-halo-width\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"text-field\"]},\"text-halo-blur\":{type:\"number\",default:0,minimum:0,function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"text-field\"]},\"text-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],function:\"interpolated\",\"zoom-function\":!0,\"property-function\":!0,transition:!0,units:\"pixels\",requires:[\"text-field\"]},\"text-translate-anchor\":{type:\"enum\",function:\"piecewise-constant\",\"zoom-function\":!0,\"property-function\":!0,values:[\"map\",\"viewport\"],default:\"map\",requires:[\"text-field\",\"text-translate\"]}},paint_raster:{\"raster-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,function:\"interpolated\",\"zoom-function\":!0,transition:!0},\"raster-hue-rotate\":{type:\"number\",default:0,period:360,function:\"interpolated\",\"zoom-function\":!0,transition:!0,units:\"degrees\"},\"raster-brightness-min\":{type:\"number\",function:\"interpolated\",\"zoom-function\":!0,default:0,minimum:0,maximum:1,transition:!0},\"raster-brightness-max\":{type:\"number\",function:\"interpolated\",\"zoom-function\":!0,default:1,minimum:0,maximum:1,transition:!0},\"raster-saturation\":{type:\"number\",default:0,minimum:-1,maximum:1,function:\"interpolated\",\"zoom-function\":!0,transition:!0},\"raster-contrast\":{type:\"number\",default:0,minimum:-1,maximum:1,function:\"interpolated\",\"zoom-function\":!0,transition:!0},\"raster-fade-duration\":{type:\"number\",default:300,minimum:0,function:\"interpolated\",\"zoom-function\":!0,transition:!0,units:\"milliseconds\"}},paint_background:{\"background-color\":{type:\"color\",default:\"#000000\",function:\"interpolated\",\"zoom-function\":!0,transition:!0,requires:[{\"!\":\"background-pattern\"}]},\"background-pattern\":{type:\"string\",function:\"piecewise-constant\",\"zoom-function\":!0,transition:!0},\"background-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,function:\"interpolated\",\"zoom-function\":!0,transition:!0}},transition:{duration:{type:\"number\",default:300,minimum:0,units:\"milliseconds\"},delay:{type:\"number\",default:0,minimum:0,units:\"milliseconds\"}}}},{}],327:[function(t,e,r){\"use strict\";function n(t){return!!(i()&&a()&&o()&&s()&&l()&&u()&&c()&&h(t&&t.failIfMajorPerformanceCaveat))}function i(){return\"undefined\"!=typeof window&&\"undefined\"!=typeof document}function a(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function o(){return Function.prototype&&Function.prototype.bind}function s(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function l(){return\"JSON\"in window&&\"parse\"in JSON&&\"stringify\"in JSON}function u(){return\"Worker\"in window}function c(){return\"Uint8ClampedArray\"in window}function h(t){return void 0===d[t]&&(d[t]=f(t)),d[t]}function f(t){var e=document.createElement(\"canvas\"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext(\"webgl\",r)||e.probablySupportsContext(\"experimental-webgl\",r):e.supportsContext?e.supportsContext(\"webgl\",r)||e.supportsContext(\"experimental-webgl\",r):e.getContext(\"webgl\",r)||e.getContext(\"experimental-webgl\",r)}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var d={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],328:[function(t,e,r){\"use strict\";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t(\"../util/util\");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{\"../util/util\":442}],329:[function(t,e,r){\"use strict\";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=i(this),t.arrays){var e=this.programInterfaces;this.bufferGroups=c.mapObject(t.arrays,function(r,n){var i=e[n],a=t.paintVertexArrayTypes[n];return r.map(function(t){return new u(t,{layoutVertexArrayType:i.layoutVertexArrayType.serialize(),elementArrayType:i.elementArrayType&&i.elementArrayType.serialize(),elementArrayType2:i.elementArrayType2&&i.elementArrayType2.serialize(),paintVertexArrayTypes:a})})})}}function i(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},i=0;i<t.childLayers.length;i++){n[t.childLayers[i].id]={attributes:[],uniforms:[],defines:[],vertexPragmas:{define:{},initialize:{}},fragmentPragmas:{define:{},initialize:{}}}}var s=t.programInterfaces[r];if(s.paintAttributes)for(var l=0;l<s.paintAttributes.length;l++){var u=s.paintAttributes[l];u.multiplier=u.multiplier||1;for(var h=0;h<t.childLayers.length;h++){var d=t.childLayers[h],p=n[d.id],m=u.name;f(\"a_\"===u.name.slice(0,2));var g,v=u.name.slice(2);if(p.fragmentPragmas.initialize[v]=\"\",d.isPaintValueFeatureConstant(u.paintProperty))p.uniforms.push(u),p.fragmentPragmas.define[v]=p.vertexPragmas.define[v]=[\"uniform\",\"{precision}\",\"{type}\",m].join(\" \")+\";\",p.fragmentPragmas.initialize[v]=p.vertexPragmas.initialize[v]=[\"{precision}\",\"{type}\",v,\"=\",m].join(\" \")+\";\\n\";else if(d.isPaintValueZoomConstant(u.paintProperty)){p.attributes.push(c.extend({},u,{name:m})),g=[\"varying\",\"{precision}\",\"{type}\",v].join(\" \")+\";\\n\"\n", | |
";var y=[p.fragmentPragmas.define[v],\"attribute\",\"{precision}\",\"{type}\",m].join(\" \")+\";\\n\";p.fragmentPragmas.define[v]=g,p.vertexPragmas.define[v]=g+y,p.vertexPragmas.initialize[v]=[v,\"=\",m,\"/\",u.multiplier.toFixed(1)].join(\" \")+\";\\n\"}else{for(var b=\"u_\"+m.slice(2)+\"_t\",x=d.getPaintValueStopZoomLevels(u.paintProperty),_=0;_<x.length&&x[_]<t.zoom;)_++;for(var w=Math.max(0,Math.min(x.length-4,_-2)),M=[],k=0;k<4;k++)M.push(x[Math.min(w+k,x.length-1)]);g=[\"varying\",\"{precision}\",\"{type}\",v].join(\" \")+\";\\n\",p.vertexPragmas.define[v]=g+[\"uniform\",\"lowp\",\"float\",b].join(\" \")+\";\\n\",p.fragmentPragmas.define[v]=g,p.uniforms.push(c.extend({},u,{name:b,getValue:o(u,w),components:1}));var A=u.components;if(1===A)p.attributes.push(c.extend({},u,{getValue:a(u,M),isFunction:!0,components:4*A})),p.vertexPragmas.define[v]+=[\"attribute\",\"{precision}\",\"vec4\",m].join(\" \")+\";\\n\",p.vertexPragmas.initialize[v]=[v,\"=\",\"evaluate_zoom_function_1(\"+m+\", \"+b+\")\",\"/\",u.multiplier.toFixed(1)].join(\" \")+\";\\n\";else{for(var T=[],S=0;S<4;S++)T.push(m+S),p.attributes.push(c.extend({},u,{getValue:a(u,[M[S]]),isFunction:!0,name:m+S})),p.vertexPragmas.define[v]+=[\"attribute\",\"{precision}\",\"{type}\",m+S].join(\" \")+\";\\n\";p.vertexPragmas.initialize[v]=[v,\" = \",\"evaluate_zoom_function_4(\"+T.join(\", \")+\", \"+b+\")\",\"/\",u.multiplier.toFixed(1)].join(\" \")+\";\\n\"}}}}}return e}function a(t,e){return function(r,n,i){if(1===e.length)return t.getValue(r,c.extend({},n,{zoom:e[0]}),i);for(var a=[],o=0;o<e.length;o++){var s=e[o];a.push(t.getValue(r,c.extend({},n,{zoom:s}),i)[0])}return a}}function o(t,e){return function(r,n){var i=r.getPaintInterpolationT(t.paintProperty,n.zoom);return[Math.max(0,Math.min(4,i-e))]}}var s=t(\"feature-filter\"),l=t(\"./array_group\"),u=t(\"./buffer_group\"),c=t(\"../util/util\"),h=t(\"../util/struct_array\"),f=t(\"assert\");e.exports=n,n.create=function(e){return new({fill:t(\"./bucket/fill_bucket\"),line:t(\"./bucket/line_bucket\"),circle:t(\"./bucket/circle_bucket\"),symbol:t(\"./bucket/symbol_bucket\")}[e.layer.type])(e)},n.EXTENT=8192,n.prototype.populateArrays=function(){this.createArrays(),this.recalculateStyleLayers();for(var t=0;t<this.features.length;t++)this.addFeature(this.features[t]);this.trimArrays()},n.prototype.prepareArrayGroup=function(t,e){var r=this.arrayGroups[t],n=r.length&&r[r.length-1];return n&&n.hasCapacityFor(e)||(n=new l({layoutVertexArrayType:this.programInterfaces[t].layoutVertexArrayType,elementArrayType:this.programInterfaces[t].elementArrayType,elementArrayType2:this.programInterfaces[t].elementArrayType2,paintVertexArrayTypes:this.paintVertexArrayTypes[t]}),n.index=r.length,r.push(n)),n},n.prototype.createArrays=function(){this.arrayGroups={},this.paintVertexArrayTypes={};for(var t in this.programInterfaces){this.arrayGroups[t]=[];var e=this.paintVertexArrayTypes[t]={},r=this.paintAttributes[t];for(var i in r)e[i]=new n.VertexArrayType(r[i].attributes)}},n.prototype.destroy=function(t){for(var e in this.bufferGroups)for(var r=this.bufferGroups[e],n=0;n<r.length;n++)r[n].destroy(t)},n.prototype.trimArrays=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)e[r].trim()},n.prototype.isEmpty=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)if(!e[r].isEmpty())return!1;return!0},n.prototype.getTransferables=function(t){for(var e in this.arrayGroups)for(var r=this.arrayGroups[e],n=0;n<r.length;n++)r[n].getTransferables(t)},n.prototype.setUniforms=function(t,e,r,n,i){for(var a=this.paintAttributes[e][n.id].uniforms,o=0;o<a.length;o++){var s=a[o],l=r[s.name];t[\"uniform\"+s.components+\"fv\"](l,s.getValue(n,i))}},n.prototype.serialize=function(){return{layerId:this.layer.id,zoom:this.zoom,arrays:c.mapObject(this.arrayGroups,function(t){return t.map(function(t){return t.serialize()})}),paintVertexArrayTypes:c.mapObject(this.paintVertexArrayTypes,function(t){return c.mapObject(t,function(t){return t.serialize()})}),childLayerIds:this.childLayers.map(function(t){return t.id})}},n.prototype.createFilter=function(){this.filter||(this.filter=s(this.layer.filter))};var d={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};n.prototype.recalculateStyleLayers=function(){for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].recalculate(this.zoom,d)},n.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a=0;a<this.childLayers.length;a++)for(var o=this.childLayers[a],s=this.arrayGroups[t],l=n.index;l<s.length;l++){var u=s[l],c=u.layoutVertexArray.length,h=u.paintVertexArrays[o.id];h.resize(c);for(var f=this.paintAttributes[t][o.id].attributes,d=0;d<f.length;d++)for(var p=f[d],m=p.getValue(o,e,r),g=p.multiplier||1,v=p.components||1,y=l===n.index?i:0,b=y;b<c;b++)for(var x=h.get(b),_=0;_<v;_++){var w=v>1?p.name+_:p.name;x[w]=m[_]*g}}},n.VertexArrayType=function(t){return new h({members:t,alignment:4})},n.ElementArrayType=function(t){return new h({members:[{type:\"Uint16\",name:\"vertices\",components:t||3}]})}},{\"../util/struct_array\":440,\"../util/util\":442,\"./array_group\":328,\"./bucket/circle_bucket\":330,\"./bucket/fill_bucket\":331,\"./bucket/line_bucket\":332,\"./bucket/symbol_bucket\":333,\"./buffer_group\":335,assert:47,\"feature-filter\":132}],330:[function(t,e,r){\"use strict\";function n(){i.apply(this,arguments)}var i=t(\"../bucket\"),a=t(\"../../util/util\"),o=t(\"../load_geometry\"),s=i.EXTENT;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:\"a_color\",components:4,type:\"Uint8\",getValue:function(t,e,r){return t.getPaintValue(\"circle-color\",e,r)},multiplier:255,paintProperty:\"circle-color\"},{name:\"a_radius\",components:1,type:\"Uint16\",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue(\"circle-radius\",e,r)]},multiplier:10,paintProperty:\"circle-radius\"},{name:\"a_blur\",components:1,type:\"Uint16\",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue(\"circle-blur\",e,r)]},multiplier:10,paintProperty:\"circle-blur\"},{name:\"a_opacity\",components:1,type:\"Uint16\",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue(\"circle-opacity\",e,r)]},multiplier:255,paintProperty:\"circle-opacity\"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup(\"circle\",0),i=n.layoutVertexArray.length,a=0;a<r.length;a++)for(var l=0;l<r[a].length;l++){var u=r[a][l].x,c=r[a][l].y;if(!(u<0||u>=s||c<0||c>=s)){var h=this.prepareArrayGroup(\"circle\",4),f=h.layoutVertexArray,d=this.addCircleVertex(f,u,c,-1,-1);this.addCircleVertex(f,u,c,1,-1),this.addCircleVertex(f,u,c,1,1),this.addCircleVertex(f,u,c,-1,1),h.elementArray.emplaceBack(d,d+1,d+2),h.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays(\"circle\",e,t.properties,n,i)}},{\"../../util/util\":442,\"../bucket\":329,\"../load_geometry\":337}],331:[function(t,e,r){\"use strict\";function n(){i.apply(this,arguments)}var i=t(\"../bucket\"),a=t(\"../../util/util\"),o=t(\"../load_geometry\"),s=t(\"earcut\"),l=t(\"../../util/classify_rings\");e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:\"a_color\",components:4,type:\"Uint8\",getValue:function(t,e,r){return t.getPaintValue(\"fill-color\",e,r)},multiplier:255,paintProperty:\"fill-color\"},{name:\"a_outline_color\",components:4,type:\"Uint8\",getValue:function(t,e,r){return t.getPaintValue(\"fill-outline-color\",e,r)},multiplier:255,paintProperty:\"fill-outline-color\"},{name:\"a_opacity\",components:1,type:\"Uint8\",getValue:function(t,e,r){return[t.getPaintValue(\"fill-opacity\",e,r)]},multiplier:255,paintProperty:\"fill-opacity\"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup(\"fill\",0),i=n.layoutVertexArray.length,a=0;a<r.length;a++)this.addPolygon(r[a]);this.populatePaintArrays(\"fill\",{zoom:this.zoom},t.properties,n,i)},n.prototype.addPolygon=function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r].length;for(var n=this.prepareArrayGroup(\"fill\",e),i=[],a=[],o=n.layoutVertexArray.length,l=0;l<t.length;l++){var u=t[l];l>0&&a.push(i.length/2);for(var c=0;c<u.length;c++){var h=u[c],f=n.layoutVertexArray.emplaceBack(h.x,h.y);c>=1&&n.elementArray2.emplaceBack(f-1,f),i.push(h.x),i.push(h.y)}}for(var d=s(i,a),p=0;p<d.length;p++)n.elementArray.emplaceBack(d[p]+o)}},{\"../../util/classify_rings\":430,\"../../util/util\":442,\"../bucket\":329,\"../load_geometry\":337,earcut:126}],332:[function(t,e,r){\"use strict\";function n(){i.apply(this,arguments)}var i=t(\"../bucket\"),a=t(\"../../util/util\"),o=t(\"../load_geometry\"),s=i.EXTENT,l=Math.cos(Math.PI/180*37.5),u=Math.pow(2,14)/.5;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.addLineVertex=function(t,e,r,n,i,a,o){return t.emplaceBack(e.x<<1|n,e.y<<1|i,Math.round(63*r.x)+128,Math.round(63*r.y)+128,1+(0===a?0:a<0?-1:1)|(.5*o&63)<<2,.5*o>>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint8\"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r<e.length;r++)this.addLine(e[r],this.layer.layout[\"line-join\"],this.layer.layout[\"line-cap\"],this.layer.layout[\"line-miter-limit\"],this.layer.layout[\"line-round-limit\"])},n.prototype.addLine=function(t,e,r,n,i){for(var a=t.length;a>2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){\"bevel\"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,u=t[0],c=t[a-1],h=u.equals(c);if(this.prepareArrayGroup(\"line\",10*a),2!==a||!h){this.distance=0;var f,d,p,m,g,v,y,b=r,x=h?\"butt\":r,_=!0;this.e1=this.e2=this.e3=-1,h&&(f=t[a-2],g=u.sub(f)._unit()._perp());for(var w=0;w<a;w++)if(!(p=h&&w===a-1?t[1]:t[w+1])||!t[w].equals(p)){g&&(m=g),f&&(d=f),f=t[w],g=p?p.sub(f)._unit()._perp():m,m=m||g;var M=m.add(g)._unit(),k=M.x*g.x+M.y*g.y,A=1/k,T=k<l&&d&&p;if(T&&w>0){var S=f.dist(d);if(S>2*o){var E=f.sub(f.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var L=d&&p,C=L?e:p?b:x;if(L&&\"round\"===C&&(A<i?C=\"miter\":A<=2&&(C=\"fakeround\")),\"miter\"===C&&A>n&&(C=\"bevel\"),\"bevel\"===C&&(A>2&&(C=\"flipbevel\"),A<n&&(C=\"miter\")),d&&(this.distance+=f.dist(d)),\"miter\"===C)M._mult(A),this.addCurrentVertex(f,this.distance,M,0,0,!1);else if(\"flipbevel\"===C){if(A>100)M=g.clone();else{var I=m.x*g.y-m.y*g.x>0?-1:1,z=A*m.add(g).mag()/m.sub(g).mag();M._perp()._mult(z*I)}this.addCurrentVertex(f,this.distance,M,0,0,!1),this.addCurrentVertex(f,this.distance,M.mult(-1),0,0,!1)}else if(\"bevel\"===C||\"fakeround\"===C){var D=m.x*g.y-m.y*g.x>0,P=-Math.sqrt(A*A-1);if(D?(y=0,v=P):(v=0,y=P),_||this.addCurrentVertex(f,this.distance,m,v,y,!1),\"fakeround\"===C){for(var O,R=Math.floor(8*(.5-(k-.5))),F=0;F<R;F++)O=g.mult((F+1)/(R+1))._add(m)._unit(),this.addPieSliceVertex(f,this.distance,O,D);this.addPieSliceVertex(f,this.distance,M,D);for(var j=R-1;j>=0;j--)O=m.mult((j+1)/(R+1))._add(g)._unit(),this.addPieSliceVertex(f,this.distance,O,D)}p&&this.addCurrentVertex(f,this.distance,g,-v,-y,!1)}else\"butt\"===C?(_||this.addCurrentVertex(f,this.distance,m,0,0,!1),p&&this.addCurrentVertex(f,this.distance,g,0,0,!1)):\"square\"===C?(_||(this.addCurrentVertex(f,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(f,this.distance,g,-1,-1,!1)):\"round\"===C&&(_||(this.addCurrentVertex(f,this.distance,m,0,0,!1),this.addCurrentVertex(f,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(f,this.distance,g,-1,-1,!0),this.addCurrentVertex(f,this.distance,g,0,0,!1)));if(T&&w<a-1){var N=f.dist(p);if(N>2*o){var B=f.add(p.sub(f)._mult(o/N)._round());this.distance+=B.dist(f),this.addCurrentVertex(B,this.distance,g.mult(1),0,0,!1),f=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],c=l.layoutVertexArray,h=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(c,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(c,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>u/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{\"../../util/util\":442,\"../bucket\":329,\"../load_geometry\":337}],333:[function(t,e,r){\"use strict\";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,u,c){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(u||0),c,10*(s||0),10*Math.min(l||25,25))}var a=t(\"point-geometry\"),o=t(\"../bucket\"),s=t(\"../../symbol/anchor\"),l=t(\"../../symbol/get_anchors\"),u=t(\"../../util/token\"),c=t(\"../../symbol/quads\"),h=t(\"../../symbol/shaping\"),f=t(\"../../symbol/resolve_text\"),d=t(\"../../symbol/mergelines\"),p=t(\"../../symbol/clip_line\"),m=t(\"../../util/util\"),g=t(\"../load_geometry\"),v=t(\"../../symbol/collision_feature\"),y=h.shapeText,b=h.shapeIcon,x=c.getGlyphQuads,_=c.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,n.prototype=m.inherit(o,{}),n.prototype.serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_offset\",components:2,type:\"Int16\"},{name:\"a_texture_pos\",components:2,type:\"Uint16\"},{name:\"a_data\",components:4,type:\"Uint8\"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_extrude\",components:2,type:\"Int16\"},{name:\"a_data\",components:2,type:\"Uint8\"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue(\"text-size\",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue(\"text-size\",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue(\"icon-size\",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue(\"icon-size\",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,c=.5;switch(a[\"text-anchor\"]){case\"right\":case\"top-right\":case\"bottom-right\":l=1;break;case\"left\":case\"top-left\":case\"bottom-left\":l=0}switch(a[\"text-anchor\"]){case\"bottom\":case\"bottom-right\":case\"bottom-left\":c=1;break;case\"top\":case\"top-right\":case\"top-left\":c=0}for(var h=\"right\"===a[\"text-justify\"]?1:\"left\"===a[\"text-justify\"]?0:.5,f=24*a[\"text-line-height\"],p=\"line\"!==a[\"symbol-placement\"]?24*a[\"text-max-width\"]:0,v=24*a[\"text-letter-spacing\"],x=[24*a[\"text-offset\"][0],24*a[\"text-offset\"][1]],_=this.fontstack=a[\"text-font\"].join(\",\"),M=[],k=0;k<o.length;k++)M.push(g(o[k]));if(\"line\"===a[\"symbol-placement\"]){var A=d(o,s,M);M=A.geometries,o=A.features,s=A.textFeatures}for(var T,S,E=0;E<o.length;E++)if(M[E]){if(T=s[E]?y(s[E],e[_],p,f,l,c,h,v,x):null,a[\"icon-image\"]){var L=u(o[E].properties,a[\"icon-image\"]),C=r[L];S=b(C,a),C&&(void 0===this.sdfIcons?this.sdfIcons=C.sdf:this.sdfIcons!==C.sdf&&m.warnOnce(\"Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer\"),1!==C.pixelRatio?this.iconsNeedLinear=!0:0===a[\"icon-rotate\"]&&this.layer.isLayoutValueFeatureConstant(\"icon-rotate\")||(this.iconsNeedLinear=!0))}else S=null;(T||S)&&this.addFeature(M[E],T,S,o[E])}this.symbolInstancesEndIndex=this.symbolInstancesArray.length,this.placeFeatures(t,this.showCollisionBoxes),this.trimArrays()},n.prototype.addFeature=function(t,e,r,n){var i=this.layer.layout,a=this.adjustedTextSize/24,o=void 0!==this.adjustedTextMaxSize?this.adjustedTextMaxSize:this.adjustedTextSize,u=this.tilePixelRatio*a,c=this.tilePixelRatio*o/24,h=this.tilePixelRatio*this.adjustedIconSize,f=this.tilePixelRatio*i[\"symbol-spacing\"],d=i[\"symbol-avoid-edges\"],m=i[\"text-padding\"]*this.tilePixelRatio,g=i[\"icon-padding\"]*this.tilePixelRatio,v=i[\"text-max-angle\"]/180*Math.PI,y=\"map\"===i[\"text-rotation-alignment\"]&&\"line\"===i[\"symbol-placement\"],b=\"map\"===i[\"icon-rotation-alignment\"]&&\"line\"===i[\"symbol-placement\"],x=i[\"text-allow-overlap\"]||i[\"icon-allow-overlap\"]||i[\"text-ignore-placement\"]||i[\"icon-ignore-placement\"],_=\"line\"===i[\"symbol-placement\"],M=f/2;_&&(t=p(t,0,0,w,w));for(var k=0;k<t.length;k++){var A,T=t[k];A=_?l(T,f,v,e,r,24,c,this.overscaling,w):[new s(T[0].x,T[0].y,0)];for(var S=0,E=A.length;S<E;S++){var L=A[S];if(!(e&&_&&this.anchorIsTooClose(e.text,M,L))){var C=!(L.x<0||L.x>w||L.y<0||L.y>w);if(!d||C){var I=C||x;this.addSymbolInstance(L,T,e,r,this.layer,I,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,u,m,y,h,g,b,{zoom:this.zoom},n.properties)}}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])<e)return!0}else n[t]=[];return n[t].push(r),!1},n.prototype.placeFeatures=function(t,e){this.recalculateStyleLayers(),this.createArrays();var r=this.layer.layout,n=t.maxScale,i=\"map\"===r[\"text-rotation-alignment\"]&&\"line\"===r[\"symbol-placement\"],a=\"map\"===r[\"icon-rotation-alignment\"]&&\"line\"===r[\"symbol-placement\"];if(r[\"text-allow-overlap\"]||r[\"icon-allow-overlap\"]||r[\"text-ignore-placement\"]||r[\"icon-ignore-placement\"]){var o=this.symbolInstancesArray.toArray(this.symbolInstancesStartIndex,this.symbolInstancesEndIndex),s=t.angle,l=Math.sin(s),u=Math.cos(s);this.sortedSymbolInstances=o.sort(function(t,e){return(l*t.anchorPointX+u*t.anchorPointY|0)-(l*e.anchorPointX+u*e.anchorPointY|0)||e.index-t.index})}for(var c=this.symbolInstancesStartIndex;c<this.symbolInstancesEndIndex;c++){var h=this.sortedSymbolInstances?this.sortedSymbolInstances[c-this.symbolInstancesStartIndex]:this.symbolInstancesArray.get(c),f={boxStartIndex:h.textBoxStartIndex,boxEndIndex:h.textBoxEndIndex},d={boxStartIndex:h.iconBoxStartIndex,boxEndIndex:h.iconBoxEndIndex},p=!(h.textBoxStartIndex===h.textBoxEndIndex),m=!(h.iconBoxStartIndex===h.iconBoxEndIndex),g=r[\"text-optional\"]||!p,v=r[\"icon-optional\"]||!m,y=p?t.placeCollisionFeature(f,r[\"text-allow-overlap\"],r[\"symbol-avoid-edges\"]):t.minScale,b=m?t.placeCollisionFeature(d,r[\"icon-allow-overlap\"],r[\"symbol-avoid-edges\"]):t.minScale;g||v?!v&&y?y=Math.max(b,y):!g&&b&&(b=Math.max(b,y)):b=y=Math.max(b,y),p&&(t.insertCollisionFeature(f,y,r[\"text-ignore-placement\"]),y<=n&&this.addSymbols(\"glyph\",h.glyphQuadStartIndex,h.glyphQuadEndIndex,y,r[\"text-keep-upright\"],i,t.angle)),m&&(t.insertCollisionFeature(d,b,r[\"icon-ignore-placement\"]),b<=n&&this.addSymbols(\"icon\",h.iconQuadStartIndex,h.iconQuadEndIndex,b,r[\"icon-keep-upright\"],a,t.angle))}e&&this.addToDebugBuffers(t)},n.prototype.addSymbols=function(t,e,r,n,a,o,s){for(var l=this.prepareArrayGroup(t,4*(r-e)),u=l.elementArray,c=l.layoutVertexArray,h=this.zoom,f=Math.max(Math.log(n)/Math.LN2+h,0),d=e;d<r;d++){var p=this.symbolQuadsArray.get(d).SymbolQuad,m=(p.anchorAngle+s+Math.PI)%(2*Math.PI);if(!(a&&o&&(m<=Math.PI/2||m>3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,b=p.br,x=p.tex,_=p.anchorPoint,w=Math.max(h+Math.log(p.minScale)/Math.LN2,f),M=Math.min(h+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===f&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),A=i(c,_.x,_.y,g.x,g.y,x.x,x.y,w,M,f,k);i(c,_.x,_.y,v.x,v.y,x.x+x.w,x.y,w,M,f,k),i(c,_.x,_.y,y.x,y.y,x.x,x.y+x.h,w,M,f,k),i(c,_.x,_.y,b.x,b.y,x.x+x.w,x.y+x.h,w,M,f,k),u.emplaceBack(A,A+1,A+2),u.emplaceBack(A+1,A+2,A+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout[\"icon-image\"];if(e)for(var r=0;r<this.features.length;r++){var n=u(this.features[r].properties,e);n&&(t[n]=!0)}},n.prototype.updateFont=function(t){this.recalculateStyleLayers();var e=this.layer.layout[\"text-font\"],r=t[e]=t[e]||{};this.textFeatures=f(this.features,this.layer.layout,r)},n.prototype.addToDebugBuffers=function(t){for(var e=this.prepareArrayGroup(\"collisionBox\",0),r=e.layoutVertexArray,n=-t.angle,i=t.yStretch,o=this.symbolInstancesStartIndex;o<this.symbolInstancesEndIndex;o++){var s=this.symbolInstancesArray.get(o);s.textCollisionFeature={boxStartIndex:s.textBoxStartIndex,boxEndIndex:s.textBoxEndIndex},s.iconCollisionFeature={boxStartIndex:s.iconBoxStartIndex,boxEndIndex:s.iconBoxEndIndex};for(var l=0;l<2;l++){var u=s[0===l?\"textCollisionFeature\":\"iconCollisionFeature\"];if(u)for(var c=u.boxStartIndex;c<u.boxEndIndex;c++){var h=this.collisionBoxArray.get(c),f=h.anchorPoint,d=new a(h.x1,h.y1*i)._rotate(n),p=new a(h.x2,h.y1*i)._rotate(n),m=new a(h.x1,h.y2*i)._rotate(n),g=new a(h.x2,h.y2*i)._rotate(n),v=Math.max(0,Math.min(25,this.zoom+Math.log(h.maxScale)/Math.LN2)),y=Math.max(0,Math.min(25,this.zoom+Math.log(h.placementScale)/Math.LN2));this.addCollisionBoxVertex(r,f,d,v,y),this.addCollisionBoxVertex(r,f,p,v,y),this.addCollisionBoxVertex(r,f,p,v,y),this.addCollisionBoxVertex(r,f,g,v,y),this.addCollisionBoxVertex(r,f,g,v,y),this.addCollisionBoxVertex(r,f,m,v,y),this.addCollisionBoxVertex(r,f,m,v,y),this.addCollisionBoxVertex(r,f,d,v,y)}}}},n.prototype.addSymbolInstance=function(t,e,r,i,a,o,s,l,u,c,h,f,d,p,g,y,b,w,M){var k,A,T,S,E,L,C,I;if(r&&(C=o?x(t,r,f,e,a,p):[],E=new v(l,e,t,u,c,h,r,f,d,p,!1)),k=this.symbolQuadsArray.length,C&&C.length)for(var z=0;z<C.length;z++)this.addSymbolQuad(C[z]);A=this.symbolQuadsArray.length;var D=E?E.boxStartIndex:this.collisionBoxArray.length,P=E?E.boxEndIndex:this.collisionBoxArray.length;i&&(I=o?_(t,i,g,e,a,b,r,w,M):[],L=new v(l,e,t,u,c,h,i,g,y,b,!0)),T=this.symbolQuadsArray.length,I&&1===I.length&&this.addSymbolQuad(I[0]),S=this.symbolQuadsArray.length;var O=L?L.boxStartIndex:this.collisionBoxArray.length,R=L?L.boxEndIndex:this.collisionBoxArray.length;return S>n.MAX_QUADS&&m.warnOnce(\"Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),A>n.MAX_QUADS&&m.warnOnce(\"Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),this.symbolInstancesArray.emplaceBack(D,P,O,R,k,A,T,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{\"../../symbol/anchor\":391,\"../../symbol/clip_line\":393,\"../../symbol/collision_feature\":395,\"../../symbol/get_anchors\":397,\"../../symbol/mergelines\":400,\"../../symbol/quads\":401,\"../../symbol/resolve_text\":402,\"../../symbol/shaping\":403,\"../../util/token\":441,\"../../util/util\":442,\"../bucket\":329,\"../load_geometry\":337,\"point-geometry\":484}],334:[function(t,e,r){\"use strict\";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:\"BYTE\",Uint8:\"UNSIGNED_BYTE\",Int16:\"SHORT\",Uint16:\"UNSIGNED_SHORT\"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],a=e[n.name];void 0!==a&&t.vertexAttribPointer(a,n.components,t[i[n.type]],!1,this.arrayType.bytesPerElement,n.offset)}},n.prototype.destroy=function(t){this.buffer&&t.deleteBuffer(this.buffer)},n.BufferType={VERTEX:\"ARRAY_BUFFER\",ELEMENT:\"ELEMENT_ARRAY_BUFFER\"}},{}],335:[function(t,e,r){\"use strict\";function n(t,e){this.layoutVertexBuffer=new a(t.layoutVertexArray,e.layoutVertexArrayType,a.BufferType.VERTEX),t.elementArray&&(this.elementBuffer=new a(t.elementArray,e.elementArrayType,a.BufferType.ELEMENT));var r,n=this.vaos={};t.elementArray2&&(this.elementBuffer2=new a(t.elementArray2,e.elementArrayType2,a.BufferType.ELEMENT),r=this.secondVaos={}),this.paintVertexBuffers=i.mapObject(t.paintVertexArrays,function(i,s){return n[s]=new o,t.elementArray2&&(r[s]=new o),new a(i,e.paintVertexArrayTypes[s],a.BufferType.VERTEX)})}var i=t(\"../util/util\"),a=t(\"./buffer\"),o=t(\"../render/vertex_array_object\");e.exports=n,n.prototype.destroy=function(t){this.layoutVertexBuffer.destroy(t),this.elementBuffer&&this.elementBuffer.destroy(t),this.elementBuffer2&&this.elementBuffer2.destroy(t);for(var e in this.paintVertexBuffers)this.paintVertexBuffers[e].destroy(t);for(var r in this.vaos)this.vaos[r].destroy(t);for(var n in this.secondVaos)this.secondVaos[n].destroy(t)}},{\"../render/vertex_array_object\":357,\"../util/util\":442,\"./buffer\":334}],336:[function(t,e,r){\"use strict\";function n(t,e,r){if(t.grid){var n=t,i=e;t=n.coord,e=n.overscaling,this.grid=new p(n.grid),this.featureIndexArray=new k(n.featureIndexArray),this.rawTileData=i,this.bucketLayerIDs=n.bucketLayerIDs}else this.grid=new p(h,16,0),this.featureIndexArray=new k;this.coord=t,this.overscaling=e,this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.setCollisionTile(r)}function i(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function a(t,e){return e-t}function o(t){return t[\"line-gap-width\"]>0?t[\"line-gap-width\"]+2*t[\"line-width\"]:t[\"line-width\"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=u.convert(e),\"viewport\"===r&&e._rotate(-n);for(var a=[],o=0;o<t.length;o++){for(var s=t[o],l=[],c=0;c<s.length;c++)l.push(s[c].sub(e._mult(i)));a.push(l)}return a}function l(t,e){for(var r=[],n=new u(0,0),i=0;i<t.length;i++){for(var a=t[i],o=[],s=0;s<a.length;s++){var l=a[s-1],c=a[s],h=a[s+1],f=0===s?n:c.sub(l)._unit()._perp(),d=s===a.length-1?n:h.sub(c)._unit()._perp(),p=f._add(d)._unit(),m=p.x*d.x+p.y*d.y;p._mult(1/m),o.push(p._mult(e)._add(c))}r.push(o)}return r}var u=t(\"point-geometry\"),c=t(\"./load_geometry\"),h=t(\"./bucket\").EXTENT,f=t(\"feature-filter\"),d=t(\"../util/struct_array\"),p=t(\"grid-index\"),m=t(\"../util/dictionary_coder\"),g=t(\"vector-tile\"),v=t(\"pbf\"),y=t(\"../util/vectortile_to_geojson\"),b=t(\"../util/util\").arraysIntersect,x=t(\"../util/intersection_tests\"),_=x.multiPolygonIntersectsBufferedMultiPoint,w=x.multiPolygonIntersectsMultiPolygon,M=x.multiPolygonIntersectsBufferedMultiLine,k=new d({members:[{type:\"Uint32\",name:\"featureIndex\"},{type:\"Uint16\",name:\"sourceLayerIndex\"},{type:\"Uint16\",name:\"bucketIndex\"}]});e.exports=n,n.prototype.insert=function(t,e,r,n){var i=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(e,r,n);for(var a=c(t),o=0;o<a.length;o++){for(var s=a[o],l=[1/0,1/0,-1/0,-1/0],u=0;u<s.length;u++){var h=s[u];l[0]=Math.min(l[0],h.x),l[1]=Math.min(l[1],h.y),l[2]=Math.max(l[2],h.x),l[3]=Math.max(l[3],h.y)}this.grid.insert(i,l[0],l[1],l[2],l[3])}},n.prototype.setCollisionTile=function(t){this.collisionTile=t},n.prototype.serialize=function(){var t={coord:this.coord,overscaling:this.overscaling,grid:this.grid.toArrayBuffer(),featureIndexArray:this.featureIndexArray.serialize(),bucketLayerIDs:this.bucketLayerIDs};return{data:t,transferables:[t.grid,t.featureIndexArray.arrayBuffer]}},n.prototype.query=function(t,e){this.vtLayers||(this.vtLayers=new g.VectorTile(new v(new Uint8Array(this.rawTileData))).layers,this.sourceLayerCoder=new m(this.vtLayers?Object.keys(this.vtLayers).sort():[\"_geojsonTileLayer\"]));var r={},n=t.params||{},s=h/t.tileSize/t.scale,l=f(n.filter),c=0;for(var d in e){var p=e[d],y=p.paint,b=0;\"line\"===p.type?b=o(y)/2+Math.abs(y[\"line-offset\"])+i(y[\"line-translate\"]):\"fill\"===p.type?b=i(y[\"fill-translate\"]):\"circle\"===p.type&&(b=y[\"circle-radius\"]+i(y[\"circle-translate\"])),c=Math.max(c,b*s)}for(var x=t.queryGeometry.map(function(t){return t.map(function(t){return new u(t.x,t.y)})}),_=1/0,w=1/0,M=-1/0,k=-1/0,A=0;A<x.length;A++)for(var T=x[A],S=0;S<T.length;S++){var E=T[S];_=Math.min(_,E.x),w=Math.min(w,E.y),M=Math.max(M,E.x),k=Math.max(k,E.y)}var L=this.grid.query(_-c,w-c,M+c,k+c);L.sort(a),this.filterMatching(r,L,this.featureIndexArray,x,l,n.layers,e,t.bearing,s);var C=this.collisionTile.queryRenderedSymbols(_,w,M,k,t.scale);return C.sort(),this.filterMatching(r,C,this.collisionTile.collisionBoxArray,x,l,n.layers,e,t.bearing,s),r},n.prototype.filterMatching=function(t,e,r,n,i,a,u,h,f){for(var d,p=0;p<e.length;p++){var m=e[p];if(m!==d){d=m;var g=r.get(m),v=this.bucketLayerIDs[g.bucketIndex];if(!a||b(a,v)){var x=this.sourceLayerCoder.decode(g.sourceLayerIndex),k=this.vtLayers[x],A=k.feature(g.featureIndex);if(i(A))for(var T=null,S=0;S<v.length;S++){var E=v[S];if(!(a&&a.indexOf(E)<0)){var L=u[E];if(L){var C;if(\"symbol\"!==L.type){T||(T=c(A));var I=L.paint;if(\"line\"===L.type){C=s(n,I[\"line-translate\"],I[\"line-translate-anchor\"],h,f);var z=o(I)/2*f;if(I[\"line-offset\"]&&(T=l(T,I[\"line-offset\"]*f)),!M(C,T,z))continue}else if(\"fill\"===L.type){if(C=s(n,I[\"fill-translate\"],I[\"fill-translate-anchor\"],h,f),!w(C,T))continue}else if(\"circle\"===L.type){C=s(n,I[\"circle-translate\"],I[\"circle-translate-anchor\"],h,f);var D=I[\"circle-radius\"]*f;if(!_(C,T,D))continue}}var P=new y(A,this.z,this.x,this.y);P.layer=L.serialize({includeRefProperties:!0});var O=t[E];void 0===O&&(O=t[E]=[]),O.push(P)}}}}}}}},{\"../util/dictionary_coder\":432,\"../util/intersection_tests\":437,\"../util/struct_array\":440,\"../util/util\":442,\"../util/vectortile_to_geojson\":443,\"./bucket\":329,\"./load_geometry\":337,\"feature-filter\":132,\"grid-index\":287,pbf:478,\"point-geometry\":484,\"vector-tile\":550}],337:[function(t,e,r){\"use strict\";function n(t){return{min:-1*Math.pow(2,t-1),max:Math.pow(2,t-1)-1}}var i=t(\"../util/util\"),a=t(\"./bucket\").EXTENT,o=t(\"assert\"),s={15:n(15),16:n(16)};e.exports=function(t,e){var r=s[e||16];o(r);for(var n=a/t.extent,l=t.loadGeometry(),u=0;u<l.length;u++)for(var c=l[u],h=0;h<c.length;h++){var f=c[h];f.x=Math.round(f.x*n),f.y=Math.round(f.y*n),(f.x<r.min||f.x>r.max||f.y<r.min||f.y>r.max)&&i.warnOnce(\"Geometry exceeds allowed extent, reduce your vector tile buffer size\")}return l}},{\"../util/util\":442,\"./bucket\":329,assert:47}],338:[function(t,e,r){\"use strict\";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],339:[function(t,e,r){\"use strict\";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error(\"Invalid LngLat object: (\"+t+\", \"+e+\")\");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}e.exports=n\n", | |
";var i=t(\"../util/util\").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return\"LngLat(\"+this.lng+\", \"+this.lat+\")\"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{\"../util/util\":442}],340:[function(t,e,r){\"use strict\";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t(\"./lng_lat\");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return\"LngLatBounds(\"+this._sw.toString()+\", \"+this._ne.toString()+\")\"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{\"./lng_lat\":339}],341:[function(t,e,r){\"use strict\";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t(\"./lng_lat\"),a=t(\"point-geometry\"),o=t(\"./coordinate\"),s=t(\"../util/util\").wrap,l=t(\"../util/interpolate\"),u=t(\"../source/tile_coord\"),c=t(\"../data/bucket\").EXTENT,h=t(\"gl-matrix\"),f=h.vec4,d=h.mat4,p=h.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(e<t.minzoom)return[];e>t.maxzoom&&(e=t.maxzoom);var n=this,i=n.locationCoordinate(n.center)._zoomTo(e),o=new a(i.column-.5,i.row-.5);return u.cover(e,[n.pointCoordinate(new a(0,0))._zoomTo(e),n.pointCoordinate(new a(n.width,0))._zoomTo(e),n.pointCoordinate(new a(n.width,n.height))._zoomTo(e),n.pointCoordinate(new a(0,n.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];f.transformMat4(e,e,this.pixelMatrixInverse),f.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,u=e[1]/n,c=r[1]/i,h=e[2]/n,d=r[2]/i,p=h===d?0:(0-h)/(d-h),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(u,c,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return f.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof u&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/c,n/c,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,u=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),i=e-t<u.y?u.y/(e-t):0),this.lngRange&&(r=this.lngX(this.lngRange[0]),n=this.lngX(this.lngRange[1]),o=n-r<u.x?u.x/(n-r):0);var h=Math.max(o||0,i||0);if(h)return this.center=this.unproject(new a(o?(n+r)/2:this.x,i?(e+t)/2:this.y)),this.zoom+=this.scaleZoom(h),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var f=this.y,d=u.y/2;f-d<t&&(l=t+d),f+d>e&&(l=e-d)}if(this.lngRange){var p=this.x,m=u.x/2;p-m<r&&(s=r+m),p+m>n&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=c,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error(\"failed to invert matrix\");this.pixelMatrixInverse=n}}}},{\"../data/bucket\":329,\"../source/tile_coord\":369,\"../util/interpolate\":436,\"../util/util\":442,\"./coordinate\":338,\"./lng_lat\":339,\"gl-matrix\":193,\"point-geometry\":484}],342:[function(t,e,r){\"use strict\";var n={\" \":[16,[]],\"!\":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'\"':[16,[4,21,4,14,-1,-1,12,21,12,14]],\"#\":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],\"%\":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],\"&\":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],\"'\":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],\"(\":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],\")\":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],\"*\":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],\"+\":[26,[13,18,13,0,-1,-1,4,9,22,9]],\",\":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],\"-\":[26,[4,9,22,9]],\".\":[10,[5,2,4,1,5,0,6,1,5,2]],\"/\":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],\":\":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],\";\":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],\"<\":[24,[20,18,4,9,20,0]],\"=\":[26,[4,12,22,12,-1,-1,4,6,22,6]],\">\":[24,[4,18,20,9,4,0]],\"?\":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],\"@\":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],\"[\":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],\"\\\\\":[14,[0,21,14,-3]],\"]\":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],\"^\":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],\"`\":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],\"{\":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],\"|\":[8,[4,25,4,-7]],\"}\":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],\"~\":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,u,c,h,f,d=[];for(a=0,o=t.length;a<o;a++)if(u=n[t[a]]){for(f=null,s=0,l=u[1].length;s<l;s+=2)-1===u[1][s]&&-1===u[1][s+1]?f=null:(c=e+u[1][s]*i,h=r-u[1][s+1]*i,f&&d.push(f.x,f.y,c,h),f={x:c,y:h});e+=u[0]*i}return d}},{}],343:[function(t,e,r){\"use strict\";var n=e.exports={};n.version=t(\"../package.json\").version,n.Map=t(\"./ui/map\"),n.Control=t(\"./ui/control/control\"),n.Navigation=t(\"./ui/control/navigation\"),n.Geolocate=t(\"./ui/control/geolocate\"),n.Attribution=t(\"./ui/control/attribution\"),n.Popup=t(\"./ui/popup\"),n.Marker=t(\"./ui/marker\"),n.Style=t(\"./style/style\"),n.LngLat=t(\"./geo/lng_lat\"),n.LngLatBounds=t(\"./geo/lng_lat_bounds\"),n.Point=t(\"point-geometry\"),n.Evented=t(\"./util/evented\"),n.util=t(\"./util/util\"),n.supported=t(\"./util/browser\").supported;var i=t(\"./util/ajax\");n.util.getJSON=i.getJSON,n.util.getArrayBuffer=i.getArrayBuffer;var a=t(\"./util/config\");n.config=a,Object.defineProperty(n,\"accessToken\",{get:function(){return a.ACCESS_TOKEN},set:function(t){a.ACCESS_TOKEN=t}})},{\"../package.json\":444,\"./geo/lng_lat\":339,\"./geo/lng_lat_bounds\":340,\"./style/style\":378,\"./ui/control/attribution\":409,\"./ui/control/control\":410,\"./ui/control/geolocate\":411,\"./ui/control/navigation\":412,\"./ui/map\":421,\"./ui/marker\":422,\"./ui/popup\":423,\"./util/ajax\":425,\"./util/browser\":426,\"./util/config\":431,\"./util/evented\":434,\"./util/util\":442,\"point-geometry\":484}],344:[function(t,e,r){\"use strict\";var n=t(\"assert\");e.exports=function(t){for(var e={define:{},initialize:{}},r=0;r<t.length;r++){var i=t[r];n(\"u_\"===i.name.slice(0,2));var a=\"{precision} \"+(1===i.components?\"float\":\"vec\"+i.components);e.define[i.name.slice(2)]=\"uniform \"+a+\" \"+i.name+\";\\n\",e.initialize[i.name.slice(2)]=a+\" \"+i.name.slice(2)+\" = \"+i.name+\";\\n\"}return e}},{assert:47}],345:[function(t,e,r){\"use strict\";function n(t,e,r){var n,s=t.gl,l=t.transform,u=r.paint[\"background-color\"],c=r.paint[\"background-pattern\"],h=r.paint[\"background-opacity\"],f=c?t.spriteAtlas.getPosition(c.from,!0):null,d=c?t.spriteAtlas.getPosition(c.to,!0):null;if(t.setDepthSublayer(0),f&&d){if(t.isOpaquePass)return;n=t.useProgram(\"pattern\"),s.uniform1i(n.u_image,0),s.uniform2fv(n.u_pattern_tl_a,f.tl),s.uniform2fv(n.u_pattern_br_a,f.br),s.uniform2fv(n.u_pattern_tl_b,d.tl),s.uniform2fv(n.u_pattern_br_b,d.br),s.uniform1f(n.u_opacity,h),s.uniform1f(n.u_mix,c.t),s.uniform2fv(n.u_pattern_size_a,f.size),s.uniform2fv(n.u_pattern_size_b,d.size),s.uniform1f(n.u_scale_a,c.fromScale),s.uniform1f(n.u_scale_b,c.toScale),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),t.tileExtentPatternVAO.bind(s,n,t.tileExtentBuffer)}else{if(t.isOpaquePass!==(1===u[3]))return;var p=a([{name:\"u_color\",components:4},{name:\"u_opacity\",components:1}]);n=t.useProgram(\"fill\",[],p,p),s.uniform4fv(n.u_color,u),s.uniform1f(n.u_opacity,h),t.tileExtentVAO.bind(s,n,t.tileExtentBuffer)}s.disable(s.STENCIL_TEST);for(var m=l.coveringTiles({tileSize:o}),g=0;g<m.length;g++){var v=m[g];if(f&&d){var y={coord:v,tileSize:o};s.uniform1f(n.u_tile_units_to_pixels,1/i(y,1,t.transform.tileZoom));var b=y.tileSize*Math.pow(2,t.transform.tileZoom-y.coord.z),x=b*(y.coord.x+v.w*Math.pow(2,y.coord.z)),_=b*y.coord.y;s.uniform2f(n.u_pixel_coord_upper,x>>16,_>>16),s.uniform2f(n.u_pixel_coord_lower,65535&x,65535&_)}s.uniformMatrix4fv(n.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}var i=t(\"../source/pixels_to_tile_units\"),a=t(\"./create_uniform_pragmas\"),o=512;e.exports=n},{\"../source/pixels_to_tile_units\":363,\"./create_uniform_pragmas\":344}],346:[function(t,e,r){\"use strict\";function n(t,e,r,n){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o<n.length;o++){var s=n[o],l=e.getTile(s),u=l.getBucket(r);if(u){var c=u.bufferGroups.circle;if(c){var h=u.paintAttributes.circle[r.id],f=t.useProgram(\"circle\",h.defines,h.vertexPragmas,h.fragmentPragmas);\"map\"===r.paint[\"circle-pitch-scale\"]?(a.uniform1i(f.u_scale_with_map,!0),a.uniform2f(f.u_extrude_scale,t.transform.pixelsToGLUnits[0]*t.transform.altitude,t.transform.pixelsToGLUnits[1]*t.transform.altitude)):(a.uniform1i(f.u_scale_with_map,!1),a.uniform2fv(f.u_extrude_scale,t.transform.pixelsToGLUnits)),a.uniform1f(f.u_devicepixelratio,i.devicePixelRatio),a.uniformMatrix4fv(f.u_matrix,!1,t.translatePosMatrix(s.posMatrix,l,r.paint[\"circle-translate\"],r.paint[\"circle-translate-anchor\"])),u.setUniforms(a,\"circle\",f,r,{zoom:t.transform.zoom});for(var d=0;d<c.length;d++){var p=c[d];p.vaos[r.id].bind(a,f,p.layoutVertexBuffer,p.elementBuffer,p.paintVertexBuffers[r.id]),a.drawElements(a.TRIANGLES,3*p.elementBuffer.length,a.UNSIGNED_SHORT,0)}}}}}}var i=t(\"../util/browser\");e.exports=n},{\"../util/browser\":426}],347:[function(t,e,r){\"use strict\";function n(t,e,r,n){var i=t.gl;i.enable(i.STENCIL_TEST);for(var a=t.useProgram(\"collisionbox\"),o=0;o<n.length;o++){var s=n[o],l=e.getTile(s),u=l.getBucket(r);if(u){var c=u.bufferGroups.collisionBox;if(c&&c.length){var h=c[0];0!==h.layoutVertexBuffer.length&&(i.uniformMatrix4fv(a.u_matrix,!1,s.posMatrix),t.enableTileClippingMask(s),t.lineWidth(1),i.uniform1f(a.u_scale,Math.pow(2,t.transform.zoom-l.coord.z)),i.uniform1f(a.u_zoom,10*t.transform.zoom),i.uniform1f(a.u_maxzoom,10*(l.coord.z+1)),h.vaos[r.id].bind(i,a,h.layoutVertexBuffer),i.drawArrays(i.LINES,0,h.layoutVertexBuffer.length))}}}}e.exports=n},{}],348:[function(t,e,r){\"use strict\";function n(t,e,r){if(!t.isOpaquePass&&t.options.debug)for(var n=0;n<r.length;n++)i(t,e,r[n])}function i(t,e,r){var n=t.gl;n.disable(n.STENCIL_TEST),t.lineWidth(1*o.devicePixelRatio);var i=r.posMatrix,h=t.useProgram(\"debug\");n.uniformMatrix4fv(h.u_matrix,!1,i),n.uniform4f(h.u_color,1,0,0,1),t.debugVAO.bind(n,h,t.debugBuffer),n.drawArrays(n.LINE_STRIP,0,t.debugBuffer.length);for(var f=a(r.toString(),50,200,5),d=new t.PosArray,p=0;p<f.length;p+=2)d.emplaceBack(f[p],f[p+1]);var m=new u(d.serialize(),t.PosArray.serialize(),u.BufferType.VERTEX);(new c).bind(n,h,m),n.uniform4f(h.u_color,1,1,1,1);for(var g=e.getTile(r).tileSize,v=l/(Math.pow(2,t.transform.zoom-r.z)*g),y=[[-1,-1],[-1,1],[1,-1],[1,1]],b=0;b<y.length;b++){var x=y[b];n.uniformMatrix4fv(h.u_matrix,!1,s.translate([],i,[v*x[0],v*x[1],0])),n.drawArrays(n.LINES,0,m.length)}n.uniform4f(h.u_color,0,0,0,1),n.uniformMatrix4fv(h.u_matrix,!1,i),n.drawArrays(n.LINES,0,m.length)}var a=t(\"../lib/debugtext\"),o=t(\"../util/browser\"),s=t(\"gl-matrix\").mat4,l=t(\"../data/bucket\").EXTENT,u=t(\"../data/buffer\"),c=t(\"./vertex_array_object\");e.exports=n},{\"../data/bucket\":329,\"../data/buffer\":334,\"../lib/debugtext\":342,\"../util/browser\":426,\"./vertex_array_object\":357,\"gl-matrix\":193}],349:[function(t,e,r){\"use strict\";function n(t,e,r,n){var o=t.gl;o.enable(o.STENCIL_TEST);var s;if(s=!r.paint[\"fill-pattern\"]&&(r.isPaintValueFeatureConstant(\"fill-color\")&&r.isPaintValueFeatureConstant(\"fill-opacity\")&&1===r.paint[\"fill-color\"][3]&&1===r.paint[\"fill-opacity\"]),t.isOpaquePass===s){t.setDepthSublayer(1);for(var l=0;l<n.length;l++)i(t,e,r,n[l])}if(!t.isOpaquePass&&r.paint[\"fill-antialias\"]){t.lineWidth(2),t.depthMask(!1);var u=r.getPaintProperty(\"fill-outline-color\");(u||!r.paint[\"fill-pattern\"])&&u?t.setDepthSublayer(2):t.setDepthSublayer(0);for(var c=0;c<n.length;c++)a(t,e,r,n[c])}}function i(t,e,r,n){var i=e.getTile(n),a=i.getBucket(r);if(a){var s=a.bufferGroups.fill;if(s){var l,u=t.gl,c=r.paint[\"fill-pattern\"];if(c)l=t.useProgram(\"pattern\"),o(c,r.paint[\"fill-opacity\"],i,n,t,l),u.activeTexture(u.TEXTURE0),t.spriteAtlas.bind(u,!0);else{var h=a.paintAttributes.fill[r.id];l=t.useProgram(\"fill\",h.defines,h.vertexPragmas,h.fragmentPragmas),a.setUniforms(u,\"fill\",l,r,{zoom:t.transform.zoom})}u.uniformMatrix4fv(l.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint[\"fill-translate\"],r.paint[\"fill-translate-anchor\"])),t.enableTileClippingMask(n);for(var f=0;f<s.length;f++){var d=s[f];d.vaos[r.id].bind(u,l,d.layoutVertexBuffer,d.elementBuffer,d.paintVertexBuffers[r.id]),u.drawElements(u.TRIANGLES,d.elementBuffer.length,u.UNSIGNED_SHORT,0)}}}}function a(t,e,r,n){var i=e.getTile(n),a=i.getBucket(r);if(a){var s,l=t.gl,u=a.bufferGroups.fill,c=r.paint[\"fill-pattern\"],h=r.paint[\"fill-opacity\"],f=r.getPaintProperty(\"fill-outline-color\");if(c&&!f)s=t.useProgram(\"outlinepattern\"),l.uniform2f(s.u_world,l.drawingBufferWidth,l.drawingBufferHeight);else{var d=a.paintAttributes.fill[r.id];s=t.useProgram(\"outline\",d.defines,d.vertexPragmas,d.fragmentPragmas),l.uniform2f(s.u_world,l.drawingBufferWidth,l.drawingBufferHeight),l.uniform1f(s.u_opacity,h),a.setUniforms(l,\"fill\",s,r,{zoom:t.transform.zoom})}l.uniformMatrix4fv(s.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint[\"fill-translate\"],r.paint[\"fill-translate-anchor\"])),c&&o(c,h,i,n,t,s),t.enableTileClippingMask(n);for(var p=0;p<u.length;p++){var m=u[p];m.secondVaos[r.id].bind(l,s,m.layoutVertexBuffer,m.elementBuffer2,m.paintVertexBuffers[r.id]),l.drawElements(l.LINES,2*m.elementBuffer2.length,l.UNSIGNED_SHORT,0)}}}function o(t,e,r,n,i,a){var o=i.gl,l=i.spriteAtlas.getPosition(t.from,!0),u=i.spriteAtlas.getPosition(t.to,!0);if(l&&u){o.uniform1i(a.u_image,0),o.uniform2fv(a.u_pattern_tl_a,l.tl),o.uniform2fv(a.u_pattern_br_a,l.br),o.uniform2fv(a.u_pattern_tl_b,u.tl),o.uniform2fv(a.u_pattern_br_b,u.br),o.uniform1f(a.u_opacity,e),o.uniform1f(a.u_mix,t.t),o.uniform1f(a.u_tile_units_to_pixels,1/s(r,1,i.transform.tileZoom)),o.uniform2fv(a.u_pattern_size_a,l.size),o.uniform2fv(a.u_pattern_size_b,u.size),o.uniform1f(a.u_scale_a,t.fromScale),o.uniform1f(a.u_scale_b,t.toScale);var c=r.tileSize*Math.pow(2,i.transform.tileZoom-r.coord.z),h=c*(r.coord.x+n.w*Math.pow(2,r.coord.z)),f=c*r.coord.y;o.uniform2f(a.u_pixel_coord_upper,h>>16,f>>16),o.uniform2f(a.u_pixel_coord_lower,65535&h,65535&f),o.activeTexture(o.TEXTURE0),i.spriteAtlas.bind(o,!0)}}var s=t(\"../source/pixels_to_tile_units\");e.exports=n},{\"../source/pixels_to_tile_units\":363}],350:[function(t,e,r){\"use strict\";var n=t(\"../util/browser\"),i=t(\"gl-matrix\").mat2,a=t(\"../source/pixels_to_tile_units\");e.exports=function(t,e,r,o){if(!t.isOpaquePass){t.setDepthSublayer(0),t.depthMask(!1);var s=t.gl;if(s.enable(s.STENCIL_TEST),!(r.paint[\"line-width\"]<=0)){var l=1/n.devicePixelRatio,u=r.paint[\"line-blur\"]+l,c=r.paint[\"line-color\"],h=t.transform,f=i.create();i.scale(f,f,[1,Math.cos(h._pitch)]),i.rotate(f,f,t.transform.angle);var d,p,m,g,v,y=Math.sqrt(h.height*h.height/4*(1+h.altitude*h.altitude)),b=h.height/2*Math.tan(h._pitch),x=(y+b)/y-1,_=r.paint[\"line-dasharray\"],w=r.paint[\"line-pattern\"];if(_)d=t.useProgram(\"linesdfpattern\"),s.uniform1f(d.u_linewidth,r.paint[\"line-width\"]/2),s.uniform1f(d.u_gapwidth,r.paint[\"line-gap-width\"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,r.paint[\"line-opacity\"]),p=t.lineAtlas.getDash(_.from,\"round\"===r.layout[\"line-cap\"]),m=t.lineAtlas.getDash(_.to,\"round\"===r.layout[\"line-cap\"]),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.lineAtlas.bind(s),s.uniform1f(d.u_tex_y_a,p.y),s.uniform1f(d.u_tex_y_b,m.y),s.uniform1f(d.u_mix,_.t),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint[\"line-offset\"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f);else if(w){if(g=t.spriteAtlas.getPosition(w.from,!0),v=t.spriteAtlas.getPosition(w.to,!0),!g||!v)return;d=t.useProgram(\"linepattern\"),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),s.uniform1f(d.u_linewidth,r.paint[\"line-width\"]/2),s.uniform1f(d.u_gapwidth,r.paint[\"line-gap-width\"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform2fv(d.u_pattern_tl_a,g.tl),s.uniform2fv(d.u_pattern_br_a,g.br),s.uniform2fv(d.u_pattern_tl_b,v.tl),s.uniform2fv(d.u_pattern_br_b,v.br),s.uniform1f(d.u_fade,w.t),s.uniform1f(d.u_opacity,r.paint[\"line-opacity\"]),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint[\"line-offset\"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f)}else d=t.useProgram(\"line\"),s.uniform1f(d.u_linewidth,r.paint[\"line-width\"]/2),s.uniform1f(d.u_gapwidth,r.paint[\"line-gap-width\"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint[\"line-offset\"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,r.paint[\"line-opacity\"]);for(var M=0;M<o.length;M++){var k=o[M],A=e.getTile(k),T=A.getBucket(r);if(T){var S=T.bufferGroups.line;if(S){t.enableTileClippingMask(k);var E=t.translatePosMatrix(k.posMatrix,A,r.paint[\"line-translate\"],r.paint[\"line-translate-anchor\"]);s.uniformMatrix4fv(d.u_matrix,!1,E);var L=1/a(A,1,t.transform.zoom);if(_){var C=p.width*_.fromScale,I=m.width*_.toScale,z=[1/a(A,C,t.transform.tileZoom),-p.height/2],D=[1/a(A,I,t.transform.tileZoom),-m.height/2],P=t.lineAtlas.width/(256*Math.min(C,I)*n.devicePixelRatio)/2;s.uniform1f(d.u_ratio,L),s.uniform2fv(d.u_patternscale_a,z),s.uniform2fv(d.u_patternscale_b,D),s.uniform1f(d.u_sdfgamma,P)}else w?(s.uniform1f(d.u_ratio,L),s.uniform2fv(d.u_pattern_size_a,[a(A,g.size[0]*w.fromScale,t.transform.tileZoom),v.size[1]]),s.uniform2fv(d.u_pattern_size_b,[a(A,v.size[0]*w.toScale,t.transform.tileZoom),v.size[1]])):s.uniform1f(d.u_ratio,L);for(var O=0;O<S.length;O++){var R=S[O];R.vaos[r.id].bind(s,d,R.layoutVertexBuffer,R.elementBuffer),s.drawElements(s.TRIANGLES,3*R.elementBuffer.length,s.UNSIGNED_SHORT,0)}}}}}}}},{\"../source/pixels_to_tile_units\":363,\"../util/browser\":426,\"gl-matrix\":193}],351:[function(t,e,r){\"use strict\";function n(t,e,r,n){if(!t.isOpaquePass){var a=t.gl;a.enable(a.DEPTH_TEST),t.depthMask(!0),a.depthFunc(a.LESS);for(var o=n.length&&n[0].z,s=0;s<n.length;s++){var l=n[s];t.setDepthSublayer(l.z-o),i(t,e,r,l)}a.depthFunc(a.LEQUAL)}}function i(t,e,r,n){var i=t.gl;i.disable(i.STENCIL_TEST);var u=e.getTile(n),c=t.transform.calculatePosMatrix(n,e.maxzoom),h=t.useProgram(\"raster\");i.uniformMatrix4fv(h.u_matrix,!1,c),i.uniform1f(h.u_brightness_low,r.paint[\"raster-brightness-min\"]),i.uniform1f(h.u_brightness_high,r.paint[\"raster-brightness-max\"]),i.uniform1f(h.u_saturation_factor,s(r.paint[\"raster-saturation\"])),i.uniform1f(h.u_contrast_factor,o(r.paint[\"raster-contrast\"])),i.uniform3fv(h.u_spin_weights,a(r.paint[\"raster-hue-rotate\"]));var f,d,p=u.source&&u.source.findLoadedParent(n,0,{}),m=l(u,p,r,t.transform);i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,u.texture),i.activeTexture(i.TEXTURE1),p?(i.bindTexture(i.TEXTURE_2D,p.texture),f=Math.pow(2,p.coord.z-u.coord.z),d=[u.coord.x*f%1,u.coord.y*f%1]):(i.bindTexture(i.TEXTURE_2D,u.texture),m[1]=0),i.uniform2fv(h.u_tl_parent,d||[0,0]),i.uniform1f(h.u_scale_parent,f||1),i.uniform1f(h.u_buffer_scale,1),i.uniform1f(h.u_opacity0,m[0]),i.uniform1f(h.u_opacity1,m[1]),i.uniform1i(h.u_image0,0),i.uniform1i(h.u_image1,1);var g=u.boundsBuffer||t.rasterBoundsBuffer;(u.boundsVAO||t.rasterBoundsVAO).bind(i,h,g),i.drawArrays(i.TRIANGLE_STRIP,0,g.length)}function a(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}function o(t){return t>0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function l(t,e,r,n){var i=[1,0],a=r.paint[\"raster-fade-duration\"];if(t.source&&a>0){var o=(new Date).getTime(),s=(o-t.timeAdded)/a,l=e?(o-e.timeAdded)/a:-1,c=n.coveringZoomLevel(t.source),h=!!e&&Math.abs(e.coord.z-c)>Math.abs(t.coord.z-c);!e||h?(i[0]=u.clamp(s,0,1),i[1]=1-i[0]):(i[0]=u.clamp(1-l,0,1),i[1]=1-i[0])}var f=r.paint[\"raster-opacity\"];return i[0]*=f,i[1]*=f,i}var u=t(\"../util/util\"),c=t(\"../util/struct_array\");e.exports=n,n.RasterBoundsArray=new c({members:[{name:\"a_pos\",type:\"Int16\",components:2},{name:\"a_texture_pos\",type:\"Int16\",components:2}]})},{\"../util/struct_array\":440,\"../util/util\":442}],352:[function(t,e,r){\"use strict\";function n(t,e,r,n){if(!t.isOpaquePass){var a=!(r.layout[\"text-allow-overlap\"]||r.layout[\"icon-allow-overlap\"]||r.layout[\"text-ignore-placement\"]||r.layout[\"icon-ignore-placement\"]),o=t.gl;a?o.disable(o.STENCIL_TEST):o.enable(o.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),o.disable(o.DEPTH_TEST),i(t,e,r,n,!1,r.paint[\"icon-translate\"],r.paint[\"icon-translate-anchor\"],r.layout[\"icon-rotation-alignment\"],r.layout[\"icon-rotation-alignment\"],r.layout[\"icon-size\"],r.paint[\"icon-halo-width\"],r.paint[\"icon-halo-color\"],r.paint[\"icon-halo-blur\"],r.paint[\"icon-opacity\"],r.paint[\"icon-color\"]),\n", | |
"i(t,e,r,n,!0,r.paint[\"text-translate\"],r.paint[\"text-translate-anchor\"],r.layout[\"text-rotation-alignment\"],r.layout[\"text-pitch-alignment\"],r.layout[\"text-size\"],r.paint[\"text-halo-width\"],r.paint[\"text-halo-color\"],r.paint[\"text-halo-blur\"],r.paint[\"text-opacity\"],r.paint[\"text-color\"]),o.enable(o.DEPTH_TEST),e.map.showCollisionBoxes&&s(t,e,r,n)}}function i(t,e,r,n,i,o,s,l,u,c,h,f,d,p,m){for(var g=0;g<n.length;g++){var v=e.getTile(n[g]),y=v.getBucket(r);if(y){var b=y.bufferGroups,x=i?b.glyph:b.icon;x.length&&(t.enableTileClippingMask(n[g]),a(t,r,n[g].posMatrix,v,y,x,i,i||y.sdfIcons,!i&&y.iconsNeedLinear,i?y.adjustedTextSize:y.adjustedIconSize,y.fontstack,o,s,l,u,c,h,f,d,p,m))}}}function a(t,e,r,n,i,a,s,u,c,h,f,d,p,m,g,v,y,b,x,_,w){var M,k,A,T=t.gl,S=t.transform,E=\"map\"===m,L=\"map\"===g,C=s?24:1,I=v/C;if(L?(k=l(n,1,t.transform.zoom)*I,A=1/Math.cos(S._pitch),M=[k,k]):(k=t.transform.altitude*I,A=1,M=[S.pixelsToGLUnits[0]*k,S.pixelsToGLUnits[1]*k]),s||t.style.sprite.loaded()){var z=t.useProgram(u?\"sdf\":\"icon\");if(T.uniformMatrix4fv(z.u_matrix,!1,t.translatePosMatrix(r,n,d,p)),T.uniform1i(z.u_rotate_with_map,E),T.uniform1i(z.u_pitch_with_map,L),T.uniform2fv(z.u_extrude_scale,M),T.activeTexture(T.TEXTURE0),T.uniform1i(z.u_texture,0),s){var D=f&&t.glyphSource.getGlyphAtlas(f);if(!D)return;D.updateTexture(T),T.uniform2f(z.u_texsize,D.width/4,D.height/4)}else{var P=t.options.rotating||t.options.zooming,O=1!==I||o.devicePixelRatio!==t.spriteAtlas.pixelRatio||c,R=L||t.transform.pitch;t.spriteAtlas.bind(T,u||P||O||R),T.uniform2f(z.u_texsize,t.spriteAtlas.width/4,t.spriteAtlas.height/4)}var F=Math.log(v/h)/Math.LN2||0;T.uniform1f(z.u_zoom,10*(t.transform.zoom-F)),T.activeTexture(T.TEXTURE1),t.frameHistory.bind(T),T.uniform1i(z.u_fadetexture,1);var j;if(u){var N=.105*C/v/o.devicePixelRatio;if(y){T.uniform1f(z.u_gamma,(1.19*x/I/8+N)*A),T.uniform4fv(z.u_color,b),T.uniform1f(z.u_opacity,_),T.uniform1f(z.u_buffer,(6-y/I)/8);for(var B=0;B<a.length;B++)j=a[B],j.vaos[e.id].bind(T,z,j.layoutVertexBuffer,j.elementBuffer),T.drawElements(T.TRIANGLES,3*j.elementBuffer.length,T.UNSIGNED_SHORT,0)}T.uniform1f(z.u_gamma,N*A),T.uniform4fv(z.u_color,w),T.uniform1f(z.u_opacity,_),T.uniform1f(z.u_buffer,.75),T.uniform1f(z.u_pitch,S.pitch/360*2*Math.PI),T.uniform1f(z.u_bearing,S.bearing/360*2*Math.PI),T.uniform1f(z.u_aspect_ratio,S.width/S.height);for(var U=0;U<a.length;U++)j=a[U],j.vaos[e.id].bind(T,z,j.layoutVertexBuffer,j.elementBuffer),T.drawElements(T.TRIANGLES,3*j.elementBuffer.length,T.UNSIGNED_SHORT,0)}else{T.uniform1f(z.u_opacity,_);for(var V=0;V<a.length;V++)j=a[V],j.vaos[e.id].bind(T,z,j.layoutVertexBuffer,j.elementBuffer),T.drawElements(T.TRIANGLES,3*j.elementBuffer.length,T.UNSIGNED_SHORT,0)}}}var o=t(\"../util/browser\"),s=t(\"./draw_collision_debug\"),l=t(\"../source/pixels_to_tile_units\");e.exports=n},{\"../source/pixels_to_tile_units\":363,\"../util/browser\":426,\"./draw_collision_debug\":347}],353:[function(t,e,r){\"use strict\";function n(){this.changeTimes=new Float64Array(256),this.changeOpacities=new Uint8Array(256),this.opacities=new Uint8ClampedArray(256),this.array=new Uint8Array(this.opacities.buffer),this.fadeDuration=300,this.previousZoom=0,this.firstFrame=!0}e.exports=n,n.prototype.record=function(t){var e=Date.now();this.firstFrame&&(e=0,this.firstFrame=!1),t=Math.floor(10*t);var r;if(t<this.previousZoom)for(r=t+1;r<=this.previousZoom;r++)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];else for(r=t;r>this.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=e-this.changeTimes[r],i=n/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+i:this.changeOpacities[r]-i}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],354:[function(t,e,r){\"use strict\";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t(\"../util/util\");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(\",\")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce(\"LineAtlas out of space\"),null;for(var a=0,o=0;o<t.length;o++)a+=t[o];for(var s=this.width/a,l=s/2,u=t.length%2==1,c=-r;c<=r;c++)for(var h=this.nextRow+r+c,f=this.width*h,d=u?-t[t.length-1]:0,p=t[0],m=1,g=0;g<this.width;g++){for(;p<g/s;)d=p,p+=t[m],u&&m===t.length-1&&(p+=t[0]),m++;var v,y=Math.abs(g-d*s),b=Math.abs(g-p*s),x=Math.min(y,b),_=m%2==1;if(e){var w=r?c/r*(l+1):0;if(_){var M=l-Math.abs(w);v=Math.sqrt(x*x+M*M)}else v=l-Math.sqrt(x*x+w*w)}else v=(_?1:-1)*x;this.data[3+4*(f+g)]=Math.max(0,Math.min(255,v+128))}var k={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:a};return this.nextRow+=n,this.dirty=!0,k},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))}},{\"../util/util\":442}],355:[function(t,e,r){\"use strict\";function n(t,e){this.gl=t,this.transform=e,this.reusableTextures={},this.preFbos={},this.frameHistory=new o,this.setup(),this.numSublayers=s.maxUnderzooming+s.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.lineWidthRange=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)}var i=t(\"../util/browser\"),a=t(\"gl-matrix\").mat4,o=t(\"./frame_history\"),s=t(\"../source/source_cache\"),l=t(\"../data/bucket\").EXTENT,u=t(\"../source/pixels_to_tile_units\"),c=t(\"../util/util\"),h=t(\"../util/struct_array\"),f=t(\"../data/buffer\"),d=t(\"./vertex_array_object\"),p=t(\"./draw_raster\").RasterBoundsArray,m=t(\"./create_uniform_pragmas\");e.exports=n,c.extend(n.prototype,t(\"./painter/use_program\")),n.prototype.resize=function(t,e){var r=this.gl;this.width=t*i.devicePixelRatio,this.height=e*i.devicePixelRatio,r.viewport(0,0,this.width,this.height)},n.prototype.setup=function(){var t=this.gl;t.verbose=!0,t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.enable(t.STENCIL_TEST),t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),this._depthMask=!1,t.depthMask(!1);var e=this.PosArray=new h({members:[{name:\"a_pos\",type:\"Int16\",components:2}]}),r=new e;r.emplaceBack(0,0),r.emplaceBack(l,0),r.emplaceBack(0,l),r.emplaceBack(l,l),this.tileExtentBuffer=new f(r.serialize(),e.serialize(),f.BufferType.VERTEX),this.tileExtentVAO=new d,this.tileExtentPatternVAO=new d;var n=new e;n.emplaceBack(0,0),n.emplaceBack(l,0),n.emplaceBack(l,l),n.emplaceBack(0,l),n.emplaceBack(0,0),this.debugBuffer=new f(n.serialize(),e.serialize(),f.BufferType.VERTEX),this.debugVAO=new d;var i=new p;i.emplaceBack(0,0,0,0),i.emplaceBack(l,0,32767,0),i.emplaceBack(0,l,0,32767),i.emplaceBack(l,l,32767,32767),this.rasterBoundsBuffer=new f(i.serialize(),p.serialize(),f.BufferType.VERTEX),this.rasterBoundsVAO=new d},n.prototype.clearColor=function(){var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},n.prototype.clearStencil=function(){var t=this.gl;t.clearStencil(0),t.stencilMask(255),t.clear(t.STENCIL_BUFFER_BIT)},n.prototype.clearDepth=function(){var t=this.gl;t.clearDepth(1),this.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},n.prototype._renderTileClippingMasks=function(t){var e=this.gl;e.colorMask(!1,!1,!1,!1),this.depthMask(!1),e.disable(e.DEPTH_TEST),e.enable(e.STENCIL_TEST),e.stencilMask(248),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE);var r=1;this._tileClippingMaskIDs={};for(var n=0;n<t.length;n++){var i=t[n],a=this._tileClippingMaskIDs[i.id]=r++<<3;e.stencilFunc(e.ALWAYS,a,248);var o=m([{name:\"u_color\",components:4},{name:\"u_opacity\",components:1}]),s=this.useProgram(\"fill\",[],o,o);e.uniformMatrix4fv(s.u_matrix,!1,i.posMatrix),this.tileExtentVAO.bind(e,s,this.tileExtentBuffer),e.drawArrays(e.TRIANGLE_STRIP,0,this.tileExtentBuffer.length)}e.stencilMask(0),e.colorMask(!0,!0,!0,!0),this.depthMask(!0),e.enable(e.DEPTH_TEST)},n.prototype.enableTileClippingMask=function(t){var e=this.gl;e.stencilFunc(e.EQUAL,this._tileClippingMaskIDs[t.id],248)},n.prototype.prepareBuffers=function(){},n.prototype.bindDefaultFramebuffer=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)};var g={symbol:t(\"./draw_symbol\"),circle:t(\"./draw_circle\"),line:t(\"./draw_line\"),fill:t(\"./draw_fill\"),raster:t(\"./draw_raster\"),background:t(\"./draw_background\"),debug:t(\"./draw_debug\")};n.prototype.render=function(t,e){this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.spriteAtlas=t.spriteAtlas,this.spriteAtlas.setSprite(t.sprite),this.glyphSource=t.glyphSource,this.frameHistory.record(this.transform.zoom),this.prepareBuffers(),this.clearColor(),this.clearDepth(),this.showOverdrawInspector(e.showOverdrawInspector),this.depthRange=(t._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass({isOpaquePass:!0}),this.renderPass({isOpaquePass:!1})},n.prototype.renderPass=function(t){var e=this.style._groups,r=t.isOpaquePass;this.currentLayer=r?this.style._order.length:-1;for(var n=0;n<e.length;n++){var i,a=e[r?e.length-1-n:n],o=this.style.sources[a.source],s=[];if(o){for(s=o.getVisibleCoordinates(),i=0;i<s.length;i++)s[i].posMatrix=this.transform.calculatePosMatrix(s[i],o.maxzoom);this.clearStencil(),o.prepare&&o.prepare(),o.isTileClipped&&this._renderTileClippingMasks(s)}for(r?(this._showOverdrawInspector||this.gl.disable(this.gl.BLEND),this.isOpaquePass=!0):(this.gl.enable(this.gl.BLEND),this.isOpaquePass=!1,s.reverse()),i=0;i<a.length;i++){var l=a[r?a.length-1-i:i];this.currentLayer+=r?-1:1,this.renderLayer(this,o,l,s)}o&&g.debug(this,o,s)}},n.prototype.depthMask=function(t){t!==this._depthMask&&(this._depthMask=t,this.gl.depthMask(t))},n.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||(\"background\"===r.type||n.length)&&(this.id=r.id,g[r.type](t,e,r,n))},n.prototype.setDepthSublayer=function(t){var e=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,r=e-1+this.depthRange;this.gl.depthRange(r,e)},n.prototype.translatePosMatrix=function(t,e,r,n){if(!r[0]&&!r[1])return t;if(\"viewport\"===n){var i=Math.sin(-this.transform.angle),o=Math.cos(-this.transform.angle);r=[r[0]*o-r[1]*i,r[0]*i+r[1]*o]}var s=[u(e,r[0],this.transform.zoom),u(e,r[1],this.transform.zoom),0],l=new Float32Array(16);return a.translate(l,t,s),l},n.prototype.saveTexture=function(t){var e=this.reusableTextures[t.size];e?e.push(t):this.reusableTextures[t.size]=[t]},n.prototype.getTexture=function(t){var e=this.reusableTextures[t];return e&&e.length>0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(c.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{\"../data/bucket\":329,\"../data/buffer\":334,\"../source/pixels_to_tile_units\":363,\"../source/source_cache\":367,\"../util/browser\":426,\"../util/struct_array\":440,\"../util/util\":442,\"./create_uniform_pragmas\":344,\"./draw_background\":345,\"./draw_circle\":346,\"./draw_debug\":348,\"./draw_fill\":349,\"./draw_line\":350,\"./draw_raster\":351,\"./draw_symbol\":352,\"./frame_history\":353,\"./painter/use_program\":356,\"./vertex_array_object\":357,\"gl-matrix\":193}],356:[function(t,e,r){\"use strict\";function n(t,e){return t.replace(/#pragma mapbox: ([\\w]+) ([\\w]+) ([\\w]+) ([\\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t(\"assert\"),a=t(\"../../util/util\"),o=t(\"mapbox-gl-shaders\"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var u=this.gl,c=u.createProgram(),h=o[t],f=\"#define MAPBOX_GL_JS;\\n\",d=0;d<e.length;d++)f+=\"#define \"+e[d]+\";\\n\";var p=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(p,n(f+h.fragmentSource,l)),u.compileShader(p),i(u.getShaderParameter(p,u.COMPILE_STATUS),u.getShaderInfoLog(p)),u.attachShader(c,p);var m=u.createShader(u.VERTEX_SHADER);u.shaderSource(m,n(f+s+h.vertexSource,r)),u.compileShader(m),i(u.getShaderParameter(m,u.COMPILE_STATUS),u.getShaderInfoLog(m)),u.attachShader(c,m),u.linkProgram(c),i(u.getProgramParameter(c,u.LINK_STATUS),u.getProgramInfoLog(c));for(var g={},v=u.getProgramParameter(c,u.ACTIVE_ATTRIBUTES),y=0;y<v;y++){var b=u.getActiveAttrib(c,y);g[b.name]=u.getAttribLocation(c,b.name)}for(var x={},_=u.getProgramParameter(c,u.ACTIVE_UNIFORMS),w=0;w<_;w++){var M=u.getActiveUniform(c,w);x[M.name]=u.getUniformLocation(c,M.name)}return a.extend({program:c,definition:h,attributes:g,numAttributes:v},g,x)},e.exports._createProgramCached=function(t,e,r,n){this.cache=this.cache||{};var i=JSON.stringify({name:t,defines:e,vertexPragmas:r,fragmentPragmas:n});return this.cache[i]||(this.cache[i]=this._createProgram(t,e,r,n)),this.cache[i]},e.exports.useProgram=function(t,e,r,n){var i=this.gl;e=e||[],this._showOverdrawInspector&&(e=e.concat(\"OVERDRAW_INSPECTOR\"));var a=this._createProgramCached(t,e,r,n);return this.currentProgram!==a&&(i.useProgram(a.program),this.currentProgram=a),a}},{\"../../util/util\":442,assert:47,\"mapbox-gl-shaders\":303}],357:[function(t,e,r){\"use strict\";function n(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.vao=null}var i=t(\"assert\");e.exports=n,n.prototype.bind=function(t,e,r,n,i){void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension(\"OES_vertex_array_object\"));var a=!this.vao||this.boundProgram!==e||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==i||this.boundElementBuffer!==n;!t.extVertexArrayObject||a?this.freshBind(t,e,r,n,i):t.extVertexArrayObject.bindVertexArrayOES(this.vao)},n.prototype.freshBind=function(t,e,r,n,a){var o,s=e.numAttributes;if(t.extVertexArrayObject)this.vao&&this.destroy(t),this.vao=t.extVertexArrayObject.createVertexArrayOES(),t.extVertexArrayObject.bindVertexArrayOES(this.vao),o=0,this.boundProgram=e,this.boundVertexBuffer=r,this.boundVertexBuffer2=a,this.boundElementBuffer=n;else{o=t.currentNumAttributes||0;for(var l=s;l<o;l++)i(0!==l),t.disableVertexAttribArray(l)}for(var u=o;u<s;u++)t.enableVertexAttribArray(u);r.bind(t),r.setVertexAttribPointers(t,e),a&&(a.bind(t),a.setVertexAttribPointers(t,e)),n&&n.bind(t),t.currentNumAttributes=s},n.prototype.unbind=function(t){var e=t.extVertexArrayObject;e&&e.bindVertexArrayOES(null)},n.prototype.destroy=function(t){var e=t.extVertexArrayObject;e&&this.vao&&(e.deleteVertexArrayOES(this.vao),this.vao=null)}},{assert:47}],358:[function(t,e,r){\"use strict\";function n(t,e,r){e=e||{},this.id=t,this.dispatcher=r,this._data=e.data,void 0!==e.maxzoom&&(this.maxzoom=e.maxzoom),e.type&&(this.type=e.type);var n=s/this.tileSize;this.workerOptions=a.extend({source:this.id,cluster:e.cluster||!1,geojsonVtOptions:{buffer:(void 0!==e.buffer?e.buffer:128)*n,tolerance:(void 0!==e.tolerance?e.tolerance:.375)*n,extent:s,maxZoom:this.maxzoom},superclusterOptions:{maxZoom:Math.min(e.clusterMaxZoom,this.maxzoom-1)||this.maxzoom-1,extent:s,radius:(e.clusterRadius||50)*n,log:!1}},e.workerOptions),this._updateWorkerData(function(t){if(t)return void this.fire(\"error\",{error:t});this.fire(\"load\")}.bind(this))}var i=t(\"../util/evented\"),a=t(\"../util/util\"),o=t(\"resolve-url\"),s=t(\"../data/bucket\").EXTENT;e.exports=n,n.prototype=a.inherit(i,{type:\"geojson\",minzoom:0,maxzoom:18,tileSize:512,isTileClipped:!0,reparseOverscaled:!0,onAdd:function(t){this.map=t},setData:function(t){return this._data=t,this._updateWorkerData(function(t){if(t)return this.fire(\"error\",{error:t});this.fire(\"change\")}.bind(this)),this},_updateWorkerData:function(t){var e=a.extend({},this.workerOptions),r=this._data;\"string\"==typeof r?e.url=\"undefined\"!=typeof window?o(window.location.href,r):r:e.data=JSON.stringify(r),this.workerID=this.dispatcher.send(this.type+\".loadData\",e,function(e){this._loaded=!0,t(e)}.bind(this))},loadTile:function(t,e){var r=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(\"load tile\",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send(\"remove tile\",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{\"../data/bucket\":329,\"../util/evented\":434,\"../util/util\":442,\"resolve-url\":501}],359:[function(t,e,r){\"use strict\";function n(t,e,r){r&&(this.loadGeoJSON=r),h.call(this,t,e)}var i=t(\"../util/util\"),a=t(\"../util/ajax\"),o=t(\"geojson-rewind\"),s=t(\"./geojson_wrapper\"),l=t(\"vt-pbf\"),u=t(\"supercluster\"),c=t(\"geojson-vt\"),h=t(\"./vector_tile_worker_source\");e.exports=n,n.prototype=i.inherit(h,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name=\"_geojsonTileLayer\";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):\"object\"!=typeof n?e(new Error(\"Input data is not a valid GeoJSON object.\")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if(\"string\"!=typeof t.data)return e(new Error(\"Input data is not a valid GeoJSON object.\"));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error(\"Input data is not a valid GeoJSON object.\"))}}},_indexData:function(t,e,r){try{e.cluster?r(null,u(e.superclusterOptions).load(t.features)):r(null,c(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{\"../util/ajax\":425,\"../util/util\":442,\"./geojson_wrapper\":360,\"./vector_tile_worker_source\":371,\"geojson-rewind\":138,\"geojson-vt\":142,supercluster:529,\"vt-pbf\":556}],360:[function(t,e,r){\"use strict\";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;e<t.geometry.length;e++)this.rawGeometry.push([t.geometry[e]])}else this.rawGeometry=t.geometry;this.properties=t.tags,this.extent=s}var a=t(\"point-geometry\"),o=t(\"vector-tile\").VectorTileFeature,s=t(\"../data/bucket\").EXTENT;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new a(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},i.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},i.prototype.toGeoJSON=o.prototype.toGeoJSON},{\"../data/bucket\":329,\"point-geometry\":484,\"vector-tile\":550}],361:[function(t,e,r){\"use strict\";function n(t,e,r){this.id=t,this.dispatcher=r,this.url=e.url,this.coordinates=e.coordinates,u.getImage(e.url,function(t,r){if(t)return this.fire(\"error\",{error:t});this.image=r,this.image.addEventListener(\"load\",function(){this.map._rerender()}.bind(this)),this._loaded=!0,this.fire(\"load\"),this.map&&this.setCoordinates(e.coordinates)}.bind(this))}var i=t(\"../util/util\"),a=t(\"./tile_coord\"),o=t(\"../geo/lng_lat\"),s=t(\"point-geometry\"),l=t(\"../util/evented\"),u=t(\"../util/ajax\"),c=t(\"../data/bucket\").EXTENT,h=t(\"../render/draw_raster\").RasterBoundsArray,f=t(\"../data/buffer\"),d=t(\"../render/vertex_array_object\");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,onAdd:function(t){this.map=t,this.image&&this.setCoordinates(this.coordinates)},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*c),Math.round((e.row-n.row)*c))}),this.fire(\"change\"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new h;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new f(e.serialize(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state=\"loaded\"},prepare:function(){if(this._loaded&&this.image&&this.image.complete&&this.tile){var t=this.map.painter,e=t.gl;this._prepared?(e.bindTexture(e.TEXTURE_2D,this.tile.texture),e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,this.image)):(this.tile.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.tile.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.image))}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state=\"errored\",e(null))},serialize:function(){return{type:\"image\",urls:this.url,coordinates:this.coordinates}}})},{\"../data/bucket\":329,\"../data/buffer\":334,\"../geo/lng_lat\":339,\"../render/draw_raster\":351,\"../render/vertex_array_object\":357,\"../util/ajax\":425,\"../util/evented\":434,\"../util/util\":442,\"./tile_coord\":369,\"point-geometry\":484}],362:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i=t(\"../util/ajax\"),a=t(\"../util/browser\"),o=t(\"../util/mapbox\").normalizeSourceURL;e.exports=function(t,e){var r=function(t,r){if(t)return e(t);var i=n.pick(r,[\"tiles\",\"minzoom\",\"maxzoom\",\"attribution\"]);r.vector_layers&&(i.vectorLayers=r.vector_layers,i.vectorLayerIds=i.vectorLayers.map(function(t){return t.id})),e(null,i)};t.url?i.getJSON(o(t.url),r):a.frame(r.bind(null,null,t))}},{\"../util/ajax\":425,\"../util/browser\":426,\"../util/mapbox\":439,\"../util/util\":442}],363:[function(t,e,r){\"use strict\";var n=t(\"../data/bucket\");e.exports=function(t,e,r){return e*(n.EXTENT/(t.tileSize*Math.pow(2,r-t.coord.z)))}},{\"../data/bucket\":329}],364:[function(t,e,r){\"use strict\";function n(t,e){var r=t.coord,n=e.coord;return r.z-n.z||r.y-n.y||r.w-n.w||r.x-n.x}function i(t){for(var e=t[0]||{},r=1;r<t.length;r++){var n=t[r];for(var i in n){var a=n[i],o=e[i];if(void 0===o)o=e[i]=a;else for(var s=0;s<a.length;s++)o.push(a[s])}}return e}var a=t(\"./tile_coord\");r.rendered=function(t,e,r,a,o,s){var l=t.tilesIn(r);l.sort(n);for(var u=[],c=0;c<l.length;c++){var h=l[c];h.tile.featureIndex&&u.push(h.tile.featureIndex.query({queryGeometry:h.queryGeometry,scale:h.scale,tileSize:h.tile.tileSize,bearing:s,params:a},e))}return i(u)},r.source=function(t,e){for(var r=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),n=[],i={},o=0;o<r.length;o++){var s=r[o],l=new a(Math.min(s.sourceMaxZoom,s.coord.z),s.coord.x,s.coord.y,0).id;i[l]||(i[l]=!0,s.querySourceFeatures(n,e))}return n}},{\"./tile_coord\":369}],365:[function(t,e,r){\"use strict\";function n(t,e,r){this.id=t,this.dispatcher=r,i.extend(this,i.pick(e,[\"url\",\"scheme\",\"tileSize\"])),s(e,function(t,e){if(t)return this.fire(\"error\",t);i.extend(this,e),this.fire(\"load\")}.bind(this))}var i=t(\"../util/util\"),a=t(\"../util/ajax\"),o=t(\"../util/evented\"),s=t(\"./load_tilejson\"),l=t(\"../util/mapbox\").normalizeTileURL;e.exports=n,n.prototype=i.inherit(o,{minzoom:0,maxzoom:22,roundZoom:!0,scheme:\"xyz\",tileSize:512,_loaded:!1,onAdd:function(t){this.map=t},serialize:function(){return{type:\"raster\",url:this.url,tileSize:this.tileSize}},loadTile:function(t,e){function r(r,n){if(delete t.request,!t.aborted){if(r)return e(r);var i=this.map.painter.gl;t.texture=this.map.painter.getTexture(n.width),t.texture?(i.bindTexture(i.TEXTURE_2D,t.texture),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,n)):(t.texture=i.createTexture(),i.bindTexture(i.TEXTURE_2D,t.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),t.texture.size=n.width),i.generateMipmap(i.TEXTURE_2D),this.map.animationLoop.set(this.map.style.rasterFadeDuration),t.state=\"loaded\",e(null)}}var n=l(t.coord.url(this.tiles,null,this.scheme),this.url,this.tileSize);t.request=a.getImage(n,r.bind(this))},abortTile:function(t){t.request&&(t.request.abort(),delete t.request)},unloadTile:function(t){t.texture&&this.map.painter.saveTexture(t.texture)}})},{\"../util/ajax\":425,\"../util/evented\":434,\"../util/mapbox\":439,\"../util/util\":442,\"./load_tilejson\":362}],366:[function(t,e,r){\"use strict\";var n=t(\"../util/util\"),i={vector:t(\"../source/vector_tile_source\"),raster:t(\"../source/raster_tile_source\"),geojson:t(\"../source/geojson_source\"),video:t(\"../source/video_source\"),image:t(\"../source/image_source\")};r.create=function(t,e,r){if(e=new i[e.type](t,e,r),e.id!==t)throw new Error(\"Expected Source id to be \"+t+\" instead of \"+e.id);return n.bindAll([\"load\",\"abort\",\"unload\",\"serialize\",\"prepare\"],e),e},r.getType=function(t){return i[t]},r.setType=function(t,e){i[t]=e}},{\"../source/geojson_source\":358,\"../source/image_source\":361,\"../source/raster_tile_source\":365,\"../source/vector_tile_source\":370,\"../source/video_source\":372,\"../util/util\":442}],367:[function(t,e,r){\"use strict\";function n(t,e,r){this.id=t,this.dispatcher=r;var n=this._source=o.create(t,e,r).on(\"load\",function(){this.map&&this._source.onAdd&&this._source.onAdd(this.map),this._sourceLoaded=!0,this.tileSize=n.tileSize,this.minzoom=n.minzoom,this.maxzoom=n.maxzoom,this.roundZoom=n.roundZoom,this.reparseOverscaled=n.reparseOverscaled,this.isTileClipped=n.isTileClipped,this.attribution=n.attribution,this.vectorLayerIds=n.vectorLayerIds,this.fire(\"load\")}.bind(this)).on(\"error\",function(t){this._sourceErrored=!0,this.fire(\"error\",t)}.bind(this)).on(\"change\",function(){this.reload(),this.transform&&this.update(this.transform,this.map&&this.map.style.rasterFadeDuration),this.fire(\"change\")}.bind(this));this._tiles={},this._cache=new c(0,this.unloadTile.bind(this)),this._isIdRenderable=this._isIdRenderable.bind(this)}function i(t,e,r){var n=r.zoomTo(Math.min(t.z,e));return{x:(n.column-(t.x+t.w*Math.pow(2,t.z)))*d,y:(n.row-t.y)*d}}function a(t,e){return t%32-e%32}var o=t(\"./source\"),s=t(\"./tile\"),l=t(\"../util/evented\"),u=t(\"./tile_coord\"),c=t(\"../util/lru_cache\"),h=t(\"../geo/coordinate\"),f=t(\"../util/util\"),d=t(\"../data/bucket\").EXTENT;e.exports=n,n.maxOverzooming=10,n.maxUnderzooming=3,n.prototype=f.inherit(l,{onAdd:function(t){this.map=t,this._source&&this._source.onAdd&&this._source.onAdd(t)},loaded:function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in this._tiles){var e=this._tiles[t];if(\"loaded\"!==e.state&&\"errored\"!==e.state)return!1}return!0},getSource:function(){return this._source},loadTile:function(t,e){return this._source.loadTile(t,e)},unloadTile:function(t){if(this._source.unloadTile)return this._source.unloadTile(t)},abortTile:function(t){if(this._source.abortTile)return this._source.abortTile(t)},serialize:function(){return this._source.serialize()},prepare:function(){if(this._sourceLoaded&&this._source.prepare)return this._source.prepare()},getIds:function(){return Object.keys(this._tiles).map(Number).sort(a)},getRenderableIds:function(){return this.getIds().filter(this._isIdRenderable)},_isIdRenderable:function(t){return this._tiles[t].isRenderable()&&!this._coveredTiles[t]},reload:function(){this._cache.reset();for(var t in this._tiles){var e=this._tiles[t];\"loading\"!==e.state&&(e.state=\"reloading\"),this.loadTile(this._tiles[t],this._tileLoaded.bind(this,this._tiles[t]))}},_tileLoaded:function(t,e){if(e)return t.state=\"errored\",this.fire(\"tile.error\",{tile:t,error:e}),void this._source.fire(\"tile.error\",{tile:t,error:e});t.source=this,t.timeAdded=(new Date).getTime(),this.fire(\"tile.load\",{tile:t}),this._source.fire(\"tile.load\",{tile:t})},getTile:function(t){return this.getTileByID(t.id)},getTileByID:function(t){return this._tiles[t]},getZoom:function(t){return t.zoom+t.scaleZoom(t.tileSize/this.tileSize)},findLoadedChildren:function(t,e,r){var n=!1;for(var i in this._tiles){var a=this._tiles[i];if(!(r[i]||!a.isRenderable()||a.coord.z<=t.z||a.coord.z>e)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;a=this._tiles[s],a&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r;this._cache.setMaxSize(Math.floor(5*n))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),c={},h=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;r<d.length;r++)i=d[r],a=this.addTile(i),c[i.id]=!0,a.isRenderable()||this.findLoadedChildren(i,l,c)||this.findLoadedParent(i,s,c);for(var p={},m=Object.keys(c),g=0;g<m.length;g++){var v=m[g];i=u.fromID(v),a=this._tiles[v],a&&a.timeAdded>h-(e||0)&&(this.findLoadedChildren(i,l,c)&&(c[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)c[y]||(this._coveredTiles[y]=!0);for(y in p)c[y]=!0;var b=f.keysDifference(this._tiles,c);for(r=0;r<b.length;r++)this.removeTile(+b[r]);this.transform=t}},addTile:function(t){var e=this._tiles[t.id];if(e)return e;var r=t.wrapped()\n", | |
";if(e=this._tiles[r.id],e||(e=this._cache.get(r.id))&&this._redoPlacement&&this._redoPlacement(e),!e){var n=t.z,i=n>this.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire(\"tile.add\",{tile:e}),this._source.fire(\"tile.add\",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire(\"tile.remove\",{tile:e}),this._source.fire(\"tile.remove\",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,c=0;c<t.length;c++){var f=t[c];n=Math.min(n,f.column),a=Math.min(a,f.row),o=Math.max(o,f.column),s=Math.max(s,f.row)}for(var p=0;p<r.length;p++){var m=this._tiles[r[p]],g=u.fromID(r[p]),v=[i(g,m.sourceMaxZoom,new h(n,a,l)),i(g,m.sourceMaxZoom,new h(o,s,l))];if(v[0].x<d&&v[0].y<d&&v[1].x>=0&&v[1].y>=0){for(var y=[],b=0;b<t.length;b++)y.push(i(g,m.sourceMaxZoom,t[b]));var x=e[m.coord.id];void 0===x&&(x=e[m.coord.id]={tile:m,coord:g,queryGeometry:[],scale:Math.pow(2,this.transform.zoom-m.coord.z)}),x.queryGeometry.push(y)}}var _=[];for(var w in e)_.push(e[w]);return _},redoPlacement:function(){for(var t=this.getIds(),e=0;e<t.length;e++){this.getTileByID(t[e]).redoPlacement(this)}},getVisibleCoordinates:function(){return this.getRenderableIds().map(u.fromID)}})},{\"../data/bucket\":329,\"../geo/coordinate\":338,\"../util/evented\":434,\"../util/lru_cache\":438,\"../util/util\":442,\"./source\":366,\"./tile\":368,\"./tile_coord\":369}],368:[function(t,e,r){\"use strict\";function n(t,e,r){this.coord=t,this.uid=a.uniqueId(),this.uses=0,this.tileSize=e,this.sourceMaxZoom=r,this.buckets={},this.state=\"loading\"}function i(t,e){if(e){for(var r={},n=0;n<t.length;n++){var i=e.getLayer(t[n].layerId);if(i){var s=o.create(a.extend({layer:i,childLayers:t[n].childLayerIds.map(e.getLayer.bind(e)).filter(function(t){return t})},t[n]));r[s.id]=s}}return r}}var a=t(\"../util/util\"),o=t(\"../data/bucket\"),s=t(\"../data/feature_index\"),l=t(\"vector-tile\"),u=t(\"pbf\"),c=t(\"../util/vectortile_to_geojson\"),h=t(\"feature-filter\"),f=t(\"../symbol/collision_tile\"),d=t(\"../symbol/collision_box\"),p=t(\"../symbol/symbol_instances\"),m=t(\"../symbol/symbol_quads\");e.exports=n,n.prototype={loadVectorData:function(t,e){this.state=\"loaded\",t&&(this.collisionBoxArray=new d(t.collisionBoxArray),this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.symbolInstancesArray=new p(t.symbolInstancesArray),this.symbolQuadsArray=new m(t.symbolQuadsArray),this.featureIndex=new s(t.featureIndex,t.rawTileData,this.collisionTile),this.rawTileData=t.rawTileData,this.buckets=i(t.buckets,e))},reloadSymbolData:function(t,e,r){if(\"unloaded\"!==this.state){this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.featureIndex.setCollisionTile(this.collisionTile);for(var n in this.buckets){var o=this.buckets[n];\"symbol\"===o.type&&(o.destroy(e.gl),delete this.buckets[n])}a.extend(this.buckets,i(t.buckets,r))}},unloadVectorData:function(t){for(var e in this.buckets){this.buckets[e].destroy(t.gl)}this.collisionBoxArray=null,this.symbolQuadsArray=null,this.symbolInstancesArray=null,this.collisionTile=null,this.featureIndex=null,this.rawTileData=null,this.buckets=null,this.state=\"unloaded\"},redoPlacement:function(t){function e(e,r){this.reloadSymbolData(r,t.map.painter,t.map.style),t.fire(\"tile.load\",{tile:this}),this.state=\"loaded\",this.redoWhenDone&&(this.redoPlacement(t),this.redoWhenDone=!1)}if(\"loaded\"!==this.state||\"reloading\"===this.state)return void(this.redoWhenDone=!0);this.state=\"reloading\",t.dispatcher.send(\"redo placement\",{uid:this.uid,source:t.id,angle:t.map.transform.angle,pitch:t.map.transform.pitch,showCollisionBoxes:t.map.showCollisionBoxes},e.bind(this),this.workerID)},getBucket:function(t){return this.buckets&&this.buckets[t.ref||t.id]},querySourceFeatures:function(t,e){if(this.rawTileData){this.vtLayers||(this.vtLayers=new l.VectorTile(new u(new Uint8Array(this.rawTileData))).layers);var r=this.vtLayers._geojsonTileLayer||this.vtLayers[e.sourceLayer];if(r)for(var n=h(e.filter),i={z:this.coord.z,x:this.coord.x,y:this.coord.y},a=0;a<r.length;a++){var o=r.feature(a);if(n(o)){var s=new c(o,this.coord.z,this.coord.x,this.coord.y);s.tile=i,t.push(s)}}}},isRenderable:function(){return\"loaded\"===this.state||\"reloading\"===this.state}}},{\"../data/bucket\":329,\"../data/feature_index\":336,\"../symbol/collision_box\":394,\"../symbol/collision_tile\":396,\"../symbol/symbol_instances\":405,\"../symbol/symbol_quads\":406,\"../util/util\":442,\"../util/vectortile_to_geojson\":443,\"feature-filter\":132,pbf:478,\"vector-tile\":550}],369:[function(t,e,r){\"use strict\";function n(t,e,r,n){l(!isNaN(t)&&t>=0&&t%1==0),l(!isNaN(e)&&e>=0&&e%1==0),l(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=-1*n-1);var i=1<<this.z;this.id=32*(i*i*n+i*this.y+this.x)+this.z,this.posMatrix=null}function i(t,e,r){for(var n,i=\"\",a=t;a>0;a--)n=1<<a-1,i+=(e&n?1:0)+(r&n?2:0);return i}function a(t,e){if(t.row>e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function o(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var l=t.dx/t.dy,u=e.dx/e.dy,c=t.dx>0,h=e.dx<0,f=a;f<o;f++){var d=l*Math.max(0,Math.min(t.dy,f+c-t.y0))+t.x0,p=u*Math.max(0,Math.min(e.dy,f+h-e.y0))+e.x0;i(Math.floor(p),Math.ceil(d),f)}}function s(t,e,r,n,i,s){var l,u=a(t,e),c=a(e,r),h=a(r,t);u.dy>c.dy&&(l=u,u=c,c=l),u.dy>h.dy&&(l=u,u=h,h=l),c.dy>h.dy&&(l=c,c=h,h=l),u.dy&&o(h,u,n,i,s),c.dy&&o(h,c,n,i,s)}var l=t(\"assert\"),u=t(\"whoots-js\"),c=t(\"../geo/coordinate\");e.exports=n,n.prototype.toString=function(){return this.z+\"/\"+this.x+\"/\"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<<e,i=(t-e)/32,a=i%r,o=(i-a)/r%r,s=Math.floor(i/(r*r));return s%2!=0&&(s=-1*s-1),s/=2,new n(e,a,o,s)},n.prototype.url=function(t,e,r){var n=u.getTileBBox(this.x,this.y,this.z),a=i(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(\"{prefix}\",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(\"{z}\",Math.min(this.z,e||this.z)).replace(\"{x}\",this.x).replace(\"{y}\",\"tms\"===r?Math.pow(2,this.z)-this.y-1:this.y).replace(\"{quadkey}\",a).replace(\"{bbox-epsg-3857}\",n)},n.prototype.parent=function(t){return 0===this.z?null:this.z>t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var s,l,u;if(i>=0&&i<=a)for(s=t;s<e;s++)l=(s%a+a)%a,u=new n(r,l,i,Math.floor(s/a)),o[u.id]=u}var a=1<<t,o={};return s(e[0],e[1],e[2],0,a,i),s(e[2],e[3],e[0],0,a,i),Object.keys(o).map(function(t){return o[t]})}},{\"../geo/coordinate\":338,assert:47,\"whoots-js\":566}],370:[function(t,e,r){\"use strict\";function n(t,e,r){if(this.id=t,this.dispatcher=r,a.extend(this,a.pick(e,[\"url\",\"scheme\",\"tileSize\"])),this._options=a.extend({type:\"vector\"},e),512!==this.tileSize)throw new Error(\"vector tile sources must have a tileSize of 512\");o(e,function(t,e){if(t)return void this.fire(\"error\",t);a.extend(this,e),this.fire(\"load\")}.bind(this))}var i=t(\"../util/evented\"),a=t(\"../util/util\"),o=t(\"./load_tilejson\"),s=t(\"../util/mapbox\").normalizeTileURL;e.exports=n,n.prototype=a.inherit(i,{minzoom:0,maxzoom:22,scheme:\"xyz\",tileSize:512,reparseOverscaled:!0,isTileClipped:!0,onAdd:function(t){this.map=t},serialize:function(){return a.extend({},this._options)},loadTile:function(t,e){function r(r,n){if(!t.aborted){if(r)return e(r);t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)}}var n=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?\"loading\"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send(\"reload tile\",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send(\"load tile\",i,r.bind(this))},abortTile:function(t){this.dispatcher.send(\"abort tile\",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send(\"remove tile\",{uid:t.uid,source:this.id},null,t.workerID)}})},{\"../util/evented\":434,\"../util/m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment