Team:UPF CRG Barcelona/plotly

/**

  • plotly.js v1.24.0
  • Copyright 2012-2017, Plotly, Inc.
  • All rights reserved.
  • Licensed under the MIT license
  • /

!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?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-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":667}],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}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":795}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":807}],5:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":560}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":815}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":822}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":832}],9:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":652}],10:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":973}],11:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":974}],12:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":847}],13:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":856}],14:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":864}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":869}],16:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":873}],17:[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("./scatter3d"),t("./surface"),t("./mesh3d"),t("./scattergeo"),t("./choropleth"),t("./scattergl"),t("./pointcloud"),t("./heatmapgl"),t("./parcoords"),t("./scattermapbox"),t("./ohlc"),t("./candlestick")]),n.register([t("./filter"),t("./groupby")]),n.register([t("./calendars")]),e.exports=n},{"./bar":3,"./box":4,"./calendars":5,"./candlestick":6,"./choropleth":7,"./contour":8,"./core":9,"./filter":10,"./groupby":11,"./heatmap":12,"./heatmapgl":13,"./histogram":14,"./histogram2d":15,"./histogram2dcontour":16,"./mesh3d":18,"./ohlc":19,"./parcoords":20,"./pie":21,"./pointcloud":22,"./scatter3d":23,"./scattergeo":24,"./scattergl":25,"./scattermapbox":26,"./scatterternary":27,"./surface":28}],18:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":877}],19:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":882}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":891}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":900}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":909}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":939}],24:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":945}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":950}],26:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":957}],27:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":963}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":972}],29:[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-v),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,v=n,g=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,v=0,g={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],g),r(1,n[0],n[1],g)}),t.addEventListener("touchmove",function(e){var n=l(e.changedTouches[0],t);r(1,n[0],n[1],g)}),t.addEventListener("touchend",function(e){l(e.changedTouches[0],t);r(0,m,v,g)}),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":30,"mouse-change":419,"mouse-event-offset":420,"mouse-wheel":422,"right-now":468}],30:[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,u=[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]];u.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":417,"orbit-camera-controller":439,"turntable-camera-controller":502}],31:[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":130,"gl-vao":241,"weak-map":523}],32:[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,l=i(o,a-s);return l+r+t}).join("\n")}var i=t("pad-left");e.exports=n},{"pad-left":440}],33:[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}var l=a.apply(void 0,r);if(l)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":474}],34:[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:77,"delaunay-triangulate":98}],35:[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":34,"simplicial-complex-boundary":482}],36:[function(t,e,r){"use strict";var n=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};e.exports=n()},{}],37:[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(k);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),r=e?": "+e:"";return"[Function"+r+"]"}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 A.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function f(t,e){t||h(t,!0,e,"==",A.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 l!==-1&&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;return!0}function v(t,e,r){d(t,e,!0)&&h(t,e,r,"notDeepStrictEqual",v)}function g(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)&&e.call({},t)===!0}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&&g(i,r)||s)&&h(i,r,"Got unwanted exception"+n),t&&i&&r&&!g(i,r)||!t&&i)throw i}var x=t("util/"),_=Object.prototype.hasOwnProperty,w=Array.prototype.slice,M=function(){return"foo"===function(){}.name}(),A=e.exports=f,k=/\s*function\s+([^\(\s]*)\s*/;A.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(A.AssertionError,Error),A.fail=h,A.ok=f,A.equal=function(t,e,r){t!=e&&h(t,e,r,"==",A.equal)},A.notEqual=function(t,e,r){t==e&&h(t,e,r,"!=",A.notEqual)},A.deepEqual=function(t,e,r){d(t,e,!1)||h(t,e,r,"deepEqual",A.deepEqual)},A.deepStrictEqual=function(t,e,r){d(t,e,!0)||h(t,e,r,"deepStrictEqual",A.deepStrictEqual)},A.notDeepEqual=function(t,e,r){d(t,e,!1)&&h(t,e,r,"notDeepEqual",A.notDeepEqual)},A.notDeepStrictEqual=v,A.strictEqual=function(t,e,r){t!==e&&h(t,e,r,"===",A.strictEqual)},A.notStrictEqual=function(t,e,r){t===e&&h(t,e,r,"!==",A.notStrictEqual)},A.throws=function(t,e,r){b(!0,t,e,r)},A.doesNotThrow=function(t,e,r){b(!1,t,e,r)},A.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/":513}],38:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],39:[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":473}],40:[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":50}],41:[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},{}],42:[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":50}],43:[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.shln(h):h<0&&(c=c.shln(-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":42,"./is-rat":44,"./lib/is-bn":48,"./lib/num-to-bn":49,"./lib/rationalize":50,"./lib/str-to-bn":51}],44:[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":48}],45:[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":58}],46:[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 n=0,i=0;i<e;i++){var a=r[i];n+=a*Math.pow(67108864,i)}return t.sign?-n:n}e.exports=n},{}],47:[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":57,"double-bits":99}],48:[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":58}],49:[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)).shln(e-52)}var i=t("bn.js"),a=t("double-bits");e.exports=n},{"bn.js":58,"double-bits":99}],50:[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":45,"./num-to-bn":49}],51:[function(t,e,r){"use strict";function n(t){return new i(t)}var i=t("bn.js");e.exports=n},{"bn.js":58}],52:[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":50}],53:[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":45}],54:[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":50}],55:[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.divmod(r),o=n.div,s=i(o),l=n.mod;if(0===l.cmpn(0))return s;if(s){var u=a(s)+4,c=i(l.shln(u).divRound(r));return s<0&&(c=-c),s+c*Math.pow(2,-u)}var h=r.bitLength()-l.bitLength()+53,c=i(l.shln(h).divRound(r));return h<1023?c*Math.pow(2,-h):(c*=Math.pow(2,-1023),c*Math.pow(2,1023-h))}var i=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=n},{"./lib/bn-to-num":46,"./lib/ctz":47}],56:[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){var a=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(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],57:[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}var i=32;r.INT_BITS=i,r.INT_MAX=2147483647,r.INT_MIN=-1<<i-1,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>i-1;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,e|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,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(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,t+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var a=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}}(a),r.reverse=function(t){return a[255&t]<<24|a[t>>>8&255]<<16|a[t>>>16&255]<<8|a[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),t<<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),t<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],58:[function(t,e,r){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){return null!==t&&"object"==typeof t&&Array.isArray(t.words)?t:(this.sign=!1,this.words=null,this.length=0,this.red=null,"le"!==e&&"be"!==e||(r=e,e=10),void(null!==t&&this._init(t||0,e||10,r||"be")))}function a(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 o(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 s(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){s.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function u(){s.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function c(){s.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function h(){s.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function f(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function d(t){f.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).ishln(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.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26,i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(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.sign=!0),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.sign=!0,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("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=0;if("be"===n)for(var i=t.length-1,o=0;i>=0;i-=3){var s=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}else if("le"===n)for(var i=0,o=0;i<t.length;i+=3){var s=t[i]|t[i+1]<<8|t[i+2]<<16;this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}return this.strip()},i.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;for(var n=0,r=t.length-6,i=0;r>=e;r-=6){var o=a(t,r,r+6);this.words[i]|=o<<n&67108863,this.words[i+1]|=o>>>26-n&4194303,n+=24,n>=26&&(n-=26,i++)}if(r+6!==e){var o=a(t,e,r+6);this.words[i]|=o<<n&67108863,this.words[i+1]|=o>>>26-n&4194303}this.strip()},i.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,s=a%n,l=Math.min(a,a-s)+r,u=0,c=r;c<l;c+=n)u=o(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){for(var h=1,u=o(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.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.sign=this.sign,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var p=["","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"],m=[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],v=[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];i.prototype.toString=function(t,e){if(t=t||10,16===t||"hex"===t){for(var n="",i=0,e=0|e||1,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,n=0!==a||o!==this.length-1?p[6-l.length]+l+n:l+n,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%e!==0;)n="0"+n;return this.sign&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var u=m[t],c=v[t],n="",h=this.clone();for(h.sign=!1;0!==h.cmpn(0);){var f=h.modn(c).toString(t);h=h.idivn(c),n=0!==h.cmpn(0)?p[u-f.length]+f+n:f+n}return 0===this.cmpn(0)&&(n="0"+n),this.sign&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t){this.strip();var e=new Array(this.byteLength());e[0]=0;var r=this.clone();if("le"!==t)for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[e.length-n-1]=i}else for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[n]=i}return e},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.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},i.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},i.prototype.bitLength=function(){var t=0,e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(0===this.cmpn(0))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},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var t=this.clone();return t.sign=!this.sign,t},i.prototype.ior=function(t){for(this.sign=this.sign||t.sign;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()},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.iand=function(t){this.sign=this.sign&&t.sign;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()},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.ixor=function(t){this.sign=this.sign||t.sign;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()},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);for(var n=t/26|0,i=t%26;this.length<=n;)this.words[this.length++]=0;return e?this.words[n]=this.words[n]|1<<i:this.words[n]=this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(t){if(this.sign&&!t.sign){this.sign=!1;var e=this.isub(t);return this.sign=!this.sign,this._normSign()}if(!this.sign&&t.sign){t.sign=!1;var e=this.isub(t);return t.sign=!0,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++){var e=r.words[a]+n.words[a]+i;this.words[a]=67108863&e,i=e>>>26}for(;0!==i&&a<r.length;a++){var e=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},i.prototype.add=function(t){if(t.sign&&!this.sign){t.sign=!1;var e=this.sub(t);return t.sign=!0,e}if(!t.sign&&this.sign){this.sign=!1;var e=t.sub(this);return this.sign=!0,e}return this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(t.sign){t.sign=!1;var e=this.iadd(t);return t.sign=!0,e._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,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++){var e=n.words[o]-i.words[o]+a;a=e>>26,this.words[o]=67108863&e}for(;0!==a&&o<n.length;o++){var e=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.sign=!0),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)},i.prototype._smallMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0;n<e.length-1;n++){for(var i=r>>>26,a=67108863&r,o=Math.min(n,t.length-1),s=Math.max(0,n-this.length+1);s<=o;s++){var l=n-s,u=0|this.words[l],c=0|t.words[s],h=u*c,f=67108863&h;i=i+(h/67108864|0)|0,f=f+a|0,a=67108863&f,i=i+(f>>>26)|0}e.words[n]=a,r=i}return 0!==r?e.words[n]=r:e.length--,e.strip()},i.prototype._bigMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0,i=0;i<e.length-1;i++){var a=n;n=0;for(var o=67108863&r,s=Math.min(i,t.length-1),l=Math.max(0,i-this.length+1);l<=s;l++){var u=i-l,c=0|this.words[u],h=0|t.words[l],f=c*h,d=67108863&f;a=a+(f/67108864|0)|0,d=d+o|0,o=67108863&d,a=a+(d>>>26)|0,n+=a>>>26,a&=67108863}e.words[i]=o,r=a,a=n}return 0!==r?e.words[i]=r:e.length--,e.strip()},i.prototype.mulTo=function(t,e){var r;return r=this.length+t.length<63?this._smallMulTo(t,e):this._bigMulTo(t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var e=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var n=this.length-2;n>=0;n--){for(var i=0,a=0,o=Math.min(n,r-1),s=Math.max(0,n-e+1);s<=o;s++){var l=n-s,u=this.words[l],c=t.words[s],h=u*c,f=67108863&h;i+=h/67108864|0,f+=a,a=67108863&f,i+=f>>>26}this.words[n]=a,this.words[n+1]+=i,i=0}for(var i=0,l=1;l<this.length;l++){var d=this.words[l]+i;this.words[l]=67108863&d,i=d>>>26}return this.strip()},i.prototype.imuln=function(t){r("number"==typeof t);for(var e=0,n=0;n<this.length;n++){var i=this.words[n]*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[n]=67108863&a}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.ishln=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=67108863>>>26-e<<26-e;if(0!==e){for(var a=0,o=0;o<this.length;o++){var s=this.words[o]&i,l=this.words[o]-s<<e;this.words[o]=l|a,a=s>>>26-e}a&&(this.words[o]=a,this.length++)}if(0!==n){for(var o=this.length-1;o>=0;o--)this.words[o+n]=this.words[o];for(var o=0;o<n;o++)this.words[o]=0;this.length+=n}return this.strip()},i.prototype.ishrn=function(t,e,n){r("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=n;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){this.length-=o;for(var u=0;u<this.length;u++)this.words[u]=this.words[u+o]}else this.words[0]=0,this.length=1;for(var c=0,u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=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(),this},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return!1;var a=this.words[n];return!!(a&i)},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(!this.sign,"imaskn works only with positive numbers"),0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),t<0?this.isubn(-t):this.sign?1===this.length&&this.words[0]<t?(this.words[0]=t-this.words[0],this.sign=!1,this):(this.sign=!1,this.isubn(t),this.sign=!0,this):this._iaddn(t)},i.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},i.prototype.isubn=function(t){if(r("number"==typeof t),t<0)return this.iaddn(-t);if(this.sign)return this.sign=!1,this.iaddn(t),this.sign=!0,this;this.words[0]-=t;for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.sign=!1,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i,a=t.length+n;if(this.words.length<a){for(var o=new Array(a),i=0;i<this.length;i++)o[i]=this.words[i];this.words=o}else i=this.length;for(this.length=Math.max(this.length,a);i<this.length;i++)this.words[i]=0;for(var s=0,i=0;i<t.length;i++){var l=this.words[i+n]+s,u=t.words[i]*e;l-=67108863&u,s=(l>>26)-(u/67108864|0),this.words[i+n]=67108863&l}for(;i<this.length-n;i++){var l=this.words[i+n]+s;s=l>>26,this.words[i+n]=67108863&l}if(0===s)return this.strip();r(s===-1),s=0;for(var i=0;i<this.length;i++){var l=-this.words[i]+s;s=l>>26,this.words[i]=67108863&l}return this.sign=!0,this.strip()},i.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),a=t,o=a.words[a.length-1],s=this._countBits(o);r=26-s,0!==r&&(a=a.shln(r),n.ishln(r),o=a.words[a.length-1]);var l,u=n.length-a.length;if("mod"!==e){l=new i(null),l.length=u+1,l.words=new Array(l.length);for(var c=0;c<l.length;c++)l.words[c]=0}var h=n.clone()._ishlnsubmul(a,1,u);h.sign||(n=h,l&&(l.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*n.words[a.length+f]+n.words[a.length+f-1];for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(a,d,f);n.sign;)d--,n.sign=!1,n._ishlnsubmul(a,1,f),0!==n.cmpn(0)&&(n.sign=!n.sign);l&&(l.words[f]=d)}return l&&l.strip(),n.strip(),"div"!==e&&0!==r&&n.ishrn(r),{div:l?l:null,mod:n}},i.prototype.divmod=function(t,e){if(r(0!==t.cmpn(0)),this.sign&&!t.sign){var n,a,o=this.neg().divmod(t,e);return"mod"!==e&&(n=o.div.neg()),"div"!==e&&(a=0===o.mod.cmpn(0)?o.mod:t.sub(o.mod)),{div:n,mod:a}}if(!this.sign&&t.sign){var n,o=this.divmod(t.neg(),e);return"mod"!==e&&(n=o.div.neg()),{div:n,mod:o.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),e):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div").div},i.prototype.mod=function(t){return this.divmod(t,"mod").mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(0===e.mod.cmpn(0))return e.div;var r=e.div.sign?e.mod.isub(t):e.mod,n=t.shrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:e.div.sign?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+this.words[i])%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=this.words[n]+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&n.isEven();)e.ishrn(1),n.ishrn(1),++u;for(var c=n.clone(),h=e.clone();0!==e.cmpn(0);){for(;e.isEven();)e.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(h).ishrn(1));for(;n.isEven();)n.ishrn(1),s.isEven()&&l.isEven()?(s.ishrn(1),l.ishrn(1)):(s.iadd(c).ishrn(1),l.isub(h).ishrn(1));e.cmp(n)>=0?(e.isub(n),a.isub(s),o.isub(l)):(n.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:n.ishln(u)}},i.prototype._invmp=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(;e.isEven();)e.ishrn(1),a.isEven()?a.ishrn(1):a.iadd(s).ishrn(1);for(;n.isEven();)n.ishrn(1),o.isEven()?o.ishrn(1):o.iadd(s).ishrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(o)):(n.isub(e),o.isub(a))}return 0===e.cmpn(1)?a:o},i.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var e=this.clone(),r=t.clone();e.sign=!1,r.sign=!1;for(var n=0;e.isEven()&&r.isEven();n++)e.ishrn(1),r.ishrn(1);for(;;){for(;e.isEven();)e.ishrn(1);for(;r.isEven();)r.ishrn(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.ishln(n)},i.prototype.invm=function(t){return this.egcd(t).a.mod(t)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n){for(var a=this.length;a<n+1;a++)this.words[a]=0;return this.words[n]|=i,this.length=n+1,this}for(var o=i,a=n;0!==o&&a<this.length;a++){var s=this.words[a];s+=o,o=s>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.cmpn=function(t){var e=t<0;if(e&&(t=-t),this.sign&&!e)return-1;if(!this.sign&&e)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var n=this.words[0];r=n===t?0:n<t?-1:1}return this.sign&&(r=-r),r},i.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var e=this.ucmp(t);return this.sign?-e:e},i.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=this.words[r],i=t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},i.red=function(t){return new f(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};s.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},s.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},s.prototype.split=function(t,e){t.ishrn(this.n,0,e)},s.prototype.imulK=function(t){return t.imul(this.k)},n(l,s),l.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];e.words[e.length++]=a&r;for(var i=10;i<t.length;i++){var o=t.words[i];t.words[i-10]=(o&r)<<4|a>>>22,a=o}t.words[i-10]=a>>>22,t.length-=9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e,r=0,n=0;n<t.length;n++){var i=t.words[n];e=64*i,r+=977*i,e+=r/67108864|0,r&=67108863,t.words[n]=r,r=e}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(u,s),n(c,s),n(h,s),h.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*t.words[r]+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function t(e){if(g[e])return g[e];var t;if("k256"===e)t=new l;else if("p224"===e)t=new u;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new h}return g[e]=t,t},f.prototype._verify1=function(t){r(!t.sign,"red works only with positives"),r(t.red,"red works only with red numbers")},f.prototype._verify2=function(t,e){r(!t.sign&&!e.sign,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},f.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},f.prototype.neg=function(t){var e=t.clone();return e.sign=!e.sign,e.iadd(this.m)._forceRed(this)},f.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)},f.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},f.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)},f.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.shln(e))},f.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},f.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},f.prototype.isqr=function(t){return this.imul(t,t)},f.prototype.sqr=function(t){return this.mul(t,t)},f.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new i(1)).ishrn(2),a=this.pow(t,n);return a}for(var o=this.m.subn(1),s=0;0!==o.cmpn(0)&&0===o.andln(1);)s++,o.ishrn(1);r(0!==o.cmpn(0));var l=new i(1).toRed(this),u=l.redNeg(),c=this.m.subn(1).ishrn(1),h=this.m.bitLength();for(h=new i(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var f=this.pow(h,o),a=this.pow(t,o.addn(1).ishrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(l);){for(var m=d,v=0;0!==m.cmp(l);v++)m=m.redSqr();r(v<p);var g=this.pow(f,new i(1).ishln(p-v-1));a=a.redMul(g),f=g.redSqr(),d=d.redMul(f),p=v}return a},f.prototype.invm=function(t){var e=t._invmp(this.m);return e.sign?(e.sign=!1,this.imod(e).redNeg()):this.imod(e)},f.prototype.pow=function(t,e){var r=[];if(0===e.cmpn(0))return new i(1);for(var n=e.clone();0!==n.cmpn(0);)r.push(n.andln(1)),n.ishrn(1);for(var a=t,o=0;o<r.length&&0===r[o];o++,a=this.sqr(a));if(++o<r.length)for(var n=this.sqr(a);o<r.length;o++,n=this.sqr(n))0!==r[o]&&(a=this.mul(a,n));return a},f.prototype.convertTo=function(t){var e=t.mod(this.m);return e===t?e.clone():e},f.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new d(t)},n(d,f),d.prototype.convertTo=function(t){return this.imod(t.shln(this.shift))},d.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},d.prototype.imul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))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).ishrn(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)},d.prototype.mul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).ishrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},d.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}("undefined"==typeof e||e,this)},{}],59:[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},{}],60:[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),a>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":62,"./lib/sweep":66,"typedarray-pool":505}],61:[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<"+v+";++j,"+b+"+="+u+"){var y0="+g+"["+o+"+"+b+"],"+(r?"y1="+g+"["+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="+g+"[k+"+b+"],b1="+g+"[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+">"+v+"-"+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(""),u=new Function(s);return u()}var a="d",o="ax",s="vv",l="fp",u="es",c="rs",h="re",f="rb",d="ri",p="rp",m="bs",v="be",g="bb",y="bi",b="bp",x="rv",_="Q",w=[a,o,s,c,h,f,d,m,v,g,y];r.partial=i(!1),r.full=i(!0)},{}],62:[function(t,e,r){"use strict";function n(t,e){var r=8*u.log2(e+1)*(t+1)|0,n=u.nextPow2(k*r);E.length<n&&(l.free(E),E=l.mallocInt32(n));var i=u.nextPow2(T*r);L<i&&(l.free(L),L=l.mallocDouble(i))}function i(t,e,r,n,i,a,o,s,l){var u=k*t;E[u]=e,E[u+1]=r,E[u+2]=n,E[u+3]=i,E[u+4]=a,E[u+5]=o;var c=T*t;L[c]=s,L[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 v=o[m+e],g=o[m+e+t];if(!(d<v||g<d||n&&d===v)){for(var y=s[p],b=e+1;b<t;++b){var v=o[m+b],g=o[m+b+t],x=u[f+b],_=u[f+b+t];if(g<x||_<v)continue t}var w;if(w=n?r(c,y):r(y,c),void 0!==w)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 v=a[p+e],g=a[p+e+t];if(!(f<v||g<f)){for(var y=e+1;y<t;++y){var v=a[p+y],g=a[p+y+t],b=l[h+y],x=l[h+y+t];if(g<b||x<v)continue t}var _=r(m,u);if(void 0!==_)return _}}}}function s(t,e,r,s,l,u,c,m,S){n(t,s+c);var C,D=0,z=2*t;for(i(D++,0,0,s,0,c,r?16:0,-(1/0),1/0),r||i(D++,0,0,c,0,s,1,-(1/0),1/0);D>0;){D-=1;var I=D*k,P=E[I],O=E[I+1],R=E[I+2],j=E[I+3],F=E[I+4],N=E[I+5],B=D*T,U=L[B],V=L[B+1],H=1&N,q=!!(16&N),Y=l,G=u,W=m,X=S;if(H&&(Y=m,G=S,W=l,X=u),!(2&N&&(R=_(t,P,O,R,Y,G,V),O>=R)||4&N&&(O=w(t,P,O,R,Y,G,U),O>=R))){var Z=R-O,J=F-j;if(q){if(t*Z*(Z+J)<y){if(C=d.scanComplete(t,P,e,O,R,Y,G,j,F,W,X),void 0!==C)return C;continue}}else{if(t*Math.min(Z,J)<v){if(C=h(t,P,e,H,O,R,Y,G,j,F,W,X),void 0!==C)return C;continue}if(t*Z*J<g){if(C=d.scanBipartite(t,P,e,H,O,R,Y,G,j,F,W,X),void 0!==C)return C;continue}}var Q=b(t,P,O,R,Y,G,U,V);if(O<Q)if(t*(Q-O)<v){if(C=f(t,P+1,e,O,Q,Y,G,j,F,W,X),void 0!==C)return C}else if(P===t-2){if(C=H?d.sweepBipartite(t,e,j,F,W,X,O,Q,Y,G):d.sweepBipartite(t,e,O,Q,Y,G,j,F,W,X),void 0!==C)return C}else i(D++,P+1,O,Q,j,F,H,-(1/0),1/0),i(D++,P+1,j,F,O,Q,1^H,-(1/0),1/0);if(Q<R){var K=p(t,P,j,F,W,X),$=W[z*K+P],tt=x(t,P,K,F,W,X,$);if(tt<F&&i(D++,P,Q,R,tt,F,(4|H)+(q?16:0),$,V),j<K&&i(D++,P,Q,R,j,K,(2|H)+(q?16:0),U,$),K+1===tt){if(C=q?o(t,P,e,Q,R,Y,G,K,W,X[K]):a(t,P,e,H,Q,R,Y,G,K,W,X[K]),void 0!==C)return C}else if(K<tt){var et;if(q){if(et=M(t,P,Q,R,Y,G,$),Q<et){var rt=x(t,P,Q,et,Y,G,$);if(P===t-2){if(Q<rt&&(C=d.sweepComplete(t,e,Q,rt,Y,G,K,tt,W,X),void 0!==C))return C;if(rt<et&&(C=d.sweepBipartite(t,e,rt,et,Y,G,K,tt,W,X),void 0!==C))return C}else Q<rt&&i(D++,P+1,Q,rt,K,tt,16,-(1/0),1/0),rt<et&&(i(D++,P+1,rt,et,K,tt,0,-(1/0),1/0),i(D++,P+1,K,tt,rt,et,1,-(1/0),1/0))}}else et=H?A(t,P,Q,R,Y,G,$):M(t,P,Q,R,Y,G,$),Q<et&&(P===t-2?C=H?d.sweepBipartite(t,e,K,tt,W,X,Q,et,Y,G):d.sweepBipartite(t,e,Q,et,Y,G,K,tt,W,X):(i(D++,P+1,Q,et,K,tt,H,-(1/0),1/0),i(D++,P+1,K,tt,Q,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"),v=128,g=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"]),A=m("lo<p0&&p0<=hi",["p0"]),k=6,T=2,S=1024,E=l.mallocInt32(S),L=l.mallocDouble(S)},{"./brute":61,"./median":63,"./partition":64,"./sweep":66,"bit-twiddle":57,"typedarray-pool":505}],63:[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 v=a[c];a[c]=a[c-1],a[c-1]=v}}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,v=Math.random()*m+u|0,g=a[f*v+e],y=Math.random()*m+u|0,b=a[f*y+e],x=Math.random()*m+u|0,_=a[f*x+e];g<=b?_>=b?(d=y,p=b):g>=_?(d=v,p=g):(d=x,p=_):b>=_?(d=y,p=b):_>=g?(d=v,p=g):(d=x,p=_);for(var w=f*(c-1),M=f*d,A=0;A<f;++A,++w,++M){var k=a[w];a[w]=a[M],a[M]=k}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,A=0;A<f;++A,++w,++M){var k=a[w];a[w]=a[M],a[M]=k}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":64}],64:[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"},{}],65:[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,v=m-n,g=m+n,y=d,b=v,x=m,_=g,w=p,M=t+1,A=e-1,k=0;u(y,b,r)&&(k=y,y=b,b=k),u(_,w,r)&&(k=_,_=w,w=k),u(y,x,r)&&(k=y,y=x,x=k),u(b,x,r)&&(k=b,b=x,x=k),u(y,_,r)&&(k=y,y=_,_=k),u(x,_,r)&&(k=x,x=_,_=k),u(b,w,r)&&(k=b,b=w,w=k),u(b,x,r)&&(k=b,b=x,x=k),u(_,w,r)&&(k=_,_=w,w=k);for(var T=r[2*b],S=r[2*b+1],E=r[2*_],L=r[2*_+1],C=2*y,D=2*x,z=2*w,I=2*d,P=2*m,O=2*p,R=0;R<2;++R){var j=r[C+R],F=r[D+R],N=r[z+R];r[I+R]=j,r[P+R]=F,r[O+R]=N}o(v,t,r),o(g,e,r);for(var B=M;B<=A;++B)if(c(B,T,S,r))B!==M&&a(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(A,E,L,r)){c(A,T,S,r)?(s(B,M,A,r),++M,--A):(a(B,A,r),--A);break}if(--A<B)break}l(t,M-1,T,S,r),l(e,A+1,E,L,r),M-2-t<=f?i(t,M-2,r):h(t,M-2,r),e-(A+2)<=f?i(A+2,e,r):h(A+2,e,r),A-M<=f?i(M,A,r):h(M,A,r)}e.exports=n;var f=32},{}],66:[function(t,e,r){"use strict";function n(t){var e=h.nextPow2(t);m.length<e&&(c.free(m),m=c.mallocInt32(e)),v.length<e&&(c.free(v),v=c.mallocInt32(e)),g.length<e&&(c.free(g),g=c.mallocInt32(e)),y.length<e&&(c.free(y),y=c.mallocInt32(e)),b.length<e&&(c.free(b),b=c.mallocInt32(e)),x.length<e&&(c.free(x),x=c.mallocInt32(e));var r=8*e;_.length<r&&(c.free(_),_=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 p=0,b=2*t,x=t-1,w=b-1,M=r;M<n;++M){var A=s[M],k=b*M;_[p++]=o[k+x],_[p++]=-(A+1),_[p++]=o[k+w],_[p++]=A}for(var M=l;M<u;++M){var A=h[M]+d,T=b*M;_[p++]=c[T+x],_[p++]=-A,_[p++]=c[T+w],_[p++]=A}var S=p>>>1;f(_,S);for(var E=0,L=0,M=0;M<S;++M){var C=0|_[2*M+1];if(C>=d)C=C-d|0,i(g,y,L--,C);else if(C>=0)i(m,v,E--,C);else if(C<=-d){C=-C-d|0;for(var D=0;D<E;++D){var z=e(m[D],C);if(void 0!==z)return z}a(g,y,L++,C)}else{C=-C-1|0;for(var D=0;D<L;++D){var z=e(C,g[D]);if(void 0!==z)return z}a(m,v,E++,C)}}}function s(t,e,r,n,o,s,l,u,c,h){for(var d=0,p=2*t,w=t-1,M=p-1,A=r;A<n;++A){var k=s[A]+1<<1,T=p*A;_[d++]=o[T+w],_[d++]=-k,_[d++]=o[T+M],_[d++]=k}for(var A=l;A<u;++A){var k=h[A]+1<<1,S=p*A;_[d++]=c[S+w],_[d++]=1|-k,_[d++]=c[S+M],_[d++]=1|k}var E=d>>>1;f(_,E);for(var L=0,C=0,D=0,A=0;A<E;++A){var z=0|_[2*A+1],I=1&z;if(A<E-1&&z>>1===_[2*A+3]>>1&&(I=2,A+=1),z<0){for(var P=-(z>>1)-1,O=0;O<D;++O){var R=e(b[O],P);if(void 0!==R)return R}if(0!==I)for(var O=0;O<L;++O){var R=e(m[O],P);if(void 0!==R)return R}if(1!==I)for(var O=0;O<C;++O){var R=e(g[O],P);if(void 0!==R)return R}0===I?a(m,v,L++,P):1===I?a(g,y,C++,P):2===I&&a(b,x,D++,P)}else{var P=(z>>1)-1;0===I?i(m,v,L--,P):1===I?i(g,y,C--,P):2===I&&i(b,x,D--,P)}}}function l(t,e,r,n,o,s,l,u,c,h,p,g){var y=0,b=2*t,x=e,w=e+t,M=1,A=1;n?A=d:M=d;for(var k=o;k<s;++k){var T=k+M,S=b*k;_[y++]=l[S+x],_[y++]=-T,_[y++]=l[S+w],_[y++]=T}for(var k=c;k<h;++k){var T=k+A,E=b*k;_[y++]=p[E+x],_[y++]=-T}var L=y>>>1;f(_,L);for(var C=0,k=0;k<L;++k){var D=0|_[2*k+1];if(D<0){var T=-D,z=!1;if(T>=d?(z=!n,T-=d):(z=!!n,T-=1),z)a(m,v,C++,T);else{var I=g[T],P=b*T,O=p[P+e+1],R=p[P+e+1+t];t:for(var j=0;j<C;++j){var F=m[j],N=b*F;if(!(R<l[N+e+1]||l[N+e+1+t]<O)){for(var B=e+2;B<t;++B)if(p[P+B+t]<l[N+B]||l[N+B+t]<p[P+B])continue t;var U,V=u[F];if(U=n?r(I,V):r(V,I),void 0!==U)return U}}}}else i(m,v,C--,D-M)}}function u(t,e,r,n,i,a,o,s,l,u,c){for(var h=0,p=2*t,v=e,g=e+t,y=n;y<i;++y){var b=y+d,x=p*y;_[h++]=a[x+v],_[h++]=-b,_[h++]=a[x+g],_[h++]=b}for(var y=s;y<l;++y){var b=y+1,w=p*y;_[h++]=u[w+v],_[h++]=-b}var M=h>>>1;f(_,M);for(var A=0,y=0;y<M;++y){var k=0|_[2*y+1];if(k<0){var b=-k;if(b>=d)m[A++]=b-d;else{b-=1;var T=c[b],S=p*b,E=u[S+e+1],L=u[S+e+1+t];t:for(var C=0;C<A;++C){var D=m[C],z=o[D];if(z===T)break;var I=p*D;if(!(L<a[I+e+1]||a[I+e+1+t]<E)){for(var P=e+2;P<t;++P)if(u[S+P+t]<a[I+P]||a[I+P+t]<u[S+P])continue t;var O=r(z,T);if(void 0!==O)return O}}}}else{for(var b=k-d,C=A-1;C>=0;--C)if(m[C]===b){for(var P=C+1;P<A;++P)m[P-1]=m[P];break}--A}}}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=1024,m=c.mallocInt32(p),v=c.mallocInt32(p),g=c.mallocInt32(p),y=c.mallocInt32(p),b=c.mallocInt32(p),x=c.mallocInt32(p),_=c.mallocDouble(8*p)},{"./sort":65,"bit-twiddle":57,"typedarray-pool":505}],67:[function(t,e,r){"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}function i(t){if(t>J)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(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 u(t)}return o(t,e,r)}function o(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?f(t,e,r):"string"==typeof t?c(t,e):d(t)}function s(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 l(t,e,r){return s(t),t<=0?i(t):void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)}function u(t){return s(t),i(t<0?0:0|p(t))}function c(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(t,e),n=i(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}function h(t){for(var e=t.length<0?0:0|p(t.length),r=i(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function f(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__=a.prototype,n}function d(t){if(a.isBuffer(t)){var e=0|p(t.length),r=i(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if(ArrayBuffer.isView(t)||"length"in t)return"number"!=typeof t.length||W(t.length)?i(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function p(t){if(t>=J)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+J.toString(16)+" bytes");return 0|t}function m(t){return+t!=t&&(t=0),a.alloc(+t)}function v(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(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 V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return V(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 z(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return D(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:x(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):x(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function x(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&&(n=String(n).toLowerCase(),"ucs2"===n||"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,c===-1?0:u-c)){if(c===-1&&(c=u),u-c+1===l)return c*o}else c!==-1&&(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 _(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),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(isNaN(s))return o;t[r+o]=s}return o}function w(t,e,r,n){return G(V(e,t.length-r),t,r,n)}function M(t,e,r,n){return G(H(e),t,r,n)}function A(t,e,r,n){return M(t,e,r,n)}function k(t,e,r,n){return G(Y(e),t,r,n)}function T(t,e,r,n){return G(q(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?X.fromByteArray(t):X.fromByteArray(t.slice(e,r))}function E(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,h>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,h>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,h>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 L(n)}function L(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Q));return r}function C(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 D(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 z(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+=U(t[a]);return i}function I(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 P(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 O(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(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 j(t,e,r,n,i){return e=+e,r>>>=0,i||R(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return e=+e,r>>>=0,i||R(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function N(t){if(t=B(t).replace(K,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function B(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function V(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),r>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=(i-55296<<10|r-56320)+65536}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 H(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function q(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 Y(t){return X.toByteArray(N(t))}function G(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 W(t){return t!==t}var X=t("base64-js"),Z=t("ieee754");r.Buffer=a,r.SlowBuffer=m,r.INSPECT_MAX_BYTES=50;var J=2147483647;r.kMaxLength=J,a.TYPED_ARRAY_SUPPORT=n(),a.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&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(t,e,r){return o(t,e,r)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(t,e,r){return l(t,e,r)},a.allocUnsafe=function(t){return u(t)},a.allocUnsafeSlow=function(t){return u(t)},a.isBuffer=function(t){return null!=t&&t._isBuffer===!0},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},a.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}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=v,a.prototype._isBuffer=!0,a.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)y(this,e,e+1);return this},a.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)y(this,e,e+3),y(this,e+1,e+2);return this},a.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)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?E(this,0,t):g.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.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+">"},a.prototype.compare=function(t,e,r,n,i){if(!a.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===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,l=Math.min(o,s),u=this.slice(n,i),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},a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},a.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},a.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 _(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return M(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=a.prototype,n},a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(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},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(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},a.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||P(t,4,this.length),Z.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),Z.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),Z.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),Z.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var a=1,o=0;for(this[e]=255&t;++o<r&&(a*=256);)this[e+o]=t/a&255;return e+r},a.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;O(this,t,e,r,i,0)}var a=r-1,o=1;for(this[e+a]=255&t;--a>=0&&(o*=256);)this[e+a]=t/o&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(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},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(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},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(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},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(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},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(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},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(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},a.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},a.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},a.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 i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.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=a.isBuffer(t)?t:new a(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":68,ieee754:258}],68:[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=16383,l=0,c=r-n;l<c;l+=o)a.push(s(t,l,l+o>c?c:l+o));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},{}],69:[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 v=d[m];p.addTriangle(v[0],v[1],v[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":70,"./lib/filter":71,"./lib/monotone":72,"./lib/triangulation":73}],70:[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],v=l[p];m===c?f=v:v===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":74,"robust-in-sphere":472}],71:[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),v=null;e&&(v=[]);for(var g=new n(r,p,m,h,f,d,v),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]=g.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&&v.push([u,l,-1]))}return g}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 v=l;l=s,s=v,l.length=0,i=-i}var g=o(c,u,e);return r?g.concat(n.boundary):g}var l=t("binary-search-bounds");e.exports=s;var u=n.prototype;u.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":74}],72:[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?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),r||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],o=t[i-1];o.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]],g=t[f[1]];d[0]<g[0]?l.push(new i(d,g,v,h),new i(g,d,m,h)):d[0]>g[0]&&l.push(new i(g,d,v,h),new i(d,g,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===v?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,v=2;e.exports=h},{"binary-search-bounds":74,"robust-orientation":474}],73:[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":74}],74:[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){var a=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(""));return a()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],75:[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},{}],76:[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:100,"robust-linear-solve":473}],77:[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:76}],78:[function(t,e,r){"use strict";function n(t){var e=x(t),r=b(y(e),t);return r<0?[e,w(e,1/0)]:r>0?[w(e,-(1/0)),e]:[e,e]}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]=[Math.min(a[0],o[0]),Math.min(a[1],o[1]),Math.max(a[0],o[0]),Math.max(a[1],o[1])]}return r}function a(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[n[0],n[1],n[0],n[1]]}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]];g(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]];g(s,l,o,o)&&i.push([r,n])}}),i}function l(t,e,r,n,i){function a(e){if(e>=t.length)return o[e-t.length];var r=t[e];return[y(r[0]),y(r[1])]}for(var o=[],s=0;s<r.length;++s){var l=r[s],u=l[0],c=l[1],h=e[u],f=e[c],d=M(_(t[h[0]]),_(t[h[1]]),_(t[f[0]]),_(t[f[1]]));if(d){var p=o.length+t.length;o.push(d),n.push([u,p],[c,p])}}n.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=a(t[1]),n=a(e[1]);return b(r[0],n[0])||b(r[1],n[1])});for(var s=n.length-1;s>=0;--s){var m=n[s],u=m[0],v=e[u],g=v[0],x=v[1],w=t[g],A=t[x];if((w[0]-A[0]||w[1]-A[1])<0){var k=g;g=x,x=k}v[0]=g;var T,S=v[1]=m[1];for(i&&(T=v[2]);s>0&&n[s-1][0]===u;){var m=n[--s],E=m[1];i?e.push([S,E,T]):e.push([S,E]),S=E}i?e.push([S,x,T]):e.push([S,x])}return o}function u(t,e,r){for(var i=t.length+e.length,a=new m(i),o=r,s=0;s<e.length;++s){var l=e[s],u=n(l[0]),c=n(l[1]);o.push([u[0],c[0],u[1],c[1]]),t.push([x(l[0]),x(l[1])])}v(o,function(t,e){a.link(t,e)});for(var h=0,f=!0,d=new Array(i),s=0;s<i;++s){var p=a.find(s);p===s?(d[s]=h,t[h++]=t[s]):(f=!1,d[s]=-1)}if(t.length=h,f)return null;for(var s=0;s<i;++s)d[s]<0&&(d[s]=d[a.find(s)]);return d}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?r:t[2]<e[2]?-1:t[2]>e[2]?1:0}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=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 p(t,e,r){var n,i=!1;if(r){n=e;for(var a=new Array(e.length),o=0;o<e.length;++o){var s=e[o];a[o]=[s[0],s[1],r[o]]}e=a}for(;d(t,e,!!r);)i=!0;if(r&&i){n.length=0,r.length=0;for(var o=0;o<e.length;++o){var s=e[o];n.push([s[0],s[1]]),r.push(s[2])}}return i}e.exports=p;var m=t("union-find"),v=t("box-intersect"),g=(t("compare-cell"),t("robust-segment-intersect")),y=t("big-rat"),b=t("big-rat/cmp"),x=t("big-rat/to-float"),_=t("rat-vec"),w=t("nextafter"),M=t("./lib/rat-seg-intersect")},{"./lib/rat-seg-intersect":79,"big-rat":43,"big-rat/cmp":41,"big-rat/to-float":55,"box-intersect":60,"compare-cell":84,nextafter:435,"rat-vec":461,"robust-segment-intersect":477,"union-find":506}],79:[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);return c(t,h(a,m))}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");t("big-rat/to-float")},{"big-rat/div":42,"big-rat/mul":52,"big-rat/sign":53,"big-rat/sub":54,"big-rat/to-float":55,"rat-vec/add":460,"rat-vec/muls":462,"rat-vec/sub":463}],80:[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 l,f;if("object"!=typeof r)return r;if(e.__isArray(r))l=[];else if(e.__isRegExp(r))l=new RegExp(r.source,o(r)),r.lastIndex&&(l.lastIndex=r.lastIndex);else if(e.__isDate(r))l=new Date(r.getTime());else{if(h&&t.isBuffer(r))return l=new t(r.length),r.copy(l),l;"undefined"==typeof a?(f=Object.getPrototypeOf(r),l=Object.create(f)):(l=Object.create(a),f=a)}if(n){var d=u.indexOf(r);if(d!=-1)return c[d];u.push(r),c.push(l)}for(var p in r){var m;f&&(m=Object.getOwnPropertyDescriptor(f,p)),m&&null==m.set||(l[p]=s(r[p],i-1))}return l}var l;"object"==typeof n&&(i=n.depth,a=n.prototype,l=n.filter,n=n.circular);var u=[],c=[],h="undefined"!=typeof t;return"undefined"==typeof n&&(n=!0),"undefined"==typeof 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:67}],81:[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]}]}},{}],82:[function(t,e,r){"use strict";function n(t){var e,r,n,u,c,h,f,d,p,m,v,g,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(v=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)}),v[0]<0&&(v[0]=0),v[1]<0&&(v[0]=0),v[0]>1&&(v[0]=1),v[1]>1&&(v[0]=1),y=0;y<e.length;++y)g=h[y].index,r=h[y].rgb,4===r.length&&r[3]>=0&&r[3]<=1||(r[3]=v[0]+(v[1]-v[0])*g);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":81,arraytools:36,clone:80}],83:[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),h=n(t,e,i);return c===h?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 f=a(t,e,r);if(f>0)return s>0&&a(t,e,i)>0?1:-1;if(f<0)return s>0||a(t,e,i)>0?1:-1;var d=a(t,e,i);return d>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":474,"robust-product":475,"robust-sum":479,signum:481,"two-sum":504}],84:[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],v=e[2],g=e[3];return c+h+f+d-(p+m+v+g)||a(c,h,f,d)-a(p,m,v,g,p)||a(c+h,c+f,c+d,h+f,h+d,f+d)-a(p+m,p+v,p+g,m+v,m+g,v+g)||a(c+h+f,c+h+d,c+f+d,h+f+d)-a(p+m+v,p+m+g,p+v+g,m+v+g);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},{}],85:[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":75,"compare-cell":84}],86:[function(t,e,r){"use strict";function n(t){var e=t.length;if(0===e)return[];if(1===e)return0;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":87,"./lib/ch2d":88,"./lib/chnd":89}],87:[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},{}],88:[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":418}],89:[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":33,"incremental-convex-hull":259}],90:[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"}},{}],91:[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(i!==-1&&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]),v=m<=.5?m*(p+1):m+p-m*p,g=2*m-v;return[n(255*s(g,v,d+1/3)),n(255*s(g,v,d)),n(255*s(g,v,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],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){}},{}],92:[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},{}],93:[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":95}],94:[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(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),f=e.offsetArgs[h];c=f.array,u="+q"+h;case"array":u="p"+c+u;var d="l"+o,p="a"+c;if(0===e.arrayBlockIndices[c])1===s.count?"generic"===r[c]?s.lvalue?(i.push(["var ",d,"=",p,".get(",u,")"].join("")),n=n.replace(l,d),a.push([p,".set(",u,",",d,")"].join(""))):n=n.replace(l,[p,".get(",u,")"].join("")):n=n.replace(l,[p,"[",u,"]"].join("")):"generic"===r[c]?(i.push(["var ",d,"=",p,".get(",u,")"].join("")),n=n.replace(l,d),s.lvalue&&a.push([p,".set(",u,",",d,")"].join(""))):(i.push(["var ",d,"=",p,"[",u,"]"].join("")),n=n.replace(l,d),s.lvalue&&a.push([p,"[",u,"]=",d].join("")));else{for(var m=[s.name],v=[u],g=0;g<Math.abs(e.arrayBlockIndices[c]);g++)m.push("\\s*\\[([^\\]]+)\\]"),v.push("$"+(g+1)+"*t"+c+"b"+g);if(l=new RegExp(m.join(""),"g"),u=v.join("+"),"generic"===r[c])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[p,"[",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=[],v=[],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 g=[],y=0;y<l[h].length;y++)p[h]<=l[h][y]&&l[h][y]<m[h]&&g.push(l[h][y]-p[h]);v.push(g)}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],A=[],y=0;y<M.offset.length;++y)0!==M.offset[y]&&(1===M.offset[y]?A.push(["t",M.array,"p",y].join("")):A.push([M.offset[y],"*t",M.array,"p",y].join("")));0===A.length?_.push("q"+h+"=0"):_.push(["q",h,"=",A.join("+")].join(""))}var k=u([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));_=_.concat(k),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(v);S<r?x.push(i(S,v[0],t,T)):x.push(n(v[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(""),L=new Function(["function ",E,"(",b.join(","),"){",x.join("\n"),"} return ",E].join(""));return L()}var u=t("uniq");e.exports=l},{uniq:507}],95:[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-->0;) {"),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]);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----------");var f=new Function("compile",e.join("\n"));return f(i.bind(void 0,t))}var i=t("./compile.js");e.exports=n},{"./compile.js":94}],96:[function(t,e,r){e.exports=t("cwise-compiler")},{"cwise-compiler":93}],97:[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 v(){var t=[];for(var e in this._)t.push(d(e));return t}function g(){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 A(){}function k(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 A,r=0,n=arguments.length;++r<n;)e[arguments[r]]=k(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 ko(t,Lo),t}function C(t){return"function"==typeof t?t:function(){return To(t,this)}}function D(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 I(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(j);var i=t.length;return"function"==typeof e?n:r}function j(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",I(i+" "+t))):r.setAttribute("class",I(i.replace(e," ")))}}function F(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 Y(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 G(t){return ko(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=Io.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 Q(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 K(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,At,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=kt((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):kt((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=vt(i)*ts,n=vt(n)*es,a=vt(a)*rs,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 vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function gt(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=as.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 At(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 kt(t,e,r){t=Tt(t),e=Tt(e),r=Tt(r);var n=gt((.4124564*t+.3575761*e+.1804375*r)/ts),i=gt((.2126729*t+.7151522*e+.072175*r)/es),a=gt((.0193339*t+.119192*e+.9503041*r)/rs);return dt(116*i-16,500*(n-i),200*(i-a))}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}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(Dt(n))}function Dt(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 It(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 ss?ss.n=a:os=a,ss=a,ls||(us=clearTimeout(us),ls=1,cs(Pt)),a}function Pt(){var t=Ot(),e=Rt()-t;e>24?(isFinite(e)&&(clearTimeout(us),us=setTimeout(Pt,e)),ls=0):(ls=1,cs(Pt))}function Ot(){for(var t=Date.now(),e=os;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Rt(){for(var t,e=os,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:os=e.n;return ss=t,r}function jt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Ft(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=fs.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="",v="",g=!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,v="%",d="f";break;case"p":p=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":g=!0,f=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],v=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=ds.get(d)||Bt;var b=u&&h;return function(t){var r=v;if(g&&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+v}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 A=m.length+x.length+_.length+(b?0:i.length),k=A<c?new Array(A=c-A+1).join(n):"";return b&&(x=a(k+x,k.length?c-_.length:1/0)),i+=m,t=x+_,("<"===o?i+t+k:">"===o?k+i+t:"^"===o?k.substring(0,A>>=1)+i+t+k.substring(A):i+(b?t:k+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 ms(r-1)),1),r}function a(t,r){return e(t=new ms(+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{ms=Ut;var n=new Ut;return n._=t,o(n,e,r)}finally{ms=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{ms=Ut;var n=new Ut;return n._=e,t(n,r)._}finally{ms=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=gs[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},i=r(n,t,e,0);if(i!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var a=null!=n.Z&&ms!==Ut,o=new(a?Ut:ms);return"j"in n?o.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),o.setFullYear(n.y,0,1),o.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(o.getDay()+5)%7:n.w+7*n.U-(o.getDay()+6)%7)):o.setFullYear(n.y,n.m,n.d),o.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),a?o._:o},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(i=e.charCodeAt(s++),37===i){if(o=e.charAt(s++),a=L[o in gs?e.charAt(s++):o],!a||(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){A.lastIndex=0;var n=A.exec(e.slice(r));return n?(t.m=k.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,v=t.shortDays,g=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{ms=Ut;var e=new ms;return e._=t,n(e)}finally{ms=Date}}var n=e(t);return r.parse=function(t){try{ms=Ut;var e=n.parse(t);return e&&e._}finally{ms=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ce;var b=uo.map(),x=Gt(m),_=Wt(m),w=Gt(v),M=Wt(v),A=Gt(g),k=Wt(g),T=Gt(y),S=Wt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var E={a:function(t){return v[t.getDay()]},A:function(t){return m[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return g[t.getMonth()]},c:e(h),d:function(t,e){return Yt(t.getDate(),e,2)},e:function(t,e){return Yt(t.getDate(),e,2)},H:function(t,e){return Yt(t.getHours(),e,2)},I:function(t,e){return Yt(t.getHours()%12||12,e,2)},j:function(t,e){return Yt(1+ps.dayOfYear(t),e,3)},L:function(t,e){return Yt(t.getMilliseconds(),e,3)},m:function(t,e){return Yt(t.getMonth()+1,e,2)},M:function(t,e){return Yt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Yt(t.getSeconds(),e,2)},U:function(t,e){return Yt(ps.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Yt(ps.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return Yt(t.getFullYear()%100,e,2)},Y:function(t,e){return Yt(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:Kt,Y:Qt,Z:$t,"%":ue};return e}function Yt(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 Gt(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){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Zt(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Jt(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Qt(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Kt(t,e,r){ys.lastIndex=0;var n=ys.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){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ie(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ae(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function oe(t,e,r){ys.lastIndex=0;var n=ys.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function se(t,e,r){ys.lastIndex=0;var n=ys.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+Yt(n,"0",2)+Yt(i,"0",2)}function ue(t,e,r){bs.lastIndex=0;var n=bs.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&&Ms.hasOwnProperty(t.type)&&Ms[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 ve(){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);ks.add(Math.atan2(f,h)),n=t,i=l,a=u}var e,r,n,i,a;Ts.point=function(o,s){Ts.point=t,n=(e=o)*Ho,i=Math.cos(s=(r=s)*Ho/2+No/4),a=Math.sin(s)},Ts.lineEnd=function(){t(e,r)}}function ge(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 Ae(t,e){return xo(t[0]-e[0])<jo&&xo(t[1]-e[1])<jo}function ke(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){++Ss,Ls+=(t-Ls)/Ss,Cs+=(e-Cs)/Ss,Ds+=(r-Ds)/Ss}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);Es+=u,zs+=u*(e+(e=o)),Is+=u*(r+(r=s)),Ps+=u*(n+(n=l)),Te(e,r,n)}var e,r,n;Fs.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),Fs.point=t,Te(e,r,n)}}function Ee(){Fs.point=ke}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);Os+=p*u,Rs+=p*c,js+=p*h,Es+=m,zs+=m*(n+(n=o)),Is+=m*(i+(i=s)),Ps+=m*(a+(a=l)),Te(n,i,a)}var e,r,n,i,a;Fs.point=function(o,s){e=o,r=s,Fs.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)},Fs.lineEnd=function(){t(e,r),Fs.lineEnd=Ee,Fs.point=ke}}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),r&&t.invert(r[0],r[1])}),r}function De(){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(Ae(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),Ie(a),Ie(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 Ie(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);v.point(r[0],r[1])}function l(){y.point=s,v.lineStart()}function u(){y.point=o,v.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,v=e(a),g=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(g,p);d.length?(_||(a.polygonStart(),_=!0),ze(d,Fe,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=je(),x=e(b),_=!1;return y}}function Re(t){return t.length>1}function je(){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 Fe(t,e){return((t=t.x)[0]<0?t[1]-Vo-jo:Vo-t[1])-((e=e.x)[0]<0?e[1]-Vo-jo: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)<jo?(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)<jo&&(r-=i*jo),xo(a-s)<jo&&(a-=s*jo),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)>jo?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])>jo){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;ks.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),v=1;;){v===c&&(v=0),t=u[v];var g=t[0],y=t[1]/2+No/4,b=Math.sin(y),x=Math.cos(y),_=g-f,w=_>=0?1:-1,M=w*_,A=M>No,k=p*b;if(ks.add(Math.atan2(k*w*Math.sin(M),m*x+k*Math.cos(M))),a+=A?_+w*Bo:_,A^f>=r^g>=r){var T=be(ge(h),ge(t));we(T);var S=be(i,T);we(S);var E=(A^_>=0?-1:1)*nt(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=A^_>=0?1:-1)}if(!v++)break;f=g,p=b,m=x,h=t}}return(a<-jo||a<jo&&ks<-jo)^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),v=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),(Ae(r,d)||Ae(p,d))&&(p[0]+=jo,p[1]+=jo,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 g;v&a||!(g=n(p,r,!0))||(c=0,o?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))}!m||r&&Ae(r,p)||t.point(p[0],p[1]),r=p,l=m,a=v},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return c|(u&&l)<<1}}}function n(t,e,r){var n=ge(t),i=ge(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),m=_e(s,f);xe(p,m);var v=d,g=ye(p,v),y=ye(v,v),b=g*g-y*(ye(p,p)-1);if(!(b<0)){var x=Math.sqrt(b),_=_e(v,(-g-x)/y);if(xe(_,p),_=Me(_),!r)return _;var w,M=t[0],A=e[0],k=t[1],T=e[1];A<M&&(w=M,M=A,A=w);var S=A-M,E=xo(S-No)<jo,L=E||S<jo;if(!E&&T<k&&(w=k,k=T,T=w),L?E?k+T>0^_[1]<(xo(_[0]-M)<jo?k:T):k<=_[1]&&_[1]<=T:S>No^(M<=_[0]&&_[0]<=A)){var C=_e(v,(-g+x)/y);return xe(C,p),[_,Me(C)]}}}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)>jo,l=vr(t,6*Ho);return Oe(e,r,l,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 Ye(t,e,r,n){function i(n,i){return xo(n[0]-t)<jo?i>0?0:3:xo(n[0]-r)<jo?i>0?2:1:xo(n[1]-e)<jo?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=v.length,n=t[1],i=0;i<r;++i)for(var a,o=1,s=v[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,v&&v.push(g=[]),A=!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(-Bs,Math.min(Bs,t)),e=Math.max(-Bs,Math.min(Bs,e));var r=c(t,e);if(v&&g.push([t,e]),A)y=t,b=e,x=r,A=!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(),k=!1):r&&(s.lineStart(),s.point(t,e),k=!1)}_=t,w=e,M=r}var m,v,g,y,b,x,_,w,M,A,k,T=s,S=je(),E=qe(t,e,r,n),L={point:h,lineStart:f,lineEnd:d,polygonStart:function(){s=S,m=[],v=[],k=!0},polygonEnd:function(){s=T,m=uo.merge(m);var e=l([t,n]),r=k&&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=v=g=null}};return L}}function Ge(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){Vs+=i*t-n*e,n=t,i=e}var e,r,n,i;Ws.point=function(a,o){Ws.point=t,e=n=a,r=i=o},Ws.lineEnd=function(){t(e,r)}}function Ze(t,e){t<Hs&&(Hs=t),t>Ys&&(Ys=t),e<qs&&(qs=e),e>Gs&&(Gs=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=Qe(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=Qe(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}function Qe(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ke(t,e){Ls+=t,Cs+=e,++Ds}function $e(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);zs+=o*(e+t)/2,Is+=o*(r+n)/2,Ps+=o,Ke(e=t,r=n)}var e,r;Zs.point=function(n,i){Zs.point=t,Ke(e=n,r=i)}}function tr(){Zs.point=Ke}function er(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);zs+=o*(n+t)/2,Is+=o*(i+e)/2,Ps+=o,o=i*t-n*e,Os+=o*(n+t),Rs+=o*(i+e),js+=3*o,Ke(n=t,i=e)}var e,r,n,i;Zs.point=function(a,o){Zs.point=t,Ke(e=n=a,r=i=o)},Zs.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,A.point=a,e.lineStart()}function a(r,n){var a=ge([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(){A.point=r,e.lineEnd()}function l(){n(),A.point=u,A.lineEnd=c}function u(t,e){a(h=t,f=e),d=b,p=x,m=_,v=w,g=M,A.point=a}function c(){i(b,x,y,_,w,M,d,p,h,m,v,g,s,e),A.lineEnd=o,o()}var h,f,d,p,m,v,g,y,b,x,_,w,M,A={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),A.lineStart=l},polygonEnd:function(){e.polygonEnd(),A.lineStart=n}};return A}function i(e,r,n,s,l,u,c,h,f,d,p,m,v,g){var y=c-e,b=h-r,x=y*y+b*b;if(x>4*a&&v--){var _=s+d,w=l+p,M=u+m,A=Math.sqrt(_*_+w*w+M*M),k=Math.asin(M/=A),T=xo(xo(M)-1)<jo||xo(n-f)<jo?(n+f)/2:Math.atan2(w,_),S=t(T,k),E=S[0],L=S[1],C=E-e,D=L-r,z=b*C-y*D;(z*z/x>a||xo((y*C+b*D)/x-.5)>.3||s*d+l*p+u*m<o)&&(i(e,r,n,s,l,u,E,L,T,_/=A,w/=A,M,v,g),g.point(E,L),i(E,L,T,_,w,M,c,h,f,d,p,m,v,g))}}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&&[t[0]*qo,t[1]*qo]}function n(){s=Ce(o=fr(g,y,b),a);var t=a(m,v);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,v=0,g=0,y=0,b=0,_=Ns,w=x,M=null,A=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,Ns):He((M=+t)*Ho),i()):M},e.clipExtent=function(t){return arguments.length?(A=t,w=t?Ye(t[0][0],t[0][1],t[1][0],t[1][1]):x,i()):A},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,v=t[1]%360*Ho,n()):[m*qo,v*qo]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Ho,y=t[1]%360*Ho,b=t.length>2?t[2]%360*Ho:0,n()):[g*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 vr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=gr(r,i),a=gr(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 gr(t,e){var r=ge(e);r[0]-=t,we(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-jo)%(2*Math.PI)}function yr(t,e,r){var n=uo.range(t,e-jo,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-jo,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);Js+=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;Qs.point=function(i,a){e=i*Ho,r=Math.sin(a*=Ho),n=Math.cos(a),Qs.point=t},Qs.lineEnd=function(){Qs.point=Qs.lineEnd=M}}function Ar(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 kr(t,e){function r(t,e){o>0?e<-Vo+jo&&(e=-Vo+jo):e>Vo-jo&&(e=Vo-jo);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)<jo?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 Dr(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 Ir(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 jr(){an(this),this.edge=this.site=this.circle=null}function Fr(t){var e=ul.pop()||new jr;return e.site=t,e}function Nr(t){Zr(t),ol.remove(t),ul.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)<jo&&xo(n-l.circle.cy)<jo;)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)<jo&&xo(n-u.circle.cy)<jo;)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=ol._;s;)if(n=Vr(s,o)-a,n>jo)s=s.L;else{if(i=a-Hr(s,o),!(i>jo)){n>-jo?(e=s.P,r=s):i>-jo?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Fr(t);if(ol.insert(e,l),e||r){if(e===r)return Zr(e),r=Fr(e.site),ol.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,v=p.y-h,g=2*(f*v-d*m),y=f*f+d*d,b=m*m+v*v,x={x:(v*y-d*b)/g+c,y:(f*b-m*y)/g+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 Yr(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=al,v=m.length;v--;)if(a=m[v],a&&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)>jo||xo(i-r)>jo)&&(s.splice(o,0,new rn(tn(a.site,c,xo(n-h)<jo&&p-i>jo?{x:h,y:xo(e-h)<jo?r:p}:xo(i-p)<jo&&f-n>jo?{x:xo(r-p)<jo?e:f,y:p}:xo(n-f)<jo&&i-d>jo?{x:f,y:xo(e-f)<jo?r:d}:xo(i-d)<jo&&n-h>jo?{x:xo(r-d)<jo?e:h,y:d}:null),a.site,null)),++l)}function Gr(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>=-Fo)){var d=l*l+u*u,p=c*c+h*h,m=(h*d-u*p)/f,v=(l*p-c*d)/f,h=v+s,g=cl.pop()||new Wr;g.arc=t,g.site=i,g.x=m+o,g.y=h+Math.sqrt(m*m+v*v),g.cy=h,t.circle=g;for(var y=null,b=ll._;b;)if(g.y<b.y||g.y===b.y&&g.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}ll.insert(y,g),y||(sl=g)}}}}function Zr(t){var e=t.circle;e&&(e.P||(sl=e.N),ll.remove(e),cl.push(e),an(e),t.circle=null)}function Jr(t){for(var e,r=il,n=qe(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)e=r[i],(!Qr(e,t)||!n(e)||xo(e.a.x-e.b.x)<jo&&xo(e.a.y-e.b.y)<jo)&&(e.a=e.b=null,r.splice(i,1))}function Qr(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,v=(f+p)/2,g=(d+m)/2;if(m===d){if(v<o||v>=s)return;if(f>p){if(a){if(a.y>=u)return}else a={x:v,y:l};r={x:v,y:u}}else{if(a){if(a.y<l)return}else a={x:v,y:u};r={x:v,y:l}}}else if(n=(f-p)/(m-d),i=g-n*v,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={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 Kr(t,e){this.l=t,this.r=e,this.a=this.b=null}function $r(t,e,r,n){var i=new Kr(t,e);return il.push(i),r&&en(i,t,e,r),n&&en(i,e,t,n),al[t.i].edges.push(new rn(i,t,e)),al[e.i].edges.push(new rn(i,e,t)),i}function tn(t,e,r){var n=new Kr(t,null);return n.a=e,n.b=r,il.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(il=[],al=new Array(t.length),ol=new nn,ll=new nn;;)if(i=sl,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(al[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),Yr(e));var o={cells:al,edges:il};return ol=ll=il=al=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 vn(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,v=r-u.y,g=m*m+v*v;if(g<l){var y=Math.sqrt(l=g);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>=_,A=M<<1|w,k=A+4;A<k;++A)if(u=b[3&A])switch(3&A){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 gn(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=fl.lastIndex=dl.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=fl.exec(t))&&(n=dl.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=dl.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 An(t){return function(e){return 1-t(1-e)}}function kn(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 Dn(t){return Math.pow(2,10*(t-1))}function zn(t){return 1-Math.sqrt(1-t*t)}function In(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 jn(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 Fn(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 Yn(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 Gn(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),Yn(t.translate,e.translate,r,n),Gn(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 Qn(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Kn(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;)a=o[l],null!=a&&(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 vi(t){return uo.range(t.length)}function gi(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 Ai(t,e){return t.value-e.value}function ki(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),ki(n,a),n._pack_prev=a,ki(a,i),i=n._pack_next,o=3;o<u;o++){zi(n,i,a=r[o]);var p=0,m=1,v=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,v++);p?(m<v||m==v&&i.r<n.r?Ti(n,i=s):Ti(n=l,i),o--):(ki(n,a),i=a,e(a))}var g=(c+h)/2,y=(f+d)/2,b=0;for(o=0;o<u;o++)a=r[o],a.x-=g,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 Di(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;)Di(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 Ii(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 ji(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 Fi(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 Yi(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function Gi(t){return t.rangeExtent?t.rangeExtent():Yi(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}}:Al}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 Qi(t,e,r,n){function i(){var i=Math.min(t.length,e.length)>2?Ji:Wi,l=n?Qn: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 Qi(t,e,r,n)},i()}function Ki(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=Yi(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=fs.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 kl?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:Sl);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Yi(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 Tl;arguments.length<2?r=Tl:"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)},Ki(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)},Ki(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 Yi(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 va(t){return t.startAngle}function ga(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,v=f-c,g=d-h,y=v*v+g*g,b=r-n,x=c*d-f*h,_=(g<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*g-v*_)/y,M=(-x*v-g*_)/y,A=(x*g+v*_)/y,k=(-x*v+g*_)/y,T=w-p,S=M-m,E=A-p,L=k-m;return T*T+S*S>E*E+L*L&&(w=A,M=k),[[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=Dr,i=De,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 Aa(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 ka(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),Da(t,e))}function Ea(t,e){return t.length<3?Ma(t):t[0]+Ca((t.push(t[0]),t),Da([t[t.length-2]].concat(t,[t[1]]),e))}function La(t,e){return t.length<3?wa(t):t[0]+Ca(t,Da(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 Da(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(Rl,o),",",Ra(Rl,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),ja(l,o,s);return t.pop(),l.push("L",n),l.join("")}function Ia(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(Rl,a)+","+Ra(Rl,o)),--n;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),ja(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(Rl,o),",",Ra(Rl,s)],--n;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),ja(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 ja(t,e,r){t.push("C",Ra(Pl,e),",",Ra(Pl,r),",",Ra(Ol,e),",",Ra(Ol,r),",",Ra(Rl,e),",",Ra(Rl,r))}function Fa(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]=Fa(i,a);++e<r;)n[e]=(o+(o=Fa(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=Fa(t[s],t[s+1]),xo(e)<jo?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,i=r*r+n*n,i>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(g),h),c,u(t(v.reverse()),h),"Z")}for(var f,d,p,m=[],v=[],g=[],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)?(v.push([d=+x.call(this,f,y),p=+_.call(this,f,y)]),g.push([+w.call(this,f,y),+M.call(this,f,y)])):v.length&&(l(),v=[],g=[]);return v.length&&l(),m.length?m.join(""):null}var r=Cr,n=Cr,i=0,a=Dr,o=De,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 Ya(t){return[t.x,t.y]}function Ga(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 Qa(t,e,r){return ko(t,Hl),t.namespace=e,t.id=r,t}function Ka(t,e,r,n){var i=t.id,a=t.namespace;return Y(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;return u.t=e+l,e<=t?o(t-e):void(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,It(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=It(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(Kl,i);return a==Kl.length?[e.year,ta(t.map(function(t){return t/31536e6}),r)[2]]:a?e[i/Kl[a-1]<Kl[a]/i?a-1:a]:[eu,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=Yi(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=Yi(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)},Ki(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,vo=po.setAttributeNS,go=this.CSSStyleDeclaration.prototype,yo=go.setProperty;po.setAttribute=function(t,e){mo.call(this,t,e+"")},po.setAttributeNS=function(t,e,r){vo.call(this,t,e,r+"")},go.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,r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=[e=i,i=t[++r]];return a},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:v,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:g,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++],v=new h;++d<p;)(f=v.get(l=m(u=o[d])))?f.push(u):v.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)}),v.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:v,size:g,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e))}}),uo.behavior={},uo.rebind=function(t,e){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 A,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=k(t);return t},A.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(Ao,"\\$&")};var Ao=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__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=D(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",Do={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:Do,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Do.hasOwnProperty(r)?{space:Do[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(F(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(F(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 v,g=new h,y=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(g.has(v=e.call(i,i.__data__,n))?m[n]=i:g.set(v,i),y[n]=v);for(n=-1;++n<c;)(i=g.get(v=e.call(r,a=r[n],n)))?i!==!0&&(d[n]=i,i.__data__=a):p[n]=V(a),g.set(v,!0);for(n=-1;++n<o;)n in y&&g.get(y[n])!==!0&&(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=G([]),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 Y(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 Y(this,function(){++t}),t};var zo=[];uo.selection.enter=G,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 Io=uo.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&Io.forEach(function(t){"on"+t in fo&&Io.remove(t)});var Po,Oo=0;uo.mouse=function(t){return K(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 K(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)&&(g.on(a+v,null).on(o+v,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(),v=".drag"+(null==m?"":"-"+m),g=uo.select(n(h)).on(a+v,s).on(o+v,l),y=Q(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=K(t,e);return r.identifier=e.identifier,r}):[]};var jo=1e-6,Fo=jo*jo,No=Math.PI,Bo=2*No,Uo=Bo-jo,Vo=No/2,Ho=No/180,qo=180/No,Yo=Math.SQRT2,Go=2,Wo=4;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<Fo)n=Math.log(u/o)/Yo,r=function(t){return[i+t*c,a+t*h,o*Math.exp(Yo*t*n)]};else{var d=Math.sqrt(f),p=(u*u-o*o+Wo*f)/(2*o*Go*d),m=(u*u-o*o-Wo*f)/(2*u*Go*d),v=Math.log(Math.sqrt(p*p+1)-p),g=Math.log(Math.sqrt(m*m+1)-m);n=(g-v)/Yo,r=function(t){var e=t*n,r=at(v),s=o/(Go*d)*(r*ot(Yo*e+v)-it(v));return[i+s*c,a+s*h,o*r/at(Yo*e+v)]}}return r.duration=1e3*n,r},uo.behavior.zoom=function(){function t(t){t.on(D,h).on(Zo+".zoom",d).on("dblclick.zoom",p).on(P,f)}function e(t){return[(t[0]-A.x)/A.k,(t[1]-A.y)/A.k]}function r(t){return[t[0]*A.k+A.x,t[1]*A.k+A.y]}function i(t){A.k=Math.max(S[0],Math.min(S[1],t))}function a(t,e){e=r(e),A.x+=t[0]-e[0],A.y+=t[1]-e[1]}function o(e,r,n,o){e.__chart__={x:A.x,y:A.y,k:A.k},i(Math.pow(2,o)),a(v=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-A.x)/A.k}).map(x.invert)),M&&M.domain(w.range().map(function(t){return(t-A.y)/A.k}).map(w.invert))}function l(t){C++||t({type:"zoomstart"})}function u(t){s(),t({type:"zoom",scale:A.k,translate:[A.x,A.y]})}function c(t){--C||(t({type:"zoomend"}),v=null)}function h(){function t(){s=1,a(uo.mouse(i),f),u(o)}function r(){h.on(z,null).on(I,null),d(s),c(o)}var i=this,o=O.of(i,arguments),s=0,h=uo.select(n(i)).on(z,t).on(I,r),f=e(uo.mouse(i)),d=Q(i);Vl.call(i),l(o)}function f(){function t(){var t=uo.touches(p);return d=A.k,t.forEach(function(t){t.identifier in v&&(v[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)v[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,v[c.identifier],Math.floor(Math.log(A.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];g=f*f+d*d}}function n(){var t,e,r,n,o=uo.touches(p);Vl.call(p);for(var s=0,l=o.length;s<l;++s,n=null)if(r=o[s],n=v[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=g&&Math.sqrt(c/g);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 v[e[r].identifier];for(var i in v)return void t()}uo.selectAll(w).on(y,null),M.on(D,h).on(P,f),k(),c(m)}var d,p=this,m=O.of(p,arguments),v={},g=0,y=".zoom-"+uo.event.changedTouches[0].identifier,x="touchmove"+y,_="touchend"+y,w=[],M=uo.select(p),k=Q(p);r(),l(m),M.on(D,null).on(P,r)}function d(){var t=O.of(this,arguments);y?clearTimeout(y):(Vl.call(this),m=e(v=g||uo.mouse(this)),l(t)),y=setTimeout(function(){y=null,c(t)},50),T(),i(Math.pow(2,.002*Xo())*A.k),a(v,m),u(t)}function p(){var t=uo.mouse(this),r=Math.log(A.k)/Math.LN2;o(this,t,e(t),uo.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var m,v,g,y,b,x,_,w,M,A={x:0,y:0,k:1},k=[960,500],S=Jo,L=250,C=0,D="mousedown.zoom",z="mousemove.zoom",I="mouseup.zoom",P="touchstart.zoom",O=E(t,"zoomstart","zoom","zoomend");return Zo||(Zo="onwheel"in fo?(Xo=function(){return-uo.event.deltaY*(uo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Xo=function(){return uo.event.wheelDelta},"mousewheel"):(Xo=function(){return-uo.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=O.of(this,arguments),e=A;Bl?uo.select(this).transition().each("start.zoom",function(){A=this.__chart__||{x:0,y:0,k:1},l(t)}).tween("zoom:zoom",function(){var r=k[0],n=k[1],i=v?v[0]:r/2,a=v?v[1]:n/2,o=uo.interpolateZoom([(i-A.x)/A.k,(a-A.y)/A.k,r/A.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__=A={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__=A,l(t),u(t),c(t))})},t.translate=function(e){return arguments.length?(A={x:+e[0],y:+e[1],k:A.k},s(),t):[A.x,A.y]},t.scale=function(e){return arguments.length?(A={x:A.x,y:A.y,k:null},i(+e),s(),t):A.k},t.scaleExtent=function(e){return arguments.length?(S=null==e?Jo:[+e[0],+e[1]],t):S},t.center=function(e){return arguments.length?(g=e&&[+e[0],+e[1]],t):g},t.size=function(e){return arguments.length?(k=e&&[+e[0],+e[1]],t):k},t.duration=function(e){return arguments.length?(L=+e,t):L},t.x=function(e){return arguments.length?(_=e,x=e.copy(),A={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(M=e,w=e.copy(),A={x:0,y:0,k:1},t):M},uo.rebind(t,O,"on")};var Xo,Zo,Jo=[0,1/0];uo.color=lt,lt.prototype.toString=function(){return this.rgb()+""},uo.hsl=ut;var Qo=ut.prototype=new lt;Qo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,this.l/t)},Qo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,t*this.l)},Qo.rgb=function(){return ct(this.h,this.s,this.l)},uo.hcl=ht;var Ko=ht.prototype=new lt;Ko.brighter=function(t){return new ht(this.h,this.c,Math.min(100,this.l+$o*(arguments.length?t:1)))},Ko.darker=function(t){return new ht(this.h,this.c,Math.max(0,this.l-$o*(arguments.length?t:1)))},Ko.rgb=function(){return ft(this.h,this.c,this.l).rgb()},uo.lab=dt;var $o=18,ts=.95047,es=1,rs=1.08883,ns=dt.prototype=new lt;ns.brighter=function(t){return new dt(Math.min(100,this.l+$o*(arguments.length?t:1)),this.a,this.b)},ns.darker=function(t){return new dt(Math.max(0,this.l-$o*(arguments.length?t:1)),this.a,this.b)},ns.rgb=function(){return pt(this.l,this.a,this.b)},uo.rgb=bt;var is=bt.prototype=new lt;is.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)},is.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new bt(t*this.r,t*this.g,t*this.b)},is.hsl=function(){return At(this.r,this.g,this.b)},is.toString=function(){return"#"+wt(this.r)+wt(this.g)+wt(this.b)};var as=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});as.forEach(function(t,e){as.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 os,ss,ls,us,cs=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};uo.timer=function(){It.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 hs=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Ft);uo.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=uo.round(t,jt(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)))),hs[8+r/3]};var fs=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ds=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,jt(t,e))).toFixed(Math.max(0,Math.min(20,jt(t*(1+1e-15),e))))}}),ps=uo.time={},ms=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(){vs.setUTCDate.apply(this._,arguments)},setDay:function(){vs.setUTCDay.apply(this._,arguments)},setFullYear:function(){vs.setUTCFullYear.apply(this._,arguments)},setHours:function(){vs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){vs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){vs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){vs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){vs.setUTCSeconds.apply(this._,arguments)},setTime:function(){vs.setTime.apply(this._,arguments)}};var vs=Date.prototype;ps.year=Vt(function(t){return t=ps.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),ps.years=ps.year.range,ps.years.utc=ps.year.utc.range,ps.day=Vt(function(t){var e=new ms(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}),ps.days=ps.day.range,ps.days.utc=ps.day.utc.range,ps.dayOfYear=function(t){var e=ps.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=ps[t]=Vt(function(t){return(t=ps.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=ps.year(t).getDay();return Math.floor((ps.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});ps[t+"s"]=r.range,ps[t+"s"].utc=r.utc.range,ps[t+"OfYear"]=function(t){var r=ps.year(t).getDay();return Math.floor((ps.dayOfYear(t)+(r+e)%7)/7)}}),ps.week=ps.sunday,ps.weeks=ps.sunday.range,ps.weeks.utc=ps.sunday.utc.range,ps.weekOfYear=ps.sundayOfYear;var gs={"-":"",_:" ",0:"0"},ys=/^\s*\d+/,bs=/^%/;uo.locale=function(t){return{numberFormat:Nt(t),timeFormat:qt(t)}};var xs=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=xs.numberFormat,uo.geo={},he.prototype={s:0,t:0,add:function(t){fe(t,this.t,_s),fe(_s.s,this.s,this),this.s?this.t+=_s.t:this.s=_s.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var _s=new he;uo.geo.stream=function(t,e){t&&ws.hasOwnProperty(t.type)?ws[t.type](t,e):de(t,e)};var ws={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)}},Ms={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 As=0,uo.geo.stream(t,Ts),As};var As,ks=new he,Ts={sphere:function(){As+=4*No},point:M,lineStart:M,lineEnd:M,polygonStart:function(){ks.reset(),Ts.lineStart=ve},polygonEnd:function(){var t=2*ks;As+=t<0?4*No+t:t,Ts.lineStart=Ts.lineEnd=Ts.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=ge([e*Ho,r*Ho]);if(g){var i=be(g,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,v=xo(l)>180;if(v^(u*p<m&&m<u*e)){var y=o[1]*qo;y>d&&(d=y)}else if(m=(m+360)%360-180,v^(u*p<m&&m<u*e)){var y=-o[1]*qo;y<h&&(h=y)}else r<h&&(h=r),r>d&&(d=r);v?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);g=n,p=e}function r(){_.point=e}function n(){x[0]=c,x[1]=f,_.point=t,g=null}function i(t,r){if(g){var n=t-p;y+=xo(n)>180?n+(n>0?360:-360):n}else m=t,v=r;Ts.point(t,r),e(t,r)}function a(){Ts.lineStart()}function o(){i(m,v),Ts.lineEnd(),xo(y)>jo&&(c=-(f=180)),x[0]=c,x[1]=f,g=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,v,g,y,b,x,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=i,_.lineStart=a,_.lineEnd=o,y=0,Ts.polygonStart()},polygonEnd:function(){Ts.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,ks<0?(c=-(f=180),h=-(d=90)):y>jo?d=90:y<-jo&&(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){Ss=Es=Ls=Cs=Ds=zs=Is=Ps=Os=Rs=js=0,uo.geo.stream(t,Fs);var e=Os,r=Rs,n=js,i=e*e+r*r+n*n;return i<Fo&&(e=zs,r=Is,n=Ps,Es<jo&&(e=Ls,r=Cs,n=Ds),i=e*e+r*r+n*n,i<Fo)?[NaN,NaN]:[Math.atan2(r,e)*qo,nt(n/Math.sqrt(i))*qo]};var Ss,Es,Ls,Cs,Ds,zs,Is,Ps,Os,Rs,js,Fs={sphere:M,point:ke,lineStart:Se,lineEnd:Ee,polygonStart:function(){Fs.lineStart=Le},polygonEnd:function(){Fs.lineStart=Se}},Ns=Oe(De,Ne,Ue,[-No,-No/2]),Bs=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=Ye(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 Ge(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+jo,h+.12*u+jo],[c-.214*u-jo,h+.234*u-jo]]).stream(l).point,i=s.translate([c-.205*u,h+.212*u]).clipExtent([[c-.214*u+jo,h+.166*u+jo],[c-.115*u-jo,h+.234*u-jo]]).stream(l).point,t},t.scale(1070)};var Us,Vs,Hs,qs,Ys,Gs,Ws={point:M,lineStart:M,lineEnd:M,polygonStart:function(){Vs=0,Ws.lineStart=Xe},polygonEnd:function(){Ws.lineStart=Ws.lineEnd=Ws.point=M,Us+=xo(Vs/2)}},Xs={point:Ze,lineStart:M,lineEnd:M,polygonStart:M,polygonEnd:M},Zs={point:Ke,lineStart:$e,lineEnd:tr,polygonStart:function(){Zs.lineStart=er},polygonEnd:function(){Zs.point=Ke,Zs.lineStart=$e,Zs.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 Us=0,uo.geo.stream(t,i(Ws)),Us},t.centroid=function(t){return Ls=Cs=Ds=zs=Is=Ps=Os=Rs=js=0,uo.geo.stream(t,i(Zs)),js?[Os/js,Rs/js]:Ps?[zs/Ps,Is/Ps]:Ds?[Ls/Ds,Cs/Ds]:[NaN,NaN]},t.bounds=function(t){return Ys=Gs=-(Hs=qs=1/0),uo.geo.stream(t,i(Xs)),[[Hs,qs],[Ys,Gs]]},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=vr((e=+n)*Ho,i*Ho),t):e},t.precision=function(n){return arguments.length?(r=vr(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/v)*v,i,v).map(f).concat(uo.range(Math.ceil(u/g)*g,l,g).map(d)).concat(uo.range(Math.ceil(n/p)*p,r,p).filter(function(t){return xo(t%v)>jo}).map(c)).concat(uo.range(Math.ceil(s/m)*m,o,m).filter(function(t){return xo(t%g)>jo}).map(h))}var r,n,i,a,o,s,l,u,c,h,f,d,p=10,m=p,v=90,g=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?(v=+e[0],g=+e[1],t):[v,g]},t.minorStep=function(e){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+jo],[180,90-jo]]).minorExtent([[-180,-80-jo],[180,80+jo]])},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 Js=0,uo.geo.stream(t,Qs),Js};var Js,Qs={sphere:M,point:M,lineStart:Mr,lineEnd:M,polygonStart:M,polygonEnd:M},Ks=Ar(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(uo.geo.azimuthalEqualArea=function(){return sr(Ks)}).raw=Ks;var $s=Ar(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(uo.geo.azimuthalEquidistant=function(){return sr($s)}).raw=$s,(uo.geo.conicConformal=function(){return Ge(kr)}).raw=kr,(uo.geo.conicEquidistant=function(){return Ge(Tr)}).raw=Tr;var tl=Ar(function(t){return 1/t},Math.atan);(uo.geo.gnomonic=function(){return sr(tl)}).raw=tl,Sr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Vo]},(uo.geo.mercator=function(){return Er(Sr)}).raw=Sr;var el=Ar(function(){return 1},Math.asin);(uo.geo.orthographic=function(){return sr(el)}).raw=el;var rl=Ar(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(uo.geo.stereographic=function(){return sr(rl)}).raw=rl,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(Ir),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=Dr;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 ko(t,nl),t};var nl=uo.geom.polygon.prototype=[];nl.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},nl.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]},nl.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 il,al,ol,sl,ll,ul=[],cl=[];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(Gr),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,c=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]]:[];c.point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/jo)*jo,y:Math.round(o(t,e)/jo)*jo,i:e}})}var n=Cr,i=Dr,a=n,o=i,s=hl;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,o=r.site,s=r.edges.sort(Gr),l=-1,u=s.length,c=s[u-1].edge,h=c.l===o?c.r:c.l;++l<u;)i=c,a=h,c=s[l].edge,h=c.l===o?c.r:c.l,n<a.i&&n<h.i&&hn(o,a,h)<0&&e.push([t[n],t[a.i],t[h.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?hl:t,e):s===hl?null:s},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===hl?null:s&&s[1]},e)};var hl=[[-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,v,g,y,b=Et(s),x=Et(l);if(null!=e)m=e,v=r,g=n,y=i;else if(g=y=-(m=v=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<v&&(v=c.y),c.x>g&&(g=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<v&&(v=w),_>g&&(g=_),w>y&&(y=w),h.push(_),f.push(w)}var M=g-m,A=y-v;M>A?y=v+M:g=m+A;var k=pn();if(k.add=function(t){a(k,t,+b(t,++d),+x(t,d),m,v,g,y)},k.visit=function(t){mn(t,k,m,v,g,y)},k.find=function(t){return vn(k,t[0],t[1],m,v,g,y)},d=-1,null==e){for(;++d<p;)a(k,t[d],h[d],f[d],m,v,g,y);--d}else t.forEach(k.add);return h=f=t=c=null,k}var o,s=Cr,l=Dr;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=gn,uo.interpolateObject=yn,uo.interpolateNumber=bn,uo.interpolateString=xn;var fl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dl=new RegExp(fl.source,"g");uo.interpolate=_n,uo.interpolators=[function(t,e){var r=typeof e;return("string"===r?as.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?gn:xn:e instanceof lt?gn:Array.isArray(e)?wn:"object"===r&&isNaN(e)?yn:bn)(t,e)}],uo.interpolateArray=wn;var pl=function(){return x},ml=uo.map({linear:pl,poly:Ln,quad:function(){return Tn},cubic:function(){return Sn},sin:function(){return Cn},exp:function(){return Dn},circle:function(){return zn},elastic:In,back:Pn,bounce:function(){return On}}),vl=uo.map({in:x,out:An,"in-out":kn,"out-in":function(t){return kn(An(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=ml.get(r)||pl,n=vl.get(n)||x,Mn(n(r.apply(null,co.call(arguments,1))))},uo.interpolateHcl=Rn,uo.interpolateHsl=jn,uo.interpolateLab=Fn,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:gl)})(t)},Bn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var gl={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(Kn(t[r]));return e}},uo.layout.chord=function(){function t(){var t,u,h,f,d,p={},m=[],v=uo.range(a),g=[];for(r=[],n=[],t=0,f=-1;++f<a;){for(u=0,d=-1;++d<a;)u+=i[f][d];m.push(u),g.push(uo.range(a)),t+=u}for(o&&v.sort(function(t,e){return o(m[t],m[e])}),s&&g.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=v[f],b=g[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],A=p[d+"-"+f];(M.value||A.value)&&r.push(M.value<A.value?{source:A,target:M}:{source:M,target:A})}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/g<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=yl,d=bl,p=-30,m=xl,v=.1,g=.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,g,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*(g=f.weight+d.weight?f.weight/(f.weight+d.weight):.5),d.y-=_*g,f.x+=x*(g=1-g),f.y+=_*g);if((g=i*v)&&(x=c[0]/2,_=c[1]/2,n=-1,g))for(;++n<w;)l=y[n],l.x+=(x-l.x)*g,l.y+=(_-l.y)*g;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?(v=+t,l):v},l.theta=function(t){return arguments.length?(g=t*t,l):Math.sqrt(g)},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=It(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(){return n||(n=uo.behavior.drag().origin(x).on("dragstart.force",ei).on("drag.force",e).on("dragend.force",ri)),arguments.length?void this.on("mouseover.force",ni).on("mouseout.force",ii).call(n):n},uo.rebind(l,u,"on")};var yl=20,bl=1,xl=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,v=uo.range(l),g=[];return null!=r&&v.sort(r===_l?function(t,e){return u[e]-u[t]}:function(t,e){return r(o[t],o[e])}),v.forEach(function(t){g[t]={data:o[t],value:s=u[t],startAngle:c,endAngle:c+=s*m+d,padAngle:f}}),g}var e=Number,r=_l,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 _l={};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,v=n.call(t,c,l),g=u[0].length;for(p=0;p<g;++p)for(i.call(t,u[0][p],m=v[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=vi,n=gi,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:wl.get(e)||vi,t):r},t.offset=function(e){return arguments.length?(n="function"==typeof e?e:Ml.get(e)||gi,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 wl=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:vi}),Ml=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:gi});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],s>=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 Di(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(Ai),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 v=s(d,p)/2-d.x,g=l[0]/(p.x+s(p,d)/2+v),y=l[1]/(m.depth||1);si(h,function(t){t.x=(t.x+v)*g,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){ji(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(Fi(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=Ii,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=Ii,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 Al={floor:x,ceil:x};uo.scale.linear=function(){return Qi([0,1],[0,1],_n,!1)};var kl={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 Tl=uo.format(".0e"),Sl={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(El)},uo.scale.category20=function(){return uo.scale.ordinal().range(Ll)},uo.scale.category20b=function(){return uo.scale.ordinal().range(Cl)},uo.scale.category20c=function(){return uo.scale.ordinal().range(Dl)};var El=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Ll=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),Cl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Dl=[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,v,g,y,b,x,_,w,M,A,k,T=0,S=0,E=[];if((g=(+l.apply(this,arguments)||0)/2)&&(v=a===zl?Math.sqrt(t*t+u*u):+a.apply(this,arguments),d||(S*=-1),u&&(S=nt(v/u*Math.sin(g))),t&&(T=nt(v/t*Math.sin(g)))),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),A=t*Math.cos(c+T),k=t*Math.sin(c+T);var D=Math.abs(c-h+2*T)<=No?0:1;if(T&&ba(w,M,A,k)===1-d^D){var z=(c+h)/2;w=t*Math.cos(z),M=t*Math.sin(z),A=k=null}}else w=M=0;if(f>jo&&(p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){m=t<u^d?0:1;var I=p,P=p;if(f<No){var O=null==A?[w,M]:null==x?[y,b]:Or([y,b],[A,k],[x,_],[w,M]),R=y-O[0],j=b-O[1],F=x-O[0],N=_-O[1],B=1/Math.sin(Math.acos((R*F+j*N)/(Math.sqrt(R*R+j*j)*Math.sqrt(F*F+N*N)))/2),U=Math.sqrt(O[0]*O[0]+O[1]*O[1]);P=Math.min(p,(t-U)/(B-1)),I=Math.min(p,(u-U)/(B+1))}if(null!=x){var V=xa(null==A?[w,M]:[A,k],[y,b],u,I,d),H=xa([x,_],[w,M],u,I,d);p===I?E.push("M",V[0],"A",I,",",I," 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",I,",",I," 0 0,",m," ",H[0]):E.push("M",V[0],"A",I,",",I," 0 1,",m," ",H[0])}else E.push("M",y,",",b);if(null!=A){var q=xa([y,b],[A,k],t,-P,d),Y=xa([w,M],null==x?[y,b]:[x,_],t,-P,d);p===P?E.push("L",Y[0],"A",P,",",P," 0 0,",m," ",Y[1],"A",t,",",t," 0 ",d^ba(Y[1][0],Y[1][1],q[1][0],q[1][1]),",",1-d," ",q[1],"A",P,",",P," 0 0,",m," ",q[0]):E.push("L",Y[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!=A&&E.push("A",t,",",t," 0 ",D,",",1-d," ",A,",",k);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=zl,o=va,s=ga,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==zl?zl: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 zl="auto";uo.svg.line=function(){return _a(x)};var Il=uo.map({linear:wa,"linear-closed":Ma,step:Aa,"step-before":ka,"step-after":Ta,basis:za,"basis-open":Ia,"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 Pl=[0,2/3,1/3,0],Ol=[0,1/3,2/3,0],Rl=[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},ka.reverse=Ta,Ta.reverse=ka,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=va,u=ga;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=Ya;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=Ya,r=t.projection;return t.projection=function(t){return arguments.length?r(Ga(e=t)):e},t},uo.svg.symbol=function(){function t(t,n){return(jl.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 jl=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*Nl)),r=e*Nl;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/Fl),r=e*Fl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Fl),r=e*Fl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});uo.svg.symbolTypes=jl.keys();var Fl=Math.sqrt(3),Nl=Math.tan(30*Ho);Lo.transition=function(t){for(var e,r,n=Bl||++ql,i=to(t),a=[],o=Ul||{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 Qa(a,i,n)},Lo.interrupt=function(t){return this.each(null==t?Vl:Ja(to(t)))};var Bl,Ul,Vl=Ja(to()),Hl=[],ql=0;Hl.call=Lo.call,Hl.empty=Lo.empty,Hl.node=Lo.node,Hl.size=Lo.size,uo.transition=function(t,e){return t&&t.transition?Bl?t.transition(e):t:uo.selection().transition(t)},uo.transition.prototype=Hl,Hl.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 Qa(o,a,i)},Hl.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=D(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 Qa(l,s,o)},Hl.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 Qa(i,this.namespace,this.id)},Hl.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):Y(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},Hl.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 Ka(this,"attr."+t,e,s.local?a:i)},Hl.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)},Hl.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 Ka(this,"style."+t,e,a)},Hl.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)},Hl.text=function(t){return Ka(this,"text",t,$a)},Hl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Hl.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)),Y(this,function(n){n[r][e].ease=t}))},Hl.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:Y(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}))},Hl.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:Y(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}))},Hl.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var i=Ul,a=Bl;try{Bl=r,Y(this,function(e,i,a){Ul=e[n][r],t.call(e,e.__data__,i,a)})}finally{Ul=i,Bl=a}}else Y(this,function(i){var a=i[n][r];(a.event||(a.event=uo.dispatch("start","end","interrupt"))).on(t,e)});return this},Hl.transition=function(){for(var t,e,r,n,i=this.id,a=++ql,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 Qa(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",jo),v=uo.transition(p.exit()).style("opacity",jo).remove(),g=uo.transition(p.order()).style("opacity",1),y=Math.max(i,0)+o,b=Gi(h),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),uo.transition(_));m.append("line"),m.append("text");var M,A,k,T,S=m.select("line"),E=g.select("line"),L=p.select("text").text(d),C=m.select("text"),D=g.select("text"),z="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(t=ro,M="x",k="y",A="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",k="x",A="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(k,z*y),E.attr(A,0).attr(T,z*i),D.attr(M,0).attr(k,z*y),h.rangeBand){var I=h,P=I.rangeBand()/2;c=h=function(t){return I(t)+P}}else c.rangeBand?c=h:v.call(t,h,c);m.call(t,c,h),g.call(t,h,h)})}var e,r=uo.scale.linear(),n=Yl,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 Gl?e+"":Yl,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 Yl="bottom",Gl={ 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 Wl[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=Gi(u),f.attr("x",l[0]).attr("width",l[1]-l[0]),r(h)),c&&(l=Gi(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,D[0]-=h[1],D[1]-=f[1],L=2),T())}function m(){32==uo.event.keyCode&&2==L&&(D[0]+=h[1],D[1]+=f[1],L=0,T())}function v(){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]),D[0]=h[+(t[0]<b[0])],D[1]=f[+(t[1]<b[1])]):b=null),S&&g(t,u,0)&&(r(A),n=!0),E&&g(t,c,1)&&(i(A),n=!0),n&&(e(A),M({type:"brush",mode:L?"move":"resize"}))}function g(t,e,r){var n,i,a=Gi(e),l=a[0],u=a[1],c=D[r],m=r?f:h,v=m[1]-m[0];if(L&&(l-=c,u-=v+c),n=(r?p:d)?Math.max(l,Math.min(u,t[r])):t[r],L?i=(n+=c)+v:(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(){v(),A.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),A=uo.select(_),k=w.datum(),S=!/^(n|s)$/.test(k)&&u,E=!/^(e|w)$/.test(k)&&c,L=w.classed("extent"),C=Q(_),D=uo.mouse(_),z=uo.select(n(_)).on("keydown.brush",a).on("keyup.brush",m);if(uo.event.changedTouches?z.on("touchmove.brush",v).on("touchend.brush",y):z.on("mousemove.brush",v).on("mouseup.brush",y),A.interrupt().selectAll("*").interrupt(),L)D[0]=h[0]-D[0],D[1]=f[0]-D[1];else if(k){var I=+/w$/.test(k),P=+/^n/.test(k);x=[h[1-I]-D[0],f[1-P]-D[1]],D[0]=h[I],D[1]=f[P]}else uo.event.altKey&&(b=D.slice());A.style("pointer-events","none").selectAll(".resize").style("display",null),uo.select("body").style("cursor",w.style("cursor")),M({type:"brushstart"}),v()}var o,s,l=E(t,"brushstart","brush","brushend"),u=null,c=null,h=[0,0],f=[0,0],d=!0,p=!0,m=Xl[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,Bl?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=Xl[!u<<1|!c],t):u},t.y=function(e){return arguments.length?(c=e,m=Xl[!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 Wl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Xl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Zl=ps.format=xs.timeFormat,Jl=Zl.utc,Ql=Jl("%Y-%m-%dT%H:%M:%S.%LZ");Zl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?io:Ql,io.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},io.toString=Ql.toString,ps.second=Vt(function(t){return new ms(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),ps.seconds=ps.second.range,ps.seconds.utc=ps.second.utc.range,ps.minute=Vt(function(t){return new ms(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),ps.minutes=ps.minute.range,ps.minutes.utc=ps.minute.utc.range,ps.hour=Vt(function(t){var e=t.getTimezoneOffset()/60;return new ms(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),ps.hours=ps.hour.range,ps.hours.utc=ps.hour.utc.range,ps.month=Vt(function(t){return t=ps.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),ps.months=ps.month.range,ps.months.utc=ps.month.utc.range;var Kl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],$l=[[ps.second,1],[ps.second,5],[ps.second,15],[ps.second,30],[ps.minute,1],[ps.minute,5],[ps.minute,15],[ps.minute,30],[ps.hour,1],[ps.hour,3],[ps.hour,6],[ps.hour,12],[ps.day,1],[ps.day,2],[ps.week,1],[ps.month,1],[ps.month,3],[ps.year,1]],tu=Zl.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",De]]),eu={range:function(t,e,r){return uo.range(Math.ceil(t/r)*r,+e,r).map(oo)},floor:x,ceil:x};$l.year=ps.year,ps.scale=function(){return ao(uo.scale.linear(),$l,tu)};var ru=$l.map(function(t){return[t[0].utc,t[1]]}),nu=Jl.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",De]]);ru.year=ps.year.utc,ps.scale.utc=function(){return ao(uo.scale.linear(),ru,nu)},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}()},{}],98:[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 v=f[m];d[m]=v,p+=v*v}d[o]=p,u[h]=new n(d,h),c=Math.max(p,c)}l(u,i),r=u.length;for(var g=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,g[0]=x.slice(),y[0]=-1;for(var h=0;h<=o;++h){var d=x.slice();d[h]=1,g[h+1]=d,y[h+1]=-1}for(var h=0;h<r;++h){var _=u[h];g[h+o+1]=_.point,y[h+o+1]=_.index}var w=s(g,!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":259,uniq:507}],99:[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){var r=e.exports.hi(t);return(r<<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){var r=e.exports.hi(t);return!(2146435072&r)}}).call(this,t("buffer").Buffer)},{buffer:67}],100:[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("undefined"==typeof 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},{}],101:[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,v;if(n&&(s=h(t,e,s,r)),t.length>80*r){u=f=t[0],c=d=t[1];for(var g=r;g<a;g+=r)p=t[g],m=t[g+1],p<u&&(u=p),m<c&&(c=m),p>f&&(f=p),m>d&&(d=m);v=Math.max(f-u,d-c)}return o(s,l,r,u,c,v),l}function i(t,e,r,n,i){var a,o;if(i===D(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===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,v=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,v=p.next;else if(t=p,t===v){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=g(s,l,e,r,n),f=g(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)&&k(i,a)&&k(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),(l<f||l===f&&n.x>r.x)&&k(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=g(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,v(i)}function v(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,n);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 g(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&&!A(t,e)&&k(t,e)&&k(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 A(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 k(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 D(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(D(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(D(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}},{}],102:[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=(0|e)+1}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:507}],103:[function(e,r,n){(function(i,a){!function(e,i){"object"==typeof n&&"undefined"!=typeof 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){Z=t}function o(t){J=t}function s(){return function(){return i.nextTick(f)}}function l(){return function(){X(f)}}function u(){var t=0,e=new $(f),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function c(){var t=new MessageChannel;return t.port1.onmessage=f,function(){return t.port2.postMessage(0)}}function h(){var t=setTimeout;return function(){return t(f,1)}}function f(){for(var t=0;t<W;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}W=0}function d(){try{var t=e,r=t("vertx");return X=r.runOnLoop||r.runOnContext,l()}catch(t){return h()}}function p(t,e){var r=arguments,n=this,i=new this.constructor(v);void 0===i[it]&&O(i);var a=n._state;return a?!function(){var t=r[a-1];J(function(){return z(a,i,t,n._result)})}():E(n,i,t,e),i}function m(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(v);return A(r,t),r}function v(){}function g(){return new TypeError("You cannot resolve a promise with itself")}function y(){return new TypeError("A promises callback cannot return that same promise.")}function b(t){try{return t.then}catch(t){return lt.error=t,lt}}function x(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function _(t,e,r){J(function(t){var n=!1,i=x(r,e,function(r){n||(n=!0,e!==r?A(t,r):T(t,r))},function(e){n||(n=!0,S(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,S(t,i))},t)}function w(t,e){e._state===ot?T(t,e._result):e._state===st?S(t,e._result):E(e,void 0,function(e){return A(t,e)},function(e){return S(t,e)})}function M(t,e,n){e.constructor===t.constructor&&n===p&&e.constructor.resolve===m?w(t,e):n===lt?S(t,lt.error):void 0===n?T(t,e):r(n)?_(t,e,n):T(t,e)}function A(e,r){e===r?S(e,g()):t(r)?M(e,r,b(r)):T(e,r)}function k(t){t._onerror&&t._onerror(t._result),L(t)}function T(t,e){t._state===at&&(t._result=e,t._state=ot,0!==t._subscribers.length&&J(L,t))}function S(t,e){t._state===at&&(t._state=st,t._result=e,J(k,t))}function E(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+ot]=r,i[a+st]=n,0===a&&t._state&&J(L,t)}function L(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?z(r,n,i,a):i(a);t._subscribers.length=0}}function C(){this.error=null}function D(t,e){try{return t(e)}catch(t){return ut.error=t,ut}}function z(t,e,n,i){var a=r(n),o=void 0,s=void 0,l=void 0,u=void 0;if(a){if(o=D(n,i),o===ut?(u=!0,s=o.error,o=null):l=!0,e===o)return void S(e,y())}else o=i,l=!0;e._state!==at||(a&&l?A(e,o):u?S(e,s):t===ot?T(e,o):t===st&&S(e,o))}function I(t,e){try{e(function(e){A(t,e)},function(e){S(t,e)})}catch(e){S(t,e)}}function P(){return ct++}function O(t){t[it]=ct++,t._state=void 0,t._result=void 0,t._subscribers=[]}function R(t,e){this._instanceConstructor=t,this.promise=new t(v),this.promise[it]||O(this.promise),G(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?T(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&T(this.promise,this._result))):S(this.promise,j())}function j(){return new Error("Array Methods must be provided an Array")}function F(t){return new R(this,t).promise}function N(t){var e=this;return new e(G(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 B(t){var e=this,r=new e(v);return S(r,t),r}function U(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function V(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function H(t){this[it]=P(),this._result=this._state=void 0,this._subscribers=[],v!==t&&("function"!=typeof t&&U(),this instanceof H?I(this,t):V())}function q(){var t=void 0;if("undefined"!=typeof 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=H}var Y=void 0;Y=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var G=Y,W=0,X=void 0,Z=void 0,J=function(t,e){rt[W]=t,rt[W+1]=e,W+=2,2===W&&(Z?Z(f):nt())},Q="undefined"!=typeof window?window:void 0,K=Q||{},$=K.MutationObserver||K.WebKitMutationObserver,tt="undefined"==typeof self&&"undefined"!=typeof i&&"[object process]"==={}.toString.call(i),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3),nt=void 0;nt=tt?s():$?u():et?c():void 0===Q&&"function"==typeof e?d():h();var it=Math.random().toString(36).substring(16),at=void 0,ot=1,st=2,lt=new C,ut=new C,ct=0;return R.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===at&&r<t;r++)this._eachEntry(e[r],r)},R.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===m){var i=b(t);if(i===p&&t._state!==at)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(r===H){var a=new r(v);M(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},R.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===at&&(this._remaining--,t===st?S(n,r):this._result[e]=r),0===this._remaining&&T(n,this._result)},R.prototype._willSettleAt=function(t,e){var r=this;E(t,void 0,function(t){return r._settledAt(ot,e,t)},function(t){return r._settledAt(st,e,t)})},H.all=F,H.race=N,H.resolve=m,H.reject=B,H._setScheduler=n,H._setAsap=o,H._asap=J,H.prototype={constructor:H,then:p,catch:function(t){return this.then(null,t)}},q(),H.polyfill=q,H.Promise=H,H})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:453}],104:[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],e 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&&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,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){var e;return e=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)}},{}],105:[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},{}],106:[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),(e<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(t=+t,0===t&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],107:[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];if(t.length<=1)return"any"===e?"false":"true";var r="=="===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";return"("+r+")"}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"]},{}],108:[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],v=e[i+1],g=v-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]*g,b[d]=o[f+c],_[d]=u[f+c]*g,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)/g,a)}for(var M=h[0],A=h[1],d=0;d<c;++d)a[d]=n(M[d],A[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=(t-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],v=this._scratch[2],g=this._scratch[3],y=this._scratch[4],b=!0,h=0;h<u;++h,--c)m[h]=a[c],g[h]=o[c]*p,v[h]=a[c+u],y[h]=o[c+u]*p,b=b&&m[h]===v[h]&&g[h]===y[h]&&0===g[h];if(b)for(var h=0;h<u;++h)i[h]=0;else{s.derivative(m,g,v,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":56,"cubic-hermite":92}],109:[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?r:e.right?l(t,e.right):void 0}function u(t,e,r,n){var i=e(t,n.key);if(i<=0){if(n.left){var a=u(t,e,r,n.left);if(a)return a}var a=r(n.key,n.value);if(a)return a}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=g);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===v){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=g,r._color=g,s._color=g,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===v){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=g,n._color=g,e._color=g,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===g){if(r._color===v)return r._color=g,void(r.right=a(v,n));r.right=a(v,n);continue}if(n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=v,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===v){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=g,r._color=g,s._color=g,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===v){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=g,n._color=g,e._color=g,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===g){if(r._color===v)return r._color=g,void(r.left=a(v,n));r.left=a(v,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=v,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 v=0,g=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(v,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===g||i._color===g)break;var d=l[h-2];if(d.left===f)if(f.left===i){var p=d.right;if(!p||p._color!==v){if(d._color=v,d.left=f.right,f._color=g,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=g,d.right=a(g,p),d._color=v,h-=1}else{var p=d.right;if(!p||p._color!==v){if(f.right=i.left,d._color=v,d.left=i.right,i._color=g,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=g,d.right=a(g,p),d._color=v,h-=1}else if(f.right===i){var p=d.left;if(!p||p._color!==v){if(d._color=v,d.right=f.left,f._color=g,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=g,d.left=a(g,p),d._color=v,h-=1}else{var p=d.left;if(!p||p._color!==v){if(f.left=i.right,d._color=v,d.right=i.left,i._color=g,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=g,d.left=a(g,p),d._color=v,h-=1}}return l[0]._color=g,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===v){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=g;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}})},{}],110:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=s[0],r=s.length-1;r>0;--r)e+=s[r]/(t+r);var n=t+o+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=7,a=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],o=607/128,s=[.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=a[0],o=1;o<i+2;o++)r+=a[o]/(e+o);var s=e+i+.5;return Math.sqrt(2*Math.PI)*Math.pow(s,e+.5)*Math.exp(-s)*r},e.exports.log=n},{}],111:[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:529}],112:[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":111}],113:[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],v=m.geometry,g=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===g?i(v,r,n,o):a(v,r,n,o,l,3===g);y.length&&h.push(s(m.tags,g,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],v=m.area,g=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,v,g,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,v,g,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,v,g,y))):d>r&&(x.push(i(u,p,r)),a||(x=o(s,x,v,g,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,v,g,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":115}],114:[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":115,"./simplify":117}],115:[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},{}],116:[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,v=null;h.length;){n=h.pop(),r=h.pop(),e=h.pop(),t=h.pop();var g=1<<e,y=a(e,r,n),b=this.tiles[y],x=e===d.maxZoom?0:d.tolerance/(g*d.extent);if(!b&&(m>1&&console.time("creation"),b=this.tiles[y]=p(t,g,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,A,k,T,S,E,L=.5*d.buffer/d.extent,C=.5-L,D=.5+L,z=1+L;M=A=k=T=null,S=f(t,g,r-L,r+D,0,o,b.min[0],b.max[0]),E=f(t,g,r+C,r+z,0,o,b.min[0],b.max[0]),S&&(M=f(S,g,n-L,n+D,1,s,b.min[1],b.max[1]),A=f(S,g,n+C,n+z,1,s,b.min[1],b.max[1])),E&&(k=f(E,g,n-L,n+D,1,s,b.min[1],b.max[1]),T=f(E,g,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(A||[],e+1,2*r,2*n+1),h.push(k||[],e+1,2*r+1,2*n),h.push(T||[],e+1,2*r+1,2*n+1))}else i&&(v=e)}return v},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 v=1<<t-m;l=a(m,Math.floor(e/v),Math.floor(r/v))}return this.tiles[l]?h.tile(this.tiles[l],i):null}},{"./clip":113,"./convert":114,"./tile":118,"./transform":119,"./wrap":120}],117:[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]),a>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},{}],118:[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){var r=o(t);r<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},{}],119:[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,h=u.type;if(1===h)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 f=c[n];for(a=0;a<f.length;a++)f[a]=i(f[a],e,o,s,l)}}return t.transformed=!0,t}function i(t,e,r,n,i){var a=Math.round(e*(t[0]*r-n)),o=Math.round(e*(t[1]*r-i));return[a,o]}r.tile=n,r.point=i},{}],120:[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":113,"./feature":115}],121:[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},{}],122:[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;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],v=[0,0,0],g={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||g;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,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=u[A],this.lastCubeProps.axis[A]=c[A];for(var k=m,A=0;A<3;++A)o(m[A],A,this.bounds,u,c);for(var e=this.gl,T=v,A=0;A<3;++A)this.backgroundEnable[A]?T[A]=c[A]:T[A]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(var A=0;A<3;++A){var S=[0,0,0];c[A]>0?S[A]=s[1][A]:S[A]=s[0][A];for(var E=0;E<2;++E){var L=(A+1+E)%3,C=(A+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=(A+1+E)%3,C=(A+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 A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,k[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,k[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);for(var D=n(y,k[A].primalMinor),z=n(b,k[A].mirrorMinor),I=this.lineTickLength,E=0;E<3;++E){var P=M/r[5*E];D[E]*=I[E]*P,z[E]*=I[E]*P}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,k[A].primalOffset,D,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,k[A].mirrorOffset,z,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(var A=0;A<3;++A){for(var O=k[A].primalMinor,R=n(x,k[A].primalOffset),E=0;E<3;++E)this.lineTickEnable[A]&&(R[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[A]){for(var E=0;E<3;++E)R[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],R,this.tickColor[A])}if(this.labelEnable[A]){for(var E=0;E<3;++E)R[E]+=M*O[E]*this.labelPad[E]/r[5*E];R[A]+=.5*(s[0][A]+s[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],R,this.labelColor[A])}}},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":123,"./lib/cube.js":124,"./lib/lines.js":125,"./lib/text.js":127,"./lib/ticks.js":128}],123:[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 v=u;u=c,c=v}var g=a(t,new Float32Array(e)),y=a(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=o(t,[{buffer:g,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:g,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,g,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":126,"gl-buffer":130,"gl-vao":241}],124:[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,v=h-n,g=f-i;a+=Math.abs(d*g-p*v)}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 A=0;A<3;++A){for(var k=(A+2)%3,T=(A+1)%3,S=-1,E=-1,L=0;L<2;++L){var C=L<<A,D=C+(L<<k)+(1-L<<T),z=C+(1-L<<k)+(L<<T);u(f[C],f[D],f[z],p)<0||(L?S=1:E=1)}if(S<0||E<0)E>S&&(_|=1<<A);else{for(var L=0;L<2;++L){var C=L<<A,D=C+(L<<k)+(1-L<<T),z=C+(1-L<<k)+(L<<T),I=i([h[C],h[D],h[z],h[C+(1<<k)+(1<<T)]]);L?S=I:E=I}E>S&&(_|=1<<A)}}}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 j=O^1<<m;if(j!==_&&j!==P){R<0&&(R=j);var T=f[j];T[0]<f[R][0]&&(R=j)}}for(var F=-1,m=0;m<3;++m){var j=O^1<<m;if(j!==_&&j!==P&&j!==R){F<0&&(F=j);var T=f[j];T[0]>f[F][0]&&(F=j)}}var N=v;N[0]=N[1]=N[2]=0,N[o.log2(R^O)]=O&R,N[o.log2(O^F)]=O&F;var B=7^F;B===_||B===P?(B=7^R,N[o.log2(F^B)]=B&F):N[o.log2(R^B)]=B&R;for(var U=g,V=_,A=0;A<3;++A)V&1<<A?U[A]=-1:U[A]=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]],v=[1,1,1],g=[0,0,0],y={ cubeEdges:v,axis:g}},{"bit-twiddle":57,"gl-mat4/invert":154,"gl-mat4/multiply":156,"robust-orientation":474,"split-polygon":492}],125:[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 v=n.length/3|0;i[f]=d,o[f]=v-d;for(var d=n.length/3|0,g=0;g<r[f].length;++g){var m=+r[f][g].x;n.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var v=n.length/3|0;c[f]=d,h[f]=v-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":126,"gl-buffer":130,"gl-vao":241}],126:[function(t,e,r){"use strict";var n=t("gl-shader"),i="#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",a="precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}";r.line=function(t){return n(t,i,a,null,[{name:"position",type:"vec3"}])};var o="#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}",s="precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}";r.text=function(t){return n(t,o,s,null,[{name:"position",type:"vec3"}])};var l="#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}",u="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}";r.bg=function(t){return n(t,l,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":225}],127:[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=3,d=n.prototype,p=[0,0];d.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,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=p},d.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 v=u[p[m]];s.push(l*v[0],-l*v[1],t)}}for(var s=(this.gl,[]),l=[0,0,0],u=[0,0,0],c=[0,0,0],d=[0,0,0],p=0;p<3;++p){c[p]=s.length/f|0,o(.5*(t[0][p]+t[1][p]),e[p],r),d[p]=(s.length/f|0)-c[p],l[p]=s.length/f|0;for(var m=0;m<n[p].length;++m)n[p][m].text&&o(n[p][m].x,n[p][m].text,n[p][m].font||a,n[p][m].fontSize||12);u[p]=(s.length/f|0)-l[p]}this.buffer.update(s),this.tickOffset=l,this.tickCount=u,this.labelOffset=c,this.labelCount=d};var m=[0,0,0];d.drawTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=m;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 v=[0,0,0];d.drawLabel=function(t,e,r,n,i){this.labelCount[t]&&(this.shader.uniforms.axis=v,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]))},d.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t("_process"))},{"./shaders":126,_process:453,"gl-buffer":130,"gl-vao":241,"vectorize-text":518}],128:[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=(.5*(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},{}],129:[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=v,_=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 A=(M+1)%3,k=(M+2)%3,T=g;t:for(var _=0;_<2;++_){var S=[];if(b[M]<0!=!!_){T[M]=y[_][M];for(var E=0;E<2;++E){T[A]=y[E^_][A];for(var L=0;L<2;++L)T[k]=y[L^E^_][k],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 k=S[E],C=i(g,d,k,r,n),L=0;L<3;++L)x[L].lo=Math.min(x[L].lo,k[L]),x[L].hi=Math.max(x[L].hi,k[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],v=[new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0),new n(1/0,-(1/0),1/0)],g=[0,0,0]},{"./lib/cube.js":124,"extract-frustum-planes":105,"gl-mat4/multiply":156,"gl-mat4/transpose":164,"gl-vec4/transformMat4":247,"split-polygon":492}],130:[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&&"undefined"!=typeof t.shape){var r=t.dtype;if(h.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var n=gl.getExtension("OES_element_index_uint");r=n&&"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 s=l.malloc(t.size,r),f=c(s,t.shape);u.assign(f,t),e<0?this.length=i(this.gl,this.type,this.length,this.usage,s,e):this.length=i(this.gl,this.type,this.length,this.usage,s.subarray(0,t.size),e),l.free(s)}}else if(Array.isArray(t)){var d;d=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),e<0?this.length=i(this.gl,this.type,this.length,this.usage,d,e):this.length=i(this.gl,this.type,this.length,this.usage,d.subarray(0,t.length),e),l.free(d)}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:434,"ndarray-ops":428,"typedarray-pool":505}],131:[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"}},{}],132:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":131}],133:[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],v=h[2]-h[0],g=h[3]-h[1],y=2*p/v,b=2*m/g,x=(s[0]-h[0]-.5*v)/p,_=(s[1]-h[1]-.5*g)/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],v=s.mallocFloat64(h*u.length*4),g=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],A=0;A<u.length;++A){var k=u[A],T=k[0],S=k[1];T<0?T*=x:T>0&&(T*=_),S<0?S*=w:S>0&&(S*=M),v[b++]=f*(r-p+T),v[b++]=d*(n-m+S),v[b++]=o*k[2]+(l+o)*k[4],v[b++]=o*k[3]+(l+o)*k[5]}}for(e=0;e<v.length;e++)g[e]=v[e],y[e]=v[e]-g[e];this.bufferHi.update(g),this.bufferLo.update(y),s.free(v)},c.dispose=function(){this.plot.removeObject(this),this.shader.dispose(),this.bufferHi.dispose(),this.bufferLo.dispose()}},{"./lib/shaders":134,"gl-buffer":130,"gl-shader":225,"typedarray-pool":505}],134:[function(t,e,r){e.exports={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"}},{}],135:[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,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":136,"gl-buffer":130,"gl-vao":241}],136:[function(t,e,r){"use strict";var n=t("gl-shader"),i="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}",a="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 n(t,i,a,null,[{name:"position",type:"vec3"},{name:"offset",type:"vec3"},{name:"color",type:"vec4"}])}},{"gl-shader":225}],137:[function(t,e,r){"use strict";function n(t){var e=t.getParameter(t.FRAMEBUFFER_BINDING),r=t.getParameter(t.RENDERBUFFER_BINDING),n=t.getParameter(t.TEXTURE_BINDING_2D);return[e,r,n]}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 v:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case g: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 v=0;v<h;++v)t.color[v]=s(r,u,c,m,r.RGBA,r.COLOR_ATTACHMENT0+v);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 g=r.getExtension("WEBGL_depth_texture");g?d?t.depth=s(r,u,c,g.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 v=0;v<t.color.length;++v)t.color[v].dispose(),t.color[v]=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,v=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,g=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),s<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,v,g,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":237}],138:[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 v=s(e).split("\n"),d=0;d<v.length;d++)if(f[d+3]||f[d+2]||f[d+1]){var g=v[d];if(u+=g+"\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":32,"gl-constants/lookup":132,"glsl-shader-name":249,"sprintf-js":493}],139:[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],v=h[3]=n[n.length-1],g=1/(m-d),y=1/(v-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*_),A=s.mallocUint8(2*_),k=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 D=g*(r[C]-d),z=g*(r[C+1]-d),I=0;I<f.length;I+=2){var P,O,R,j,F=f[I],N=f[I+1],B=(S+N)*b+(C+F),U=i[B],V=a.le(l,U);if(V<0)P=u[0],O=u[1],R=u[2],j=u[3];else if(V===c-1)P=u[4*c-4],O=u[4*c-3],R=u[4*c-2],j=u[4*c-1];else{var H=(U-l[V])/(l[V+1]-l[V]),q=1-H,Y=4*V,G=4*(V+1);P=q*u[Y]+H*u[G],O=q*u[Y+1]+H*u[G+1],R=q*u[Y+2]+H*u[G+2],j=q*u[Y+3]+H*u[G+3]}w[4*T]=255*P,w[4*T+1]=255*O,w[4*T+2]=255*R,w[4*T+3]=255*j,M[2*T]=.5*D+.5*z,M[2*T+1]=.5*E+.5*L,A[2*T]=F,A[2*T+1]=N,k[T]=S*b+C,T+=1}this.positionBuffer.update(M),this.weightBuffer.update(A),this.colorBuffer.update(w),this.idBuffer.update(k),s.free(M),s.free(w),s.free(A),s.free(k)},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":140,"binary-search-bounds":141,"gl-buffer":130,"gl-shader":225,"iota-array":262,"typedarray-pool":505}],140:[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"}},{}],141:[function(t,e,r){arguments[4][74][0].apply(r,arguments)},{dup:74}],142:[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}"},{}],143:[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),v=new n(t,c,i,a,u,f,d,p,m);return t.addObject(v),v.update(e),v}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 v=this.lineShader;v.bind(),this.lineBufferLo.bind(),v.attributes.aLo.pointer(l.FLOAT,!1,16,0),v.attributes.dLo.pointer(l.FLOAT,!1,16,8),this.lineBufferHi.bind();var g=v.uniforms;this.setProjectionUniforms(g,a),g.color=c,g.width=s*u,g.dashPattern=this.dashPattern.bind(),g.dashLength=this.dashLength*u;var y=v.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 v=this.bounds;v[0]=v[1]=1/0,v[2]=v[3]=-(1/0);var g=this.numPoints=m.length>>>1;if(0!==g){for(e=0;e<g;++e)a=m[2*e],o=m[2*e+1],isNaN(a)||isNaN(o)||(v[0]=Math.min(v[0],a),v[1]=Math.min(v[1],o),v[2]=Math.max(v[2],a),v[3]=Math.max(v[3],o));v[0]===v[2]&&(v[2]+=1),v[3]===v[1]&&(v[3]+=1);var y=c.mallocFloat64(24*(g-1)),b=c.mallocFloat32(24*(g-1)),x=c.mallocFloat32(24*(g-1)),_=c.mallocUint32(12*(g-1)),w=b.length,M=_.length;n=g;for(var A=0;n>1;){var k=--n;a=m[2*n],o=m[2*n+1];var T=k-1,S=m[2*T],E=m[2*T+1];if(!(isNaN(a)||isNaN(o)||isNaN(S)||isNaN(E))){A+=1,a=(a-v[0])/(v[2]-v[0]),o=(o-v[1])/(v[3]-v[1]),S=(S-v[0])/(v[2]-v[0]),E=(E-v[1])/(v[3]-v[1]);var L=S-a,C=E-o,D=k|1<<24,z=k-1,I=k,P=k-1|1<<24;y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=D,_[--M]=z,y[--w]=C,y[--w]=L,y[--w]=E,y[--w]=S,_[--M]=I,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=E,y[--w]=S,_[--M]=I,_[--M]=P,y[--w]=C,y[--w]=L,y[--w]=E,y[--w]=S,_[--M]=I,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=D,_[--M]=z,y[--w]=C,y[--w]=L,y[--w]=o,y[--w]=a,_[--M]=D,_[--M]=z}}for(e=0;e<y.length;e++)b[e]=y[e],x[e]=y[e]-b[e];this.vertCount=6*A,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":142,"gl-buffer":130,"gl-shader":225,"gl-texture2d":237,ndarray:434,"typedarray-pool":505}],144:[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="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",o="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}",s=[{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,a,null,s)},r.createPickShader=function(t){return n(t,i,o,null,s)}},{"gl-shader":225}],145:[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){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=v(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,v=p.createPickShader,g=[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||g,view:t.view||g,projection:t.projection||g,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||g,view:t.view||g,projection:t.projection||g,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)]],v=!1;t:for(e=1;e<a.length;++e){var g=a[e-1],y=a[e];for(u.push(h),c.push(g.slice()),r=0;r<3;++r){if(isNaN(g[r])||isNaN(y[r])||!isFinite(g[r])||!isFinite(y[r])){if(!i&&l.length>0){for(var b=0;b<24;++b)l.push(l[l.length-12]);p+=2,v=!0}continue t}m[0][r]=Math.min(m[0][r],g[r],y[r]),m[1][r]=Math.max(m[1][r],g[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(g,y),v){for(r=0;r<2;++r)l.push(g[0],g[1],g[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3]);p+=2,v=!1}l.push(g[0],g[1],g[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3],g[0],g[1],g[2],y[0],y[1],y[2],M,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],g[0],g[1],g[2],h,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],g[0],g[1],g[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 A=t.dashes,k=A.slice();for(k.unshift(0),e=1;e<k.length;++e)k[e]=k[e-1]+k[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(k,k[k.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":144,"binary-search-bounds":56,"gl-buffer":130,"gl-texture2d":237,"gl-vao":241,"glsl-read-float":248,ndarray:434}],146:[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},{}],147:[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},{}],148:[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},{}],149:[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},{}],150:[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],v=t[15],g=e*o-r*a,y=e*s-n*a,b=e*l-i*a,x=r*s-n*o,_=r*l-i*o,w=n*l-i*s,M=u*p-c*d,A=u*m-h*d,k=u*v-f*d,T=c*m-h*p,S=c*v-f*p,E=h*v-f*m;return g*E-y*S+b*T+x*k-_*A+w*M}e.exports=n},{}],151:[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,v=a*s,g=a*l;return t[0]=1-h-p,t[1]=c+g,t[2]=f-v,t[3]=0,t[4]=c-g,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+v,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},{}],152:[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,v=o*s,g=o*l,y=o*u;return t[0]=1-(d+m),t[1]=h+y,t[2]=f-g,t[3]=0,t[4]=h-y,t[5]=1-(c+m),t[6]=p+v,t[7]=0,t[8]=f+g,t[9]=p-v,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},{}],153:[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},{}],154:[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],v=e[14],g=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,A=c*m-h*p,k=c*v-f*p,T=c*g-d*p,S=h*v-f*m,E=h*g-d*m,L=f*g-d*v,C=y*L-b*E+x*S+_*T-w*k+M*A;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-v*w+g*_)*C,t[3]=(f*w-h*M-d*_)*C,t[4]=(l*T-o*L-u*k)*C,t[5]=(r*L-i*T+a*k)*C,t[6]=(v*x-p*M-g*b)*C,t[7]=(c*M-f*x+d*b)*C,t[8]=(o*E-s*T+u*A)*C,t[9]=(n*T-r*E-a*A)*C,t[10]=(p*w-m*x+g*y)*C,t[11]=(h*x-c*w-d*y)*C,t[12]=(s*k-o*S-l*A)*C,t[13]=(r*S-n*k+i*A)*C,t[14]=(m*b-p*_-v*y)*C,t[15]=(c*_-h*b+f*y)*C,t):null}e.exports=n},{}],155:[function(t,e,r){function n(t,e,r,n){var a,o,s,l,u,c,h,f,d,p,m=e[0],v=e[1],g=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(v-w)<1e-6&&Math.abs(g-M)<1e-6?i(t):(h=m-_,f=v-w,d=g-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*v+s*g),t[13]=-(l*m+u*v+c*g),t[14]=-(h*m+f*v+d*g),t[15]=1,t)}var i=t("./identity");e.exports=n},{"./identity":153}],156:[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],v=e[13],g=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*v,t[2]=b*a+x*u+_*d+w*g,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*v,t[6]=b*a+x*u+_*d+w*g,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*v,t[10]=b*a+x*u+_*d+w*g,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*v,t[14]=b*a+x*u+_*d+w*g,t[15]=b*o+x*c+_*p+w*y,t}e.exports=n},{}],157:[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},{}],158:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u,c,h,f,d,p,m,v,g,y,b,x,_,w,M,A,k,T,S,E=n[0],L=n[1],C=n[2],D=Math.sqrt(E*E+L*L+C*C);return Math.abs(D)<1e-6?null:(D=1/D,E*=D,L*=D,C*=D,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],v=e[9],g=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,A=C*L*o+E*i,k=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+v*_,t[2]=u*b+d*x+g*_,t[3]=c*b+p*x+y*_,t[4]=s*w+h*M+m*A,t[5]=l*w+f*M+v*A,t[6]=u*w+d*M+g*A,t[7]=c*w+p*M+y*A,t[8]=s*k+h*T+m*S,t[9]=l*k+f*T+v*S,t[10]=u*k+d*T+g*S,t[11]=c*k+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},{}],159:[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},{}],160:[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},{}],161:[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},{}],162:[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},{}],163:[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],v=r[1],g=r[2];return e===t?(t[12]=e[0]*m+e[4]*v+e[8]*g+e[12],t[13]=e[1]*m+e[5]*v+e[9]*g+e[13],t[14]=e[2]*m+e[6]*v+e[10]*g+e[14],t[15]=e[3]*m+e[7]*v+e[11]*g+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*v+h*g+e[12],t[13]=i*m+l*v+f*g+e[13],t[14]=a*m+u*v+d*g+e[14],t[15]=o*m+c*v+p*g+e[15]),t}e.exports=n},{}],164:[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},{}],165:[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":146,"gl-mat3/invert":147,"gl-mat4/invert":154}],166:[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":167,"./gl-matrix/mat2.js":168,"./gl-matrix/mat2d.js":169,"./gl-matrix/mat3.js":170,"./gl-matrix/mat4.js":171,"./gl-matrix/quat.js":172,"./gl-matrix/vec2.js":173,"./gl-matrix/vec3.js":174,"./gl-matrix/vec4.js":175}],167:[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},{}],168:[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":167}],169:[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":167}],170:[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],v=r[4],g=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+v*o+g*u,t[4]=m*i+v*s+g*c,t[5]=m*a+v*l+g*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,v=a*s,g=a*l;return t[0]=1-h-p,t[3]=c-g,t[6]=f+v,t[1]=c+g,t[4]=1-u-p,t[7]=d-m,t[2]=f-v,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],v=e[14],g=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,A=c*m-h*p,k=c*v-f*p,T=c*g-d*p,S=h*v-f*m,E=h*g-d*m,L=f*g-d*v,C=y*L-b*E+x*S+_*T-w*k+M*A;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(l*T-o*L-u*k)*C,t[2]=(o*E-s*T+u*A)*C,t[3]=(i*E-n*L-a*S)*C,t[4]=(r*L-i*T+a*k)*C,t[5]=(n*T-r*E-a*A)*C,t[6]=(m*M-v*w+g*_)*C,t[7]=(v*x-p*M-g*b)*C,t[8]=(p*w-m*x+g*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],v=e[4],g=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-v)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-g)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&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":167}],171:[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,v){var g=new n.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=i,g[4]=a,g[5]=o,g[6]=s,g[7]=l,g[8]=u,g[9]=c,g[10]=h,g[11]=f,g[12]=d,g[13]=p,g[14]=m,g[15]=v,g},i.set=function(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,v){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]=v,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],v=e[14],g=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,A=c*m-h*p,k=c*v-f*p,T=c*g-d*p,S=h*v-f*m,E=h*g-d*m,L=f*g-d*v,C=y*L-b*E+x*S+_*T-w*k+M*A;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-v*w+g*_)*C,t[3]=(f*w-h*M-d*_)*C,t[4]=(l*T-o*L-u*k)*C,t[5]=(r*L-i*T+a*k)*C,t[6]=(v*x-p*M-g*b)*C,t[7]=(c*M-f*x+d*b)*C,t[8]=(o*E-s*T+u*A)*C,t[9]=(n*T-r*E-a*A)*C,t[10]=(p*w-m*x+g*y)*C,t[11]=(h*x-c*w-d*y)*C,t[12]=(s*k-o*S-l*A)*C,t[13]=(r*S-n*k+i*A)*C,t[14]=(m*b-p*_-v*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],v=e[14],g=e[15];return t[0]=s*(f*g-d*v)-h*(l*g-u*v)+m*(l*d-u*f),t[1]=-(n*(f*g-d*v)-h*(i*g-a*v)+m*(i*d-a*f)),t[2]=n*(l*g-u*v)-s*(i*g-a*v)+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*g-d*v)-c*(l*g-u*v)+p*(l*d-u*f)),t[5]=r*(f*g-d*v)-c*(i*g-a*v)+p*(i*d-a*f),t[6]=-(r*(l*g-u*v)-o*(i*g-a*v)+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*g-d*m)-c*(s*g-u*m)+p*(s*d-u*h),t[9]=-(r*(h*g-d*m)-c*(n*g-a*m)+p*(n*d-a*h)),t[10]=r*(s*g-u*m)-o*(n*g-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*v-f*m)-c*(s*v-l*m)+p*(s*f-l*h)),t[13]=r*(h*v-f*m)-c*(n*v-i*m)+p*(n*f-i*h),t[14]=-(r*(s*v-l*m)-o*(n*v-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);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],v=t[15],g=e*o-r*a,y=e*s-n*a,b=e*l-i*a,x=r*s-n*o,_=r*l-i*o,w=n*l-i*s,M=u*p-c*d,A=u*m-h*d,k=u*v-f*d,T=c*m-h*p,S=c*v-f*p,E=h*v-f*m;return g*E-y*S+b*T+x*k-_*A+w*M},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],v=e[13],g=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*v,t[2]=b*a+x*u+_*d+w*g,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*v,t[6]=b*a+x*u+_*d+w*g,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*v,t[10]=b*a+x*u+_*d+w*g,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*v,t[14]=b*a+x*u+_*d+w*g,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],v=r[1],g=r[2];return e===t?(t[12]=e[0]*m+e[4]*v+e[8]*g+e[12],t[13]=e[1]*m+e[5]*v+e[9]*g+e[13],t[14]=e[2]*m+e[6]*v+e[10]*g+e[14],t[15]=e[3]*m+e[7]*v+e[11]*g+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*v+h*g+e[12],t[13]=i*m+l*v+f*g+e[13],t[14]=a*m+u*v+d*g+e[14],t[15]=o*m+c*v+p*g+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,v,g,y,b,x,_,w,M,A,k,T,S,E,L=i[0],C=i[1],D=i[2],z=Math.sqrt(L*L+C*C+D*D);return Math.abs(z)<n.EPSILON?null:(z=1/z,L*=z,C*=z,D*=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],v=e[8],g=e[9],y=e[10],b=e[11],x=L*L*s+o,_=C*L*s+D*a,w=D*L*s-C*a,M=L*C*s-D*a,A=C*C*s+o,k=D*C*s+L*a,T=L*D*s+C*a,S=C*D*s-L*a,E=D*D*s+o,t[0]=l*x+f*_+v*w,t[1]=u*x+d*_+g*w,t[2]=c*x+p*_+y*w,t[3]=h*x+m*_+b*w,t[4]=l*M+f*A+v*k,t[5]=u*M+d*A+g*k,t[6]=c*M+p*A+y*k,t[7]=h*M+m*A+b*k,t[8]=l*T+f*S+v*E,t[9]=u*T+d*S+g*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,v=o*s,g=o*l,y=o*u;return t[0]=1-(d+m),t[1]=h+y,t[2]=f-g,t[3]=0,t[4]=h-y,t[5]=1-(c+m),t[6]=p+v,t[7]=0,t[8]=f+g,t[9]=p-v,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,v=o*c,g=s*l,y=s*u,b=s*c,x=n[0],_=n[1],w=n[2];return t[0]=(1-(p+v))*x,t[1]=(f+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(f-b)*_,t[5]=(1-(h+v))*_,t[6]=(m+g)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-g)*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,v=o*h,g=s*h,y=l*u,b=l*c,x=l*h,_=n[0],w=n[1],M=n[2],A=i[0],k=i[1],T=i[2];return t[0]=(1-(m+g))*_,t[1]=(d+x)*_,t[2]=(p-b)*_,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(f+g))*w,t[6]=(v+y)*w,t[7]=0,t[8]=(p+b)*M,t[9]=(v-y)*M,t[10]=(1-(f+m))*M,t[11]=0,t[12]=r[0]+A-(t[0]*A+t[4]*k+t[8]*T),t[13]=r[1]+k-(t[1]*A+t[5]*k+t[9]*T),t[14]=r[2]+T-(t[2]*A+t[6]*k+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,v=a*s,g=a*l;return t[0]=1-h-p,t[1]=c+g,t[2]=f-v,t[3]=0,t[4]=c-g,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+v,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,v=e[0],g=e[1],y=e[2],b=a[0],x=a[1],_=a[2],w=r[0],M=r[1],A=r[2];return Math.abs(v-w)<n.EPSILON&&Math.abs(g-M)<n.EPSILON&&Math.abs(y-A)<n.EPSILON?i.identity(t):(f=v-w,d=g-M,p=y-A,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*v+s*g+l*y),t[13]=-(u*v+c*g+h*y),t[14]=-(f*v+d*g+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],v=t[13],g=t[14],y=t[15],b=e[0],x=e[1],_=e[2],w=e[3],M=e[4],A=e[5],k=e[6],T=e[7],S=e[8],E=e[9],L=e[10],C=e[11],D=e[12],z=e[13],I=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-A)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(u-k)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(k))&&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-D)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(v-z)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(z))&&Math.abs(g-I)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(y-P)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(P))},e.exports=i},{"./common.js":167}],172:[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],v=r[3];return a=u*d+c*p+h*m+f*v,a<0&&(a=-a,d=-d,p=-p,m=-m,v=-v),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*v,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":167,"./mat3.js":170,"./vec3.js":174,"./vec4.js":175}],173:[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":167}],174:[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":167}],175:[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],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":167}],176:[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),v=0,c=0;c<3;++c){if(m[c]<-.001||m[c]>1.0001)return null;v+=m[c]}return Math.abs(v-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:39,"polytope-closest-point/lib/closest_point_2d.js":452}],177:[function(t,e,r){var n="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}",i="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}",a="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}",o="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}",s="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}",l="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}",u="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}",c="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}",h="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}",f="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}",d="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n"; r.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:a,fragment:o,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:s,fragment:l,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:f,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{}],178:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,v,g,y,b,x,_,w,M,A,k,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=v,this.edgeUVs=g,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=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,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=O,this._view=O,this._projection=O,this._resolution=[1,1]}function i(t){for(var e=A({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 M(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=v(t,L);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=v(t,C);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function u(t){var e=v(t,D);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=v(t,z);return e.attributes.position.location=0,e.attributes.id.location=1,e}function h(t){var e=v(t,I);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function f(t){var e=v(t,P);return e.attributes.position.location=0,e}function d(t){var e=t.gl,r=s(e),i=l(e),a=u(e),o=c(e),d=h(e),p=f(e),m=b(e,M(new Uint8Array([255,255,255,255]),[1,1,4]));m.generateMipmap(),m.minFilter=e.LINEAR_MIPMAP_LINEAR,m.magFilter=e.LINEAR;var v=g(e),x=g(e),_=g(e),w=g(e),A=g(e),k=y(e,[{buffer:v,type:e.FLOAT,size:3},{buffer:A,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:x,type:e.FLOAT,size:4},{buffer:_,type:e.FLOAT,size:2},{buffer:w,type:e.FLOAT,size:3}]),T=g(e),S=g(e),E=g(e),L=g(e),C=y(e,[{buffer:T,type:e.FLOAT,size:3},{buffer:L,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:S,type:e.FLOAT,size:4},{buffer:E,type:e.FLOAT,size:2}]),D=g(e),z=g(e),I=g(e),P=g(e),O=g(e),R=y(e,[{buffer:D,type:e.FLOAT,size:3},{buffer:O,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:z,type:e.FLOAT,size:4},{buffer:I,type:e.FLOAT,size:2},{buffer:P,type:e.FLOAT,size:1}]),j=g(e),F=y(e,[{buffer:j,type:e.FLOAT,size:3}]),N=new n(e,m,r,i,a,o,d,p,v,A,x,_,w,k,T,L,S,E,C,D,O,z,I,P,R,j,F);return N.update(t),N}var p=1e-6,m=1e-6,v=t("gl-shader"),g=t("gl-buffer"),y=t("gl-vao"),b=t("gl-texture2d"),x=t("normals"),_=t("gl-mat4/multiply"),w=t("gl-mat4/invert"),M=t("ndarray"),A=t("colormap"),k=t("simplicial-complex-contour"),T=t("typedarray-pool"),S=t("./lib/shaders"),E=t("./lib/closest-point"),L=S.meshShader,C=S.wireShader,D=S.pointShader,z=S.pickShader,I=S.pointPickShader,P=S.contourShader,O=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],R=n.prototype;R.isOpaque=function(){return this.opacity>=1},R.isTransparent=function(){return this.opacity<1},R.pickSlots=1,R.setPickBase=function(t){this.pickId=t},R.highlight=function(t){if(!t||!this.contourEnable)return void(this.contourCount=0);for(var e=k(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=T.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,v=this.positions[f],g=this.positions[d],y=0;y<3;++y)o[s++]=p*v[y]+m*g[y]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),T.free(o)},R.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=b(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=[],v=[],g=[],y=[],_=[],w=[],M=[],A=[];this.cells=r,this.positions=n;var k=t.vertexNormals,T=t.cellNormals,S=void 0===t.vertexNormalsEpsilon?p:t.vertexNormalsEpsilon,E=void 0===t.faceNormalsEpsilon?m:t.faceNormalsEpsilon;t.useFacetNormals&&!T&&(T=x.faceNormals(r,n,E)),T||k||(k=x.vertexNormals(r,n,S));var L=t.vertexColors,C=t.cellColors,D=t.meshColor||[1,1,1,1],z=t.vertexUVs,I=t.vertexIntensity,P=t.cellUVs,O=t.cellIntensity,R=1/0,j=-(1/0);if(!z&&!P)if(I)for(var F=0;F<I.length;++F){var N=I[F];R=Math.min(R,N),j=Math.max(j,N)}else if(O)for(var F=0;F<O.length;++F){var N=O[F];R=Math.min(R,N),j=Math.max(j,N)}else for(var F=0;F<n.length;++F){var N=n[F][2];R=Math.min(R,N),j=Math.max(j,N)}I?this.intensity=I:O?this.intensity=a(r,n.length,O):this.intensity=o(n);var B=t.pointSizes,U=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(var F=0;F<n.length;++F)for(var V=n[F],H=0;H<3;++H)!isNaN(V[H])&&isFinite(V[H])&&(this.bounds[0][H]=Math.min(this.bounds[0][H],V[H]),this.bounds[1][H]=Math.max(this.bounds[1][H],V[H]));var q=0,Y=0,G=0;t:for(var F=0;F<r.length;++F){var W=r[F];switch(W.length){case 1:for(var X=W[0],V=n[X],H=0;H<3;++H)if(isNaN(V[H])||!isFinite(V[H]))continue t;y.push(V[0],V[1],V[2]);var Z;Z=L?L[X]:C?C[F]:D,3===Z.length?_.push(Z[0],Z[1],Z[2],1):_.push(Z[0],Z[1],Z[2],Z[3]);var J;J=z?z[X]:I?[(I[X]-R)/(j-R),0]:P?P[F]:O?[(O[F]-R)/(j-R),0]:[(V[2]-R)/(j-R),0],w.push(J[0],J[1]),B?M.push(B[X]):M.push(U),A.push(F),G+=1;break;case 2:for(var H=0;H<2;++H)for(var X=W[H],V=n[X],Q=0;Q<3;++Q)if(isNaN(V[Q])||!isFinite(V[Q]))continue t;for(var H=0;H<2;++H){var X=W[H],V=n[X];f.push(V[0],V[1],V[2]);var Z;Z=L?L[X]:C?C[F]:D,3===Z.length?d.push(Z[0],Z[1],Z[2],1):d.push(Z[0],Z[1],Z[2],Z[3]);var J;J=z?z[X]:I?[(I[X]-R)/(j-R),0]:P?P[F]:O?[(O[F]-R)/(j-R),0]:[(V[2]-R)/(j-R),0],v.push(J[0],J[1]),g.push(F)}Y+=1;break;case 3:for(var H=0;H<3;++H)for(var X=W[H],V=n[X],Q=0;Q<3;++Q)if(isNaN(V[Q])||!isFinite(V[Q]))continue t;for(var H=0;H<3;++H){var X=W[H],V=n[X];s.push(V[0],V[1],V[2]);var Z;Z=L?L[X]:C?C[F]:D,3===Z.length?l.push(Z[0],Z[1],Z[2],1):l.push(Z[0],Z[1],Z[2],Z[3]);var J;J=z?z[X]:I?[(I[X]-R)/(j-R),0]:P?P[F]:O?[(O[F]-R)/(j-R),0]:[(V[2]-R)/(j-R),0],c.push(J[0],J[1]);var K;K=k?k[X]:T[F],u.push(K[0],K[1],K[2]),h.push(F)}q+=1}}this.pointCount=G,this.edgeCount=Y,this.triangleCount=q,this.pointPositions.update(y),this.pointColors.update(_),this.pointUVs.update(w),this.pointSizes.update(M),this.pointIds.update(new Uint32Array(A)),this.edgePositions.update(f),this.edgeColors.update(d),this.edgeUVs.update(v),this.edgeIds.update(new Uint32Array(g)),this.trianglePositions.update(s),this.triangleColors.update(l),this.triangleUVs.update(c),this.triangleNormals.update(u),this.triangleIds.update(new Uint32Array(h))}},R.drawTransparent=R.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||O,n=t.view||O,i=t.projection||O,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);_(l,s.view,s.model),_(l,s.projection,l),w(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()}},R.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||O,n=t.view||O,i=t.projection||O,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()}},R.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=E(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]]]}},R.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":176,"./lib/shaders":177,colormap:82,"gl-buffer":130,"gl-mat4/invert":154,"gl-mat4/multiply":156,"gl-shader":225,"gl-texture2d":237,"gl-vao":241,ndarray:434,normals:436,"simplicial-complex-contour":483,"typedarray-pool":505}],179:[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,r=a(e,[0,0,0,1,1,0,1,1]),i=o(e,s.boxVert,s.lineFrag);return new n(t,r,i)}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":182,"gl-buffer":130,"gl-shader":185}],180:[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,r=o(e),i=s(e,u.gridVert,u.gridFrag),a=s(e,u.tickVert,u.gridFrag),l=new n(t,r,i,a);return l}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 v=l[m],g=l[m+2],y=g-v,b=.5*(u[m+2]+u[m]),x=u[m+2]-u[m];e[m]=2*y/x,t[m]=2*(v-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,v=s.pixelRatio,g=s.screenBox,y=g[2]-g[0],b=g[3]-g[1],x=m[2]-m[0],_=m[3]-m[1],w=0;w<2;++w){var M=d[w],A=d[w+2],k=A-M,T=.5*(p[w+2]+p[w]),S=p[w+2]-p[w];e[w]=2*k/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,D=s.tickMarkColor,z=0,I=6*h[0].length,P=Math.min(l.ge(h[0],(p[0]-d[0])/(d[2]-d[0]),i),h[0].length),O=Math.min(l.gt(h[0],(p[2]-d[0])/(d[2]-d[0]),i),h[0].length),R=z+6*P,j=6*Math.max(0,O-P),F=Math.min(l.ge(h[1],(p[1]-d[1])/(d[3]-d[1]),i),h[1].length),N=Math.min(l.gt(h[1],(p[3]-d[1])/(d[3]-d[1]),i),h[1].length),B=I+6*F,U=6*Math.max(0,N-F);a[0]=2*(m[0]-L[1])/y-1,a[1]=(m[3]+m[1])/b-1,o[0]=L[1]*v/y,o[1]=C[1]*v/b,U&&(E.color=D[1],E.tickScale=o,E.dataAxis=n,E.screenOffset=a,f.drawArrays(f.TRIANGLES,B,U)),a[0]=(m[2]+m[0])/y-1,a[1]=2*(m[1]-L[0])/b-1,o[0]=C[0]*v/y,o[1]=L[0]*v/b,j&&(E.color=D[0],E.tickScale=o,E.dataAxis=r,E.screenOffset=a,f.drawArrays(f.TRIANGLES,R,j)),a[0]=2*(m[2]+L[3])/y-1,a[1]=(m[3]+m[1])/b-1,o[0]=L[3]*v/y,o[1]=C[3]*v/b,U&&(E.color=D[3],E.tickScale=o,E.dataAxis=n,E.screenOffset=a,f.drawArrays(f.TRIANGLES,B,U)),a[0]=(m[2]+m[0])/y-1,a[1]=2*(m[3]+L[2])/b-1,o[0]=C[2]*v/y,o[1]=L[2]*v/b,j&&(E.color=D[2],E.tickScale=o,E.dataAxis=r,E.screenOffset=a,f.drawArrays(f.TRIANGLES,R,j))}}(),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":182,"binary-search-bounds":184,"gl-buffer":130,"gl-shader":185}],181:[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,r=a(e,[-1,-1,-1,1,1,-1,1,1]),i=o(e,s.lineVert,s.lineFrag),l=new n(t,r,i);return l}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":182,"gl-buffer":130,"gl-shader":185}],182:[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"}},{}],183:[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,r=a(e),i=o(e,u.textVert,u.textFrag),s=new n(t,r,i);return s}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,v=i.tickColor,g=i.tickAngle,y=i.labelEnable,b=i.labelPad,x=i.labelColor,_=i.labelAngle,w=this.labelOffset[n],M=this.labelCount[n],A=l.lt(o,h[n]),k=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],A<k&&s[k]>s[A]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n],a.uniforms.angle=g[n],u.drawArrays(u.TRIANGLES,s[A],s[k]-s[A]))),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],A<k&&s[k]>s[A]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n+2],a.uniforms.angle=g[n+2],u.drawArrays(u.TRIANGLES,s[A],s[k]-s[A]))),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],v=l[u+2],g=v-m,y=s[u],b=s[u+2],x=b-y;e[u]=2*f/p*g/x,t[u]=2*(c-d)/p*g/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,v=d.font||"sans-serif";i=d.fontSize||12;for(var g=1/(u[a+2]-u[a]),y=u[a],b=m.split("\n"),x=0;x<b.length;x++)for(n=s(v,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)*g);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,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":182,"binary-search-bounds":184,"gl-buffer":130,"gl-shader":185,"text-cache":497}],184:[function(t,e,r){arguments[4][74][0].apply(r,arguments)},{dup:74}],185:[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 v=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),v&&v.dispose(),d.fragShader=d._fref.shader,!r||!n){var g=p.createProgram();if(p.attachShader(g,d.fragShader),p.attachShader(g,d.vertShader),p.linkProgram(g),!p.getProgramParameter(g,p.LINK_STATUS)){var y=p.getProgramInfoLog(g);throw new h(y,"Error linking program:"+y)}r=r||c.uniforms(p,g),n=n||c.attributes(p,g),p.deleteProgram(g)}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 A=0|M.type.charAt(M.type.length-1),k=new Array(A),T=0;T<A;++T)k[T]=w.length,_.push(M.name+"["+T+"]"),"number"==typeof M.location?w.push(M.location+T):Array.isArray(M.location)&&M.location.length===A&&"number"==typeof M.location[T]?w.push(0|M.location[T]):w.push(-1);x.push({name:M.name,type:M.type,locations:k})}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":186,"./lib/create-attributes":187,"./lib/create-uniforms":188,"./lib/reflect":189,"./lib/runtime-reflect":190,"./lib/shader-cache":191}],186:[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},{}],187:[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":186}],188:[function(t,e,r){"use strict";function n(t){var e=new Function("y","return function(){return y}");return e(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){var n=new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+r+"])}");return n(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)returnt,e;var r=[];for(var n in e){var i=e[n],a=t;a+=parseInt(n)+""===n?"["+n+"]":"."+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))}n.push("return obj}");var f=new Function("gl","locations",n.join("\n"));return f(t,a)}function f(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;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":186,"./reflect":189}],189:[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]):e?o[c]=n:o[c]=t[n].type}}else s<a.length-1?(l[0]in o||(o[l[0]]={}),o=o[l[0]]):e?o[l[0]]=n:o[l[0]]=t[n].type}return r}e.exports=n},{}],190:[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},{}],191:[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":186,"gl-format-compiler-error":138,"weakmap-shim":526}],192:[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 v=this.borderLineEnable,g=this.borderLineWidth,y=this.borderLineColor;v[1]&&o.drawLine(r[0],r[1]-.5*g[1]*i,r[0],r[3]+.5*g[3]*i,g[1],y[1]),v[0]&&o.drawLine(r[0]-.5*g[0]*i,r[1],r[2]+.5*g[2]*i,r[1],g[0],y[0]),v[3]&&o.drawLine(r[2],r[1]-.5*g[1]*i,r[2],r[3]+.5*g[3]*i,g[3],y[3]),v[2]&&o.drawLine(r[0]-.5*g[0]*i,r[3],r[2]+.5*g[2]*i,r[3],g[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,r=e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3];r&&(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":179,"./lib/grid":180,"./lib/line":181,"./lib/text":183,"gl-select-static":224}],193:[function(t,e,r){var n=t("gl-shader"),i="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}",a="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}";e.exports=function(t){return n(t,i,a,null,[{name:"position",type:"vec2"}])}},{"gl-shader":225}],194:[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&&Y.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*Y.pixelRatio),i=0|Math.ceil(r*Y.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=F.length,r=0;r<e;++r)j[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(j[a]+i<255){R[r]=a,n.setPickBase(j[a]+1),j[a]+=i;continue t}var o=f(k,q);R[r]=e,F.push(o),j.push(i),n.setPickBase(1),e+=1}else R[r]=-1}for(;e>0&&0===j[e-1];)j.pop(),F.pop().dispose()}function s(){return!!Y.contextLost||void(k.isContextLost()&&(Y.contextLost=!0,Y.mouseListener.enabled=!1,Y.selection.object=null,Y.oncontextloss&&Y.oncontextloss()))}function b(){if(!s()){k.colorMask(!0,!0,!0,!0),k.depthMask(!0),k.disable(k.BLEND),k.enable(k.DEPTH_TEST);for(var t=O.length,e=F.length,r=0;r<e;++r){var n=F[r];n.shape=G,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=Y.camera.tick();H.view=Y.camera.matrix,N=N||t,B=B||t,z.pixelRatio=Y.pixelRatio,P.pixelRatio=Y.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=Y.pixelRatio,l.axes=Y.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=Y.bounds;if(Y.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 g=.05*(i[d]-n[d]);n[d]=n[d]-g,i[d]=i[d]+g}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(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})}B=B||y,N=N||y;var _=k.drawingBufferWidth,w=k.drawingBufferHeight;q[0]=_,q[1]=w,G[0]=0|Math.max(_/Y.pixelRatio,1),G[1]=0|Math.max(w/Y.pixelRatio,1),v(U,Y.fovy,_/w,Y.zNear,Y.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)Y.autoScale?V[5*o]=Y.aspect[o]/(m[1][o]-m[0][o]):V[5*o]=1/M,Y.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,Y.clipToBounds&&(l.clipBounds=m)}if(S.object&&(Y.snapToData?P.position=S.dataCoordinate:P.position=S.dataPosition,P.bounds=m),B&&(B=!1,b()),N){Y.axesPixels=c(Y.axes,H,_,w),Y.onrender&&Y.onrender(),k.bindFramebuffer(k.FRAMEBUFFER,null),k.viewport(0,0,_,w);var A=Y.clearColor;k.clearColor(A[0],A[1],A[2],A[3]),k.clear(k.COLOR_BUFFER_BIT|k.DEPTH_BUFFER_BIT),k.depthMask(!0),k.colorMask(!0,!0,!0,!0),k.enable(k.DEPTH_TEST),k.depthFunc(k.LEQUAL),k.disable(k.BLEND),k.disable(k.CULL_FACE);var T=!1;z.enable&&(T=T||z.isTransparent(),z.draw(H)),P.axes=z,S.object&&P.draw(H),k.disable(k.CULL_FACE);for(var o=0;o<r;++o){var l=O[o];l.axes=z,l.pixelRatio=Y.pixelRatio,l.isOpaque&&l.isOpaque()&&l.draw(H),l.isTransparent&&l.isTransparent()&&(T=!0)}if(T){E.shape=q,E.bind(),k.clear(k.DEPTH_BUFFER_BIT),k.colorMask(!1,!1,!1,!1),k.depthMask(!0),k.depthFunc(k.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)}k.enable(k.BLEND),k.blendEquation(k.FUNC_ADD),k.blendFunc(k.ONE,k.ONE_MINUS_SRC_ALPHA),k.colorMask(!0,!0,!0,!0),k.depthMask(!1),k.clearColor(0,0,0,0),k.clear(k.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)}k.bindFramebuffer(k.FRAMEBUFFER,null),k.blendFunc(k.ONE,k.ONE_MINUS_SRC_ALPHA),k.disable(k.DEPTH_TEST),L.bind(),E.color[0].bind(0),L.uniforms.accumBuffer=0,p(k),k.disable(k.BLEND)}N=!1;for(var o=0;o<r;++o)O[o].dirty=!1}}}function _(){w||Y.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 A=t.container;A.appendChild(M)}else document.body.appendChild(M);var k=t.gl;if(k||(k=i(M,t.glOptions||{premultipliedAlpha:!0,antialias:!0})),!k)throw new Error("webgl not supported");var T=t.bounds||[[-10,-10,-10],[10,10,10]],S=new n,E=d(k,[k.drawingBufferWidth,k.drawingBufferHeight],{preferFloat:!y}),L=g(k),C=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:"turntable"},D=t.axes||{},z=u(k,D);z.enable=!D.disable;var I=t.spikes||{},P=h(k,I),O=[],R=[],j=[],F=[],N=!0,B=!0,U=new Array(16),V=new Array(16),H={view:null,projection:U,model:V},B=!0,q=[k.drawingBufferWidth,k.drawingBufferHeight],Y={gl:k,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},G=[k.drawingBufferWidth/Y.pixelRatio|0,k.drawingBufferHeight/Y.pixelRatio|0];Y.autoResize&&e(),window.addEventListener("resize",e),Y.update=function(t){w||(t=t||{},N=!0,B=!0)},Y.add=function(t){w||(t.axes=z,O.push(t),R.push(-1),N=!0,B=!0,r())},Y.remove=function(t){if(!w){var e=O.indexOf(t);e<0||(O.splice(e,1),R.pop(),N=!0,B=!0,r())}},Y.dispose=function(){if(!w&&(w=!0,window.removeEventListener("resize",e),M.removeEventListener("webglcontextlost",s),Y.mouseListener.enabled=!1,!Y.contextLost)){z.dispose(),P.dispose();for(var t=0;t<O.length;++t)O[t].dispose();E.dispose();for(var t=0;t<F.length;++t)F[t].dispose();L.dispose(),k=null,z=null,P=null,O=[]}};var W=!1,X=0;Y.mouseListener=m(M,function(t,e,r){if(!w){var n=F.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=F[s].query(e,G[1]-r-1,Y.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&&Y.onselect&&Y.onselect(S),1&t&&!(1&X)&&Y.onclick&&Y.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 _(),Y.redraw=function(){w||(N=!0,x())},Y}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"),v=t("gl-mat4/perspective"),g=t("./lib/shader"),y=t("is-mobile")()},{"./lib/shader":193,"3d-view-controls":29,"a-big-triangle":31,"gl-axes3d":122,"gl-axes3d/properties":129,"gl-fbo":137,"gl-mat4/perspective":157,"gl-select-static":224,"gl-spikes3d":234,"is-mobile":264,"mouse-change":419}],195:[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"},{}],196:[function(t,e,r){arguments[4][185][0].apply(r,arguments)},{"./lib/GLError":197,"./lib/create-attributes":198,"./lib/create-uniforms":199,"./lib/reflect":200,"./lib/runtime-reflect":201,"./lib/shader-cache":202,dup:185}],197:[function(t,e,r){arguments[4][186][0].apply(r,arguments)},{dup:186}],198:[function(t,e,r){arguments[4][187][0].apply(r,arguments)},{"./GLError":197,dup:187}],199:[function(t,e,r){arguments[4][188][0].apply(r,arguments)},{"./GLError":197,"./reflect":200,dup:188}],200:[function(t,e,r){arguments[4][189][0].apply(r,arguments)},{dup:189}],201:[function(t,e,r){arguments[4][190][0].apply(r,arguments)},{dup:190}],202:[function(t,e,r){arguments[4][191][0].apply(r,arguments)},{"./GLError":197,dup:191,"gl-format-compiler-error":138,"weakmap-shim":526}],203:[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":195,"gl-buffer":130,"gl-shader":196,"typedarray-pool":505}],204:[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],v=r[3];return a=u*d+c*p+h*m+f*v,a<0&&(a=-a,d=-d,p=-p,m=-m,v=-v),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*v,t}e.exports=n},{}],205:[function(t,e,r){"use strict";e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec2 offset;\nattribute vec4 color;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo, pixelScale;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo, vec2 screenScale, vec2 screenOffset) {\n return vec4((posHi + trHi) * scHi\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n + screenScale * screenOffset, 0, 1);\n}\n\nvoid main() {\n fragColor = color;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo,\n pixelScale, offset);\n}\n",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",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec2 offset;\nattribute vec4 id;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo, pixelScale;\nuniform vec4 pickOffset;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo, vec2 screenScale, vec2 screenOffset) {\n return vec4((posHi + trHi) * scHi\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n + screenScale * screenOffset, 0, 1);\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_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo,\n pixelScale, offset);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],206:[function(t,e,r){arguments[4][185][0].apply(r,arguments)},{"./lib/GLError":207,"./lib/create-attributes":208,"./lib/create-uniforms":209,"./lib/reflect":210,"./lib/runtime-reflect":211,"./lib/shader-cache":212,dup:185}],207:[function(t,e,r){arguments[4][186][0].apply(r,arguments)},{dup:186}],208:[function(t,e,r){arguments[4][187][0].apply(r,arguments)},{"./GLError":207,dup:187}],209:[function(t,e,r){arguments[4][188][0].apply(r,arguments)},{"./GLError":207,"./reflect":210,dup:188}],210:[function(t,e,r){arguments[4][189][0].apply(r,arguments)},{dup:189}],211:[function(t,e,r){arguments[4][190][0].apply(r,arguments)},{dup:190}],212:[function(t,e,r){arguments[4][191][0].apply(r,arguments)},{"./GLError":207,dup:191,"gl-format-compiler-error":138,"weakmap-shim":526}],213:[function(t,e,r){"use strict";function n(t){if(t in f)return f[t];var e=c(t,{polygons:!0,font:"sans-serif",textAlign:"left",textBaseline:"alphabetic"}),r=[],n=[];e.forEach(function(t){t.forEach(function(t){for(var e=0;e<t.length;++e){var i=t[(e+t.length-1)%t.length],a=t[e],o=t[(e+1)%t.length],s=t[(e+2)%t.length],l=a[0]-i[0],u=a[1]-i[1],c=Math.sqrt(l*l+u*u);l/=c,u/=c,r.push(i[0],i[1]+1.4),n.push(u,-l),r.push(i[0],i[1]+1.4),n.push(-u,l),r.push(a[0],a[1]+1.4),n.push(-u,l),r.push(a[0],a[1]+1.4),n.push(-u,l),r.push(i[0],i[1]+1.4),n.push(u,-l),r.push(a[0],a[1]+1.4),n.push(u,-l);var h=s[0]-o[0],f=s[1]-o[1],d=Math.sqrt(h*h+f*f);h/=d,f/=d,r.push(a[0],a[1]+1.4),n.push(u,-l),r.push(a[0],a[1]+1.4),n.push(-u,l),r.push(o[0],o[1]+1.4),n.push(-f,h),r.push(o[0],o[1]+1.4),n.push(-f,h),r.push(a[0],a[1]+1.4),n.push(f,-h),r.push(o[0],o[1]+1.4),n.push(f,-h)}})});for(var i=[1/0,1/0,-(1/0),-(1/0)],a=0;a<r.length;a+=2)for(var o=0;o<2;++o)i[o]=Math.min(i[o],r[a+o]),i[2+o]=Math.max(i[2+o],r[a+o]);return f[t]={coords:r,normals:n,bounds:i}}function i(t,e,r,n,i,a,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.posHiBuffer=n,this.posLoBuffer=i,this.offsetBuffer=a,this.colorBuffer=o,this.idBuffer=s,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.numVertices=0,this.pickOffset=0,this.points=null}function a(t,e){var r=t.gl,n=o(r,h.vertex,h.fragment),a=o(r,h.pickVertex,h.pickFragment),l=s(r),u=s(r),c=s(r),f=s(r),d=s(r),p=new i(t,n,a,l,u,c,f,d);return p.update(e),t.addObject(p),p}e.exports=a;var o=t("gl-shader"),s=t("gl-buffer"),l=t("text-cache"),u=t("typedarray-pool"),c=t("vectorize-text"),h=t("./lib/shaders"),f={},d=i.prototype;!function(){function t(){var t=this.plot,o=this.bounds,s=t.viewBox,l=t.dataBox,u=t.pixelRatio,c=o[2]-o[0],h=o[3]-o[1],f=l[2]-l[0],d=l[3]-l[1],p=2*c/f,m=2*h/d,v=(o[0]-l[0]-.5*f)/c,g=(o[1]-l[1]-.5*d)/h;e[0]=p,r[0]=p-e[0],e[1]=m,r[1]=m-e[1],n[0]=v,i[0]=v-n[0],n[1]=g,i[1]=g-n[1];var y=s[2]-s[0],b=s[3]-s[1];a[0]=2*u/y,a[1]=2*u/b}var e=new Float32Array([0,0]),r=new Float32Array([0,0]),n=new Float32Array([0,0]),i=new Float32Array([0,0]),a=[0,0],o=[0,0,0,0];d.drawPick=function(s){var l=void 0!==s,u=this.plot,c=this.numVertices;if(!c)return s;t.call(this);var h=u.gl,f=l?this.pickShader:this.shader;if(f.bind(),l){this.pickOffset=s;for(var d=0;d<4;++d)o[d]=s>>8*d&255;f.uniforms.pickOffset=o,this.idBuffer.bind(),f.attributes.id.pointer(h.UNSIGNED_BYTE,!1)}else this.colorBuffer.bind(),f.attributes.color.pointer(h.UNSIGNED_BYTE,!0);return this.posHiBuffer.bind(),f.attributes.positionHi.pointer(),this.posLoBuffer.bind(),f.attributes.positionLo.pointer(), this.offsetBuffer.bind(),f.attributes.offset.pointer(),f.uniforms.pixelScale=a,f.uniforms.scaleHi=e,f.uniforms.scaleLo=r,f.uniforms.translateHi=n,f.uniforms.translateLo=i,h.drawArrays(h.TRIANGLES,0,c),l?s+this.numPoints:void 0}}(),d.draw=d.drawPick,d.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.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},d.update=function(t){t=t||{};var e,r,i=t.positions||[],a=t.colors||[],o=t.glyphs||[],s=t.sizes||[],c=t.borderWidths||[],h=t.borderColors||[];this.points=i;var f,d,p=this.bounds=[1/0,1/0,-(1/0),-(1/0)],m=0,v=[],g=[];for(e=0;e<o.length;++e)for(f=l("sans-serif",o[e]),d=n(o[e]),v.push(f),g.push(d),m+=f.data.length+d.coords.length>>1,r=0;r<2;++r)p[r]=Math.min(p[r],i[2*e+r]),p[2+r]=Math.max(p[2+r],i[2*e+r]);p[0]===p[2]&&(p[2]+=1),p[3]===p[1]&&(p[3]+=1);var y=1/(p[2]-p[0]),b=1/(p[3]-p[1]),x=p[0],_=p[1],w=u.mallocFloat64(2*m),M=u.mallocFloat32(2*m),A=u.mallocFloat32(2*m),k=u.mallocFloat32(2*m),T=u.mallocUint8(4*m),S=u.mallocUint32(m),E=0;for(e=0;e<o.length;++e){f=v[e],d=g[e];var L=y*(i[2*e]-x),C=b*(i[2*e+1]-_),D=s[e],z=255*a[4*e],I=255*a[4*e+1],P=255*a[4*e+2],O=255*a[4*e+3],R=.5*(d.bounds[0]+d.bounds[2]),j=.5*(d.bounds[1]+d.bounds[3]);for(r=0;r<f.data.length;r+=2)w[2*E]=L,w[2*E+1]=C,k[2*E]=-D*(f.data[r]-R),k[2*E+1]=-D*(f.data[r+1]-j),T[4*E]=z,T[4*E+1]=I,T[4*E+2]=P,T[4*E+3]=O,S[E]=e,E+=1;var F=c[e];for(z=255*h[4*e],I=255*h[4*e+1],P=255*h[4*e+2],O=255*h[4*e+3],r=0;r<d.coords.length;r+=2)w[2*E]=L,w[2*E+1]=C,k[2*E]=-(D*(d.coords[r]-R)+F*d.normals[r]),k[2*E+1]=-(D*(d.coords[r+1]-j)+F*d.normals[r+1]),T[4*E]=z,T[4*E+1]=I,T[4*E+2]=P,T[4*E+3]=O,S[E]=e,E+=1}for(this.numPoints=o.length,this.numVertices=m,M.set(w),e=0;e<w.length;e++)A[e]=w[e]-M[e];this.posHiBuffer.update(M),this.posLoBuffer.update(A),this.offsetBuffer.update(k),this.colorBuffer.update(T),this.idBuffer.update(S),u.free(w),u.free(M),u.free(A),u.free(k),u.free(T),u.free(S)},d.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.posHiBuffer.dispose(),this.posLoBuffer.dispose(),this.offsetBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{"./lib/shaders":205,"gl-buffer":130,"gl-shader":206,"text-cache":497,"typedarray-pool":505,"vectorize-text":518}],214:[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}",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}"},{}],215:[function(t,e,r){arguments[4][74][0].apply(r,arguments)},{dup:74}],216:[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,v=t+m,g=e-m,y=t+e>>1,b=y-m,x=y+m,_=v,w=b,M=y,A=x,k=g,T=t+1,S=e-1,E=0;u(_,w,r,n,d,p)&&(E=_,_=w,w=E),u(A,k,r,n,d,p)&&(E=A,A=k,k=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(_,A,r,n,d,p)&&(E=_,_=A,A=E),u(M,A,r,n,d,p)&&(E=M,M=A,A=E),u(w,k,r,n,d,p)&&(E=w,w=k,k=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(A,k,r,n,d,p)&&(E=A,A=k,k=E);var L=r[w],C=n[2*w],D=n[2*w+1],z=d[w],I=p[w],P=r[A],O=n[2*A],R=n[2*A+1],j=d[A],F=p[A],N=_,B=M,U=k,V=v,H=y,q=g,Y=r[N],G=r[B],W=r[U];r[V]=Y,r[H]=G,r[q]=W;for(var X=0;X<2;++X){var Z=n[2*N+X],J=n[2*B+X],Q=n[2*U+X];n[2*V+X]=Z,n[2*H+X]=J,n[2*q+X]=Q}var K=d[N],$=d[B],tt=d[U];d[V]=K,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,D,z,r,n,d))it!==T&&a(it,T,r,n,d,p),++T;else if(!c(it,P,O,R,j,r,n,d))for(;;){if(c(S,P,O,R,j,r,n,d)){c(S,L,C,D,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,D,z,I,r,n,d,p),l(e,S+1,P,O,R,j,F,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},{}],217:[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 v=i+p*h,g=a+m*h,y=n(t,e,f,u,v,g,v+h,g+h);if(y!==f){if(y-f>=Math.max(.9*d,32)){var b=u+s>>>1;l(v,g,h,f,b,c+1),f=b}l(v,g,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],v=t[2*p+1];c=Math.min(c,m),f=Math.max(f,m),h=Math.min(h,v),d=Math.max(d,v),e[p]=p}c===f&&(f+=1+Math.abs(f)),h===d&&(d+=1+Math.abs(f));var g=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,A=u,_=u-1;_>=0;--_){t[2*_]=(t[2*_]-c)*g,t[2*_+1]=(t[2*_+1]-h)*y;var k=x[_];k!==M&&(w.push(new i(b*Math.pow(.5,k),_+1,A-(_+1))),A=_+1,M=k)}return w.push(new i(b*Math.pow(.5,k+1),0,A)),o.free(x),w}var o=t("typedarray-pool"),s=t("./lib/sort");e.exports=a},{"./lib/sort":216,"typedarray-pool":505}],218:[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}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");e.exports=i;var h=n.prototype,f=new Float32Array(2),d=new Float32Array(2),p=new Float32Array(2),m=new Float32Array(2),v=[0,0,0,0];h.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)},h.update=function(t){function e(e,r){return e in t?t[e]:r}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.xCoords&&u.free(this.xCoords),this.points=t.positions;var r=this.points.length>>>1,n=u.mallocInt32(r),i=u.mallocFloat32(2*r),a=u.mallocFloat64(2*r);a.set(this.points),this.scales=l(a,n,i,this.bounds);var o=u.mallocFloat64(r),s=u.mallocFloat32(2*r),c=u.mallocFloat32(2*r);s.set(a);for(var h=0,f=0;h<r;h++,f+=2)c[f]=a[f]-s[f],c[f+1]=a[f+1]-s[f+1],o[h]=a[f];this.positionBufferHi.update(s),this.positionBufferLo.update(c),this.pickBuffer.update(n),this.weightBuffer.update(i),u.free(n),u.free(a),u.free(s),u.free(c),u.free(i),this.xCoords=o,this.pointCount=r,this.pickOffset=0},h.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,l=this.pickBuffer,u=this.bounds,c=this.size,h=this.borderSize,g=r.gl,y=e?r.pickPixelRatio:r.pixelRatio,b=r.viewBox,x=r.dataBox;if(0===this.pointCount)return t;var _=u[2]-u[0],w=u[3]-u[1],M=x[2]-x[0],A=x[3]-x[1],k=(b[2]-b[0])*y/r.pixelRatio,T=(b[3]-b[1])*y/r.pixelRatio,S=Math.min(M/k,A/T),E=2*_/M,L=2*w/A;f[0]=E,f[1]=L,d[0]=E-f[0],d[1]=L-f[1];var C=(u[0]-x[0]-.5*M)/_,D=(u[1]-x[1]-.5*A)/w;p[0]=C,p[1]=D,m[0]=C-p[0],m[1]=D-p[1],n.bind(),n.uniforms.scaleHi=f,n.uniforms.scaleLo=d,n.uniforms.translateHi=p,n.uniforms.translateLo=m,n.uniforms.color=this.color,n.uniforms.borderColor=this.borderColor,n.uniforms.pointSize=y*(c+h),n.uniforms.centerFraction=0===this.borderSize?2:c/(c+h+1.25),a.bind(),n.attributes.positionHi.pointer(),o.bind(),n.attributes.positionLo.pointer(),e?(this.pickOffset=t,v[0]=255&t,v[1]=t>>8&255,v[2]=t>>16&255,v[3]=t>>24&255,n.uniforms.pickOffset=v,l.bind(),n.attributes.pickId.pointer(g.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());for(var z=this.xCoords,I=(x[0]-u[0]-S*c*y)/_,P=(x[2]-u[0]+S*c*y)/_,O=!0,R=i.length-1;R>=0;R--){var j=i[R];if(!(j.pixelSize<S&&R>1)){var F=j.offset,N=j.count+F,B=s.ge(z,I,F,N-1),U=s.lt(z,P,B,N-1)+1;U>B&&g.drawArrays(g.POINTS,B,U-B),!e&&O&&(O=!1,n.uniforms.useWeight=0)}}return t+this.pointCount},h.drawPick=h.draw,h.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":214,"binary-search-bounds":215,"gl-buffer":130,"gl-shader":225,"snap-points-2d":217,"typedarray-pool":505}],219:[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":518}],220:[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},v={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,v)}},{"gl-shader":225}],221:[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,v=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=v,d.screenSize=w,d.highlightId=e.highlightId,d.highlightScale=e.highlightScale,d.clipBounds=b,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][_],g(L,p,L),d.model=L;var D=(_+1)%3,z=(_+2)%3,I=s(M),P=s(A);I[D]=1,P[z]=1;var O=i(v,m,p,l(k,I)),R=i(v,m,p,l(T,P));if(Math.abs(O[1])>Math.abs(R[1])){var j=O;O=R,R=j,j=I,I=P,P=j;var F=D;D=z,z=F}O[0]<0&&(I[D]=-1),R[1]>0&&(P[z]=-1);for(var N=0,B=0,C=0;C<4;++C)N+=Math.pow(p[4*D+C],2),B+=Math.pow(p[4*z+C],2);I[D]/=Math.sqrt(N),P[z]/=Math.sqrt(B),d.axes[0]=I,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}]),v=new o(e,r,n,i,u,c,h,f,d,a,s,l);return v.update(t),v}var p=t("gl-buffer"),m=t("gl-vao"),v=t("typedarray-pool"),g=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],A=[0,0,0],k=[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],D=[1e8,1e8,1e8],z=[C,D];_.draw=function(t){var e=this.useOrtho?this.orthoShader:this.shader;f(e,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){var e=this.useOrtho?this.orthoShader:this.shader;f(e,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){var e=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;f(e,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,g=n.length;t:for(var y=0;y<g;++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],A=w[1],k=w[2];p+=3*M.cells.length,m+=2*A.edges.length}var T=p+m,S=v.mallocFloat(3*T),E=v.mallocFloat(4*T),L=v.mallocFloat(2*T),C=v.mallocUint32(T),D=[0,a[1]],z=0,I=p,P=[0,0,0,1],O=[0,0,0,1],R=Array.isArray(u)&&Array.isArray(u[0]),j=Array.isArray(f)&&Array.isArray(f[0]);t:for(var y=0;y<g;++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],A=w[1],k=w[2];if(Array.isArray(u)){var F;if(F=R?u[y]:u,3===F.length){for(var _=0;_<3;++_)P[_]=F[_];P[3]=1}else if(4===F.length)for(var _=0;_<4;++_)P[_]=F[_]}else P[0]=P[1]=P[2]=0,P[3]=1;if(Array.isArray(f)){var F;if(F=j?f[y]:f,3===F.length){for(var _=0;_<3;++_)O[_]=F[_];O[_]=1}else if(4===F.length)for(var _=0;_<4;++_)O[_]=F[_]}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?D[0]=a[0]*(1+k[1][0]):a[0]>0&&(D[0]=-a[0]*(1+k[0][0]));for(var H=M.cells,q=M.positions,_=0;_<H.length;++_)for(var Y=H[_],G=0;G<3;++G){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[Y[G]];L[2*z]=N*(U*X[0]-V*X[1]+D[0]),L[2*z+1]=N*(V*X[0]+U*X[1]+D[1]),z+=1}for(var H=A.edges,q=A.positions,_=0;_<H.length;++_)for(var Y=H[_],G=0;G<2;++G){for(var W=0;W<3;++W)S[3*I+W]=x[W];for(var W=0;W<4;++W)E[4*I+W]=O[W];C[I]=d;var X=q[Y[G]];L[2*I]=N*(U*X[0]-V*X[1]+D[0]),L[2*I+1]=N*(V*X[0]+U*X[1]+D[1]),I+=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)),v.free(S),v.free(E),v.free(L),v.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":219,"./lib/shaders":220,"gl-buffer":130,"gl-mat4/multiply":156,"gl-vao":241,"typedarray-pool":505}],222:[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"},{}],223:[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],v=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,v,i),o.drawBox(d,f,m,p,i)),this.innerFill&&o.drawBox(h,f,d,p,n),r>0){var g=r*c;o.drawBox(h-g,f-g,d+g,f+g,a),o.drawBox(h-g,p-g,d+g,p+g,a),o.drawBox(h-g,f-g,h+g,p+g,a),o.drawBox(d-g,f-g,d+g,p+g,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":222,"gl-buffer":130,"gl-shader":225}],224:[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){var r=o(t,e),n=s.mallocUint8(e[0]*e[1]*4);return new i(t,r,n)}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_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_f<this_closestD2&&(this_closestD2=_inline_46_f,this_closestX=_inline_46_arg6_[0],this_closestY=_inline_46_arg6_[1])}}",args:[{name:"_inline_46_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg4_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg5_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg6_",lvalue:!1,rvalue:!0,count:4}],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:["_inline_46_a","_inline_46_f","_inline_46_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];if(p<0||Math.pow(this.radius,2)<d[2])return null;var v=f.get(p,m,0),g=f.get(p,m,1),y=f.get(p,m,2),b=f.get(p,m,3);return new n(p+a|0,m+s|0,v,[g,y,b],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":57,"cwise/lib/wrapper":96,"gl-fbo":137,ndarray:434,"typedarray-pool":505}],225:[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 v=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),v&&v.dispose(),d.fragShader=d._fref.shader,!r||!n){var g=p.createProgram();if(p.attachShader(g,d.fragShader),p.attachShader(g,d.vertShader),p.linkProgram(g),!p.getProgramParameter(g,p.LINK_STATUS)){var y=p.getProgramInfoLog(g);throw new h(y,"Error linking program:"+y)}r=r||c.uniforms(p,g),n=n||c.attributes(p,g),p.deleteProgram(g)}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 A=0|M.type.charAt(M.type.length-1),k=new Array(A),T=0;T<A;++T)k[T]=_.length,x.push(M.name+"["+T+"]"),"number"==typeof M.location?_.push(M.location+T):Array.isArray(M.location)&&M.location.length===A&&"number"==typeof M.location[T]?_.push(0|M.location[T]):_.push(-1);b.push({name:M.name,type:M.type,locations:k})}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":226,"./lib/create-attributes":227,"./lib/create-uniforms":228,"./lib/reflect":229,"./lib/runtime-reflect":230,"./lib/shader-cache":231}],226:[function(t,e,r){arguments[4][186][0].apply(r,arguments)},{dup:186}],227:[function(t,e,r){arguments[4][187][0].apply(r,arguments)},{"./GLError":226,dup:187}],228:[function(t,e,r){arguments[4][188][0].apply(r,arguments)},{"./GLError":226,"./reflect":229,dup:188}],229:[function(t,e,r){arguments[4][189][0].apply(r,arguments)},{dup:189}],230:[function(t,e,r){arguments[4][190][0].apply(r,arguments)},{dup:190}],231:[function(t,e,r){arguments[4][191][0].apply(r,arguments)},{"./GLError":226,dup:191,"gl-format-compiler-error":138,"weakmap-shim":526}],232:[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)}},{}],233:[function(t,e,r){"use strict";var n=t("gl-shader"),i="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",a="precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}";e.exports=function(t){return n(t,i,a,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":225}],234:[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":233,"gl-buffer":130,"gl-vao":241}],235:[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 = beckmannSpecular_1_1(L, V, N, roughness);\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":225}],236:[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=[_(g.mallocFloat(1024),[0,0]),_(g.mallocFloat(1024),[0,0]),_(g.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||F,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||I,n.view=t.view||I,n.projection=t.projection||I,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=A(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),A(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=D(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=v(e,1,R,e.RGBA,e.UNSIGNED_BYTE);d.minFilter=e.LINEAR,d.magFilter=e.LINEAR;var g=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",g.update(y),g}e.exports=f;var d=t("bit-twiddle"),p=t("gl-buffer"),m=t("gl-vao"),v=t("gl-texture2d"),g=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"),A=t("gl-mat4/invert"),k=t("binary-search-bounds"),T=t("ndarray-gradient"),S=t("./lib/shaders"),E=S.createShader,L=S.createContourShader,C=S.createPickShader,D=S.createPickContourShader,z=40,I=[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,j=a.prototype;j.isTransparent=function(){return this.opacity<1},j.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},j.pickSlots=1,j.setPickBase=function(t){this.pickId=t};var F=[0,0,0],N={showSurface:!1,showContour:!1,projections:[I.slice(),I.slice(),I.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:I,view:I,projection:I,inverseModel:I.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=I.slice(),V=[1,0,0,0,1,0,0,0,1];j.draw=function(t){return s.call(this,t,!1)},j.drawTransparent=function(t){return s.call(this,t,!0)};var H={model:I,view:I,projection:I,inverseModel:I,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]};j.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=H;r.model=t.model||I,r.view=t.view||I,r.projection=t.projection||I,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()}},j.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,v=h*d,g=0;g<3;++g)u[g]+=this._field[g].get(p,m)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=k.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],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},j.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&&(g.freeFloat(this._field[2].data),this._field[2].data=g.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&&(g.freeFloat(this._field[o].data),this._field[o].data=g.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 v=[0,0];v[o]=1,this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2],v,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=_(g.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=_(g.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 A=x.get(0,o,y,0),k=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),D=S*C-E*L,z=L*k-C*A,I=A*E-k*S,O=Math.sqrt(D*D+z*z+I*I);O<1e-8?(O=Math.max(Math.abs(D),Math.abs(z),Math.abs(I)),O<1e-8?(I=1,z=D=0,O=1):O=1/O):O=1/Math.sqrt(O),M.set(o,y,0,D*O),M.set(o,y,1,z*O),M.set(o,y,2,I*O)}g.free(x.data);var R=[1/0,1/0,1/0],j=[-(1/0),-(1/0),-(1/0)],F=1/0,N=-(1/0),B=(a[0]-1)*(a[1]-1)*6,U=g.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 Y=0;Y<2;++Y)for(var G=0;G<3;++G){var W=this._field[G].get(1+o+q,1+y+Y);if(isNaN(W)||!isFinite(W))continue t}for(G=0;G<6;++G){var X=o+P[G][0],Z=y+P[G][1],J=this._field[0].get(X+1,Z+1),Q=this._field[1].get(X+1,Z+1);W=this._field[2].get(X+1,Z+1);var K=W;D=M.get(X+1,Z+1,0),z=M.get(X+1,Z+1,1),I=M.get(X+1,Z+1,2),t.intensity&&(K=t.intensity.get(X,Z)),U[V++]=X,U[V++]=Z,U[V++]=J,U[V++]=Q,U[V++]=W,U[V++]=0,U[V++]=K,U[V++]=D,U[V++]=z,U[V++]=I,R[0]=Math.min(R[0],J),R[1]=Math.min(R[1],Q),R[2]=Math.min(R[2],W),F=Math.min(F,K),j[0]=Math.max(j[0],J),j[1]=Math.max(j[1],Q),j[2]=Math.max(j[2],W),N=Math.max(N,K),H+=1}}for(t.intensityBounds&&(F=+t.intensityBounds[0],N=+t.intensityBounds[1]),o=6;o<V;o+=10)U[o]=(U[o]-F)/(N-F);this._vertexCount=H,this._coordinateBuffer.update(U.subarray(0,V)),g.freeFloat(U),g.free(M.data),this.bounds=[R,j],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===F&&this.intensityBounds[1]===N||(r=!0),this.intensityBounds=[F,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(G=0;G<2;++G){var st=at.positions[ot[G]],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 vt=(et+mt+1)%3;for(q=0;q<2;++q){var gt=q?ct:1-ct;for(X=0|Math.min(Math.max(ut+q,0),a[0]),Y=0;Y<2;++Y){var yt=Y?dt:1-dt;if(Z=0|Math.min(Math.max(ft+Y,0),a[1]),W=mt<2?this._field[vt].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=gt*yt;it[mt]+=bt*W}}}if(pt){if(G>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=g.mallocFloat(tt.length);for(o=0;o<tt.length;++o)_t[o]=tt[o];this._contourBuffer.update(_t),g.freeFloat(_t)}t.colormap&&this._colorMap.setPixels(i(t.colormap))},j.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)g.freeFloat(this._field[t].data)},j.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=g.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],v=0;v<2;++v){var y=p[m[v]],b=+y[0],x=0|b,_=0|Math.min(x+1,i[0]),M=b-x,A=1-M,k=+y[1],T=0|k,S=0|Math.min(T+1,i[1]),E=k-T,L=1-E,C=A*L,D=A*E,z=M*L,I=M*E,P=C*c.get(x,T)+D*c.get(x,S)+z*c.get(_,T)+I*c.get(_,S),O=C*h.get(x,T)+D*h.get(x,S)+z*h.get(_,T)+I*h.get(_,S);if(isNaN(P)||isNaN(O)){v&&(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)),g.freeFloat(a)}}},{"./lib/shaders":235,"binary-search-bounds":56,"bit-twiddle":57,colormap:82,"gl-buffer":130,"gl-mat4/invert":154,"gl-mat4/multiply":156,"gl-texture2d":237,"gl-vao":241,ndarray:434,"ndarray-gradient":425,"ndarray-ops":428,"ndarray-pack":429,"surface-nets":496,"typedarray-pool":505}],237:[function(t,e,r){"use strict";function n(t){g=[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");var g=1;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}g=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 y=l.size,b=o.indexOf(n)<0;if(b&&o.push(n),h===a&&d)0===l.offset&&l.data.length===y?b?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):b?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var _;_=a===t.FLOAT?v.mallocFloat32(y):v.mallocUint8(y);var w=p(_,c,[c[2],c[2]*c[0],1]);h===t.FLOAT&&a===t.UNSIGNED_BYTE?x(w,l):m.assign(w,l),b?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,_.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,_.subarray(0,y)),a===t.FLOAT?v.freeFloat32(_):v.freeUint8(_)}}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){var i=u(t);return t.texImage2D(t.TEXTURE_2D,0,r,r,n,e),new o(t,i,0|e.width,0|e.height,r,n)}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 g=[n[2],n[2]*n[0],1];f=v.malloc(d,r);var y=p(f,n,g,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||v.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(g||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];if(i(e))return h(t,e,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"),v=t("typedarray-pool");e.exports=d;var g=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&&g.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&&g.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;if(this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0,i(t)){var o=this._mipLevels.indexOf(n)<0;o?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,t),this._mipLevels.push(n)):a.texSubImage2D(a.TEXTURE_2D,n,e,r,this.format,this.type,t)}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:434,"ndarray-ops":428,"typedarray-pool":505}],238:[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},{}],239:[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":238}],240:[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":238}],241:[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":239,"./lib/vao-native.js":240}],242:[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},{}],243:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],244:[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},{}],245:[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},{}],246:[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},{}],247:[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},{}],248:[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)},{}],249:[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":38,"glsl-tokenizer":256}],250:[function(t,e,r){function n(t){function e(t){t.length&&V.push({type:M[B],data:t,position:Y,line:H,column:q})}function r(t){F=0,X+=t,j=X.length;for(var e;O=X[F],F<j;){switch(e=F,B){case h:F=E();break;case f:F=S();break;case d:F=T();break;case p:F=L();break;case m:F=z();break;case w:F=D();break;case v:F=I();break;case c:F=P();break;case x:F=k();break;case u:F=A()}if(e!==F)switch(X[e]){case"\n":q=0,++H;break;default:++q}}return N+=F,X=X.slice(F),V}function n(t){return U.length&&e(U.join("")),B=_,e("(eof)"),V}function A(){return U=U.length?[]:U,"/"===R&&"*"===O?(Y=N+F-1,B=h,R=O,F+1):"/"===R&&"/"===O?(Y=N+F-1,B=f,R=O,F+1):"#"===O?(B=d,Y=N+F,F):/\s/.test(O)?(B=x,Y=N+F,F):(G=/\d/.test(O),W=/[^\w_]/.test(O),Y=N+F,B=G?m:W?p:c,F)}function k(){return/[^\s]/g.test(O)?(e(U.join("")),B=u,F):(U.push(O),R=O,F+1)}function T(){return"\r"!==O&&"\n"!==O||"\\"===R?(U.push(O),R=O,F+1):(e(U.join("")),B=u,F)}function S(){return T()}function E(){return"/"===O&&"*"===R?(U.push(O),e(U.join("")),B=u,F+1):(U.push(O),R=O,F+1)}function L(){if("."===R&&/\d/.test(O))return B=v,F;if("/"===R&&"*"===O)return B=h,F;if("/"===R&&"/"===O)return B=f,F;if("."===O&&U.length){for(;C(U););return B=v,F}if(";"===O||")"===O||"("===O){if(U.length)for(;C(U););return e(O),B=u,F+1}var t=2===U.length&&"="!==O;if(/[\w_\d\s]/.test(O)||t){for(;C(U););return B=u,F}return U.push(O),R=O,F+1}function C(t){for(var r,n,i=0;;){if(r=a.indexOf(t.slice(0,t.length+i).join("")),n=a[r],r===-1){if(i--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),Y+=n.length,U=U.slice(n.length),U.length}}function D(){return/[^a-fA-F0-9]/.test(O)?(e(U.join("")),B=u,F):(U.push(O),R=O,F+1)}function z(){return"."===O?(U.push(O),B=v,R=O,F+1):/[eE]/.test(O)?(U.push(O),B=v,R=O,F+1):"x"===O&&1===U.length&&"0"===U[0]?(B=w,U.push(O),R=O,F+1):/[^\d]/.test(O)?(e(U.join("")),B=u,F):(U.push(O),R=O,F+1)}function I(){return"f"===O&&(U.push(O),R=O,F+=1),/[eE]/.test(O)?(U.push(O),R=O,F+1):"-"===O&&/[eE]/.test(R)?(U.push(O),R=O,F+1):/[^\d]/.test(O)?(e(U.join("")),B=u,F):(U.push(O),R=O,F+1)}function P(){if(/[^\d\w_]/.test(O)){var t=U.join("");return B=J.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:g,e(U.join("")),B=u,F}return U.push(O),R=O,F+1}var O,R,j,F=0,N=0,B=u,U=[],V=[],H=1,q=0,Y=0,G=!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,v=5,g=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":252,"./lib/builtins-300es":251,"./lib/literals":254,"./lib/literals-300es":253,"./lib/operators":255}],251:[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":252}],252:[function(t,e,r){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"]},{}],253:[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":254}],254:[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"]},{}],255:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],256:[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":250}],257:[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}},{}],258:[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:(d?-1:1)*(1/0);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}},{}],259:[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 v=p[0];p[0]=p[1],p[1]=v;var g=new n(p,new Array(i+1),!0);f[c]=g,d[c]=g}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];f<0?i[h]=e:i[h]=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 v=0;v<=o;++v)if(v!==m){var g=p[v];if(g.boundary&&!(g.lastVisited>=r)){var y=g.vertices;if(g.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,g.boundary=!1,u.push(g),h.push(g),g.lastVisited=r;continue}g.lastVisited=-r}var w=g.adjacent,M=d.slice(),A=p.slice(),k=new n(M,A,!0);c.push(k);var T=w.indexOf(e);if(!(T<0)){w[T]=k,A[m]=g,M[v]=-1,A[v]=e,p[v]=k,k.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 D=M[C];D<0||C===x||(E[L++]=D)}f.push(new i(E,k,x))}}}}}}f.sort(a);for(var v=0;v+1<f.length;v+=2){var z=f[v],I=f[v+1],P=z.index,O=I.index;P<0||O<0||(z.cell.adjacent[z.index]=I.cell,I.cell.adjacent[I.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];s<0?a[o]=t:a[o]=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":474,"simplicial-complex":485}],260:[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?r:t[1]-e[1]}function d(t,e){var r=t[1]-e[1];return r?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 v(t){return new m(t&&0!==t.length?p(t):null)}var g=t("binary-search-bounds"),y=0,b=1,x=2;e.exports=v;var _=n.prototype;_.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},_.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=g.ge(this.leftPoints,t,f),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},_.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){if(!this.left)return y;var r=this.right?this.right.count:0;if(4*r>3*(e-1))return s(this,t);var n=this.left.remove(t);return n===x?(this.left=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(t[0]>this.mid){if(!this.right)return y;var a=this.left?this.left.count:0;if(4*a>3*(e-1))return s(this,t);var n=this.right.remove(t);return n===x?(this.right=null,this.count-=1,b):(n===b&&(this.count-=1),n)}if(1===this.count)return this.leftPoints[0]===t?x:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){ if(this.left&&this.right){for(var o=this,l=this.left;l.right;)o=l,l=l.right;if(o===this)l.right=this.right;else{var u=this.left,n=this.right;o.count-=l.count,o.right=l.left,l.left=u,l.right=n}i(this,l),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 u=g.ge(this.leftPoints,t,f);u<this.leftPoints.length&&this.leftPoints[u][0]===t[0];++u)if(this.leftPoints[u]===t){this.count-=1,this.leftPoints.splice(u,1);for(var n=g.ge(this.rightPoints,t,d);n<this.rightPoints.length&&this.rightPoints[n][1]===t[1];++n)if(this.rightPoints[n]===t)return this.rightPoints.splice(n,1),b}return y},_.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)},_.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 w=m.prototype;w.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},w.remove=function(t){if(this.root){var e=this.root.remove(t);return e===x&&(this.root=null),e!==y}return!1},w.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},w.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":56}],261:[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},{}],262:[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},{}],263:[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)}},{}],264:[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},{}],265:[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":266,"./sort":267,"./within":268}],266:[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 v=(h+1)%2;(0===h?r<=s:n<=l)&&(u.push(d),u.push(m-1),u.push(v)),(0===h?i>=s:a>=l)&&(u.push(m+1),u.push(f),u.push(v))}}return c}e.exports=n},{}],267:[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),d=Math.max(n,Math.floor(r-u*h/l+f)),p=Math.min(o,Math.floor(r+(l-u)*h/l+f));i(t,e,r,d,p,s)}var m=e[2*r+s],v=n,g=o;for(a(t,e,n,r),e[2*o+s]>m&&a(t,e,n,o);v<g;){for(a(t,e,v,g),v++,g--;e[2*v+s]<m;)v++;for(;e[2*g+s]>m;)g--}e[2*n+s]===m?a(t,e,n,g):(g++,a(t,e,g,o)),g<=r&&(n=g+1),r<=g&&(o=g-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},{}],268:[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],v=e[2*p+1];i(m,v,r,n)<=u&&l.push(t[p]);var g=(c+1)%2;(0===c?r-a<=m:n-a<=v)&&(s.push(f),s.push(p-1),s.push(g)),(0===c?r+a>=m:n+a>=v)&&(s.push(p+1),s.push(h),s.push(g))}}return l}function i(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=n},{}],269:[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=[],v=0;v<t.stops.length;v++){var g=t.stops[v];void 0===p[g[0].zoom]&&(p[g[0].zoom]={zoom:g[0].zoom,type:t.type,property:t.property,stops:[]}),p[g[0].zoom].stops.push([g[0].value,g[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")}},{}],270:[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:{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:442}],271:[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:513}],272:[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}},{}],273:[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}},{}],274:[function(t,e,r){"use strict";e.exports=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}},{}],275:[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":271,"../util/extend":272,"../util/get_type":273,"./validate_array":276,"./validate_boolean":277,"./validate_color":278,"./validate_constants":279,"./validate_enum":280,"./validate_filter":281,"./validate_function":282,"./validate_layer":284,"./validate_number":286,"./validate_object":287,"./validate_source":289,"./validate_string":290}],276:[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":271,"../util/get_type":273,"./validate":275}],277:[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":271,"../util/get_type":273}],278:[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":271,"../util/get_type":273,csscolorparser:91}],279:[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,a=t.styleSpec;if(a.$version>7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var o=i(r);if("object"!==o)return[new n(e,r,"object expected, %s found",o)];var s=[];for(var l in r)"@"!==l[0]&&s.push(new n(e+"."+l,r[l],'constants must start with "@"'));return s}},{"../error/validation_error":271,"../util/get_type":273}],280:[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 a.values.indexOf(i(r))===-1&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":271,"../util/unbundle_jsonlint":274}],281:[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":271,"../util/get_type":273,"../util/unbundle_jsonlint":274,"./validate_enum":280}],282:[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":271,"../util/get_type":273,"./validate":275,"./validate_array":276,"./validate_number":286,"./validate_object":287}],283:[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:(e.indexOf("{fontstack}")===-1&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":271,"./validate_string":290}],284:[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 v=h.layers[m];i(v.id)===i(r.id)&&e.push(new n(c,r.id,'duplicate layer id "%s", previously used at line %d',r.id,v.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 g;h.layers.forEach(function(t){t.id==p&&(g=t)}),g?g.ref?e.push(new n(c,r.ref,"ref cannot reference another ref layer")):d=i(g.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":271,"../util/extend":272,"../util/unbundle_jsonlint":274,"./validate_filter":281,"./validate_layout_property":285,"./validate_object":287,"./validate_paint_property":288}],285:[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":271,"./validate":275}],286:[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":271,"../util/get_type":273}],287:[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":271,"../util/get_type":273,"./validate":275}],288:[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":271,"./validate":275}],289:[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')];var u=i(e.type);switch(u){case"vector":case"raster":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var h in e)["type","url","tileSize"].indexOf(h)<0&&c.push(new n(r+"."+h,e[h],'a source with a "url" property may not include a "%s" property',h));return c;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":271,"../util/unbundle_jsonlint":274,"./validate_enum":280,"./validate_object":287}],290:[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":271,"../util/get_type":273}],291:[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":292,"./validate/validate":275,"./validate/validate_constants":279,"./validate/validate_filter":281,"./validate/validate_glyphs_url":283,"./validate/validate_layer":284,"./validate/validate_layout_property":285,"./validate/validate_paint_property":288,"./validate/validate_source":289}],292:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":293}],293:[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"}}}},{}],294:[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)}"undefined"!=typeof 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}},{}],295:[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":409}],296:[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++){var s=t.childLayers[i];n[s.id]={attributes:[],uniforms:[],defines:[],vertexPragmas:{define:{},initialize:{}},fragmentPragmas:{define:{},initialize:{}}}}var l=t.programInterfaces[r];if(l.paintAttributes)for(var u="{precision}",h="{type}",d=0;d<l.paintAttributes.length;d++){var p=l.paintAttributes[d];p.multiplier=p.multiplier||1;for(var m=0;m<t.childLayers.length;m++){var v=t.childLayers[m],g=n[v.id],y=p.name;f("a_"===p.name.slice(0,2));var b,x=p.name.slice(2);if(g.fragmentPragmas.initialize[x]="",v.isPaintValueFeatureConstant(p.paintProperty))g.uniforms.push(p),g.fragmentPragmas.define[x]=g.vertexPragmas.define[x]=["uniform",u,h,y].join(" ")+";",g.fragmentPragmas.initialize[x]=g.vertexPragmas.initialize[x]=[u,h,x,"=",y].join(" ")+";\n";else if(v.isPaintValueZoomConstant(p.paintProperty)){g.attributes.push(c.extend({},p,{name:y})),b=["varying",u,h,x].join(" ")+";\n";var _=[g.fragmentPragmas.define[x],"attribute",u,h,y].join(" ")+";\n";g.fragmentPragmas.define[x]=b,g.vertexPragmas.define[x]=b+_,g.vertexPragmas.initialize[x]=[x,"=",y,"/",p.multiplier.toFixed(1)].join(" ")+";\n"}else{for(var w="u_"+y.slice(2)+"_t",M=v.getPaintValueStopZoomLevels(p.paintProperty),A=0;A<M.length&&M[A]<t.zoom;)A++;for(var k=Math.max(0,Math.min(M.length-4,A-2)),T=[],S=0;S<4;S++)T.push(M[Math.min(k+S,M.length-1)]);b=["varying",u,h,x].join(" ")+";\n",g.vertexPragmas.define[x]=b+["uniform","lowp","float",w].join(" ")+";\n",g.fragmentPragmas.define[x]=b,g.uniforms.push(c.extend({},p,{name:w,getValue:o(p,k),components:1}));var E=p.components;if(1===E)g.attributes.push(c.extend({},p,{getValue:a(p,T),isFunction:!0,components:4*E})),g.vertexPragmas.define[x]+=["attribute",u,"vec4",y].join(" ")+";\n",g.vertexPragmas.initialize[x]=[x,"=","evaluate_zoom_function_1("+y+", "+w+")","/",p.multiplier.toFixed(1)].join(" ")+";\n";else{for(var L=[],C=0;C<4;C++)L.push(y+C),g.attributes.push(c.extend({},p,{getValue:a(p,[T[C]]),isFunction:!0,name:y+C})),g.vertexPragmas.define[x]+=["attribute",u,h,y+C].join(" ")+";\n";g.vertexPragmas.initialize[x]=[x," = ","evaluate_zoom_function_4("+L.join(", ")+", "+w+")","/",p.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){var r={fill:t("./bucket/fill_bucket"),line:t("./bucket/line_bucket"),circle:t("./bucket/circle_bucket"),symbol:t("./bucket/symbol_bucket")};return new r[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),v=p.multiplier||1,g=p.components||1,y=l===n.index?i:0,b=y;b<c;b++)for(var x=h.get(b),_=0;_<g;_++){var w=g>1?p.name+_:p.name;x[w]=m[_]*v}}},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":407,"../util/util":409,"./array_group":295,"./bucket/circle_bucket":297,"./bucket/fill_bucket":298,"./bucket/line_bucket":299,"./bucket/symbol_bucket":300,"./buffer_group":302,assert:37,"feature-filter":107}],297:[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":409,"../bucket":296,"../load_geometry":304}],298:[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"),u=500;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,u),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":397,"../../util/util":409,"../bucket":296,"../load_geometry":304,earcut:101}],299:[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=63,u=Math.cos(37.5*(Math.PI/180)),c=15,h=15,f=.5,d=Math.pow(2,h-1)/f;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(l*r.x)+128,Math.round(l*r.y)+128,(0===a?0:a<0?-1:1)+1|(o*f&63)<<2,o*f>>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,h),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=c*(s/(512*this.overscaling)),l=t[0],h=t[a-1],f=l.equals(h);if(this.prepareArrayGroup("line",10*a),2!==a||!f){this.distance=0;var d,p,m,v,g,y,b,x=r,_=f?"butt":r,w=!0;this.e1=this.e2=this.e3=-1,f&&(d=t[a-2],g=l.sub(d)._unit()._perp());for(var M=0;M<a;M++)if(m=f&&M===a-1?t[1]:t[M+1],!m||!t[M].equals(m)){g&&(v=g),d&&(p=d),d=t[M],g=m?m.sub(d)._unit()._perp():v,v=v||g;var A=v.add(g)._unit(),k=A.x*g.x+A.y*g.y,T=1/k,S=k<u&&p&&m;if(S&&M>0){var E=d.dist(p);if(E>2*o){var L=d.sub(d.sub(p)._mult(o/E)._round());this.distance+=L.dist(p),this.addCurrentVertex(L,this.distance,v.mult(1),0,0,!1),p=L}}var C=p&&m,D=C?e:m?x:_;if(C&&"round"===D&&(T<i?D="miter":T<=2&&(D="fakeround")),"miter"===D&&T>n&&(D="bevel"),"bevel"===D&&(T>2&&(D="flipbevel"),T<n&&(D="miter")),p&&(this.distance+=d.dist(p)),"miter"===D)A._mult(T),this.addCurrentVertex(d,this.distance,A,0,0,!1);else if("flipbevel"===D){if(T>100)A=g.clone();else{var z=v.x*g.y-v.y*g.x>0?-1:1,I=T*v.add(g).mag()/v.sub(g).mag();A._perp()._mult(I*z)}this.addCurrentVertex(d,this.distance,A,0,0,!1),this.addCurrentVertex(d,this.distance,A.mult(-1),0,0,!1)}else if("bevel"===D||"fakeround"===D){var P=v.x*g.y-v.y*g.x>0,O=-Math.sqrt(T*T-1);if(P?(b=0,y=O):(y=0,b=O),w||this.addCurrentVertex(d,this.distance,v,y,b,!1),"fakeround"===D){for(var R,j=Math.floor(8*(.5-(k-.5))),F=0;F<j;F++)R=g.mult((F+1)/(j+1))._add(v)._unit(),this.addPieSliceVertex(d,this.distance,R,P);this.addPieSliceVertex(d,this.distance,A,P);for(var N=j-1;N>=0;N--)R=v.mult((N+1)/(j+1))._add(g)._unit(),this.addPieSliceVertex(d,this.distance,R,P)}m&&this.addCurrentVertex(d,this.distance,g,-y,-b,!1)}else"butt"===D?(w||this.addCurrentVertex(d,this.distance,v,0,0,!1),m&&this.addCurrentVertex(d,this.distance,g,0,0,!1)):"square"===D?(w||(this.addCurrentVertex(d,this.distance,v,1,1,!1),this.e1=this.e2=-1),m&&this.addCurrentVertex(d,this.distance,g,-1,-1,!1)):"round"===D&&(w||(this.addCurrentVertex(d,this.distance,v,0,0,!1),this.addCurrentVertex(d,this.distance,v,1,1,!0),this.e1=this.e2=-1),m&&(this.addCurrentVertex(d,this.distance,g,-1,-1,!0),this.addCurrentVertex(d,this.distance,g,0,0,!1)));if(S&&M<a-1){var B=d.dist(m);if(B>2*o){var U=d.add(m.sub(d)._mult(o/B)._round());this.distance+=U.dist(d),this.addCurrentVertex(U,this.distance,g.mult(1),0,0,!1),d=U}}w=!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],u=l.layoutVertexArray,c=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&c.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(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&c.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>d/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":409,"../bucket":296,"../load_geometry":304}],300:[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"),v=t("../load_geometry"),g=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"}]),A=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:A},icon:{layoutVertexArrayType:M,elementArrayType:A},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,p=a["text-line-height"]*f,g="line"!==a["symbol-placement"]?a["text-max-width"]*f:0,x=a["text-letter-spacing"]*f,_=[a["text-offset"][0]*f,a["text-offset"][1]*f],M=this.fontstack=a["text-font"].join(","),A=[],k=0;k<o.length;k++)A.push(v(o[k]));if("line"===a["symbol-placement"]){var T=d(o,s,A);A=T.geometries,o=T.features, s=T.textFeatures}for(var S,E,L=0;L<o.length;L++)if(A[L]){if(S=s[L]?y(s[L],e[M],g,p,l,c,h,x,_):null,a["icon-image"]){var C=u(o[L].properties,a["icon-image"]),D=r[C];E=b(D,a),D&&(void 0===this.sdfIcons?this.sdfIcons=D.sdf:this.sdfIcons!==D.sdf&&m.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),1!==D.pixelRatio?this.iconsNeedLinear=!0:0===a["icon-rotate"]&&this.layer.isLayoutValueFeatureConstant("icon-rotate")||(this.iconsNeedLinear=!0))}else E=null;(S||E)&&this.addFeature(A[L],S,E,o[L])}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=24,o=this.adjustedTextSize/a,u=void 0!==this.adjustedTextMaxSize?this.adjustedTextMaxSize:this.adjustedTextSize,c=this.tilePixelRatio*o,h=this.tilePixelRatio*u/a,f=this.tilePixelRatio*this.adjustedIconSize,d=this.tilePixelRatio*i["symbol-spacing"],m=i["symbol-avoid-edges"],v=i["text-padding"]*this.tilePixelRatio,g=i["icon-padding"]*this.tilePixelRatio,y=i["text-max-angle"]/180*Math.PI,b="map"===i["text-rotation-alignment"]&&"line"===i["symbol-placement"],x="map"===i["icon-rotation-alignment"]&&"line"===i["symbol-placement"],_=i["text-allow-overlap"]||i["icon-allow-overlap"]||i["text-ignore-placement"]||i["icon-ignore-placement"],M="line"===i["symbol-placement"],A=d/2;M&&(t=p(t,0,0,w,w));for(var k=0;k<t.length;k++){var T,S=t[k];T=M?l(S,d,y,e,r,a,h,this.overscaling,w):[new s(S[0].x,S[0].y,0)];for(var E=0,L=T.length;E<L;E++){var C=T[E];if(!(e&&M&&this.anchorIsTooClose(e.text,A,C))){var D=!(C.x<0||C.x>w||C.y<0||C.y>w);if(!m||D){var z=D||_;this.addSymbolInstance(C,S,e,r,this.layer,z,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,v,b,f,g,x,{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"],o=r["text-allow-overlap"]||r["icon-allow-overlap"]||r["text-ignore-placement"]||r["icon-ignore-placement"];if(o){var s=this.symbolInstancesArray.toArray(this.symbolInstancesStartIndex,this.symbolInstancesEndIndex),l=t.angle,u=Math.sin(l),c=Math.cos(l);this.sortedSymbolInstances=s.sort(function(t,e){var r=u*t.anchorPointX+c*t.anchorPointY|0,n=u*e.anchorPointX+c*e.anchorPointY|0;return r-n||e.index-t.index})}for(var h=this.symbolInstancesStartIndex;h<this.symbolInstancesEndIndex;h++){var f=this.sortedSymbolInstances?this.sortedSymbolInstances[h-this.symbolInstancesStartIndex]:this.symbolInstancesArray.get(h),d={boxStartIndex:f.textBoxStartIndex,boxEndIndex:f.textBoxEndIndex},p={boxStartIndex:f.iconBoxStartIndex,boxEndIndex:f.iconBoxEndIndex},m=!(f.textBoxStartIndex===f.textBoxEndIndex),v=!(f.iconBoxStartIndex===f.iconBoxEndIndex),g=r["text-optional"]||!m,y=r["icon-optional"]||!v,b=m?t.placeCollisionFeature(d,r["text-allow-overlap"],r["symbol-avoid-edges"]):t.minScale,x=v?t.placeCollisionFeature(p,r["icon-allow-overlap"],r["symbol-avoid-edges"]):t.minScale;g||y?!y&&b?b=Math.max(x,b):!g&&x&&(x=Math.max(x,b)):x=b=Math.max(x,b),m&&(t.insertCollisionFeature(d,b,r["text-ignore-placement"]),b<=n&&this.addSymbols("glyph",f.glyphQuadStartIndex,f.glyphQuadEndIndex,b,r["text-keep-upright"],i,t.angle)),v&&(t.insertCollisionFeature(p,x,r["icon-ignore-placement"]),x<=n&&this.addSymbols("icon",f.iconQuadStartIndex,f.iconQuadEndIndex,x,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 v=p.tl,g=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 A=Math.round(p.glyphAngle/(2*Math.PI)*256),k=i(c,_.x,_.y,v.x,v.y,x.x,x.y,w,M,f,A);i(c,_.x,_.y,g.x,g.y,x.x+x.w,x.y,w,M,f,A),i(c,_.x,_.y,y.x,y.y,x.x,x.y+x.h,w,M,f,A),i(c,_.x,_.y,b.x,b.y,x.x+x.w,x.y+x.h,w,M,f,A),u.emplaceBack(k,k+1,k+2),u.emplaceBack(k+1,k+2,k+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),v=new a(h.x2,h.y2*i)._rotate(n),g=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,g,y),this.addCollisionBoxVertex(r,f,p,g,y),this.addCollisionBoxVertex(r,f,p,g,y),this.addCollisionBoxVertex(r,f,v,g,y),this.addCollisionBoxVertex(r,f,v,g,y),this.addCollisionBoxVertex(r,f,m,g,y),this.addCollisionBoxVertex(r,f,m,g,y),this.addCollisionBoxVertex(r,f,d,g,y)}}}},n.prototype.addSymbolInstance=function(t,e,r,i,a,o,s,l,u,c,h,f,d,p,v,y,b,w,M){var A,k,T,S,E,L,C,D;if(r&&(C=o?x(t,r,f,e,a,p):[],E=new g(l,e,t,u,c,h,r,f,d,p,!1)),A=this.symbolQuadsArray.length,C&&C.length)for(var z=0;z<C.length;z++)this.addSymbolQuad(C[z]);k=this.symbolQuadsArray.length;var I=E?E.boxStartIndex:this.collisionBoxArray.length,P=E?E.boxEndIndex:this.collisionBoxArray.length;i&&(D=o?_(t,i,v,e,a,b,r,w,M):[],L=new g(l,e,t,u,c,h,i,v,y,b,!0)),T=this.symbolQuadsArray.length,D&&1===D.length&&this.addSymbolQuad(D[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"),k>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(I,P,O,R,A,k,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":358,"../../symbol/clip_line":360,"../../symbol/collision_feature":362,"../../symbol/get_anchors":364,"../../symbol/mergelines":367,"../../symbol/quads":368,"../../symbol/resolve_text":369,"../../symbol/shaping":370,"../../util/token":408,"../../util/util":409,"../bucket":296,"../load_geometry":304,"point-geometry":450}],301:[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"}},{}],302:[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":324,"../util/util":409,"./buffer":301}],303:[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 A(n.featureIndexArray),this.rawTileData=i,this.bucketLayerIDs=n.bucketLayerIDs}else this.grid=new p(h,16,0),this.featureIndexArray=new A;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"),v=t("vector-tile"),g=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,A=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 v.VectorTile(new g(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),A=-(1/0),k=0;k<x.length;k++)for(var T=x[k],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),A=Math.max(A,E.y)}var L=this.grid.query(_-c,w-c,M+c,A+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,A,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 v=r.get(m),g=this.bucketLayerIDs[v.bucketIndex];if(!a||b(a,g)){var x=this.sourceLayerCoder.decode(v.sourceLayerIndex),A=this.vtLayers[x],k=A.feature(v.featureIndex);if(i(k))for(var T=null,S=0;S<g.length;S++){var E=g[S];if(!(a&&a.indexOf(E)<0)){var L=u[E];if(L){var C;if("symbol"!==L.type){T||(T=c(k));var D=L.paint;if("line"===L.type){C=s(n,D["line-translate"],D["line-translate-anchor"],h,f);var z=o(D)/2*f;if(D["line-offset"]&&(T=l(T,D["line-offset"]*f)),!M(C,T,z))continue}else if("fill"===L.type){if(C=s(n,D["fill-translate"],D["fill-translate-anchor"],h,f),!w(C,T))continue}else if("circle"===L.type){C=s(n,D["circle-translate"],D["circle-translate-anchor"],h,f);var I=D["circle-radius"]*f;if(!_(C,T,I))continue}}var P=new y(k,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":399,"../util/intersection_tests":404,"../util/struct_array":407,"../util/util":409,"../util/vectortile_to_geojson":410,"./bucket":296,"./load_geometry":304,"feature-filter":107,"grid-index":257,pbf:444,"point-geometry":450,"vector-tile":514}],304:[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":409,"./bucket":296,assert:37}],305:[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}}},{}],306:[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;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":409}],307:[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":306}],308:[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){var r=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-r)*(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=0,r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];f.transformMat4(r,r,this.pixelMatrixInverse),f.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],s=r[0]/i,u=n[0]/a,c=r[1]/i,h=n[1]/a,d=r[2]/i,p=n[2]/a,m=d===p?0:(e-d)/(p-d),v=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(s,u,m)/v,l(c,h,m)/v,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),!n)throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":296,"../source/tile_coord":336,"../util/interpolate":403,"../util/util":409,"./coordinate":305,"./lng_lat":306,"gl-matrix":166,"point-geometry":450}],309:[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)u[1][s]===-1&&u[1][s+1]===-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}},{}],310:[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":411,"./geo/lng_lat":306,"./geo/lng_lat_bounds":307,"./style/style":345,"./ui/control/attribution":376,"./ui/control/control":377,"./ui/control/geolocate":378,"./ui/control/navigation":379,"./ui/map":388,"./ui/marker":389,"./ui/popup":390,"./util/ajax":392,"./util/browser":393,"./util/config":398,"./util/evented":401,"./util/util":409,"point-geometry":450}],311:[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:37}],312:[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}),v=0;v<m.length;v++){var g=m[v];if(f&&d){var y={coord:g,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+g.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(g)),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":330,"./create_uniform_pragmas":311}],313:[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":393}],314:[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},{}],315:[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),v=new c;v.bind(n,h,m),n.uniform4f(h.u_color,1,1,1,1);for(var g=e.getTile(r).tileSize,y=l/(Math.pow(2,t.transform.zoom-r.z)*g),b=[[-1,-1],[-1,1],[1,-1],[1,1]],x=0;x<b.length;x++){var _=b[x];n.uniformMatrix4fv(h.u_matrix,!1,s.translate([],i,[y*_[0],y*_[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":296,"../data/buffer":301,"../lib/debugtext":309,"../util/browser":393,"./vertex_array_object":324,"gl-matrix":166}],316:[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":330}],317:[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,v,g,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(v=t.spriteAtlas.getPosition(w.from,!0),g=t.spriteAtlas.getPosition(w.to,!0),!v||!g)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,v.tl),s.uniform2fv(d.u_pattern_br_a,v.br),s.uniform2fv(d.u_pattern_tl_b,g.tl),s.uniform2fv(d.u_pattern_br_b,g.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 A=o[M],k=e.getTile(A),T=k.getBucket(r);if(T){var S=T.bufferGroups.line;if(S){t.enableTileClippingMask(A);var E=t.translatePosMatrix(A.posMatrix,k,r.paint["line-translate"],r.paint["line-translate-anchor"]);s.uniformMatrix4fv(d.u_matrix,!1,E);var L=1/a(k,1,t.transform.zoom);if(_){var C=p.width*_.fromScale,D=m.width*_.toScale,z=[1/a(k,C,t.transform.tileZoom),-p.height/2],I=[1/a(k,D,t.transform.tileZoom),-m.height/2],P=t.lineAtlas.width/(256*Math.min(C,D)*n.devicePixelRatio)/2;s.uniform1f(d.u_ratio,L),s.uniform2fv(d.u_patternscale_a,z),s.uniform2fv(d.u_patternscale_b,I),s.uniform1f(d.u_sdfgamma,P)}else w?(s.uniform1f(d.u_ratio,L),s.uniform2fv(d.u_pattern_size_a,[a(k,v.size[0]*w.fromScale,t.transform.tileZoom),g.size[1]]),s.uniform2fv(d.u_pattern_size_b,[a(k,g.size[0]*w.toScale,t.transform.tileZoom),g.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":330,"../util/browser":393,"gl-matrix":166}],318:[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 v=u.boundsBuffer||t.rasterBoundsBuffer,g=u.boundsVAO||t.rasterBoundsVAO;g.bind(i,h,v),i.drawArrays(i.TRIANGLE_STRIP,0,v.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":407,"../util/util":409}],319:[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"]),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 v=0;v<n.length;v++){var g=e.getTile(n[v]),y=g.getBucket(r);if(y){var b=y.bufferGroups,x=i?b.glyph:b.icon;x.length&&(t.enableTileClippingMask(n[v]),a(t,r,n[v].posMatrix,g,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,v,g,y,b,x,_,w){var M,A,k,T=t.gl,S=t.transform,E="map"===m,L="map"===v,C=s?24:1,D=g/C;if(L?(A=l(n,1,t.transform.zoom)*D,k=1/Math.cos(S._pitch),M=[A,A]):(A=t.transform.altitude*D,k=1,M=[S.pixelsToGLUnits[0]*A,S.pixelsToGLUnits[1]*A]),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 I=f&&t.glyphSource.getGlyphAtlas(f);if(!I)return;I.updateTexture(T),T.uniform2f(z.u_texsize,I.width/4,I.height/4)}else{var P=t.options.rotating||t.options.zooming,O=1!==D||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 j=Math.log(g/h)/Math.LN2||0;T.uniform1f(z.u_zoom,10*(t.transform.zoom-j)),T.activeTexture(T.TEXTURE1),t.frameHistory.bind(T),T.uniform1i(z.u_fadetexture,1);var F;if(u){var N=8,B=1.19,U=6,V=.105*C/g/o.devicePixelRatio;if(y){T.uniform1f(z.u_gamma,(x*B/D/N+V)*k),T.uniform4fv(z.u_color,b),T.uniform1f(z.u_opacity,_),T.uniform1f(z.u_buffer,(U-y/D)/N);for(var H=0;H<a.length;H++)F=a[H],F.vaos[e.id].bind(T,z,F.layoutVertexBuffer,F.elementBuffer),T.drawElements(T.TRIANGLES,3*F.elementBuffer.length,T.UNSIGNED_SHORT,0)}T.uniform1f(z.u_gamma,V*k),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 q=0;q<a.length;q++)F=a[q],F.vaos[e.id].bind(T,z,F.layoutVertexBuffer,F.elementBuffer),T.drawElements(T.TRIANGLES,3*F.elementBuffer.length,T.UNSIGNED_SHORT,0)}else{T.uniform1f(z.u_opacity,_);for(var Y=0;Y<a.length;Y++)F=a[Y],F.vaos[e.id].bind(T,z,F.layoutVertexBuffer,F.elementBuffer),T.drawElements(T.TRIANGLES,3*F.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":330,"../util/browser":393,"./draw_collision_debug":314}],320:[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;r<=t?this.opacities[r]=this.changeOpacities[r]+i:this.opacities[r]=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))}},{}],321:[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,a=128;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var o=0,s=0;s<t.length;s++)o+=t[s];for(var l=this.width/o,u=l/2,c=t.length%2===1,h=-r;h<=r;h++)for(var f=this.nextRow+r+h,d=this.width*f,p=c?-t[t.length-1]:0,m=t[0],v=1,g=0;g<this.width;g++){for(;m<g/l;)p=m,m+=t[v],c&&v===t.length-1&&(m+=t[0]),v++;var y,b=Math.abs(g-p*l),x=Math.abs(g-m*l),_=Math.min(b,x),w=v%2===1;if(e){var M=r?h/r*(u+1):0;if(w){var A=u-Math.abs(M);y=Math.sqrt(_*_+A*A)}else y=u-Math.sqrt(_*_+M*M)}else y=(w?1:-1)*_;this.data[3+4*(d+g)]=Math.max(0,Math.min(255,y+a))}var k={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:o};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":409}],322:[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 v={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&&v.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,v[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);var r=8,n=1/r;e.blendColor(n,n,n,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":296,"../data/buffer":301,"../source/pixels_to_tile_units":330,"../source/source_cache":334,"../util/browser":393,"../util/struct_array":407,"../util/util":409,"./create_uniform_pragmas":311,"./draw_background":312,"./draw_circle":313,"./draw_debug":315,"./draw_fill":316,"./draw_line":317,"./draw_raster":318,"./draw_symbol":319,"./frame_history":320,"./painter/use_program":323,"./vertex_array_object":324,"gl-matrix":166}],323:[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 v={},g=u.getProgramParameter(c,u.ACTIVE_ATTRIBUTES),y=0;y<g;y++){var b=u.getActiveAttrib(c,y);v[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:v,numAttributes:g},v,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),o=this.currentProgram;return o!==a&&(i.useProgram(a.program),this.currentProgram=a),a}},{"../../util/util":409,assert:37,"mapbox-gl-shaders":270}],324:[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:37}],325:[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){return t?void this.fire("error",{error:t}):void 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){return t?this.fire("error",{error:t}):void 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":296,"../util/evented":401,"../util/util":409,"resolve-url":467}],326:[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){return r?e(r):(this._geoJSONIndexes[t.source]=n,void 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":392,"../util/util":409,"./geojson_wrapper":327,"./vector_tile_worker_source":338,"geojson-rewind":112,"geojson-vt":116,supercluster:494,"vt-pbf":520}],327:[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":296,"point-geometry":450,"vector-tile":514}],328:[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){return t?this.fire("error",{error:t}):(this.image=r,this.image.addEventListener("load",function(){this.map._rerender()}.bind(this)),this._loaded=!0,this.fire("load"),void(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=32767,r=new h;r.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),r.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,e,0),r.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,e),r.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,e,e),this.tile.buckets={},this.tile.boundsBuffer=new f(r.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":296,"../data/buffer":301,"../geo/lng_lat":306,"../render/draw_raster":318,"../render/vertex_array_object":324,"../util/ajax":392,"../util/evented":401,"../util/util":409,"./tile_coord":336,"point-geometry":450}],329:[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":392,"../util/browser":393,"../util/mapbox":406,"../util/util":409}],330:[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":296}],331:[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":336}],332:[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){return t?this.fire("error",t):(i.extend(this,e),void 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":392,"../util/evented":401,"../util/mapbox":406,"../util/util":409,"./load_tilejson":329}],333:[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":325,"../source/image_source":328,"../source/raster_tile_source":332,"../source/vector_tile_source":337,"../source/video_source":339,"../util/util":409}],334:[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){return e?(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}),void 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,i=5;this._cache.setMaxSize(Math.floor(n*i))},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),v=0;v<m.length;v++){var g=m[v];i=u.fromID(g),a=this._tiles[g],a&&a.timeAdded>h-(e||0)&&(this.findLoadedChildren(i,l,c)&&(c[g]=!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();if(e=this._tiles[r.id],e||(e=this._cache.get(r.id),e&&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]],v=u.fromID(r[p]),g=[i(v,m.sourceMaxZoom,new h(n,a,l)),i(v,m.sourceMaxZoom,new h(o,s,l))];if(g[0].x<d&&g[0].y<d&&g[1].x>=0&&g[1].y>=0){for(var y=[],b=0;b<t.length;b++)y.push(i(v,m.sourceMaxZoom,t[b]));var x=e[m.coord.id];void 0===x&&(x=e[m.coord.id]={tile:m,coord:v,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++){var r=this.getTileByID(t[e]);r.redoPlacement(this)}},getVisibleCoordinates:function(){return this.getRenderableIds().map(u.fromID)}})},{"../data/bucket":296,"../geo/coordinate":305,"../util/evented":401,"../util/lru_cache":405,"../util/util":409,"./source":333,"./tile":335,"./tile_coord":336}],335:[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){var r=this.buckets[e];r.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)}return"loaded"!==this.state||"reloading"===this.state?void(this.redoWhenDone=!0):(this.state="reloading",void 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":296,"../data/feature_index":303,"../symbol/collision_box":361,"../symbol/collision_tile":363,"../symbol/symbol_instances":372,"../symbol/symbol_quads":373,"../util/util":409,"../util/vectortile_to_geojson":410,"feature-filter":107,pbf:444,"vector-tile":514}],336:[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,n<0&&(n=n*-1-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=s*-1-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":305,assert:37,"whoots-js":530}],337:[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){return t?void this.fire("error",t):(a.extend(this,e),void 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":401,"../util/mapbox":406,"../util/util":409,"./load_tilejson":329}],338:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){function r(t,r){return delete this.loading[n][i],t?e(t):r?(a.data=r.tile,a.parse(a.data,this.styleLayers.getLayerFamilies(),this.actor,r.rawTileData,e),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][i]=a)):e(null,null)}var n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var a=this.loading[n][i]=new s(t);a.abort=this.loadVectorData(t,r.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){function r(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}var n=i.getArrayBuffer(t.url,r.bind(this));return function(){n.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i],o=a.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);o.result&&e(null,o.result,o.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":392,"./worker_tile":341,pbf:444,"vector-tile":514}],339:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,u.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.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,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),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=32767,r=new h;r.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),r.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,e,0),r.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,e),r.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,e,e),this.tile.buckets={},this.tile.boundsBuffer=new f(r.serialize(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.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.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},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:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":296,"../data/buffer":301,"../geo/lng_lat":306,"../render/draw_raster":318,"../render/vertex_array_object":324,"../util/ajax":392,"../util/evented":401,"../util/util":409,"./tile_coord":336,"point-geometry":450}],340:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new u(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),u=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a<t.length;a++){var s=t[a];"fill"!==s.type&&"line"!==s.type&&"circle"!==s.type&&"symbol"!==s.type||(s.ref?n.push(a):e(s))}for(var l=0;l<n.length;l++)e(t[n[l]]);this.layerFamilies=i(this.layers)},"update layers":function(t){function e(t){var e=a.layers[t.ref];a.layers[t.id]?a.layers[t.id].set(t,e):a.layers[t.id]=o.create(t,e),a.layers[t.id].updatePaintTransitions({},{transition:!1})}var r,n,a=this;for(r in t)n=t[r],n.ref&&e(n);for(r in t)n=t[r],n.ref||e(n);this.layerFamilies=i(this.layers)},"load tile":function(t,e){var r=t.type||"vector";this.workerSources[r].loadTile(t,e)},"reload tile":function(t,e){var r=t.type||"vector";this.workerSources[r].reloadTile(t,e)},"abort tile":function(t){var e=t.type||"vector";this.workerSources[e].abortTile(t)},"remove tile":function(t){var e=t.type||"vector";this.workerSources[e].removeTile(t)},"redo placement":function(t,e){var r=t.type||"vector";this.workerSources[r].redoPlacement(t,e)},"load worker source":function(t,e){try{this.self.importScripts(t.url),e()}catch(t){e(t)}}})},{"../style/style_layer":348,"../util/actor":391,"../util/util":409,"./geojson_worker_source":326,"./vector_tile_worker_source":338}],341:[function(t,e,r){"use strict";function n(t){this.coord=t.coord,this.uid=t.uid,this.zoom=t.zoom,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=t.overscaling,this.angle=t.angle,this.pitch=t.pitch,this.showCollisionBoxes=t.showCollisionBoxes}function i(t){return!t.isEmpty()}function a(t){return t.serialize()} function o(t){var e=[];for(var r in t)t[r].getTransferables(e);return e}function s(t){return t.id}var l=t("../data/feature_index"),u=t("../symbol/collision_tile"),c=t("../data/bucket"),h=t("../symbol/collision_box"),f=t("../util/dictionary_coder"),d=t("../util/util"),p=t("../symbol/symbol_instances"),m=t("../symbol/symbol_quads");e.exports=n,n.prototype.parse=function(t,e,r,n,v){function g(t,e){for(var r=0;r<t.length;r++){var n=t.feature(r);n.index=r;for(var i in e)e[i].filter(n)&&e[i].features.push(n)}}function y(t){if(t)return v(t);if(N++,2===N){for(var e=P.length-1;e>=0;e--)b(E,P[e]);x()}}function b(t,e){if(e.populateArrays(k,F,j),"symbol"!==e.type)for(var r=0;r<e.features.length;r++){var n=e.features[r];T.insert(n,n.index,e.sourceLayerIndex,e.index)}e.features=null}function x(){E.status="done",E.redoPlacementAfterDone&&(E.redoPlacement(E.angle,E.pitch,null),E.redoPlacementAfterDone=!1);var t=T.serialize(),e=k.serialize(),r=E.collisionBoxArray.serialize(),s=E.symbolInstancesArray.serialize(),l=E.symbolQuadsArray.serialize(),u=[n].concat(t.transferables).concat(e.transferables),c=I.filter(i);v(null,{buckets:c.map(a),featureIndex:t.data,collisionTile:e.data,collisionBoxArray:r,symbolInstancesArray:s,symbolQuadsArray:l,rawTileData:n},o(c).concat(u))}this.status="parsing",this.data=t,this.collisionBoxArray=new h,this.symbolInstancesArray=new p,this.symbolQuadsArray=new m;var _,w,M,A,k=new u(this.angle,this.pitch,this.collisionBoxArray),T=new l(this.coord,this.overscaling,k,t.layers),S=new f(t.layers?Object.keys(t.layers).sort():["_geojsonTileLayer"]),E=this,L={},C={},D=0;for(var z in e)w=e[z][0],w.source===this.source&&(w.ref||w.minzoom&&this.zoom<w.minzoom||w.maxzoom&&this.zoom>=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||(A=c.create({layer:w,index:D++,childLayers:e[z],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")}),A.createFilter(),L[w.id]=A,t.layers&&(M=w.sourceLayer,C[M]=C[M]||{},C[M][w.id]=A)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),w=t.layers[M],w&&g(w,C[M]);else g(t,L);var I=[],P=this.symbolBuckets=[],O=[];T.bucketLayerIDs={};for(var R in L)A=L[R],0!==A.features.length&&(T.bucketLayerIDs[A.index]=A.childLayers.map(s),I.push(A),"symbol"===A.type?P.push(A):O.push(A));var j={},F={},N=0;if(P.length>0){for(_=P.length-1;_>=0;_--)P[_].updateIcons(j),P[_].updateFont(F);for(var B in F)F[B]=Object.keys(F[B]).map(Number);j=Object.keys(j),r.send("get glyphs",{uid:this.uid,stacks:F},function(t,e){F=e,y(t)}),j.length?r.send("get icons",{icons:j},function(t,e){j=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)b(this,O[_]);if(0===P.length)return x()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new u(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var c=n.serialize(),h=s.filter(i);return{result:{buckets:h.map(a),collisionTile:c.data},transferables:o(h).concat(c.transferables)}}},{"../data/bucket":296,"../data/feature_index":303,"../symbol/collision_box":361,"../symbol/collision_tile":363,"../symbol/symbol_instances":372,"../symbol/symbol_quads":373,"../util/dictionary_coder":399,"../util/util":409}],342:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],343:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){return t?void this.fire("error",{error:t}):(this.data=e,void(this.img&&this.fire("load")))}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)return void this.fire("error",{error:t});for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i<r.length;i+=4){var a=r[i+3]/255;n[i+0]=r[i+0]*a,n[i+1]=r[i+1]*a,n[i+2]=r[i+2]*a,n[i+3]=r[i+3]}this.img=e,this.data&&this.fire("load")}.bind(this))}function i(){}var a=t("../util/evented"),o=t("../util/ajax"),s=t("../util/browser"),l=t("../util/mapbox").normalizeSpriteURL;e.exports=n,n.prototype=Object.create(a),n.prototype.toJSON=function(){return this.base},n.prototype.loaded=function(){return!(!this.data||!this.img)},n.prototype.resize=function(){if(s.devicePixelRatio>1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":392,"../util/browser":393,"../util/evented":401,"../util/mapbox":406}],344:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":409,"./style_function":347,csscolorparser:91}],345:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new u(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},c.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)return void this.fire("error",{error:t});if(!v.emitErrors(this,v(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?h.getJSON(f(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),u=t("../render/line_atlas"),c=t("../util/util"),h=t("../util/ajax"),f=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),v=t("./validate_style"),g=t("../source/source"),y=t("../source/query_features"),b=t("../source/source_cache"),x=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=c.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&e.vectorLayerIds.indexOf(t.sourceLayer)===-1&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;r<this.stylesheet.layers.length;r++)e=this.stylesheet.layers[r],e.ref||(t=a.create(e),this._layers[t.id]=t,t.on("error",this._forwardLayerEvent));for(var n=0;n<this.stylesheet.layers.length;n++)if(e=this.stylesheet.layers[n],e.ref){var i=this.getLayer(e.ref);t=a.create(e,i),this._layers[t.id]=t,t.on("error",this._forwardLayerEvent)}this._groupLayers(),this._updateWorkerLayers()},_groupLayers:function(){var t;this._groups=[];for(var e=0;e<this._order.length;++e){var r=this._layers[this._order[e]];t&&r.source===t.source||(t=[],t.source=r.source,this._groups.push(t)),t.push(r)}},_updateWorkerLayers:function(t){this.dispatcher.broadcast(t?"update layers":"set layers",this._serializeLayers(t))},_serializeLayers:function(t){t=t||this._order;for(var e=[],r={includeRefProperties:!0},n=0;n<t.length;n++)e.push(this._layers[t[n]].serialize(r));return e},_applyClasses:function(t,e){if(this._loaded){t=t||[],e=e||{transition:!0};var r=this.stylesheet.transition||{},n=this._updates.allPaintProps?this._layers:this._updates.paintProps;for(var i in n){var a=this._layers[i],o=this._updates.paintProps[i];if(this._updates.allPaintProps||o.all)a.updatePaintTransitions(t,e,r,this.animationLoop);else for(var s in o)this._layers[i].updatePaintTransition(s,t,e,r,this.animationLoop)}}},_recalculate:function(t){for(var e in this.sources)this.sources[e].used=!1;this._updateZoomHistory(t),this.rasterFadeDuration=300;for(var r in this._layers){var n=this._layers[r];n.recalculate(t,this.zoomHistory),!n.isHidden(t)&&n.source&&(this.sources[n.source].used=!0)}var i=300;Math.floor(this.z)!==Math.floor(t)&&this.animationLoop.set(i),this.z=t,this.fire("zoom")},_updateZoomHistory:function(t){var e=this.zoomHistory;void 0===e.lastIntegerZoom&&(e.lastIntegerZoom=Math.floor(t),e.lastIntegerZoomTime=0,e.lastZoom=t),Math.floor(e.lastZoom)<Math.floor(t)?(e.lastIntegerZoom=Math.floor(t),e.lastIntegerZoomTime=Date.now()):Math.floor(e.lastZoom)>Math.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n<i.length;n++)this._reloadSource(i[n]);for(n=0;n<this._updates.events.length;n++){var a=this._updates.events[n];this.fire(a[0],a[1])}return this._applyClasses(t,e),this._updates.changed&&this.fire("change"),this._resetUpdates(),this},_resetUpdates:function(){this._updates={events:[],layers:{},sources:{},paintProps:{}}},addSource:function(t,e){if(this._checkLoaded(),void 0!==this.sources[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e)+".");var r=["vector","raster","geojson","video","image"],n=r.indexOf(e.type)>=0;return n&&this._handleErrors(v.source,"sources."+t,e)?this:(e=new b(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(v.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(v.filter,"layers."+r.id+".filter",e)?this:c.deepEqual(r.filter,e)?this:(r.filter=c.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return c.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(c.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);var o=!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property);return o&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:c.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;i<t.length;i++){var a=t[i][n];if(a)for(var o=0;o<a.length;o++)e.push(a[o])}return e},queryRenderedFeatures:function(t,e,r,n){e&&e.filter&&this._handleErrors(v.filter,"queryRenderedFeatures.filter",e.filter,!0);var i={};if(e&&e.layers)for(var a=0;a<e.layers.length;a++){var o=e.layers[a];i[this._layers[o].source]=!0}var s=[];for(var l in this.sources)if(!e.layers||i[l]){var u=this.sources[l],c=y.rendered(u,this._layers,t,e,r,n);s.push(c)}return this._flattenRenderedFeatures(s)},querySourceFeatures:function(t,e){e&&e.filter&&this._handleErrors(v.filter,"querySourceFeatures.filter",e.filter,!0);var r=this.sources[t];return r?y.source(r,e):[]},addSourceType:function(t,e,r){return g.getType(t)?r(new Error('A source type called "'+t+'" already exists.')):(g.setType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("load worker source",{name:t,url:e.workerSourceURL},r):r(null,null))},_handleErrors:function(t,e,r,n,i){var a=n?v.throwErrors:v.emitErrors,o=t.call(v,c.extend({key:e,style:this.serialize(),value:r,styleSpec:x},i));return a.call(v,this,o)},_remove:function(){this.dispatcher.remove()},_reloadSource:function(t){this.sources[t].reload()},_updateSources:function(t){for(var e in this.sources)this.sources[e].update(t)},_redoPlacement:function(){for(var t in this.sources)this.sources[t].redoPlacement&&this.sources[t].redoPlacement()},_forwardSourceEvent:function(t){this.fire("source."+t.type,c.extend({source:t.target.getSource()},t))},_forwardTileEvent:function(t){this.fire(t.type,c.extend({source:t.target},t))},_forwardLayerEvent:function(t){this.fire("layer."+t.type,c.extend({layer:{id:t.target.id}},t))},"get sprite json":function(t,e){var r=this.sprite;r.loaded()?e(null,{sprite:r.data,retina:r.retina}):r.on("load",function(){e(null,{sprite:r.data,retina:r.retina})})},"get icons":function(t,e){var r=this.sprite,n=this.spriteAtlas;r.loaded()?(n.setSprite(r),n.addIcons(t.icons,e)):r.on("load",function(){n.setSprite(r),n.addIcons(t.icons,e)})},"get glyphs":function(t,e){function r(t,r,n){t&&console.error(t),a[n]=r,i--,0===i&&e(null,a)}var n=t.stacks,i=Object.keys(n).length,a={};for(var o in n)this.glyphSource.getSimpleGlyphs(o,n[o],t.uid,r)}})},{"../render/line_atlas":321,"../source/query_features":331,"../source/source":333,"../source/source_cache":334,"../symbol/glyph_source":366,"../symbol/sprite_atlas":371,"../util/ajax":392,"../util/browser":393,"../util/dispatcher":400,"../util/evented":401,"../util/mapbox":406,"../util/util":409,"./animation_loop":342,"./image_sprite":343,"./style_function":347,"./style_layer":348,"./style_spec":355,"./validate_style":357}],346:[function(t,e,r){"use strict";function n(t,e){this.value=s.clone(e),this.isFunction=a.isFunctionDefinition(e),this.json=JSON.stringify(this.value);var r="color"===t.type&&this.value?o(this.value):e;if(this.calculate=a[t.function||"piecewise-constant"](r),this.isFeatureConstant=this.calculate.isFeatureConstant,this.isZoomConstant=this.calculate.isZoomConstant,"piecewise-constant"===t.function&&t.transition&&(this.calculate=i(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var n=[],l=this.value.stops,u=0;u<this.value.stops.length;u++){var c=l[u][0].zoom;this.stopZoomLevels.indexOf(c)<0&&(this.stopZoomLevels.push(c),n.push([c,n.length]))}this.calculateInterpolationT=a.interpolated({stops:n,base:e.base})}}function i(t){return function(e,r){var n,i,a,o=e.zoom,s=e.zoomHistory,l=e.duration,u=o%1,c=Math.min((Date.now()-s.lastIntegerZoomTime)/l,1),h=1,f=1;return o>s.lastIntegerZoom?(n=u+(1-u)*c,h*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-c)*u,a=t({zoom:o},r),i=t({zoom:o+1},r),h/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:h,to:a,toScale:f,t:n}}}var a=t("./style_function"),o=t("./parse_color"),s=t("../util/util");e.exports=n},{"../util/util":409,"./parse_color":344,"./style_function":347}],347:[function(t,e,r){"use strict";var n=t("mapbox-gl-function");r.interpolated=function(t){var e=n.interpolated(t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r["piecewise-constant"]=function(t){var e=n["piecewise-constant"](t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r.isFunctionDefinition=n.isFunctionDefinition},{"mapbox-gl-function":269}],348:[function(t,e,r){"use strict";function n(t,e){this.set(t,e)}function i(t){return t.value}var a=t("../util/util"),o=t("./style_transition"),s=t("./style_declaration"),l=t("./style_spec"),u=t("./validate_style"),c=t("./parse_color"),h=t("../util/evented");e.exports=n;var f="-transition";n.create=function(e,r){var n={background:t("./style_layer/background_style_layer"),circle:t("./style_layer/circle_style_layer"),fill:t("./style_layer/fill_style_layer"),line:t("./style_layer/line_style_layer"),raster:t("./style_layer/raster_style_layer"),symbol:t("./style_layer/symbol_style_layer")};return new n[(r||e).type](e,r)},n.prototype=a.inherit(h,{set:function(t,e){this.id=t.id,this.ref=t.ref,this.metadata=t.metadata,this.type=(e||t).type,this.source=(e||t).source,this.sourceLayer=(e||t)["source-layer"],this.minzoom=(e||t).minzoom,this.maxzoom=(e||t).maxzoom,this.filter=(e||t).filter,this.paint={},this.layout={},this._paintSpecifications=l["paint_"+this.type],this._layoutSpecifications=l["layout_"+this.type],this._paintTransitions={},this._paintTransitionOptions={},this._paintDeclarations={},this._layoutDeclarations={},this._layoutFunctions={};var r,n;for(var i in t){var a=i.match(/^paint(?:\.(.*))?$/);if(a){var o=a[1]||"";for(r in t[i])this.setPaintProperty(r,t[i][r],o)}}if(this.ref)this._layoutDeclarations=e._layoutDeclarations;else for(n in t.layout)this.setLayoutProperty(n,t.layout[n]);for(r in this._paintSpecifications)this.paint[r]=this.getPaintValue(r);for(n in this._layoutSpecifications)this._updateLayoutValue(n)},setLayoutProperty:function(t,e){if(null==e)delete this._layoutDeclarations[t];else{var r="layers."+this.id+".layout."+t;if(this._handleErrors(u.layoutProperty,r,t,e))return;this._layoutDeclarations[t]=new s(this._layoutSpecifications[t],e)}this._updateLayoutValue(t)},getLayoutProperty:function(t){return this._layoutDeclarations[t]&&this._layoutDeclarations[t].value},getLayoutValue:function(t,e,r){var n=this._layoutSpecifications[t],i=this._layoutDeclarations[t];return i?i.calculate(e,r):n.default},setPaintProperty:function(t,e,r){var n="layers."+this.id+(r?'["paint.'+r+'"].':".paint.")+t;if(a.endsWith(t,f))if(this._paintTransitionOptions[r||""]||(this._paintTransitionOptions[r||""]={}),null===e||void 0===e)delete this._paintTransitionOptions[r||""][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintTransitionOptions[r||""][t]=e}else if(this._paintDeclarations[r||""]||(this._paintDeclarations[r||""]={}),null===e||void 0===e)delete this._paintDeclarations[r||""][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintDeclarations[r||""][t]=new s(this._paintSpecifications[t],e)}},getPaintProperty:function(t,e){return e=e||"",a.endsWith(t,f)?this._paintTransitionOptions[e]&&this._paintTransitionOptions[e][t]:this._paintDeclarations[e]&&this._paintDeclarations[e][t]&&this._paintDeclarations[e][t].value},getPaintValue:function(t,e,r){var n=this._paintSpecifications[t],i=this._paintTransitions[t];return i?i.calculate(e,r):"color"===n.type&&n.default?c(n.default):n.default},getPaintValueStopZoomLevels:function(t){var e=this._paintTransitions[t];return e?e.declaration.stopZoomLevels:[]},getPaintInterpolationT:function(t,e){var r=this._paintTransitions[t];return r.declaration.calculateInterpolationT({zoom:e})},isPaintValueFeatureConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isFeatureConstant},isLayoutValueFeatureConstant:function(t){var e=this._layoutDeclarations[t];return!e||e.isFeatureConstant},isPaintValueZoomConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isZoomConstant},isHidden:function(t){return!!(this.minzoom&&t<this.minzoom)||(!!(this.maxzoom&&t>=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o<t.length;o++)a.extend(i,this._paintDeclarations[t[o]]);var s;for(s in i)this._applyPaintDeclaration(s,i[s],e,r,n);for(s in this._paintTransitions)s in i||this._applyPaintDeclaration(s,null,e,r,n)},updatePaintTransition:function(t,e,r,n,i){for(var a=this._paintDeclarations[""][t],o=0;o<e.length;o++){var s=this._paintDeclarations[e[o]];s&&s[t]&&(a=s[t])}this._applyPaintDeclaration(t,a,r,n,i)},recalculate:function(t,e){for(var r in this._paintTransitions)this.paint[r]=this.getPaintValue(r,{zoom:t,zoomHistory:e});for(var n in this._layoutFunctions)this.layout[n]=this.getLayoutValue(n,{zoom:t,zoomHistory:e})},serialize:function(t){var e={id:this.id,ref:this.ref,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom};for(var r in this._paintDeclarations){var n=""===r?"paint":"paint."+r;e[n]=a.mapObject(this._paintDeclarations[r],i)}return(!this.ref||t&&t.includeRefProperties)&&a.extend(e,{type:this.type,source:this.source,"source-layer":this.sourceLayer,filter:this.filter,layout:a.mapObject(this._layoutDeclarations,i)}),a.filterObject(e,function(t,e){return void 0!==t&&!("layout"===e&&!Object.keys(t).length)})},_applyPaintDeclaration:function(t,e,r,n,i){var l=r.transition?this._paintTransitions[t]:void 0,u=this._paintSpecifications[t];if(null!==e&&void 0!==e||(e=new s(u,u.default)),!l||l.declaration.json!==e.json){var c=a.extend({duration:300,delay:0},n,this.getPaintProperty(t+f)),h=this._paintTransitions[t]=new o(u,e,l,c);h.instant()||(h.loopID=i.set(h.endTime-Date.now())),l&&i.cancel(l.loopID)}},_updateLayoutValue:function(t){var e=this._layoutDeclarations[t];e&&e.isFunction?this._layoutFunctions[t]=!0:(delete this._layoutFunctions[t],this.layout[t]=this.getLayoutValue(t))},_handleErrors:function(t,e,r,n){return u.emitErrors(this,t.call(u,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:l,style:{glyphs:!0,sprite:!0}}))}})},{"../util/evented":401,"../util/util":409,"./parse_color":344,"./style_declaration":346,"./style_layer/background_style_layer":349,"./style_layer/circle_style_layer":350,"./style_layer/fill_style_layer":351,"./style_layer/line_style_layer":352,"./style_layer/raster_style_layer":353,"./style_layer/symbol_style_layer":354,"./style_spec":355,"./style_transition":356,"./validate_style":357}],349:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{})},{"../../util/util":409,"../style_layer":348}],350:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{})},{"../../util/util":409,"../style_layer":348}],351:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");n.prototype=i.inherit(a,{getPaintValue:function(t,e,r){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.getPaintValue.call(this,"fill-color",e,r):a.prototype.getPaintValue.call(this,t,e,r)},getPaintValueStopZoomLevels:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.getPaintValueStopZoomLevels.call(this,"fill-color"):a.prototype.getPaintValueStopZoomLevels.call(this,arguments)},getPaintInterpolationT:function(t,e){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.getPaintInterpolationT.call(this,"fill-color",e):a.prototype.getPaintInterpolationT.call(this,t,e)},isPaintValueFeatureConstant:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.isPaintValueFeatureConstant.call(this,"fill-color"):a.prototype.isPaintValueFeatureConstant.call(this,t)},isPaintValueZoomConstant:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.isPaintValueZoomConstant.call(this,"fill-color"):a.prototype.isPaintValueZoomConstant.call(this,t)}}),e.exports=n},{"../../util/util":409,"../style_layer":348}],352:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{getPaintValue:function(t,e,r){var n=a.prototype.getPaintValue.apply(this,arguments);if(n&&"line-dasharray"===t){var i=Math.floor(e.zoom);this._flooredZoom!==i&&(this._flooredZoom=i,this._flooredLineWidth=this.getPaintValue("line-width",e,r)),n.fromScale*=this._flooredLineWidth,n.toScale*=this._flooredLineWidth}return n}})},{"../../util/util":409,"../style_layer":348}],353:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{})},{"../../util/util":409,"../style_layer":348}],354:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{isHidden:function(){if(a.prototype.isHidden.apply(this,arguments))return!0;var t=0===this.paint["text-opacity"]||!this.layout["text-field"],e=0===this.paint["icon-opacity"]||!this.layout["icon-image"];return!(!t||!e)},getLayoutValue:function(t,e,r){return("text-rotation-alignment"!==t||"line"!==this.getLayoutValue("symbol-placement",e,r)||this.getLayoutProperty("text-rotation-alignment"))&&("icon-rotation-alignment"!==t||"line"!==this.getLayoutValue("symbol-placement",e,r)||this.getLayoutProperty("icon-rotation-alignment"))?"text-pitch-alignment"!==t||this.getLayoutProperty("text-pitch-alignment")?a.prototype.getLayoutValue.apply(this,arguments):this.getLayoutValue("text-rotation-alignment"):"map"}})},{"../../util/util":409,"../style_layer":348}],355:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/reference/latest.min")},{"mapbox-gl-style-spec/reference/latest.min":292}],356:[function(t,e,r){"use strict";function n(t,e,r,n){this.declaration=e,this.startTime=this.endTime=(new Date).getTime(),"piecewise-constant"===t.function&&t.transition?this.interp=i:this.interp=o[t.type],this.oldTransition=r,this.duration=n.duration||0,this.delay=n.delay||0,this.instant()||(this.endTime=this.startTime+this.duration+this.delay,this.ease=a.easeCubicInOut),r&&r.endTime<=this.startTime&&delete r.oldTransition}function i(t,e,r){return void 0===(t&&t.to)||void 0===(e&&e.to)?void 0:{from:t.to,fromScale:t.toScale,to:e.to,toScale:e.toScale,t:r}}var a=t("../util/util"),o=t("../util/interpolate");e.exports=n,n.prototype.instant=function(){return!this.oldTransition||!this.interp||0===this.duration&&0===this.delay},n.prototype.calculate=function(t,e){var r=this.declaration.calculate(a.extend({},t,{duration:this.duration}),e);if(this.instant())return r;var n=t.time||Date.now();if(n<this.endTime){var i=this.oldTransition.calculate(a.extend({},t,{time:this.startTime}),e),o=this.ease((n-this.startTime-this.delay)/this.duration);r=this.interp(i,r,o)}return r}},{"../util/interpolate":403,"../util/util":409}],357:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/lib/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0;r<e.length;r++)t.fire("error",{error:new Error(e[r].message)});return!0}return!1},e.exports.throwErrors=function(t,e){if(e)for(var r=0;r<e.length;r++)throw new Error(e[r].message)}},{"mapbox-gl-style-spec/lib/validate_style.min":291}],358:[function(t,e,r){"use strict";function n(t,e,r,n){this.x=t,this.y=e,this.angle=r,void 0!==n&&(this.segment=n)}var i=t("point-geometry");e.exports=n,n.prototype=Object.create(i.prototype),n.prototype.clone=function(){return new n(this.x,this.y,this.angle,this.segment)}},{"point-geometry":450}],359:[function(t,e,r){"use strict";function n(t,e,r,n,i){if(void 0===e.segment)return!0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(o--,o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;s<r/2;){var c=t[o-1],h=t[o],f=t[o+1];if(!f)return!1;var d=c.angleTo(h)-h.angleTo(f);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:d}),u+=d;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=h.dist(f)}return!0}e.exports=n},{}],360:[function(t,e,r){"use strict";function n(t,e,r,n,a){for(var o=[],s=0;s<t.length;s++)for(var l,u=t[s],c=0;c<u.length-1;c++){ var h=u[c],f=u[c+1];h.x<e&&f.x<e||(h.x<e?h=new i(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round():f.x<e&&(f=new i(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round()),h.y<r&&f.y<r||(h.y<r?h=new i(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round():f.y<r&&(f=new i(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round()),h.x>=n&&f.x>=n||(h.x>=n?h=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),h.y>=a&&f.y>=a||(h.y>=a?h=new i(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round():f.y>=a&&(f=new i(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round()),l&&h.equals(l[l.length-1])||(l=[h],o.push(l)),l.push(f)))))}return o}var i=t("point-geometry");e.exports=n},{"point-geometry":450}],361:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":407,"../util/util":409,"point-geometry":450}],362:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c){var h=o.top*s-l,f=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,u){var m=f-h,v=p-d;if(m>0)if(m=Math.max(10*s,m),c){var g=e[r.segment+1].sub(e[r.segment])._unit()._mult(v),y=[r.sub(g),r.add(g)];this._addLineCollisionBoxes(t,y,r,0,v,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,v,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,h,p,f,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var u=a/2,c=Math.floor(i/u),h=-a/2,f=this.boxes,d=r,p=n+1,m=h;do{if(p--,p<0)return f;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var v=e[p].dist(e[p+1]),g=0;g<c;g++){for(var y=-i/2+g*u;m+v<y;){if(m+=v,p++,p+1>=e.length)return f;v=e[p].dist(e[p+1])}var b=y-m,x=e[p],_=e[p+1],w=_.sub(x)._unit()._mult(b)._add(x)._round(),M=Math.max(Math.abs(y-h)-u/2,0),A=i/2/M;t.emplaceBack(w.x,w.y,-a/2,-a/2,a/2,a/2,A,o,s,l,0,0,0,0,0)}return f}},{}],363:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();var l=32767;r.emplaceBack(0,0,0,-l,0,l,l,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-l,0,l,l,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-l,0,l,0,l,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-l,0,l,0,l,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l<t.boxEndIndex;l++){var u=n.get(l),c=u.anchorPoint._matMult(o),h=c.x,f=c.y,d=h+u.x1,p=f+u.y1*s,m=h+u.x2,v=f+u.y2*s;if(u.bbox0=d,u.bbox1=p,u.bbox2=m,u.bbox3=v,!e)for(var g=this.grid.query(d,p,m,v),y=0;y<g.length;y++){var b=n.get(g[y]),x=b.anchorPoint._matMult(o);if(a=this.getPlacementScale(a,c,u,x,b),a>=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(u.x1,u.y1).matMult(w),A=new i(u.x2,u.y1).matMult(w),k=new i(u.x1,u.y2).matMult(w),T=new i(u.x2,u.y2).matMult(w);_=this.tempCollisionBox,_.anchorPointX=u.anchorPoint.x,_.anchorPointY=u.anchorPoint.y,_.x1=Math.min(M.x,A.x,k.x,T.x),_.y1=Math.min(M.y,A.x,k.x,T.x),_.x2=Math.max(M.x,A.x,k.x,T.x),_.y2=Math.max(M.y,A.x,k.x,T.x),_.maxScale=u.maxScale}else _=u;for(var S=0;S<this.edges.length;S++){var E=this.edges[S];if(a=this.getPlacementScale(a,u.anchorPoint,_,E.anchorPoint,E),a>=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,u=this.rotationMatrix,c=new i(t,e)._matMult(u),h=this.tempCollisionBox;h.anchorX=c.x,h.anchorY=c.y,h.x1=0,h.y1=0,h.x2=r-t,h.y2=n-e,h.maxScale=a,a=h.maxScale;for(var f=[c.x+h.x1/a,c.y+h.y1/a*this.yStretch,c.x+h.x2/a,c.y+h.y2/a*this.yStretch],d=this.grid.query(f[0],f[1],f[2],f[3]),p=this.ignoredGrid.query(f[0],f[1],f[2],f[3]),m=0;m<p.length;m++)d.push(p[m]);for(var v=0;v<d.length;v++){var g=l.get(d[v]),y=g.sourceLayerIndex,b=g.featureIndex;if(void 0===o[y]&&(o[y]={}),!o[y][b]){var x=g.anchorPoint.matMult(u),_=this.getPlacementScale(this.minScale,c,h,x,g);_>=a&&(o[y][b]=!0,s.push(d[v]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,u=(i.y1-r.y2)*this.yStretch/o,c=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(u)||isNaN(c))&&(u=c=1);var h=Math.min(Math.max(s,l),Math.max(u,c)),f=i.maxScale,d=r.maxScale;return h>f&&(h=f),h>d&&(h=d),h>t&&h>=i.placementScale&&(t=h),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a<t.boxEndIndex;a++){var o=i.get(a);o.placementScale=e,e<this.maxScale&&n.insert(a,o.bbox0,o.bbox1,o.bbox2,o.bbox3)}}},{"../data/bucket":296,"grid-index":257,"point-geometry":450}],364:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,s,l,u){var c=n?.6*o*s:0,h=Math.max(n?n.right-n.left:0,a?a.right-a.left:0),f=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;e-h*s<e/4&&(e=h*s+e/4);var d=2*o,p=f?e/2*l%e:(h/2+d)*s*l%e;return i(t,p,e,c,r,h*s,f,!1,u)}function i(t,e,r,n,l,u,c,h,f){for(var d=u/2,p=0,m=0;m<t.length-1;m++)p+=t[m].dist(t[m+1]);for(var v=0,g=e-r,y=[],b=0;b<t.length-1;b++){for(var x=t[b],_=t[b+1],w=x.dist(_),M=_.angleTo(x);g+r<v+w;){g+=r;var A=(g-v)/w,k=a(x.x,_.x,A),T=a(x.y,_.y,A);if(k>=0&&k<f&&T>=0&&T<f&&g-d>=0&&g+d<=p){var S=new o(k,T,M,b)._round();n&&!s(t,S,u,n,l)||y.push(S)}}v+=w}return h||y.length||c||(y=i(t,v/2,r,n,l,u,c,!0,f)),y}var a=t("../util/interpolate"),o=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../symbol/anchor":358,"../util/interpolate":403,"./check_max_angle":359}],365:[function(t,e,r){"use strict";function n(){this.width=s,this.height=s,this.bin=new i(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)}var i=t("shelf-pack"),a=t("../util/util"),o=4,s=128,l=2048;e.exports=n,n.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},n.prototype.getRects=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]={}),n[e][r]=this.index[i];return n},n.prototype.addGlyph=function(t,e,r,n){if(!r)return null;var i=e+"#"+r.id;if(this.index[i])return this.ids[i].indexOf(t)<0&&this.ids[i].push(t),this.index[i];if(!r.bitmap)return null;var o=r.width+2*n,s=r.height+2*n,l=1,u=o+2*l,c=s+2*l;u+=4-u%4,c+=4-c%4;var h=this.bin.packOne(u,c);if(h||(this.resize(),h=this.bin.packOne(u,c)),!h)return a.warnOnce("glyph bitmap overflow"),null;this.index[i]=h,this.ids[i]=[t];for(var f=this.data,d=r.bitmap,p=0;p<s;p++)for(var m=this.width*(h.y+p+l)+h.x+l,v=o*p,g=0;g<o;g++)f[m+g]=d[v+g];return this.dirty=!0,h},n.prototype.resize=function(){var t=this.width,e=this.height;if(!(t>=l||e>=l)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=o,this.height*=o,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n<e;n++){var i=new Uint8Array(this.data.buffer,e*n,t),a=new Uint8Array(r,e*n*o,t);a.set(i)}this.data=new Uint8Array(r)}},n.prototype.bind=function(t){this.gl=t,this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),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.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,null))},n.prototype.updateTexture=function(t){this.bind(t),this.dirty&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data),this.dirty=!1)}},{"../util/util":409,"shelf-pack":480}],366:[function(t,e,r){"use strict";function n(t){this.url=t&&o(t),this.atlases={},this.stacks={},this.loading={}}function i(t,e,r){var n=1;this.advance=t.advance,this.left=t.left-r-n,this.top=t.top+r+n,this.rect=e}function a(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}var o=t("../util/mapbox").normalizeGlyphsURL,s=t("../util/ajax").getArrayBuffer,l=t("../util/glyphs"),u=t("../symbol/glyph_atlas"),c=t("pbf");e.exports=n,n.prototype.getSimpleGlyphs=function(t,e,r,n){void 0===this.stacks[t]&&(this.stacks[t]={}),void 0===this.atlases[t]&&(this.atlases[t]=new u);for(var a,o={},s=this.stacks[t],l=this.atlases[t],c=3,h={},f=0,d=0;d<e.length;d++){var p=e[d];if(a=Math.floor(p/256),s[a]){var m=s[a].glyphs[p],v=l.addGlyph(r,t,m,c);m&&(o[p]=new i(m,v,c))}else void 0===h[a]&&(h[a]=[],f++),h[a].push(p)}f||n(void 0,o,t);var g=function(e,a,s){if(!e)for(var u=this.stacks[t][a]=s.stacks[0],d=0;d<h[a].length;d++){var p=h[a][d],m=u.glyphs[p],v=l.addGlyph(r,t,m,c);m&&(o[p]=new i(m,v,c))}f--,f||n(void 0,o,t)}.bind(this);for(var y in h)this.loadRange(t,y,g)},n.prototype.loadRange=function(t,e,r){if(256*e>65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=256*e+"-"+(256*e+255),o=a(t,i,this.url);s(o,function(t,r){for(var i=!t&&new l(new c(new Uint8Array(r))),a=0;a<n[e].length;a++)n[e][a](t,e,i);delete n[e]})}},n.prototype.getGlyphAtlas=function(t){return this.atlases[t]}},{"../symbol/glyph_atlas":365,"../util/ajax":392,"../util/glyphs":402,"../util/mapbox":406,pbf:444}],367:[function(t,e,r){"use strict";e.exports=function(t,e,r){function n(n){c.push(t[n]),h.push(r[n]),f.push(e[n]),d++}function i(t,e,r){var n=u[t];return delete u[t],u[e]=n,h[n][0].pop(),h[n][0]=h[n][0].concat(r[0]),n}function a(t,e,r){var n=l[e];return delete l[e],l[t]=n,h[n][0].shift(),h[n][0]=r[0].concat(h[n][0]),n}function o(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}var s,l={},u={},c=[],h=[],f=[],d=0;for(s=0;s<t.length;s++){var p=r[s],m=e[s];if(m){var v=o(m,p),g=o(m,p,!0);if(v in u&&g in l&&u[v]!==l[g]){var y=a(v,g,p),b=i(v,g,h[y]);delete l[v],delete u[g],u[o(m,h[b],!0)]=b,h[y]=null}else v in u?i(v,g,p):g in l?a(v,g,p):(n(s),l[v]=d-1,u[g]=d-1)}else n(s)}return{features:c,textFeatures:f,geometries:h}}},{}],368:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){this.anchorPoint=t,this.tl=e,this.tr=r,this.bl=n,this.br=i,this.tex=a,this.anchorAngle=o,this.glyphAngle=s,this.minScale=l,this.maxScale=u}function i(t,e,r,i,a,o,u,c,h){var f,d,p,m,v=e.image.rect,g=a.layout,y=1,b=e.left-y,x=b+v.w/e.image.pixelRatio,_=e.top-y,w=_+v.h/e.image.pixelRatio;if("none"!==g["icon-text-fit"]&&u){var M=x-b,A=w-_,k=g["text-size"]/24,T=u.left*k,S=u.right*k,E=u.top*k,L=u.bottom*k,C=S-T,D=L-E,z=g["icon-text-fit-padding"][0],I=g["icon-text-fit-padding"][1],P=g["icon-text-fit-padding"][2],O=g["icon-text-fit-padding"][3],R="width"===g["icon-text-fit"]?.5*(D-A):0,j="height"===g["icon-text-fit"]?.5*(C-M):0,F="width"===g["icon-text-fit"]||"both"===g["icon-text-fit"]?C:M,N="height"===g["icon-text-fit"]||"both"===g["icon-text-fit"]?D:A;f=new s(T+j-O,E+R-z),d=new s(T+j+I+F,E+R-z),p=new s(T+j+I+F,E+R+P+N),m=new s(T+j-O,E+R+P+N)}else f=new s(b,_),d=new s(x,_),p=new s(x,w),m=new s(b,w);var B=a.getLayoutValue("icon-rotate",c,h)*Math.PI/180;if(o){var U=i[t.segment];if(t.y===U.y&&t.x===U.x&&t.segment+1<i.length){var V=i[t.segment+1];B+=Math.atan2(t.y-V.y,t.x-V.x)+Math.PI}else B+=Math.atan2(t.y-U.y,t.x-U.x)}if(B){var H=Math.sin(B),q=Math.cos(B),Y=[q,-H,H,q];f=f.matMult(Y),d=d.matMult(Y),m=m.matMult(Y),p=p.matMult(Y)}return[new n(new s(t.x,t.y),f,d,m,p,e.image.rect,0,0,l,1/0)]}function a(t,e,r,i,a,u){for(var c=a.layout["text-rotate"]*Math.PI/180,h=a.layout["text-keep-upright"],f=e.positionedGlyphs,d=[],p=0;p<f.length;p++){var m=f[p],v=m.glyph,g=v.rect;if(g){var y,b=(m.x+v.advance/2)*r,x=l;u?(y=[],x=o(y,t,b,i,t.segment,!0),h&&(x=Math.min(x,o(y,t,b,i,t.segment,!1)))):y=[{anchorPoint:new s(t.x,t.y),offset:0,angle:0,maxScale:1/0,minScale:l}];for(var _=m.x+v.left,w=m.y-v.top,M=_+g.w,A=w+g.h,k=new s(_,w),T=new s(M,w),S=new s(_,A),E=new s(M,A),L=0;L<y.length;L++){var C=y[L],D=k,z=T,I=S,P=E;if(c){var O=Math.sin(c),R=Math.cos(c),j=[R,-O,O,R];D=D.matMult(j),z=z.matMult(j),I=I.matMult(j),P=P.matMult(j)}var F=Math.max(C.minScale,x),N=(t.angle+C.offset+2*Math.PI)%(2*Math.PI),B=(C.angle+C.offset+2*Math.PI)%(2*Math.PI);d.push(new n(C.anchorPoint,D,z,I,P,g,N,B,F,C.maxScale))}}}return d}function o(t,e,r,n,i,a){var o=!a;r<0&&(a=!a),a&&i++;var u=new s(e.x,e.y),c=n[i],h=1/0;r=Math.abs(r);for(var f=l;;){var d=u.dist(c),p=r/d,m=Math.atan2(c.y-u.y,c.x-u.x);if(a||(m+=Math.PI),t.push({anchorPoint:u,offset:o?Math.PI:0,minScale:p,maxScale:h,angle:(m+2*Math.PI)%(2*Math.PI)}),p<=f)break;for(u=c;u.equals(c);)if(i+=a?1:-1,c=n[i],!c)return p;var v=c.sub(u)._unit();u=u.sub(v._mult(d)),h=p}return f}var s=t("point-geometry");e.exports={getIconQuads:i,getGlyphQuads:a,SymbolQuad:n};var l=.5},{"point-geometry":450}],369:[function(t,e,r){"use strict";function n(t,e,r){for(var n=[],a=0,o=t.length;a<o;a++){var s=i(t[a].properties,e["text-field"]);if(s){s=s.toString();var l=e["text-transform"];"uppercase"===l?s=s.toLocaleUpperCase():"lowercase"===l&&(s=s.toLocaleLowerCase());for(var u=0;u<s.length;u++)r[s.charCodeAt(u)]=!0;n[a]=s}else n[a]=null}return n}var i=t("../util/token");e.exports=n},{"../util/token":408}],370:[function(t,e,r){"use strict";function n(t,e,r,n){this.codePoint=t,this.x=e,this.y=r,this.glyph=n}function i(t,e,r,n,i,a){this.positionedGlyphs=t,this.text=e,this.top=r,this.bottom=n,this.left=i,this.right=a}function a(t,e,r,a,s,l,u,c,h){for(var f=[],d=new i(f,t,h[1],h[1],h[0],h[0]),p=-17,m=0,v=p,g=0;g<t.length;g++){var y=t.charCodeAt(g),b=e[y];b&&(f.push(new n(y,m,v,b)),m+=b.advance+c)}return!!f.length&&(o(d,e,a,r,s,l,u,h),d)}function o(t,e,r,n,i,a,o,u){var c=null,d=0,p=0,m=0,v=0,g=t.positionedGlyphs;if(n)for(var y=0;y<g.length;y++){var b=g[y];if(b.x-=d,b.y+=r*m,b.x>n&&null!==c){var x=g[c+1].x;v=Math.max(x,v);for(var _=c+1;_<=y;_++)g[_].y+=r,g[_].x-=x;if(o){var w=c;h[g[c].codePoint]&&w--,s(g,e,p,w,o)}p=c+1,c=null,d+=x,m++}f[b.codePoint]&&(c=y)}var M=g[g.length-1],A=M.x+e[M.codePoint].advance;v=Math.max(v,A);var k=(m+1)*r;s(g,e,p,g.length-1,o),l(g,o,i,a,v,r,m,u),t.top+=-a*k,t.bottom=t.top+k,t.left+=-i*v,t.right=t.left+v}function s(t,e,r,n,i){for(var a=e[t[n].codePoint].advance,o=(t[n].x+a)*i,s=r;s<=n;s++)t[s].x-=o}function l(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],u=(-n*(o+1)+.5)*a+s[1],c=0;c<t.length;c++)t[c].x+=l,t[c].y+=u}function u(t,e){if(!t||!t.rect)return null;var r=e["icon-offset"][0],n=e["icon-offset"][1],i=r-t.width/2,a=i+t.width,o=n-t.height/2,s=o+t.height;return new c(t,o,s,i,a)}function c(t,e,r,n,i){this.image=t,this.top=e,this.bottom=r,this.left=n,this.right=i}e.exports={shapeText:a,shapeIcon:u};var h={32:!0,8203:!0},f={32:!0,38:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0}},{}],371:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.bin=new o(t,e),this.images={},this.data=!1,this.texture=0,this.filter=0,this.pixelRatio=1,this.dirty=!0}function i(t,e,r,n,i,a,o,s,l,u,c){var h,f,d=n*e+r,p=s*a+o;if(c)for(p-=a,f=-1;f<=u;f++,d=((f+u)%u+n)*e+r,p+=a)for(h=-1;h<=l;h++)i[p+h]=t[d+(h+l)%l];else for(f=0;f<u;f++,d+=e,p+=a)for(h=0;h<l;h++)i[p+h]=t[d+h]}function a(t,e,r,n,i){this.rect=t,this.width=e,this.height=r,this.sdf=n,this.pixelRatio=i}var o=t("shelf-pack"),s=t("../util/browser"),l=t("../util/util");e.exports=n,n.prototype.allocateImage=function(t,e){t/=this.pixelRatio,e/=this.pixelRatio;var r=2,n=t+r+(4-(t+r)%4),i=e+r+(4-(e+r)%4),a=this.bin.packOne(n,i);return a?a:(l.warnOnce("SpriteAtlas out of space."),null)},n.prototype.getImage=function(t,e){if(this.images[t])return this.images[t];if(!this.sprite)return null;var r=this.sprite.getSpritePosition(t);if(!r.width||!r.height)return null;var n=this.allocateImage(r.width,r.height);if(!n)return null;var i=new a(n,r.width/r.pixelRatio,r.height/r.pixelRatio,r.sdf,r.pixelRatio/this.pixelRatio);return this.images[t]=i,this.copy(n,r,e),i},n.prototype.getPosition=function(t,e){var r=this.getImage(t,e),n=r&&r.rect;if(!n)return null;var i=r.width*r.pixelRatio,a=r.height*r.pixelRatio,o=1;return{size:[r.width,r.height],tl:[(n.x+o)/this.width,(n.y+o)/this.height],br:[(n.x+o+i)/this.width,(n.y+o+a)/this.height]}},n.prototype.allocate=function(){if(!this.data){var t=Math.floor(this.width*this.pixelRatio),e=Math.floor(this.height*this.pixelRatio);this.data=new Uint32Array(t*e);for(var r=0;r<this.data.length;r++)this.data[r]=0}},n.prototype.copy=function(t,e,r){if(this.sprite.img.data){var n=new Uint32Array(this.sprite.img.data.buffer);this.allocate();var a=this.data,o=1;i(n,this.sprite.img.width,e.x,e.y,a,this.width*this.pixelRatio,(t.x+o)*this.pixelRatio,(t.y+o)*this.pixelRatio,e.width,e.height,r),this.dirty=!0}},n.prototype.setSprite=function(t){t&&(this.pixelRatio=s.devicePixelRatio>1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r<t.length;r++)this.getImage(t[r]);e(null,this.images)},n.prototype.bind=function(t,e){var r=!1;this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(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),r=!0);var n=e?t.LINEAR:t.NEAREST;n!==this.filter&&(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n),this.filter=n),this.dirty&&(this.allocate(),r?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width*this.pixelRatio,this.height*this.pixelRatio,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width*this.pixelRatio,this.height*this.pixelRatio,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)),this.dirty=!1)}},{"../util/browser":393,"../util/util":409,"shelf-pack":480}],372:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"glyphQuadStartIndex"},{type:"Uint16",name:"glyphQuadEndIndex"},{type:"Uint16",name:"iconQuadStartIndex"},{type:"Uint16",name:"iconQuadEndIndex"},{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int8",name:"index"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":407,"../util/util":409,"point-geometry":450}],373:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=t("./quads").SymbolQuad,s=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Float32",name:"tlX"},{type:"Float32",name:"tlY"},{type:"Float32",name:"trX"},{type:"Float32",name:"trY"},{type:"Float32",name:"blX"},{type:"Float32",name:"blY"},{type:"Float32",name:"brX"},{type:"Float32",name:"brY"},{type:"Int16",name:"texH"},{type:"Int16",name:"texW"},{type:"Int16",name:"texX"},{type:"Int16",name:"texY"},{type:"Float32",name:"anchorAngle"},{type:"Float32",name:"glyphAngle"},{type:"Float32",name:"maxScale"},{type:"Float32",name:"minScale"}]});i.extendAll(s.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)},get SymbolQuad(){return new o(this.anchorPoint,new a(this.tlX,this.tlY),new a(this.trX,this.trY),new a(this.blX,this.blY),new a(this.brX,this.brY),{x:this.texX,y:this.texY,h:this.texH,w:this.texW,height:this.texH,width:this.texW},this.anchorAngle,this.glyphAngle,this.minScale,this.maxScale)}})},{"../util/struct_array":407,"../util/util":409,"./quads":368,"point-geometry":450}],374:[function(t,e,r){"use strict";var n=t("../util/dom"),i=t("point-geometry"),a={scrollZoom:t("./handler/scroll_zoom"),boxZoom:t("./handler/box_zoom"),dragRotate:t("./handler/drag_rotate"),dragPan:t("./handler/drag_pan"),keyboard:t("./handler/keyboard"),doubleClickZoom:t("./handler/dblclick_zoom"),touchZoomRotate:t("./handler/touch_zoom_rotate")};e.exports=function(t,e){function r(t){g("mouseout",t)}function o(e){t.stop(),_=n.mousePos(b,e),g("mousedown",e)}function s(e){var r=t.dragRotate&&t.dragRotate.isActive();x&&!r&&g("contextmenu",x),x=null,g("mouseup",e)}function l(e){if(!(t.dragPan&&t.dragPan.isActive()||t.dragRotate&&t.dragRotate.isActive())){for(var r=e.toElement||e.target;r&&r!==b;)r=r.parentNode;r===b&&g("mousemove",e)}}function u(e){t.stop(),y("touchstart",e),!e.touches||e.touches.length>1||(w?(clearTimeout(w),w=null,g("dblclick",e)):w=setTimeout(d,300))}function c(t){y("touchmove",t)}function h(t){y("touchend",t)}function f(t){y("touchcancel",t)}function d(){w=null}function p(t){var e=n.mousePos(b,t);e.equals(_)&&g("click",t)}function m(t){g("dblclick",t),t.preventDefault()}function v(t){x=t,t.preventDefault()}function g(e,r){var i=n.mousePos(b,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function y(e,r){var a=n.touchPos(b,r),o=a.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(o),point:o,lngLats:a.map(function(e){return t.unproject(e)},this),points:a,originalEvent:r})}var b=t.getCanvasContainer(),x=null,_=null,w=null;for(var M in a)t[M]=new a[M](t,e),e.interactive&&e[M]&&t[M].enable();b.addEventListener("mouseout",r,!1),b.addEventListener("mousedown",o,!1),b.addEventListener("mouseup",s,!1),b.addEventListener("mousemove",l,!1),b.addEventListener("touchstart",u,!1),b.addEventListener("touchend",h,!1),b.addEventListener("touchmove",c,!1),b.addEventListener("touchcancel",f,!1),b.addEventListener("click",p,!1),b.addEventListener("dblclick",m,!1),b.addEventListener("contextmenu",v,!1)}},{"../util/dom":395,"./handler/box_zoom":380,"./handler/dblclick_zoom":381,"./handler/drag_pan":382,"./handler/drag_rotate":383,"./handler/keyboard":384,"./handler/scroll_zoom":385,"./handler/touch_zoom_rotate":386,"point-geometry":450}],375:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),u=e.exports=function(){};n.extend(u.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},getPitch:function(){return this.transform.pitch},setPitch:function(t,e){return this.jumpTo({pitch:t},e),this},fitBounds:function(t,e,r){e=n.extend({padding:0,offset:[0,0],maxZoom:1/0},e),t=s.convert(t);var i=l.convert(e.offset),a=this.transform,o=a.project(t.getNorthWest()),u=a.project(t.getSouthEast()),c=u.sub(o),h=(a.width-2*e.padding-2*Math.abs(i.x))/c.x,f=(a.height-2*e.padding-2*Math.abs(i.y))/c.y;return e.center=a.unproject(o.add(u).div(2)),e.zoom=Math.min(a.scaleZoom(a.scale*Math.min(h,f)),e.maxZoom),e.bearing=0,e.linear?this.easeTo(e,r):this.flyTo(e,r)},jumpTo:function(t,e){this.stop();var r=this.transform,n=!1,i=!1,a=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(n=!0,r.zoom=+t.zoom),"center"in t&&(r.center=o.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(i=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.pitch=+t.pitch),this.fire("movestart",e).fire("move",e),n&&this.fire("zoomstart",e).fire("zoom",e).fire("zoomend",e),i&&this.fire("rotate",e),a&&this.fire("pitch",e),this.fire("moveend",e)},easeTo:function(t,e){this.stop(),t=n.extend({offset:[0,0],duration:500,easing:n.ease},t);var r,a,s=this.transform,u=l.convert(t.offset),c=this.getZoom(),h=this.getBearing(),f=this.getPitch(),d="zoom"in t?+t.zoom:c,p="bearing"in t?this._normalizeBearing(t.bearing,h):h,m="pitch"in t?+t.pitch:f;"center"in t?(r=o.convert(t.center),a=s.centerPoint.add(u)):"around"in t?(r=o.convert(t.around),a=s.locationPoint(r)):(a=s.centerPoint.add(u),r=s.pointLocation(a));var v=s.locationPoint(r);return t.animate===!1&&(t.duration=0),this.zooming=d!==c,this.rotating=h!==p,this.pitching=m!==f,t.noMoveStart||this.fire("movestart",e),this.zooming&&this.fire("zoomstart",e),clearTimeout(this._onEaseEnd),this._ease(function(t){this.zooming&&(s.zoom=i(c,d,t)),this.rotating&&(s.bearing=i(h,p,t)),this.pitching&&(s.pitch=i(f,m,t)),s.setLocationAtPoint(r,v.add(a.sub(v)._mult(t))),this.fire("move",e),this.zooming&&this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)},function(){t.delayEndEvents?this._onEaseEnd=setTimeout(this._easeToEnd.bind(this,e),t.delayEndEvents):this._easeToEnd(e)}.bind(this),t),this},_easeToEnd:function(t){var e=this.zooming;this.zooming=!1,this.rotating=!1,this.pitching=!1,e&&this.fire("zoomend",t),this.fire("moveend",t)},flyTo:function(t,e){function r(t){var e=(k*k-A*A+(t?-1:1)*L*L*T*T)/(2*(t?k:A)*L*T);return Math.log(Math.sqrt(e*e+1)-e)}function a(t){return(Math.exp(t)-Math.exp(-t))/2}function s(t){return(Math.exp(t)+Math.exp(-t))/2}function u(t){return a(t)/s(t)}this.stop(),t=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},t);var c=this.transform,h=l.convert(t.offset),f=this.getZoom(),d=this.getBearing(),p=this.getPitch(),m="center"in t?o.convert(t.center):this.getCenter(),v="zoom"in t?+t.zoom:f,g="bearing"in t?this._normalizeBearing(t.bearing,d):d,y="pitch"in t?+t.pitch:p;Math.abs(c.center.lng)+Math.abs(m.lng)>180&&(c.center.lng>0&&m.lng<0?m.lng+=360:c.center.lng<0&&m.lng>0&&(m.lng-=360));var b=c.zoomScale(v-f),x=c.point,_="center"in t?c.project(m).sub(h.div(b)):x,w=c.worldSize,M=t.curve,A=Math.max(c.width,c.height),k=A/b,T=_.sub(x).mag();if("minZoom"in t){var S=n.clamp(Math.min(t.minZoom,f,v),c.minZoom,c.maxZoom),E=A/c.zoomScale(S-f);M=Math.sqrt(E/T*2)}var L=M*M,C=r(0),D=function(t){return s(C)/s(C+M*t)},z=function(t){return A*((s(C)*u(C+M*t)-a(C))/L)/T},I=(r(1)-C)/M;if(Math.abs(T)<1e-6){if(Math.abs(A-k)<1e-6)return this.easeTo(t);var P=k<A?-1:1;I=Math.abs(Math.log(k/A))/M,z=function(){return 0},D=function(t){return Math.exp(P*M*t)}}if("duration"in t)t.duration=+t.duration;else{var O="screenSpeed"in t?+t.screenSpeed/M:+t.speed;t.duration=1e3*I/O}return this.zooming=!0,d!==g&&(this.rotating=!0),p!==y&&(this.pitching=!0),this.fire("movestart",e),this.fire("zoomstart",e),this._ease(function(t){var r=t*I,n=z(r);c.zoom=f+c.scaleZoom(1/D(r)),c.center=c.unproject(x.add(_.sub(x).mult(n)),w),this.rotating&&(c.bearing=i(d,g,t)),this.pitching&&(c.pitch=i(p,y,t)),this.fire("move",e),this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)},function(){this.zooming=!1,this.rotating=!1,this.pitching=!1,this.fire("zoomend",e),this.fire("moveend",e)},t),this},isEasing:function(){return!!this._abortFn},stop:function(){return this._abortFn&&(this._abortFn(),this._finishEase()),this},_ease:function(t,e,r){this._finishFn=e,this._abortFn=a.timed(function(e){t.call(this,r.easing(e)),1===e&&this._finishEase()},r.animate===!1?0:r.duration,this)},_finishEase:function(){delete this._abortFn;var t=this._finishFn;delete this._finishFn,t.call(this)},_normalizeBearing:function(t,e){t=n.wrap(t,-180,180);var r=Math.abs(t-e);return Math.abs(t-360-e)<r&&(t-=360),Math.abs(t+360-e)<r&&(t+=360),t},_updateEasing:function(t,e,r){var i;if(this.ease){var a=this.ease,o=(Date.now()-a.start)/a.duration,s=a.easing(o+.01)-a.easing(o),l=.27/Math.sqrt(s*s+1e-4)*.01,u=Math.sqrt(.0729-l*l);i=n.bezier(l,u,.25,1)}else i=r?n.bezier.apply(n,r):n.ease;return this.ease={start:(new Date).getTime(),to:Math.pow(2,e),duration:t,easing:i},i}})},{"../geo/lng_lat":306,"../geo/lng_lat_bounds":307,"../util/browser":393,"../util/interpolate":403,"../util/util":409,"point-geometry":450}],376:[function(t,e,r){"use strict";function n(t){o.setOptions(this,t)}var i=t("./control"),a=t("../../util/dom"),o=t("../../util/util");e.exports=n,n.createAttributionString=function(t){var e=[];for(var r in t){var n=t[r];n.attribution&&e.indexOf(n.attribution)<0&&e.push(n.attribution)}return e.sort(function(t,e){return t.length-e.length}),e=e.filter(function(t,r){for(var n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}),e.join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e="mapboxgl-ctrl-attrib",r=this._container=a.create("div",e,t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),r},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":395,"../../util/util":409,"./control":377}],377:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",r.indexOf("bottom")!==-1?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":401,"../../util/util":409}],378:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right" },onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button",e+"-icon "+e+"-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),r):r},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":393,"../../util/dom":395,"../../util/util":409,"./control":377}],379:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":395,"../../util/util":409,"./control":377}],380:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":307,"../../util/dom":395,"../../util/util":409}],381:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],382:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=.3,s=a.bezier(0,0,o,1),l=1400,u=2500;n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=Date.now(),this._pos)},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)return void e();var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),c=(n[0]-i[0])/1e3;if(0===c||n[1].equals(i[1]))return void e();var h=a.mult(o/c),f=h.mag();f>l&&(f=l,h._unit()._mult(f));var d=f/(u*o),p=h.mult(-d/2);this._map.panBy(p,{duration:1e3*d,easing:s,noMoveStart:!0},{originalEvent:t})}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;var r=1,n=0;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()}}},{"../../util/dom":395,"../../util/util":409}],383:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=.25,l=o.bezier(0,0,s,1),u=180,c=720;n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=Date.now(),this._map.getBearing(),this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center),r=e.mag();r<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,u[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)<this._bearingSnap?e.resetNorth({noMoveStart:!0},{originalEvent:t}):this._fireEvent("moveend",t)}.bind(this);if(n.length<2)return void i();var a=n[0],o=n[n.length-1],h=n[n.length-2],f=e._normalizeBearing(r,h[1]),d=o[1]-a[1],p=d<0?-1:1,m=(o[0]-a[0])/1e3;if(0===d||0===m)return void i();var v=Math.abs(d*(s/m));v>u&&(v=u);var g=v/(c*s),y=p*v*(g/2);f+=y,Math.abs(e._normalizeBearing(f,0))<this._bearingSnap&&(f=e._normalizeBearing(0,f)),e.rotateTo(f,{duration:1e3*g,easing:l,noMoveStart:!0},{originalEvent:t})}},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragPan&&e.dragPan.isActive())return!0;if(t.touches)return t.touches.length>1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()}}},{"../../util/dom":395,"../../util/util":409,"point-geometry":450}],384:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;var i=80,a=2,o=5;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-a},r):(t.preventDefault(),e.panBy([-i,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+a},r):(t.preventDefault(),e.panBy([i,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+o},r):(t.preventDefault(),e.panBy([0,-i],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-o,0)},r):(t.preventDefault(),e.panBy([0,i],r))}}}}},{}],385:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=s.indexOf("firefox")!==-1,u=s.indexOf("safari")!==-1&&s.indexOf("chrom")===-1;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625===0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":393,"../../util/dom":395,"../../util/util":409}],386:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=.15,s=a.bezier(0,0,o,1),l=12,u=2.5,c=.15,h=4;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(u.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(u.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(u,{originalEvent:t})}else{var f=Math.abs(1-o)>c,d=Math.abs(s)>h;d?this._gestureIntent="rotate":f&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),c=r.transform.scaleZoom(this._startScale*i[1]),h=a-c,f=(n[0]-i[0])/1e3,d=n[2];if(0===f||a===c)return void r.snapToNorth({},{originalEvent:t});var p=h*o/f;Math.abs(p)>u&&(p=p>0?u:-u);var m=1e3*Math.abs(p/(l*o)),v=a+p*m/2e3;v<0&&(v=0),r.easeTo({zoom:v,duration:m,easing:s,around:r.unproject(d)},{originalEvent:t})},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>2&&e-t[0][0]>r;)t.shift()}}},{"../../util/dom":395,"../../util/util":409}],387:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":409}],388:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),u=t("../util/dom"),c=t("../style/style"),h=t("../style/animation_loop"),f=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),v=t("./camera"),g=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),b=t("point-geometry"),x=t("./control/attribution"),_=0,w=20,M={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:_,maxZoom:w,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},A=e.exports=function(t){if(t=a.extend({},M,t),t.workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new h,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),"undefined"!=typeof s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new x(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(A.prototype,l),a.extend(A.prototype,v.prototype),a.extend(A.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n<t.length;n++)""!==t[n]&&(r[t[n]]=!0);return this._classes=Object.keys(r),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0)},hasClass:function(t){return this._classes.indexOf(t)>=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new b(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new b(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new b(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if(t=null===t||void 0===t?_:t,t>=_&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between "+_+" and the current maxZoom, inclusive")},setMaxZoom:function(t){if(t=null===t||void 0===t?w:t,t>=this.transform.minZoom&&t<=w)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and "+w+", inclusive")},project:function(t){return this.transform.locationPoint(g.convert(t))},unproject:function(t){return this.transform.pointLocation(b.convert(t))},queryRenderedFeatures:function(){function t(t){return t instanceof b||Array.isArray(t)}var e,r={};return 2===arguments.length?(e=arguments[0],r=arguments[1]):1===arguments.length&&t(arguments[0])?e=arguments[0]:1===arguments.length&&(r=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(e),r,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[b.convert([0,0]),b.convert([this.transform.width,this.transform.height])]);var e,r=t instanceof b||"number"==typeof t[0];if(r){var n=b.convert(t);e=[n]}else{var i=[b.convert(t[0]),b.convert(t[1])];e=[i[0],new b(i[1].x,i[0].y),i[1],new b(i[0].x,i[1].y),i[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(t instanceof c?this.style=t:this.style=new c(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=u.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=u.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=u.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});return t?void(this.painter=new f(t,this.transform)):void this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),"undefined"!=typeof s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(A.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":306,"../geo/lng_lat_bounds":307,"../geo/transform":308,"../render/painter":322,"../style/animation_loop":342,"../style/style":345,"../util/browser":393,"../util/canvas":394,"../util/dom":395,"../util/evented":401,"../util/util":409,"./bind_handlers":374,"./camera":375,"./control/attribution":376,"./hash":387,"point-geometry":450}],389:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode; return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":306,"../util/dom":395,"point-geometry":450}],390:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;;){if(e=n.firstChild,!e)break;r.appendChild(e)}return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.y<n?["top"]:t.y>this._map.transform.height-n?["bottom"]:[],t.x<r/2?e.push("left"):t.x>this._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":306,"../util/dom":395,"../util/evented":401,"../util/util":409}],391:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"<response>",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if("<response>"===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if("undefined"!=typeof n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if("undefined"!=typeof n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],392:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i<t.length;i++){var a=document.createElement("source");n(t[i])||(r.crossOrigin="Anonymous"),a.src=t[i],r.appendChild(a)}return r.getData=function(){return r},r}},{}],393:[function(t,e,r){"use strict";r.window=window,e.exports.now=function(){return window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now.bind(Date)}();var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;r.frame=function(t){return n(t)};var i=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;r.cancelFrame=function(t){i(t)},r.timed=function(t,n,i){function a(l){o||(l=e.exports.now(),l>=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":294}],394:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":409,"mapbox-gl-supported":294}],395:[function(t,e,r){"use strict";function n(t){for(var e=0;e<t.length;e++)if(t[e]in s)return t[e]}function i(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",i,!0)}var a=t("point-geometry");r.create=function(t,e,r){var n=document.createElement(t);return e&&(n.className=e),r&&r.appendChild(n),n};var o,s=document.documentElement.style,l=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){l&&(o=s[l],s[l]="none")},r.enableDrag=function(){l&&(s[l]=o)};var u=n(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[u]=e},r.suppressClick=function(){window.addEventListener("click",i,!0),window.setTimeout(function(){window.removeEventListener("click",i,!0)},0)},r.mousePos=function(t,e){var r=t.getBoundingClientRect();return e=e.touches?e.touches[0]:e,new a(e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop)},r.touchPos=function(t,e){for(var r=t.getBoundingClientRect(),n=[],i=0;i<e.touches.length;i++)n.push(new a(e.touches[i].clientX-r.left-t.clientLeft,e.touches[i].clientY-r.top-t.clientTop));return n}},{"point-geometry":450}],396:[function(t,e,r){"use strict";var n=t("webworkify");e.exports=function(){return new n(t("../../source/worker"))}},{"../../source/worker":340,webworkify:528}],397:[function(t,e,r){"use strict";function n(t,e){return e.area-t.area}function i(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.x-e.x)*(e.y+r.y);return n}var a=t("quickselect");e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var o,s,l=[],u=0;u<r;u++){var c=i(t[u]);0!==c&&(t[u].area=Math.abs(c),void 0===s&&(s=c<0),s===c<0?(o&&l.push(o),o=[t[u]]):o.push(t[u]))}if(o&&l.push(o),e>1)for(var h=0;h<l.length;h++)l[h].length<=e||(a(l[h],e,1,l[h].length-1,n),l[h]=l[h].slice(0,e));return l}},{quickselect:459}],398:[function(t,e,r){"use strict";e.exports={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0}},{}],399:[function(t,e,r){"use strict";function n(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}var i=t("assert");e.exports=n,n.prototype.encode=function(t){return i(t in this._stringToNumber),this._stringToNumber[t]},n.prototype.decode=function(t){return i(t<this._numberToString.length),this._numberToString[t]}},{assert:37}],400:[function(t,e,r){"use strict";function n(t,e){this.actors=[],this.currentActor=0;for(var r=0;r<t;r++){var n=new o,i=new a(n,e);i.name="Worker "+r,this.actors.push(i)}}var i=t("./util"),a=t("./actor"),o=t("./web_worker");e.exports=n,n.prototype={broadcast:function(t,e,r){r=r||function(){},i.asyncAll(this.actors,function(r,n){r.send(t,e,n)},r)},send:function(t,e,r,n,i){return("number"!=typeof n||isNaN(n))&&(n=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[n].send(t,e,r,i),n},remove:function(){for(var t=0;t<this.actors.length;t++)this.actors[t].target.terminate();this.actors=[]}}},{"./actor":391,"./util":409,"./web_worker":396}],401:[function(t,e,r){"use strict";var n=t("./util"),i={on:function(t,e){return this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e),this},off:function(t,e){if(!t)return delete this._events,this;if(!this.listens(t))return this;if(e){var r=this._events[t].indexOf(e);r>=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i<r.length;i++)r[i].call(this,e);return this},listens:function(t){return!(!this._events||!this._events[t])}};e.exports=i},{"./util":409}],402:[function(t,e,r){"use strict";function n(t,e){this.stacks=t.readFields(i,[],e)}function i(t,e,r){if(1===t){var n=r.readMessage(a,{glyphs:{}});e.push(n)}}function a(t,e,r){if(1===t)e.name=r.readString();else if(2===t)e.range=r.readString();else if(3===t){var n=r.readMessage(o,{});e.glyphs[n.id]=n}}function o(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}e.exports=n},{}],403:[function(t,e,r){"use strict";function n(t,e,r){return t*(1-r)+e*r}e.exports=n,n.number=n,n.vec2=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r)]},n.color=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r),n(t[2],e[2],r),n(t[3],e[3],r)]},n.array=function(t,e,r){return t.map(function(t,i){return n(t,e[i],r)})}},{}],404:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<t.length;n++)for(var i=t[n],a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s];if(d(i,l))return!0;if(c(l,i,r))return!0}return!1}function i(t,e){if(1===t.length&&1===t[0].length)return f(e,t[0][0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(f(t,n[i]))return!0;for(var a=0;a<t.length;a++){for(var o=t[a],l=0;l<o.length;l++)if(f(e,o[l]))return!0;for(var u=0;u<e.length;u++)if(s(o,e[u]))return!0}return!1}function a(t,e,r){for(var n=0;n<e.length;n++)for(var i=e[n],a=0;a<t.length;a++){var s=t[a];if(s.length>=3)for(var l=0;l<i.length;l++)if(d(s,i[l]))return!0;if(o(s,i,r))return!0}return!1}function o(t,e,r){if(t.length>1){if(s(t,e))return!0;for(var n=0;n<e.length;n++)if(c(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(c(t[i],e,r))return!0;return!1}function s(t,e){for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++){var o=e[a],s=e[a+1];if(u(n,i,o,s))return!0}return!1}function l(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function u(t,e,r,n){return l(t,r,n)!==l(e,r,n)&&l(t,e,r)!==l(t,e,n)}function c(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++){var a=e[i-1],o=e[i];if(h(t,a,o)<n)return!0}return!1}function h(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function f(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++){r=t[o];for(var s=0,l=r.length-1;s<r.length;l=s++)n=r[s],i=r[l],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function d(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:n,multiPolygonIntersectsMultiPolygon:i,multiPolygonIntersectsBufferedMultiLine:a}},{}],405:[function(t,e,r){"use strict";function n(t,e){this.max=t,this.onRemove=e,this.reset()}e.exports=n,n.prototype.reset=function(){for(var t in this.data)this.onRemove(this.data[t]);return this.data={},this.order=[],this},n.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],406:[function(t,e,r){"use strict";function n(t,e,r){if(r=r||o.ACCESS_TOKEN,!r&&o.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,o.API_URL+e),t+=t.indexOf("?")!==-1?"&access_token=":"?access_token=",o.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}function a(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?u.extend({},t,{access_token:o.ACCESS_TOKEN}):t}var o=t("./config"),s=t("./browser"),l=t("url"),u=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=l.parse(t);if("mapbox:"!==r.protocol)return t;var a=r.pathname.split("/")[1];return n("mapbox://"+a+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=l.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,l.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=l.parse(t,!0);if(!e)return t;var i=l.parse(e);if("mapbox:"!==i.protocol)return t;var o=s.supportsWebp?".webp":"$1",u=s.devicePixelRatio>=2||512===r?"@2x":"";return l.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,u+o),query:a(n.query)})}},{"./browser":393,"./config":398,"./util":409,url:509}],407:[function(t,e,r){"use strict";function n(t){function e(){f.apply(this,arguments)}function r(){d.apply(this,arguments),this.members=e.prototype.members}var n=JSON.stringify(t);if(v[n])return v[n];void 0===t.alignment&&(t.alignment=1),e.prototype=Object.create(f.prototype);var s=0,u=0,g=["Uint8"];return e.prototype.members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},p(r.name.length),p(r.type in m),g.indexOf(r.type)<0&&g.push(r.type);var n=o(r.type);u=Math.max(u,n),r.offset=s=a(s,Math.max(t.alignment,n));for(var i=0;i<r.components;i++)Object.defineProperty(e.prototype,r.name+(1===r.components?"":i),{get:c(r,i),set:h(r,i)});return s+=n*r.components,r}),e.prototype.alignment=t.alignment,e.prototype.size=a(s,Math.max(u,t.alignment)),r.serialize=i,r.prototype=Object.create(d.prototype),r.prototype.StructType=e,r.prototype.bytesPerElement=e.prototype.size,r.prototype.emplaceBack=l(e.prototype.members,e.prototype.size),r.prototype._usedTypes=g,v[n]=r,r}function i(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function a(t,e){return Math.ceil(t/e)*e}function o(t){return m[t].BYTES_PER_ELEMENT}function s(t){return t.toLowerCase()}function l(t,e){for(var r=[],n=[],i="var i = this.length;\nthis.resize(this.length + 1);\n",a=0;a<t.length;a++){var l=t[a],u=o(l.type);r.indexOf(u)<0&&(r.push(u),i+="var o"+u.toFixed(0)+" = i * "+(e/u).toFixed(0)+";\n");for(var c=0;c<l.components;c++){var h="v"+n.length,f="o"+u.toFixed(0)+" + "+(l.offset/u+c).toFixed(0);i+="this."+s(l.type)+"["+f+"] = "+h+";\n",n.push(h)}}return i+="return i;",new Function(n,i)}function u(t,e){var r="this._pos"+o(t.type).toFixed(0),n=(t.offset/o(t.type)+e).toFixed(0),i=r+" + "+n;return"this._structArray."+s(t.type)+"["+i+"]"}function c(t,e){return new Function([],"return "+u(t,e)+";")}function h(t,e){return new Function(["x"],u(t,e)+" = x;")}function f(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function d(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var p=t("assert");e.exports=n;var m={Int8:Int8Array,Uint8:Uint8Array,Uint8Clamped:Uint8ClampedArray,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array,Float64:Float64Array},v={};d.prototype.DEFAULT_CAPACITY=128,d.prototype.RESIZE_MULTIPLIER=5,d.prototype.serialize=function(){return this.trim(),{length:this.length,arrayBuffer:this.arrayBuffer}},d.prototype.get=function(t){return new this.StructType(this,t)},d.prototype.trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},d.prototype.resize=function(t){if(this.length=t,t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},d.prototype._refreshViews=function(){for(var t=0;t<this._usedTypes.length;t++){var e=this._usedTypes[t];this[s(e)]=new m[e](this.arrayBuffer)}},d.prototype.toArray=function(t,e){for(var r=[],n=t;n<e;n++){var i=this.get(n);r.push(i)}return r}},{assert:37}],408:[function(t,e,r){"use strict";function n(t,e){return e.replace(/{([^{}]+)}/g,function(e,r){return r in t?t[r]:""})}e.exports=n},{}],409:[function(t,e,r){"use strict";var n=t("unitbezier"),i=t("../geo/coordinate");r.easeCubicInOut=function(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)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t<arguments.length;t++){var e=arguments[t];if(null!==e&&void 0!==e)return e}},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),i[o]=e,0===--n&&r(a,i)})})},r.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},r.extend=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},r.extendAll=function(t,e){for(var r in e)Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));return t},r.inherit=function(t,e){var n="function"==typeof t?t.prototype:t,i=Object.create(n);return r.extendAll(i,e),i},r.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r};var a=1;r.uniqueId=function(){return a++},r.debounce=function(t,e){var r,n;return function(){n=arguments,clearTimeout(r),r=setTimeout(function(){t.apply(null,n)},e)}},r.bindAll=function(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})},r.bindHandlers=function(t){for(var e in t)"function"==typeof t[e]&&0===e.indexOf("_on")&&(t[e]=t[e].bind(t))},r.setOptions=function(t,e){t.hasOwnProperty("options")||(t.options=t.options?Object.create(t.options):{});for(var r in e)t.options[r]=e[r];return t.options},r.getCoordinatesCenter=function(t){for(var e=1/0,r=1/0,n=-(1/0),a=-(1/0),o=0;o<t.length;o++)e=Math.min(e,t[o].column),r=Math.min(r,t[o].row),n=Math.max(n,t[o].column),a=Math.max(a,t[o].row);var s=n-e,l=a-r,u=Math.max(s,l);return new i((e+n)/2,(r+a)/2,0).zoomTo(Math.floor(-Math.log(u)/Math.LN2))},r.endsWith=function(t,e){return t.indexOf(e,t.length-e.length)!==-1},r.startsWith=function(t,e){return 0===t.indexOf(e)},r.mapObject=function(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n},r.filterObject=function(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n},r.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return!1;var i=Object.keys(e);if(i.length!==Object.keys(r).length)return!1;for(var a in e)if(!t(e[a],r[a]))return!1;return!0}return e===r},r.clone=function(t){return Array.isArray(t)?t.map(r.clone):"object"==typeof t?r.mapObject(t,r.clone):t},r.arraysIntersect=function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":305,unitbezier:508}],410:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],411:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],412:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;i<t;++i)n[i]=0,i===e&&(n[i]+=.5),i===r&&(n[i]+=.5);return n}function i(t,e){if(0===e||e===(1<<t+1)-1)return[];for(var r=[],i=[],a=0;a<=t;++a)if(e&1<<a){r.push(n(t,a-1,a-1)),i.push(null);for(var s=0;s<=t;++s)~e&1<<s&&(r.push(n(t,a-1,s-1)), i.push([a,s]))}var l=o(r),u=[];t:for(var a=0;a<l.length;++a){for(var c=l[a],h=[],s=0;s<c.length;++s){if(!i[c[s]])continue t;h.push(i[c[s]].slice())}u.push(h)}return u}function a(t){for(var e=1<<t+1,r=new Array(e),n=0;n<e;++n)r[n]=i(t,n);return r}e.exports=a;var o=t("convex-hull")},{"convex-hull":86}],413:[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}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function a(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var o=t("./normalize"),s=t("gl-mat4/create"),l=t("gl-mat4/clone"),u=t("gl-mat4/determinant"),c=t("gl-mat4/invert"),h=t("gl-mat4/transpose"),f={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},d=s(),p=s(),m=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],g=[0,0,0];e.exports=function(t,e,r,s,y,b){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),b||(b=[0,0,0,1]),!o(d,t))return!1;if(l(p,d),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(u(p)<1e-8))return!1;var x=d[3],_=d[7],w=d[11],M=d[12],A=d[13],k=d[14],T=d[15];if(0!==x||0!==_||0!==w){m[0]=x,m[1]=_,m[2]=w,m[3]=T;var S=c(p,p);if(!S)return!1;h(p,p),n(y,m,p)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=M,e[1]=A,e[2]=k,i(v,d),r[0]=f.length(v[0]),f.normalize(v[0],v[0]),s[0]=f.dot(v[0],v[1]),a(v[1],v[1],v[0],1,-s[0]),r[1]=f.length(v[1]),f.normalize(v[1],v[1]),s[0]/=r[1],s[1]=f.dot(v[0],v[2]),a(v[2],v[2],v[0],1,-s[1]),s[2]=f.dot(v[1],v[2]),a(v[2],v[2],v[1],1,-s[2]),r[2]=f.length(v[2]),f.normalize(v[2],v[2]),s[1]/=r[2],s[2]/=r[2],f.cross(g,v[1],v[2]),f.dot(v[0],g)<0)for(var E=0;E<3;E++)r[E]*=-1,v[E][0]*=-1,v[E][1]*=-1,v[E][2]*=-1;return b[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),b[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),b[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),b[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[1][2]&&(b[0]=-b[0]),v[0][2]>v[2][0]&&(b[1]=-b[1]),v[1][0]>v[0][1]&&(b[2]=-b[2]),!0}},{"./normalize":414,"gl-mat4/clone":148,"gl-mat4/create":149,"gl-mat4/determinant":150,"gl-mat4/invert":154,"gl-mat4/transpose":164,"gl-vec3/cross":242,"gl-vec3/dot":243,"gl-vec3/length":244,"gl-vec3/normalize":246}],414:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],415:[function(t,e,r){function n(t,e,r,n){if(0===c(e)||0===c(r))return!1;var i=u(e,f.translate,f.scale,f.skew,f.perspective,f.quaternion),a=u(r,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return!(!i||!a)&&(s(p.translate,f.translate,d.translate,n),s(p.skew,f.skew,d.skew,n),s(p.scale,f.scale,d.scale,n),s(p.perspective,f.perspective,d.perspective,n),h(p.quaternion,f.quaternion,d.quaternion,n),l(t,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:o(),quaternion:o()}}function a(t){return[t||0,t||0,t||0]}function o(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),u=t("mat4-decompose"),c=t("gl-mat4/determinant"),h=t("quat-slerp"),f=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":150,"gl-vec3/lerp":245,"mat4-decompose":413,"mat4-recompose":416,"quat-slerp":455}],416:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":149,"gl-mat4/fromRotationTranslation":152,"gl-mat4/identity":153,"gl-mat4/multiply":156,"gl-mat4/scale":162,"gl-mat4/translate":163}],417:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-(1/0),1/0]}function i(t){t=t||{};var e=t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new n(e)}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),u=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),h=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),d=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];e.exports=i;var m=n.prototype;m.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(r<0)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,f=!0,u=0;u<16;++u)h[u]=i[l++];for(var p=this.nextMatrix,u=0;u<16;++u)p[u]=i[l++],f=f&&h[u]===p[u];if(c<1e-6||f)for(var u=0;u<16;++u)n[u]=h[u];else o(n,h,p,(t-e[r])/c)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[6],d(m,m);var v=this.computedInverse;s(v,n);var g=this.computedEye,y=v[15];g[0]=v[12]/y,g[1]=v[13]/y,g[2]=v[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;u<3;++u)b[u]=g[u]-n[2+4*u]*x}},m.idle=function(t){if(!(t<this.lastT())){for(var e=this._components,r=e.length-16,n=0;n<16;++n)e.push(e[r++]);this._time.push(t)}},m.flush=function(t){var e=a.gt(this._time,t)-2;e<0||(this._time.slice(0,e),this._components.slice(0,16*e))},m.lastT=function(){return this._time[this._time.length-1]},m.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(t,h(this.computedMatrix,e,r,n));for(var i=0,a=0;a<3;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},m.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&u(i,i,e),r&&l(i,i,r),n&&c(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var v=[0,0,0];m.pan=function(t,e,r,n){v[0]=-(e||0),v[1]=-(r||0),v[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;f(i,i,v),this.setMatrix(t,s(i,i))},m.translate=function(t,e,r,n){v[0]=e||0,v[1]=r||0,v[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;f(i,i,v),this.setMatrix(t,i)},m.setMatrix=function(t,e){if(!(t<this.lastT())){this._time.push(t);for(var r=0;r<16;++r)this._components.push(e[r])}},m.setDistance=function(t,e){this.computedRadius[0]=e},m.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},m.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":56,"gl-mat4/invert":154,"gl-mat4/lookAt":155,"gl-mat4/rotateX":159,"gl-mat4/rotateY":160,"gl-mat4/rotateZ":161,"gl-mat4/scale":162,"gl-mat4/translate":163,"gl-vec3/normalize":246,"mat4-interpolate":415}],418:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e<3){for(var r=new Array(e),n=0;n<e;++n)r[n]=n;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}for(var a=new Array(e),n=0;n<e;++n)a[n]=n;a.sort(function(e,r){var n=t[e][0]-t[r][0];return n?n:t[e][1]-t[r][1]});for(var o=[a[0],a[1]],s=[a[0],a[1]],n=2;n<e;++n){for(var l=a[n],u=t[l],c=o.length;c>1&&i(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),h=0,n=0,f=o.length;n<f;++n)r[h++]=o[n];for(var d=s.length-2;d>0;--d)r[h++]=s[d];return r}e.exports=n;var i=t("robust-orientation")[3]},{"robust-orientation":474}],419:[function(t,e,r){"use strict";function n(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==v.alt,v.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==v.shift,v.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==v.control,v.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==v.meta,v.meta=!!t.metaKey),e}function n(t,n){var a=i.x(n),o=i.y(n);"buttons"in n&&(t=0|n.buttons),(t!==d||a!==p||o!==m||r(n))&&(d=0|t,p=a||0,m=o||0,e&&e(d,p,m,v))}function a(t){n(0,t)}function o(){(d||p||m||v.shift||v.alt||v.meta||v.control)&&(p=m=0,d=0,v.shift=v.alt=v.control=v.meta=!1,e&&e(0,0,0,v))}function s(t){r(t)&&e&&e(d,p,m,v)}function l(t){0===i.buttons(t)?n(0,t):n(d,t)}function u(t){n(d|i.buttons(t),t)}function c(t){n(d&~i.buttons(t),t)}function h(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",u),t.addEventListener("mouseup",c),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}function f(){g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",u),t.removeEventListener("mouseup",c),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))}e||(e=t,t=window);var d=0,p=0,m=0,v={shift:!1,alt:!1,control:!1,meta:!1},g=!1;h();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return g},set:function(t){t?h():f()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return m},enumerable:!0},mods:{get:function(){return v},enumerable:!0}}),y}e.exports=n;var i=t("mouse-event")},{"mouse-event":421}],420:[function(t,e,r){function n(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var n=t.clientX||0,a=t.clientY||0,o=i(e);return r[0]=n-o.left,r[1]=a-o.top,r}function i(t){return t===window||t===document||t===document.body?a:t.getBoundingClientRect()}var a={left:0,top:0};e.exports=n},{}],421:[function(t,e,r){"use strict";function n(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<<e-1}else if("button"in t){var e=t.button;if(1===e)return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0}function i(t){return t.target||t.srcElement||window}function a(t){if("object"==typeof t){if("offsetX"in t)return t.offsetX;var e=i(t),r=e.getBoundingClientRect();return t.clientX-r.left}return 0}function o(t){if("object"==typeof t){if("offsetY"in t)return t.offsetY;var e=i(t),r=e.getBoundingClientRect();return t.clientY-r.top}return 0}r.buttons=n,r.element=i,r.x=a,r.y=o},{}],422:[function(t,e,r){"use strict";function n(t,e,r){"function"==typeof t&&(r=!!e,e=t,t=window);var n=i("ex",t),a=function(t){r&&t.preventDefault();var i=t.deltaX||0,a=t.deltaY||0,o=t.deltaZ||0,s=t.deltaMode,l=1;switch(s){case 1:l=n;break;case 2:l=window.innerHeight}if(i*=l,a*=l,o*=l,i||a||o)return e(i,a,o,t)};return t.addEventListener("wheel",a),a}var i=t("to-px");e.exports=n},{"to-px":499}],423:[function(t,e,r){"use strict";function n(t){return"a"+t}function i(t){return"d"+t}function a(t,e){return"c"+t+"_"+e}function o(t){return"s"+t}function s(t,e){return"t"+t+"_"+e}function l(t){return"o"+t}function u(t){return"x"+t}function c(t){return"p"+t}function h(t,e){return"d"+t+"_"+e}function f(t){return"i"+t}function d(t,e){return"u"+t+"_"+e}function p(t){return"b"+t}function m(t){return"y"+t}function v(t){return"e"+t}function g(t){return"v"+t}function y(t,e,r){for(var n=0,i=0;i<t;++i)e&1<<i&&(n|=1<<r[i]);return n}function b(t,e,r,b,x,E){function L(t,e){F.push("for(",f(x[t]),"=",e,";",f(x[t]),"<",o(x[t]),";","++",f(x[t]),"){")}function C(t){for(var e=0;e<O;++e)F.push(c(e),"+=",d(e,x[t]),";");F.push("}")}function D(t){for(var e=t-1;e>=0;--e)L(e,0);for(var r=[],e=0;e<O;++e)E[e]?r.push(i(e)+".get("+c(e)+")"):r.push(i(e)+"["+c(e)+"]");for(var e=0;e<b;++e)r.push(u(e));F.push(M,"[",T,"++]=phase(",r.join(),");");for(var e=0;e<t;++e)C(e);for(var n=0;n<O;++n)F.push(c(n),"+=",d(n,x[t]),";")}function z(t){for(var e=0;e<O;++e)E[e]?F.push(a(e,0),"=",i(e),".get(",c(e),");"):F.push(a(e,0),"=",i(e),"[",c(e),"];");for(var r=[],e=0;e<O;++e)r.push(a(e,0));for(var e=0;e<b;++e)r.push(u(e));F.push(p(0),"=",M,"[",T,"]=phase(",r.join(),");");for(var n=1;n<1<<R;++n)F.push(p(n),"=",M,"[",T,"+",v(n),"];");for(var o=[],n=1;n<1<<R;++n)o.push("("+p(0)+"!=="+p(n)+")");F.push("if(",o.join("||"),"){");for(var s=[],e=0;e<R;++e)s.push(f(e));for(var e=0;e<O;++e){s.push(a(e,0));for(var n=1;n<1<<R;++n)E[e]?F.push(a(e,n),"=",i(e),".get(",c(e),"+",h(e,n),");"):F.push(a(e,n),"=",i(e),"[",c(e),"+",h(e,n),"];"),s.push(a(e,n))}for(var e=0;e<1<<R;++e)s.push(p(e));for(var e=0;e<b;++e)s.push(u(e));F.push("vertex(",s.join(),");",g(0),"=",w,"[",T,"]=",A,"++;");for(var l=(1<<R)-1,d=p(l),n=0;n<R;++n)if(0===(t&~(1<<n))){for(var m=l^1<<n,y=p(m),x=[],_=m;_>0;_=_-1&m)x.push(w+"["+T+"+"+v(_)+"]");x.push(g(0));for(var _=0;_<O;++_)1&n?x.push(a(_,l),a(_,m)):x.push(a(_,m),a(_,l));1&n?x.push(d,y):x.push(y,d);for(var _=0;_<b;++_)x.push(u(_));F.push("if(",d,"!==",y,"){","face(",x.join(),")}")}F.push("}",T,"+=1;")}function I(){for(var t=1;t<1<<R;++t)F.push(S,"=",v(t),";",v(t),"=",m(t),";",m(t),"=",S,";")}function P(t,e){if(t<0)return void z(e);D(t),F.push("if(",o(x[t]),">0){",f(x[t]),"=1;"),P(t-1,e|1<<x[t]);for(var r=0;r<O;++r)F.push(c(r),"+=",d(r,x[t]),";");t===R-1&&(F.push(T,"=0;"),I()),L(t,2),P(t-1,e),t===R-1&&(F.push("if(",f(x[R-1]),"&1){",T,"=0;}"),I()),C(t),F.push("}")}var O=E.length,R=x.length;if(R<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var j="extractContour"+x.join("_"),F=[],N=[],B=[],U=0;U<O;++U)B.push(n(U));for(var U=0;U<b;++U)B.push(u(U));for(var U=0;U<R;++U)N.push(o(U)+"="+n(0)+".shape["+U+"]|0");for(var U=0;U<O;++U){N.push(i(U)+"="+n(U)+".data",l(U)+"="+n(U)+".offset|0");for(var V=0;V<R;++V)N.push(s(U,V)+"="+n(U)+".stride["+V+"]|0")}for(var U=0;U<O;++U){N.push(c(U)+"="+l(U)),N.push(a(U,0));for(var V=1;V<1<<R;++V){for(var H=[],q=0;q<R;++q)V&1<<q&&H.push("-"+s(U,q));N.push(h(U,V)+"=("+H.join("")+")|0"),N.push(a(U,V)+"=0")}}for(var U=0;U<O;++U)for(var V=0;V<R;++V){var Y=[s(U,x[V])];V>0&&Y.push(s(U,x[V-1])+"*"+o(x[V-1])),N.push(d(U,x[V])+"=("+Y.join("-")+")|0")}for(var U=0;U<R;++U)N.push(f(U)+"=0");N.push(A+"=0");for(var G=["2"],U=R-2;U>=0;--U)G.push(o(x[U]));N.push(k+"=("+G.join("*")+")|0",M+"=mallocUint32("+k+")",w+"=mallocUint32("+k+")",T+"=0"),N.push(p(0)+"=0");for(var V=1;V<1<<R;++V){for(var W=[],X=[],q=0;q<R;++q)V&1<<q&&(0===X.length?W.push("1"):W.unshift(X.join("*"))),X.push(o(x[q]));var Z="";W[0].indexOf(o(x[R-2]))<0&&(Z="-");var J=y(R,V,x);N.push(v(J)+"=(-"+W.join("-")+")|0",m(J)+"=("+Z+W.join("-")+")|0",p(J)+"=0")}N.push(g(0)+"=0",S+"=0"),P(R-1,0),F.push("freeUint32(",w,");freeUint32(",M,");");var Q=["'use strict';","function ",j,"(",B.join(),"){","var ",N.join(),";",F.join(""),"}","return ",j].join(""),K=new Function("vertex","face","phase","mallocUint32","freeUint32",Q);return K(t,e,r,_.mallocUint32,_.freeUint32)}function x(t){function e(t){throw new Error("ndarray-extract-contour: "+t)}"object"!=typeof t&&e("Must specify arguments");var r=t.order;Array.isArray(r)||e("Must specify order");var n=t.arrayArguments||1;n<1&&e("Must have at least one array argument");var i=t.scalarArguments||0;i<0&&e("Scalar arg count must be > 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var a=t.getters||[],o=new Array(n),s=0;s<n;++s)a.indexOf(s)>=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)}var _=t("typedarray-pool");e.exports=x;var w="V",M="P",A="N",k="Q",T="X",S="T"},{"typedarray-pool":505}],424:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":96}],425:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;r<t;++r)e.push("out",r,"s=0.5*(inp",r,"l-inp",r,"r);");for(var n=["array"],i=["junk"],r=0;r<t;++r){n.push("array"),i.push("out"+r+"s");var a=o(t);a[r]=-1,n.push({array:0,offset:a.slice()}),a[r]=1,n.push({array:0,offset:a.slice()}),i.push("inp"+r+"l","inp"+r+"r")}return l[t]=s({args:n,pre:c,post:c,body:{body:e.join(""),args:i.map(function(t){return{name:t,lvalue:0===t.indexOf("out"),rvalue:0===t.indexOf("inp"),count:"junk"!==t|0}}),thisVars:[],localVars:[]},funcName:"fdTemplate"+t})}function i(t){function e(e){for(var r=a-e.length,n=[],i=[],s=[],l=0;l<a;++l)e.indexOf(l+1)>=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),i.push("s["+l+"]-2"));var u=".lo("+n.join()+").hi("+i.join()+")";if(0===n.length&&(u=""),r>0){o.push("if(1");for(var l=0;l<a;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||o.push("&&s[",l,"]>2");o.push("){grad",r,"(src.pick(",s.join(),")",u);for(var l=0;l<a;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||o.push(",dst.pick(",s.join(),",",l,")",u);o.push(");")}for(var l=0;l<e.length;++l){var c=Math.abs(e[l])-1,h="dst.pick("+s.join()+","+c+")"+u;switch(t[c]){case"clamp":var f=s.slice(),d=s.slice();e[l]<0?f[c]="s["+c+"]-2":d[c]="1",0===r?o.push("if(s[",c,"]>1){dst.set(",s.join(),",",c,",0.5*(src.get(",f.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):o.push("if(s[",c,"]>1){diff(",h,",src.pick(",f.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",h,");};");break;case"mirror":0===r?o.push("dst.set(",s.join(),",",c,",0);"):o.push("zero(",h,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[c]="s["+c+"]-2",m[c]="0"):(p[c]="s["+c+"]-1",m[c]="1"),0===r?o.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):o.push("if(s[",c,"]>2){diff(",h,",src.pick(",p.join(),")",u,",src.pick(",m.join(),")",u,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&o.push("};")}var r=t.join(),i=u[r];if(i)return i;for(var a=t.length,o=["function gradient(dst,src){var s=src.shape.slice();"],s=0;s<1<<a;++s){for(var c=[],d=0;d<a;++d)s&1<<d&&c.push(d+1);for(var p=0;p<1<<c.length;++p){for(var m=c.slice(),d=0;d<c.length;++d)p&1<<d&&(m[d]=-m[d]);e(m)}}o.push("return dst;};return gradient");for(var v=["diff","zero"],g=[h,f],s=1;s<=a;++s)v.push("grad"+s),g.push(n(s));v.push(o.join(""));var y=Function.apply(void 0,v),i=y.apply(void 0,g);return l[r]=i,i}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r="string"==typeof r?o(e.dimension,r):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var n=0;n<e.dimension;++n)if(t.shape[n]!==e.shape[n])throw new Error("ndarray-gradient: shape mismatch");if(0===e.size)return t;if(e.dimension<=0)return t.set(0),t;var a=i(r);return a(t,e)}e.exports=a;var o=t("dup"),s=t("cwise-compiler"),l={},u={},c={body:"",args:[],thisVars:[],localVars:[]},h=s({args:["array","array","array"],pre:c,post:c,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1},{name:"left",lvalue:!1,rvalue:!0,count:1},{name:"right",lvalue:!1,rvalue:!0,count:1}],body:"out=0.5*(left-right)",thisVars:[],localVars:[]},funcName:"cdiff"}),f=s({args:["array"],pre:c,post:c,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1}],body:"out=0",thisVars:[],localVars:[]},funcName:"zero"})},{"cwise-compiler":93,dup:100}],426:[function(t,e,r){"use strict";function n(t,e,r){var n=e.dimension,o=a([],r);return i(t,e,function(t,e){for(var r=0;r<n;++r){t[r]=o[(n+1)*n+r];for(var i=0;i<n;++i)t[r]+=o[(n+1)*i+r]*e[i]}for(var a=o[(n+1)*(n+1)-1],i=0;i<n;++i)a+=o[(n+1)*i+n]*e[i];for(var s=1/a,r=0;r<n;++r)t[r]*=s;return t}),t}var i=t("ndarray-warp"),a=t("gl-matrix-invert");e.exports=n},{"gl-matrix-invert":165,"ndarray-warp":433}],427:[function(t,e,r){"use strict";function n(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r<t.shape[0],a=0<=r+1&&r+1<t.shape[0],o=i?+t.get(r):0,s=a?+t.get(r+1):0;return(1-n)*o+n*s}function i(t,e,r){var n=Math.floor(e),i=e-n,a=0<=n&&n<t.shape[0],o=0<=n+1&&n+1<t.shape[0],s=Math.floor(r),l=r-s,u=0<=s&&s<t.shape[1],c=0<=s+1&&s+1<t.shape[1],h=a&&u?t.get(n,s):0,f=a&&c?t.get(n,s+1):0,d=o&&u?t.get(n+1,s):0,p=o&&c?t.get(n+1,s+1):0;return(1-l)*((1-i)*h+i*d)+l*((1-i)*f+i*p)}function a(t,e,r,n){var i=Math.floor(e),a=e-i,o=0<=i&&i<t.shape[0],s=0<=i+1&&i+1<t.shape[0],l=Math.floor(r),u=r-l,c=0<=l&&l<t.shape[1],h=0<=l+1&&l+1<t.shape[1],f=Math.floor(n),d=n-f,p=0<=f&&f<t.shape[2],m=0<=f+1&&f+1<t.shape[2],v=o&&c&&p?t.get(i,l,f):0,g=o&&h&&p?t.get(i,l+1,f):0,y=s&&c&&p?t.get(i+1,l,f):0,b=s&&h&&p?t.get(i+1,l+1,f):0,x=o&&c&&m?t.get(i,l,f+1):0,_=o&&h&&m?t.get(i,l+1,f+1):0,w=s&&c&&m?t.get(i+1,l,f+1):0,M=s&&h&&m?t.get(i+1,l+1,f+1):0;return(1-d)*((1-u)*((1-a)*v+a*y)+u*((1-a)*g+a*b))+d*((1-u)*((1-a)*x+a*w)+u*((1-a)*_+a*M))}function o(t){var e,r,n=0|t.shape.length,i=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n);for(e=0;e<n;++e)r=+arguments[e+1],i[e]=Math.floor(r),a[e]=r-i[e],o[e]=0<=i[e]&&i[e]<t.shape[e],s[e]=0<=i[e]+1&&i[e]+1<t.shape[e];var l,u,c,h=0;t:for(e=0;e<1<<n;++e){for(u=1,c=t.offset,l=0;l<n;++l)if(e&1<<l){if(!s[l])continue t;u*=a[l],c+=t.stride[l]*(i[l]+1)}else{if(!o[l])continue t;u*=1-a[l],c+=t.stride[l]*i[l]}h+=u*t.data[c]}return h}function s(t,e,r,s){switch(t.shape.length){case 0:return 0;case 1:return n(t,e);case 2:return i(t,e,r);case 3:return a(t,e,r,s);default:return o.apply(void 0,arguments)}}e.exports=s,e.exports.d1=n,e.exports.d2=i,e.exports.d3=a},{}],428:[function(t,e,r){"use strict";function n(t){if(!t)return s;for(var e=0;e<t.args.length;++e){var r=t.args[e];0===e?t.args[e]={name:r,lvalue:!0,rvalue:!!t.rvalue,count:t.count||1}:t.args[e]={name:r,lvalue:!1,rvalue:!0,count:1}}return t.thisVars||(t.thisVars=[]),t.localVars||(t.localVars=[]),t}function i(t){return o({args:t.args,pre:n(t.pre),body:n(t.body),post:n(t.proc),funcName:t.funcName})}function a(t){for(var e=[],r=0;r<t.args.length;++r)e.push("a"+r);var n=new Function("P",["return function ",t.funcName,"_ndarrayops(",e.join(","),") {P(",e.join(","),");return a0}"].join(""));return n(i(t))}var o=t("cwise-compiler"),s={body:"",args:[],thisVars:[],localVars:[]},l={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var h=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;t<h.length;++t){var e=h[t];r[e]=a({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:e}),r[e+"eq"]=a({args:["array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"eq"})}}();var f=["max","min","atan2","pow"];!function(){for(var t=0;t<f.length;++t){var e=f[t];r[e]=a({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:e}),r[e+"s"]=a({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:e+"s"}),r[e+"eq"]=a({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"eq"}),r[e+"seq"]=a({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"seq"})}}();var d=["atan2","pow"];!function(){for(var t=0;t<d.length;++t){var e=d[t];r[e+"op"]=a({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:e+"op"}),r[e+"ops"]=a({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:e+"ops"}),r[e+"opeq"]=a({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"opeq"}),r[e+"opseq"]=a({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"opseq"})}}(),r.any=o({args:["array"],pre:s,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=o({args:["array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=o({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=o({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=o({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=o({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=o({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":93}],429:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":430,ndarray:434}],430:[function(t,e,r){e.exports=t("cwise-compiler")({ args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":93}],431:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[l.mallocUint8,l.freeUint8];case"uint16":return[l.mallocUint16,l.freeUint16];case"uint32":return[l.mallocUint32,l.freeUint32];case"int8":return[l.mallocInt8,l.freeInt8];case"int16":return[l.mallocInt16,l.freeInt16];case"int32":return[l.mallocInt32,l.freeInt32];case"float32":return[l.mallocFloat,l.freeFloat];case"float64":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r<t;++r)e.push("s"+r);for(var r=0;r<t;++r)e.push("n"+r);for(var r=1;r<t;++r)e.push("d"+r);for(var r=1;r<t;++r)e.push("e"+r);for(var r=1;r<t;++r)e.push("f"+r);return e}function a(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),u=n(e),c=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var h=[],f=1;f<t.length;++f)c.push("i"+f),h.push("n"+f);u?c.push("scratch=malloc("+h.join("*")+")"):c.push("scratch=new Array("+h.join("*")+")"),c.push("dptr","sptr","a","b")}else c.push("scratch");if(o.push(["function ",s,"(",l.join(","),"){var ",c.join(",")].join(""),"for(i=left+1;i<=right;++i){","j=i;ptr+=s0","cptr=ptr"),t.length>1){o.push("dptr=0;sptr=ptr");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}o.push("scratch[dptr++]=",r("sptr"));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push("sptr+=d"+d,"}")}o.push("__g:while(j-->left){","dptr=0","sptr=cptr-s0");for(var f=1;f<t.length;++f)1===f&&o.push("__l:"),o.push(["for(i",f,"=0;i",f,"<n",f,";++i",f,"){"].join(""));o.push(["a=",r("sptr"),"\nb=scratch[dptr]\nif(a<b){break __g}\nif(a>b){break __l}"].join(""));for(var f=t.length-1;f>=1;--f)o.push("sptr+=e"+f,"dptr+=f"+f,"}");o.push("dptr=cptr;sptr=cptr-s0");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}o.push(a("dptr",r("sptr")));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push(["dptr+=d",d,";sptr+=d",d].join(""),"}")}o.push("cptr-=s0\n}"),o.push("dptr=cptr;sptr=0");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}o.push(a("dptr","scratch[sptr++]"));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push("dptr+=d"+d,"}")}}else o.push("scratch="+r("ptr"),"while((j-->left)&&("+r("cptr-s0")+">scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));if(o.push("}"),t.length>1&&u&&o.push("free(scratch)"),o.push("} return "+s),u){var p=new Function("malloc","free",o.join("\n"));return p(u[0],u[1])}var p=new Function(o.join("\n"));return p()}function o(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function o(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function l(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i<e.length;++i)_.push(["b_ptr",i,"=s0*",e[i]].join(""));r&&_.push("pivot_ptr=0"),_.push("ptr_shift=offset");for(var i=t.length-1;i>=0;--i){var o=t[i];0!==o&&_.push(["for(i",o,"=0;i",o,"<n",o,";++i",o,"){"].join(""))}if(e.length>1)for(var i=0;i<e.length;++i)_.push(["ptr",i,"=b_ptr",i,"+ptr_shift"].join(""));_.push(n),r&&_.push("++pivot_ptr");for(var i=0;i<t.length;++i){var o=t[i];0!==o&&(e.length>1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function c(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o<r.length;++o)_.push(["b_ptr",o,"=s0*",r[o]].join(""));_.push("ptr_shift=offset")}n&&_.push("pivot_ptr=0"),e&&_.push(e+":");for(var o=1;o<t.length;++o)_.push(["for(i",o,"=0;i",o,"<n",o,";++i",o,"){"].join(""));if(r.length>1)for(var o=0;o<r.length;++o)_.push(["ptr",o,"=b_ptr",o,"+ptr_shift"].join(""));_.push(i);for(var o=t.length-1;o>=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function h(){t.length>1&&A&&_.push("free(pivot1)","free(pivot2)")}function f(e,r){var n="el"+e,i="el"+r;if(t.length>1){var s="__l"+ ++k;c(s,[n,i],!1,["comp=",o("ptr0"),"-",o("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",s,"}\n","if(comp<0){break ",s,"}"].join(""))}else _.push(["if(",o(a(n)),">",o(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?l([e,r],!1,s("ptr0",o("ptr1"))):_.push(s(a(e),o(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++k;c(i,[r],!0,[e,"=",o("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",o(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?l([e,r],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join(""))}function v(e,r,n){t.length>1?(l([e,r,n],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join(""))}function g(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?l([e,r],!0,[s("ptr0",o("ptr1")),"\n",s("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(s(a(e),o(a(r))),s(a(r),"pivot"+n))}function b(e,r){_.push(["if((",r,"-",e,")<=",u,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function x(e,r,n){t.length>1?(_.push(["__l",++k,":while(true){"].join("")),l([e],!0,["if(",o("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",k,"}"].join("")),_.push(n,"}")):_.push(["while(",o(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),A=n(e),k=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E<t.length;++E)S.push("n"+E),T.push("i"+E);for(var E=0;E<8;++E)T.push("b_ptr"+E);T.push("ptr3","ptr4","ptr5","ptr6","ptr7","pivot_ptr","ptr_shift","elementSize="+S.join("*")),A?T.push("pivot1=malloc(elementSize)","pivot2=malloc(elementSize)"):T.push("pivot1=new Array(elementSize),pivot2=new Array(elementSize)")}else T.push("pivot1","pivot2");if(_.push("var "+T.join(",")),f(1,2),f(4,5),f(1,3),f(2,3),f(1,4),f(3,4),f(2,5),f(2,3),f(4,5),t.length>1?l(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",o("ptr1"),"\n","pivot2[pivot_ptr]=",o("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",o("ptr0"),"\n","y=",o("ptr2"),"\n","z=",o("ptr4"),"\n",s("ptr5","x"),"\n",s("ptr6","y"),"\n",s("ptr7","z")].join("")):_.push(["pivot1=",o(a("el2")),"\n","pivot2=",o(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",o(a("el1")),"\n","y=",o(a("el3")),"\n","z=",o(a("el5")),"\n",s(a("index1"),"x"),"\n",s(a("index3"),"y"),"\n",s(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),v("k","less","great"),_.push("break"),_.push("}else{"),g("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--great<k){break}"),_.push("continue"),_.push("}else{"),p("comp","great",1),_.push("if(comp<0){"),v("k","less","great"),_.push("}else{"),g("k","great"),_.push("}"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),y("left","(less-1)",1),y("right","(great+1)",2),b("left","(less-2)"),b("(great+2)","right"),_.push("if(pivots_are_equal){"),h(),_.push("return"),_.push("}"),_.push("if(less<index1&&great>index5){"),x("less",1,"++less"),x("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great<k){break}"),_.push("continue"),_.push("}else{"),p("comp","great",1),_.push("if(comp<0){"),v("k","less","great"),_.push("}else{"),g("k","great"),_.push("}"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),h(),b("less","great"),_.push("}return "+w),t.length>1&&A){var L=new Function("insertionSort","malloc","free",_.join("\n"));return L(r,A[0],A[1])}var L=new Function("insertionSort",_.join("\n"));return L(r)}function s(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join(""),s=["array"];r.push(["function ",n,"(",s.join(","),"){"].join(""));for(var l=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],c=0;c<t.length;++c)l.push(["s",c,"=stride[",c,"]|0,n",c,"=shape[",c,"]|0"].join(""));for(var h=new Array(t.length),f=[],c=0;c<t.length;++c){var d=t[c];0!==d&&(0===f.length?h[d]="1":h[d]=f.join("*"),f.push("n"+d))}for(var p=-1,m=-1,c=0;c<t.length;++c){var v=t[c];0!==v&&(p>0?l.push(["d",v,"=s",v,"-d",p,"*n",p].join("")):l.push(["d",v,"=s",v].join("")),p=v);var d=t.length-1-c;0!==d&&(m>0?l.push(["e",d,"=s",d,"-e",m,"*n",m,",f",d,"=",h[d],"-f",m,"*n",m].join("")):l.push(["e",d,"=s",d,",f",d,"=",h[d]].join("")),m=d)}r.push("var "+l.join(","));var g=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",u,"){","insertionSort(",g.join(","),")}else{","quickSort(",g.join(","),")}"].join("")),r.push("}return "+n);var y=new Function("insertionSort","quickSort",r.join("\n")),b=a(t,e),x=o(t,e,b);return y(b,x)}var l=t("typedarray-pool"),u=32;e.exports=s},{"typedarray-pool":505}],432:[function(t,e,r){"use strict";function n(t){var e=t.order,r=t.dtype,n=[e,r],o=n.join(":"),s=a[o];return s||(a[o]=s=i(e,r)),s(t),t}var i=t("./lib/compile_sort.js"),a={};e.exports=n},{"./lib/compile_sort.js":431}],433:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":96,"ndarray-linear-interpolate":427}],434:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(n);var i=new Array(r.length);for(t=0;t<i.length;++t)i[t]=r[t][1];return i}function a(t,e){var r=["View",e,"d",t].join("");e<0&&(r="View_Nil"+t);var n="generic"===t;if(e===-1){var a="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",o=new Function(a);return o()}if(0===e){var a="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",o=new Function("TrivialArray",a);return o(h[t][0])}var a=["'use strict'"],s=l(e),u=s.map(function(t){return"i"+t}),c="this.offset+"+s.map(function(t){return"this.stride["+t+"]*i"+t}).join("+"),f=s.map(function(t){return"b"+t}).join(","),d=s.map(function(t){return"c"+t}).join(",");a.push("function "+r+"(a,"+f+","+d+",d){this.data=a","this.shape=["+f+"]","this.stride=["+d+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),a.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})"),1===e?a.push("proto.order=[0]"):(a.push("Object.defineProperty(proto,'order',{get:"),e<4?(a.push("function "+r+"_order(){"),2===e?a.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?a.push("return this.data.set("+c+",v)}"):a.push("return this.data["+c+"]=v}"),a.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?a.push("return this.data.get("+c+")}"):a.push("return this.data["+c+"]}"),a.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),a.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),m=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+m.join(","));for(var v=0;v<e;++v)a.push("if(typeof i"+v+"==='number'&&i"+v+">=0){d=i"+v+"|0;b+=c"+v+"*d;a"+v+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var v=0;v<e;++v)a.push("if(typeof i"+v+"==='number'){d=i"+v+"|0;if(d<0){c+=b"+v+"*(a"+v+"-1);a"+v+"=ceil(-a"+v+"/d)}else{a"+v+"=ceil(a"+v+"/d)}b"+v+"*=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"b"+t}).join(",")+",c)}");for(var g=new Array(e),y=new Array(e),v=0;v<e;++v)g[v]="a[i"+v+"]",y[v]="b[i"+v+"]";a.push("proto.transpose=function "+r+"_transpose("+u+"){"+u.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+g.join(",")+","+y.join(",")+",this.offset)}"),a.push("proto.pick=function "+r+"_pick("+u+"){var a=[],b=[],c=this.offset");for(var v=0;v<e;++v)a.push("if(typeof i"+v+"==='number'&&i"+v+">=0){c=(c+this.stride["+v+"]*i"+v+")|0}else{a.push(this.shape["+v+"]);b.push(this.stride["+v+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",a.join("\n"));return o(h[t],i)}function o(t){if(u(t))return"buffer";if(c)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}function s(t,e,r,n){if(void 0===t){var i=h.array[0];return i([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=e[l]}if(void 0===n){n=0;for(var l=0;l<s;++l)r[l]<0&&(n-=(e[l]-1)*r[l])}for(var c=o(t),f=h[c];f.length<=s+1;)f.push(a(c,f.length-1));var i=f[s+1];return i(t,e,r,n)}var l=t("iota-array"),u=t("is-buffer"),c="undefined"!=typeof Float64Array,h={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=s},{"iota-array":262,"is-buffer":263}],435:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-a:a;var r=i.hi(t),n=i.lo(t);return e>t==t>0?n===o?(r+=1,n=0):n+=1:0===n?(n=o,r-=1):n-=1,i.pack(n,r)}var i=t("double-bits"),a=Math.pow(2,-1074),o=-1>>>0;e.exports=n},{"double-bits":99}],436:[function(t,e,r){var n=1e-6,i=1e-6;r.vertexNormals=function(t,e,r){for(var i=e.length,a=new Array(i),o=void 0===r?n:r,s=0;s<i;++s)a[s]=[0,0,0];for(var s=0;s<t.length;++s)for(var l=t[s],u=0,c=l[l.length-1],h=l[0],f=0;f<l.length;++f){u=c,c=h,h=l[(f+1)%l.length];for(var d=e[u],p=e[c],m=e[h],v=new Array(3),g=0,y=new Array(3),b=0,x=0;x<3;++x)v[x]=d[x]-p[x],g+=v[x]*v[x],y[x]=m[x]-p[x],b+=y[x]*y[x];if(g*b>o)for(var _=a[c],w=1/Math.sqrt(g*b),x=0;x<3;++x){var M=(x+1)%3,A=(x+2)%3;_[x]+=w*(y[M]*v[A]-y[A]*v[M])}}for(var s=0;s<i;++s){for(var _=a[s],k=0,x=0;x<3;++x)k+=_[x]*_[x];if(k>o)for(var w=1/Math.sqrt(k),x=0;x<3;++x)_[x]*=w;else for(var x=0;x<3;++x)_[x]=0}return a},r.faceNormals=function(t,e,r){for(var n=t.length,a=new Array(n),o=void 0===r?i:r,s=0;s<n;++s){for(var l=t[s],u=new Array(3),c=0;c<3;++c)u[c]=e[l[c]];for(var h=new Array(3),f=new Array(3),c=0;c<3;++c)h[c]=u[1][c]-u[0][c],f[c]=u[2][c]-u[0][c];for(var d=new Array(3),p=0,c=0;c<3;++c){var m=(c+1)%3,v=(c+2)%3;d[c]=h[m]*f[v]-h[v]*f[m],p+=d[c]*d[c]}p=p>o?1/Math.sqrt(p):0;for(var c=0;c<3;++c)d[c]*=p;a[s]=d}return a}},{}],437:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function i(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==n.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}var a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=i()?Object.assign:function(t,e){for(var r,i,s=n(t),l=1;l<arguments.length;l++){r=Object(arguments[l]);for(var u in r)a.call(r,u)&&(s[u]=r[u]);if(Object.getOwnPropertySymbols){i=Object.getOwnPropertySymbols(r);for(var c=0;c<i.length;c++)o.call(r,i[c])&&(s[i[c]]=r[i[c]])}}return s}},{}],438:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(h>0){var h=Math.sqrt(c+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,u),h=Math.sqrt(2*f-c+1);e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}e.exports=n},{}],439:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),r=[].slice.call(r,0,4),a(r,r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),h=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),d=o.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,h=0;h<3;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var m=a[2],v=a[6],g=a[10],y=m*o+v*s+g*l,b=m*c+v*h+g*f;m-=y*o+b*c,v-=y*s+b*h,g-=y*l+b*f;var x=n(m,v,g);m/=x,v/=x,g/=x;var _=c*e+o*r,w=h*e+s*r,M=f*e+l*r;this.center.move(t,_,w,M);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+i),this.radius.set(t,Math.log(A))},d.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],u=o[8],c=o[1],h=o[5],f=o[9],d=o[2],p=o[6],m=o[10],v=e*s+r*c,g=e*l+r*h,y=e*u+r*f,b=-(p*y-m*g),x=-(m*v-d*y),_=-(d*g-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=i(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var A=this.computedRotation,k=A[0],T=A[1],S=A[2],E=A[3],L=k*w+E*b+T*_-S*x,C=T*w+E*x+S*b-k*_,D=S*w+E*_+k*x-T*b,z=E*w-k*b-T*x-S*_;if(a){b=d,x=p,_=m;var I=Math.sin(a)/n(b,x,_);b*=I,x*=I,_*=I,w=Math.cos(e),L=L*w+z*b+C*_-D*x,C=C*w+z*x+D*b-L*_,D=D*w+z*_+L*x-C*b,z=z*w-L*b-C*x-D*_}var P=i(L,C,D,z);P>1e-6?(L/=P,C/=P,D/=P,z/=P):(L=C=D=0,z=1),this.rotation.set(t,L,C,D,z)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;u(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,l=0;l<3;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;h(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*u,s-n[6]*u,l-n[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":438,"filtered-vector":108,"gl-mat4/fromQuat":151,"gl-mat4/invert":154,"gl-mat4/lookAt":155}],440:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r="undefined"!=typeof r?r+"":" ",n(r,e)+t}},{"repeat-string":466}],441:[function(t,e,r){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],442:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(t){return i.exec(t).slice(1)};r.resolve=function(){for(var r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l<o;l++)if(i[l]!==a[l]){s=l;break}for(var u=[],l=s;l<i.length;l++)u.push("..");return u=u.concat(a.slice(s)),u.join("/")},r.sep="/",r.delimiter=":",r.dirname=function(t){var e=a(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},r.basename=function(t,e){var r=a(t)[2];return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){return a(t)[3]};var o="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:453}],443:[function(t,e,r){"use strict";function n(t){var e;t&&t.length&&(e=t,t=e.length);var r=new Uint8Array(t||0);return e&&r.set(e),r.readUInt32LE=a.readUInt32LE,r.writeUInt32LE=a.writeUInt32LE,r.readInt32LE=a.readInt32LE,r.writeInt32LE=a.writeInt32LE,r.readFloatLE=a.readFloatLE,r.writeFloatLE=a.writeFloatLE,r.readDoubleLE=a.readDoubleLE,r.writeDoubleLE=a.writeDoubleLE,r.toString=a.toString,r.write=a.write,r.slice=a.slice,r.copy=a.copy,r._isBuffer=!0,r}function i(t){for(var e,r,n=t.length,i=[],a=0;a<n;a++){if(e=t.charCodeAt(a), e>55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a<r;a++){var o=this[a];o<=127?(n+=decodeURIComponent(i)+String.fromCharCode(o),i=""):i+="%"+o.toString(16)}return n+=decodeURIComponent(i)},write:function(t,e){for(var r=t===o?s:i(t),n=0;n<r.length;n++)this[e+n]=r[n]},slice:function(t,e){return this.subarray(t,e)},copy:function(t,e){e=e||0;for(var r=0;r<this.length;r++)t[e+r]=this[r]}},a.writeInt32LE=a.writeUInt32LE,n.byteLength=function(t){return o=t,s=i(t),s.length},n.isBuffer=function(t){return!(!t||!t._isBuffer)}},{ieee754:258}],444:[function(t,e,r){(function(r){"use strict";function n(t){this.buf=v.isBuffer(t)?t:new v(t||0),this.pos=0,this.length=this.buf.length}function i(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}function a(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function o(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function u(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function m(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}e.exports=n;var v=r.Buffer||t("./buffer");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var g=4294967296,y=1/g,b=Math.pow(2,63);n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readUInt32LE(this.pos+4)*g;return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readInt32LE(this.pos+4)*g;return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e<b)return e;for(var r=this.pos-2;255===this.buf[r];)r--;r<t&&(r=t),e=0;for(var n=0;n<r-t+1;n++){var i=127&~this.buf[t+n];e+=n<4?i<<7*n:i*Math.pow(2,7*n)}return-e-1},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.buf.toString("utf8",this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.slice(this.pos,t);return this.pos=t,e},readPackedVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readVarint());return e},readPackedSVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new v(e);this.buf.copy(r),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.slice(0,this.length)},writeFixed32:function(t){this.realloc(4),this.buf.writeUInt32LE(t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),this.buf.writeInt32LE(t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(t&-1,this.pos),this.buf.writeUInt32LE(Math.floor(t*y),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(t&-1,this.pos),this.buf.writeInt32LE(Math.floor(t*y),this.pos+4),this.pos+=8},writeVarint:function(t){return t=+t,t>268435455?void a(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),void(t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127)))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=v.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&o(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,h,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":443}],445:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e<i){for(var r=1,n=0;n<e;++n)for(var o=0;o<n;++o)if(t[n]<t[o])r=-r;else if(t[n]===t[o])return 0;return r}for(var s=a.mallocUint8(e),n=0;n<e;++n)s[n]=0;for(var r=1,n=0;n<e;++n)if(!s[n]){var l=1;s[n]=1;for(var o=t[n];o!==n;o=t[o]){if(s[o])return a.freeUint8(s),0;l+=1,s[o]=1}1&l||(r=-r)}return a.freeUint8(s),r}e.exports=n;var i=32,a=t("typedarray-pool")},{"typedarray-pool":505}],446:[function(t,e,r){"use strict";function n(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,n,i,s=a.mallocUint32(e),l=a.mallocUint32(e),u=0;for(o(t,l),i=0;i<e;++i)s[i]=t[i];for(i=e-1;i>0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,u=(u+r)*i;return a.freeUint32(l),a.freeUint32(s),u}function i(t,e,r){switch(t){case 0:return r?r:[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}r=r||new Array(t);var n,i,a,o=1;for(r[0]=0,a=1;a<t;++a)r[a]=a,o=o*a|0;for(a=t-1;a>0;--a)n=e/o|0,e=e-n*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}var a=t("typedarray-pool"),o=t("invert-permutation");r.rank=n,r.unrank=i},{"invert-permutation":261,"typedarray-pool":505}],447:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=u[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,s,l,c=0;c<2;++c)if(u[c][n].length>0){o=u[c][n][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var f=u[h][n],d=0;d<f.length;++d){var p=f[d],m=p[1^h],v=i(e[t],e[n],e[s],e[m]);v>0&&(o=p,s=m,l=h)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=u[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=n(s[s.length-2],l,!1);if(u[0][t].length+u[1][t].length===0)break;var c=s[s.length-1],h=t,f=s[1],d=n(c,h,!0);if(i(e[c],e[h],e[f],e[d])<0)break;s.push(t),l=n(c,h)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,u=[new Array(s),new Array(s)],c=0;c<s;++c)u[0][c]=[],u[1][c]=[];for(var c=0;c<l;++c){var h=t[c];u[0][h[0]].push(h),u[1][h[1]].push(h)}for(var f=[],c=0;c<s;++c)u[0][c].length+u[1][c].length===0&&f.push([c]);for(var c=0;c<s;++c)for(var d=0;d<2;++d){for(var p=[];u[d][c].length>0;){var m=(u[0][c].length,a(c,d));o(p,m)?p.push.apply(p,m):(p.length>0&&f.push(p),p=m)}p.length>0&&f.push(p)}return f}e.exports=n;var i=t("compare-angle")},{"compare-angle":83}],448:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t,e.length),n=new Array(e.length),a=new Array(e.length),o=[],s=0;s<e.length;++s){var l=r[s].length;a[s]=l,n[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){var u=o.pop();n[u]=!1;for(var c=r[u],s=0;s<c.length;++s){var h=c[s];0===--a[h]&&o.push(h)}}for(var f=new Array(e.length),d=[],s=0;s<e.length;++s)if(n[s]){var u=d.length;f[s]=u,d.push(e[s])}else f[s]=-1;for(var p=[],s=0;s<t.length;++s){var m=t[s];n[m[0]]&&n[m[1]]&&p.push([f[m[0]],f[m[1]]])}return[p,d]}e.exports=n;var i=t("edges-to-adjacency-list")},{"edges-to-adjacency-list":102}],449:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=[];return e}function a(t,e){function r(t){for(var r=t.length,n=[0],i=0;i<r;++i){var a=e[t[i]],o=e[t[(i+1)%r]],s=u(-a[0],a[1]),l=u(-a[0],o[1]),h=u(o[0],a[1]),f=u(o[0],o[1]);n=c(n,c(c(s,l),c(h,f)))}return n[n.length-1]>0}function a(t){for(var e=t.length,r=0;r<e;++r)if(!P[t[r]])return!1;return!0}var d=f(t,e);t=d[0],e=d[1];for(var p=e.length,m=(t.length,o(t,e.length)),v=0;v<p;++v)if(m[v].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var g=s(t,e);g=g.filter(r);for(var y=g.length,b=new Array(y),x=new Array(y),v=0;v<y;++v){b[v]=v;var _=new Array(y),w=g[v].map(function(t){return e[t]}),M=l([w]),A=0;t:for(var k=0;k<y;++k)if(_[k]=0,v!==k){for(var T=g[k],S=T.length,E=0;E<S;++E){var L=M(e[T[E]]);if(0!==L){L<0&&(_[k]=1,A+=1);continue t}}_[k]=1,A+=1}x[v]=[A,v,_]}x.sort(function(t,e){return e[0]-t[0]});for(var v=0;v<y;++v)for(var _=x[v],C=_[1],D=_[2],k=0;k<y;++k)D[k]&&(b[k]=C);for(var z=i(y),v=0;v<y;++v)z[v].push(b[v]),z[b[v]].push(v);for(var I={},P=n(p,!1),v=0;v<y;++v)for(var T=g[v],S=T.length,k=0;k<S;++k){var O=T[k],R=T[(k+1)%S],j=Math.min(O,R)+":"+Math.max(O,R);if(j in I){var F=I[j];z[F].push(v),z[v].push(F),P[O]=P[R]=!0}else I[j]=v}for(var N=[],B=n(y,-1),v=0;v<y;++v)b[v]!==v||a(g[v])?B[v]=-1:(N.push(v),B[v]=0);for(var d=[];N.length>0;){var U=N.pop(),V=z[U];h(V,function(t,e){return t-e});var H,q=V.length,Y=B[U];if(0===Y){var T=g[U];H=[T]}for(var v=0;v<q;++v){var G=V[v];if(!(B[G]>=0)&&(B[G]=1^Y,N.push(G),0===Y)){var T=g[G];a(T)||(T.reverse(),H.push(T))}}0===Y&&d.push(H)}return d}e.exports=a;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),h=t("uniq"),f=t("./lib/trim-leaves")},{"./lib/trim-leaves":448,"edges-to-adjacency-list":102,"planar-dual":447,"point-in-big-polygon":451,"robust-sum":479,"two-product":503,uniq:507}],450:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],451:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return!!i&&!!i.queryPoint(r,n)}}function a(t){for(var e={},r=0;r<t.length;++r){var n=t[r],a=n[0][0],o=n[0][1],s=n[1][1],l=[Math.min(o,s),Math.max(o,s)];a in e?e[a].push(l):e[a]=[l]}for(var u={},c=Object.keys(e),r=0;r<c.length;++r){var h=e[c[r]];u[c[r]]=d(h)}return i(u)}function o(t,e){return function(r){var n=p.le(e,r[0]);if(n<0)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=h(r,o[0],o[1]);if(o[0][0]<o[1][0])if(s<0)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(s<0))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],i=0;i<e;++i)for(var c=t[i],h=c.length,d=h-1,p=0;p<h;d=p++){var m=c[d],v=c[p];m[0]===v[0]?n.push([m,v]):r.push([m,v])}if(0===r.length)return 0===n.length?s:l(a(n));var g=f(r),y=o(g.slabs,g.coordinates);return 0===n.length?y:u(a(n),y)}e.exports=c;var h=t("robust-orientation")[3],f=t("slab-decomposition"),d=t("interval-tree-1d"),p=t("binary-search-bounds")},{"binary-search-bounds":56,"interval-tree-1d":260,"robust-orientation":474,"slab-decomposition":491}],452:[function(t,e,r){"use strict";function n(t,e,r,n,s){i.length<n.length&&(i=new Float64Array(n.length),a=new Float64Array(n.length),o=new Float64Array(n.length));for(var l=0;l<n.length;++l)i[l]=t[l]-n[l],a[l]=e[l]-t[l],o[l]=r[l]-t[l];for(var u=0,c=0,h=0,f=0,d=0,p=0,l=0;l<n.length;++l){var m=a[l],v=o[l],g=i[l];u+=m*m,c+=m*v,h+=v*v,f+=g*m,d+=g*v,p+=g*g}var y,b=Math.abs(u*h-c*c),x=c*d-h*f,_=c*f-u*d;if(x+_<=b)if(x<0)_<0&&f<0?(_=0,-f>=u?(x=1,y=u+2*f+p):(x=-f/u,y=f*x+p)):(x=0,d>=0?(_=0,y=p):-d>=h?(_=1,y=h+2*d+p):(_=-d/h,y=d*_+p));else if(_<0)_=0,f>=0?(x=0,y=p):-f>=u?(x=1,y=u+2*f+p):(x=-f/u,y=f*x+p);else{var w=1/b;x*=w,_*=w,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p}else{var M,A,k,T;x<0?(M=c+f,A=h+d,A>M?(k=A-M,T=u-2*c+h,k>=T?(x=1,_=0,y=u+2*f+p):(x=k/T,_=1-x,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)):(x=0,A<=0?(_=1,y=h+2*d+p):d>=0?(_=0,y=p):(_=-d/h,y=d*_+p))):_<0?(M=c+d,A=u+f,A>M?(k=A-M,T=u-2*c+h,k>=T?(_=1,x=0,y=h+2*d+p):(_=k/T,x=1-_,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)):(_=0,A<=0?(x=1,y=u+2*f+p):f>=0?(x=0,y=p):(x=-f/u,y=f*x+p))):(k=h+d-c-f,k<=0?(x=0,_=1,y=h+2*d+p):(T=u-2*c+h,k>=T?(x=1,_=0,y=u+2*f+p):(x=k/T,_=1-x,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)))}for(var S=1-x-_,l=0;l<n.length;++l)s[l]=S*t[l]+x*e[l]+_*r[l];return y<0?0:y}var i=new Float64Array(4),a=new Float64Array(4),o=new Float64Array(4);e.exports=n},{}],453:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(t){if(h===setTimeout)return setTimeout(t,0);if((h===n||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===i||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function s(){v&&p&&(v=!1,p.length?m=p.concat(m):g=-1,m.length&&l())}function l(){if(!v){var t=a(s);v=!0;for(var e=m.length;e;){for(p=m,m=[];++g<e;)p&&p[g].run();g=-1,e=m.length}p=null,v=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function c(){}var h,f,d=e.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:n}catch(t){h=n}try{f="function"==typeof clearTimeout?clearTimeout:i}catch(t){f=i}}();var p,m=[],v=!1,g=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];m.push(new u(t,e)),1!==m.length||v||a(l)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],454:[function(e,r,n){(function(e){!function(i){function a(t){throw new RangeError(P[t])}function o(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function s(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(I,".");var i=t.split("."),a=o(i,e).join(".");return n+a}function l(t){for(var e,r,n=[],i=0,a=t.length;i<a;)e=t.charCodeAt(i++),e>=55296&&e<=56319&&i<a?(r=t.charCodeAt(i++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function u(t){return o(t,function(t){var e="";return t>65535&&(t-=65536,e+=j(t>>>10&1023|55296),t=56320|1023&t),e+=j(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:M}function h(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?R(t/S):t>>1,t+=R(t/e);t>O*k>>1;n+=M)t=R(t/O);return R(n+(O+1)*t/(t+T))}function d(t){var e,r,n,i,o,s,l,h,d,p,m=[],v=t.length,g=0,y=L,b=E;for(r=t.lastIndexOf(C),r<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&a("not-basic"),m.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<v;){for(o=g,s=1,l=M;i>=v&&a("invalid-input"),h=c(t.charCodeAt(i++)),(h>=M||h>R((w-g)/s))&&a("overflow"),g+=h*s,d=l<=b?A:l>=b+k?k:l-b,!(h<d);l+=M)p=M-d,s>R(w/p)&&a("overflow"),s*=p;e=m.length+1,b=f(g-o,e,0==o),R(g/e)>w-y&&a("overflow"),y+=R(g/e),g%=e,m.splice(g++,0,y)}return u(m)}function p(t){var e,r,n,i,o,s,u,c,d,p,m,v,g,y,b,x=[];for(t=l(t),v=t.length,e=L,r=0,o=E,s=0;s<v;++s)m=t[s],m<128&&x.push(j(m));for(n=i=x.length,i&&x.push(C);n<v;){for(u=w,s=0;s<v;++s)m=t[s],m>=e&&m<u&&(u=m);for(g=n+1,u-e>R((w-r)/g)&&a("overflow"),r+=(u-e)*g,e=u,s=0;s<v;++s)if(m=t[s],m<e&&++r>w&&a("overflow"),m==e){for(c=r,d=M;p=d<=o?A:d>=o+k?k:d-o,!(c<p);d+=M)b=c-p,y=M-p,x.push(j(h(p+b%y,0))),c=R(b/y);x.push(j(h(c,0))),o=f(r,g,n==i),r=0,++n}++r,++e}return x.join("")}function m(t){return s(t,function(t){return D.test(t)?d(t.slice(4).toLowerCase()):t})}function v(t){return s(t,function(t){return z.test(t)?"xn--"+p(t):t})}var g="object"==typeof n&&n&&!n.nodeType&&n,y="object"==typeof r&&r&&!r.nodeType&&r,b="object"==typeof e&&e;b.global!==b&&b.window!==b&&b.self!==b||(i=b);var x,_,w=2147483647,M=36,A=1,k=26,T=38,S=700,E=72,L=128,C="-",D=/^xn--/,z=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,P={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=M-A,R=Math.floor,j=String.fromCharCode;if(x={version:"1.4.1",ucs2:{decode:l,encode:u},decode:d,encode:p,toASCII:v,toUnicode:m},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(g&&y)if(r.exports==g)y.exports=x;else for(_ in x)x.hasOwnProperty(_)&&(g[_]=x[_]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],455:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":204}],456:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var c=0;c<u;++c){var h,f,d,p,m=t[c].replace(s,"%20"),v=m.indexOf(r);v>=0?(h=m.substr(0,v),f=m.substr(v+1)):(h=m,f=""),d=decodeURIComponent(h),p=decodeURIComponent(f),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],457:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,r,s){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?n(o(t),function(o){var s=encodeURIComponent(i(o))+r;return a(t[o])?n(t[o],function(t){return s+encodeURIComponent(i(t))}).join(e):s+encodeURIComponent(i(t[o]))}).join(e):s?encodeURIComponent(i(s))+r+encodeURIComponent(i(t)):""};var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},{}],458:[function(t,e,r){"use strict";r.decode=r.parse=t("./decode"),r.encode=r.stringify=t("./encode")},{"./decode":456,"./encode":457}],459:[function(t,e,r){"use strict";function n(t,e,r,o,s){for(r=r||0,o=o||t.length-1,s=s||a;o>r;){if(o-r>600){var l=o-r+1,u=e-r+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),d=Math.max(r,Math.floor(e-u*h/l+f)),p=Math.min(o,Math.floor(e+(l-u)*h/l+f));n(t,e,d,p,s)}var m=t[e],v=r,g=o;for(i(t,r,e),s(t[o],m)>0&&i(t,r,o);v<g;){for(i(t,v,g),v++,g--;s(t[v],m)<0;)v++;for(;s(t[g],m)>0;)g--}0===s(t[r],m)?i(t,r,g):(g++,i(t,g,o)),g<=e&&(r=g+1),e<=g&&(o=g-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function a(t,e){return t<e?-1:t>e?1:0}e.exports=n},{}],460:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;++a)n[a]=i(t[a],e[a]);return n}var i=t("big-rat/add");e.exports=n},{"big-rat/add":40}],461:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=i(t[r]);return e}e.exports=n;var i=t("big-rat")},{"big-rat":43}],462:[function(t,e,r){"use strict";function n(t,e){for(var r=i(e),n=t.length,o=new Array(n),s=0;s<n;++s)o[s]=a(t[s],r);return o}var i=t("big-rat"),a=t("big-rat/mul");e.exports=n},{"big-rat":43,"big-rat/mul":52}],463:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;++a)n[a]=i(t[a],e[a]);return n}var i=t("big-rat/sub");e.exports=n},{"big-rat/sub":54}],464:[function(t,e,r){"use strict";function n(t){t.sort(a);for(var e=t.length,r=0,n=0;n<e;++n){var s=t[n],l=o(s);if(0!==l){if(r>0){var u=t[r-1];if(0===i(s,u)&&o(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}var i=t("compare-cell"),a=t("compare-oriented-cell"),o=t("cell-orientation");e.exports=n},{"cell-orientation":75,"compare-cell":84,"compare-oriented-cell":85}],465:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.createREGL=i()}(this,function(){"use strict";function t(t){return"undefined"!=typeof btoa?btoa(t):"base64:"+t}function e(t){var e=new Error("(regl) "+t);throw console.error(e),e}function r(t,r){t||e(r)}function n(t){return t?": "+t:""}function i(t,r,i){t in r||e("unknown parameter ("+t+")"+n(i)+". possible values: "+Object.keys(r).join())}function a(t,r){Kt(t)||e("invalid parameter type"+n(r)+". must be a typed array")}function o(t,r,i){typeof t!==r&&e("invalid parameter type"+n(i)+". expected "+r+", got "+typeof t)}function s(t,r){t>=0&&(0|t)===t||e("invalid parameter type, ("+t+")"+n(r)+". must be a nonnegative integer")}function l(t,r,i){r.indexOf(t)<0&&e("invalid value"+n(i)+". must be one of: "+r)}function u(t){Object.keys(t).forEach(function(t){te.indexOf(t)<0&&e('invalid regl constructor argument "'+t+'". must be one of '+te)})}function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function h(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function f(t,e){this.number=t,this.line=e,this.errors=[]}function d(t,e,r){this.file=t,this.line=e,this.message=r}function p(){var t=new Error,e=(t.stack||t).toString(),r=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(e);if(r)return r[1];var n=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(e);return n?n[1]:"unknown"}function m(){var t=new Error,e=(t.stack||t).toString(),r=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(e);if(r)return r[1];var n=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(e);return n?n[1]:"unknown"}function v(e,r){var n=e.split("\n"),i=1,a=0,o={unknown:new h,0:new h};o.unknown.name=o[0].name=r||p(),o.unknown.lines.push(new f(0,""));for(var s=0;s<n.length;++s){var l=n[s],u=/^\s*\#\s*(\w+)\s+(.+)\s*$/.exec(l);if(u)switch(u[1]){case"line":var c=/(\d+)(\s+\d+)?/.exec(u[2]);c&&(i=0|c[1],c[2]&&(a=0|c[2],a in o||(o[a]=new h)));break;case"define":var d=/SHADER_NAME(_B64)?\s+(.*)$/.exec(u[2]);d&&(o[a].name=d[1]?t(d[2]):d[2])}o[a].lines.push(new f(i++,l))}return Object.keys(o).forEach(function(t){var e=o[t];e.lines.forEach(function(t){e.index[t.number]=t})}),o}function g(t){var e=[];return t.split("\n").forEach(function(t){if(!(t.length<5)){var r=/^ERROR\:\s+(\d+)\:(\d+)\:\s*(.*)$/.exec(t);r?e.push(new d(0|r[1],0|r[2],r[3].trim())):t.length>0&&e.push(new d("unknown",0,t))}}),e}function y(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}function b(t,e,n,i,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";T(n,"string",s+" shader source must be a string",a);var l=v(n,a),u=g(o);y(l,u),Object.keys(l).forEach(function(t){function e(t,e){n.push(t),i.push(e||"")}var r=l[t];if(r.hasErrors){var n=[""],i=[""];e("file number "+t+": "+r.name+"\n","color:red;text-decoration:underline;font-weight:bold"),r.lines.forEach(function(t){if(t.errors.length>0){e(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),e(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var r=0;t.errors.forEach(function(n){var i=n.message,a=/^\s*\'(.*)\'\s*\:\s*(.*)$/.exec(i);if(a){var o=a[1];switch(i=a[2],o){case"assign":o="="}r=Math.max(t.line.indexOf(o,r),0)}else r=0;e(c("| ",6)),e(c("^^^",r+3)+"\n","font-weight:bold"),e(c("| ",6)),e(i+"\n","font-weight:bold")}),e(c("| ",6)+"\n")}else e(c(t.number,4)+"| "),e(t.line+"\n","color:red")}),"undefined"!=typeof document?(i[0]=n.join("%c"),console.log.apply(console,i)):console.log(n.join(""))}}),r.raise("Error compiling "+s+" shader, "+l[0].name)}}function x(t,e,n,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var o=t.getProgramInfoLog(e),s=v(n,a),l=v(i,a),u='Error linking program with vertex shader, "'+l[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+u+"\n%c"+o,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\n"+o),r.raise(u)}}function _(t){t._commandRef=p()}function w(t,e,r,n){function i(t){return t?n.id(t):0}function a(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}_(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var o=t._uniformSet={};a(o,e.static),a(o,e.dynamic);var s=t._attributeSet={};a(s,r.static),a(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic}function M(t,r){var n=m();e(t+" in command "+(r||p())+("unknown"===n?"":" called from "+n))}function A(t,e,r){t||M(e,r||p())}function k(t,e,r,i){t in e||M("unknown parameter ("+t+")"+n(r)+". possible values: "+Object.keys(e).join(),i||p())}function T(t,e,r,i){typeof t!==e&&M("invalid parameter type"+n(r)+". expected "+e+", got "+typeof t,i||p())}function S(t){t()}function E(t,e,r){t.texture?l(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):l(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")}function L(t,e){return t===me||t===pe||t===ve?2:t===ge?4:be[t]*e}function C(t){return!(t&t-1||!t)}function D(t,e,n){var i,a=e.width,o=e.height,s=e.channels;r(a>0&&a<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,"invalid texture shape"),t.wrapS===ee&&t.wrapT===ee||r(C(a)&&C(o),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==a&&1!==o&&r(t.minFilter!==ne&&t.minFilter!==ae&&t.minFilter!==ie&&t.minFilter!==oe,"min filter requires mipmap"):(r(C(a)&&C(o),"texture must be a square power of 2 to support mipmapping"), r(e.mipmask===(a<<1)-1,"missing or incomplete mipmap data")),e.type===de&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(t.minFilter===re&&t.magFilter===re,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var l=e.images;for(i=0;i<16;++i)if(l[i]){var u=a>>i,c=o>>i;r(e.mipmask&1<<i,"missing mipmap data");var h=l[i];if(r(h.width===u&&h.height===c,"invalid shape for mip images"),r(h.format===e.format&&h.internalformat===e.internalformat&&h.type===e.type,"incompatible type for mip image"),h.compressed);else if(h.data){var f=Math.ceil(L(h.type,s)*u/h.unpackAlignment)*h.unpackAlignment;r(h.data.byteLength===f*c,"invalid data for image, buffer size is inconsistent with image format")}else h.element||h.copy}else t.genMipmaps||r(0===(e.mipmask&1<<i),"extra mipmap data");e.compressed&&r(!t.genMipmaps,"mipmap generation for compressed images not supported")}function z(t,e,n,i){var a=t.width,o=t.height,s=t.channels;r(a>0&&a<=i.maxTextureSize&&o>0&&o<=i.maxTextureSize,"invalid texture shape"),r(a===o,"cube map must be square"),r(e.wrapS===ee&&e.wrapT===ee,"wrap mode not supported by cube map");for(var l=0;l<n.length;++l){var u=n[l];r(u.width===a&&u.height===o,"inconsistent cube map face shape"),e.genMipmaps&&(r(!u.compressed,"can not generate mipmap for compressed textures"),r(1===u.mipmask,"can not specify mipmaps and generate mipmaps"));for(var c=u.images,h=0;h<16;++h){var f=c[h];if(f){var d=a>>h,p=o>>h;r(u.mipmask&1<<h,"missing mipmap data"),r(f.width===d&&f.height===p,"invalid shape for mip images"),r(f.format===t.format&&f.internalformat===t.internalformat&&f.type===t.type,"incompatible type for mip image"),f.compressed||(f.data?r(f.data.byteLength===d*p*Math.max(L(f.type,s),f.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):f.element||f.copy)}}}}function I(t,e){this.id=_e++,this.type=t,this.data=e}function P(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function O(t){if(0===t.length)return[];var e=t.charAt(0),r=t.charAt(t.length-1);if(t.length>1&&e===r&&('"'===e||"'"===e))return['"'+P(t.substr(1,t.length-2))+'"'];var n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(n)return O(t.substr(0,n.index)).concat(O(n[1])).concat(O(t.substr(n.index+n[0].length)));var i=t.split(".");if(1===i.length)return['"'+P(t)+'"'];for(var a=[],o=0;o<i.length;++o)a=a.concat(O(i[o]));return a}function R(t){return"["+O(t).join("][")+"]"}function j(t,e){return new I(t,R(e+""))}function F(t){return"function"==typeof t&&!t._reglType||t instanceof I}function N(t,e){return"function"==typeof t?new I(we,t):t}function B(){var t={"":0},e=[""];return{id:function(r){var n=t[r];return n?n:(n=t[r]=e.length,e.push(r),n)},str:function(t){return e[t]}}}function U(t,e,r){function n(){var e=window.innerWidth,n=window.innerHeight;if(t!==document.body){var i=t.getBoundingClientRect();e=i.right-i.left,n=i.bottom-i.top}a.width=r*e,a.height=r*n,$t(a.style,{width:e+"px",height:n+"px"})}function i(){window.removeEventListener("resize",n),t.removeChild(a)}var a=document.createElement("canvas");return $t(a.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(a),t===document.body&&(a.style.position="absolute",$t(t.style,{margin:0,padding:0})),window.addEventListener("resize",n,!1),n(),{canvas:a,onDestroy:i}}function V(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}function H(t){return"string"==typeof t.nodeName&&"function"==typeof t.appendChild&&"function"==typeof t.getBoundingClientRect}function q(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}function Y(t){return"string"==typeof t?t.split():(xe(Array.isArray(t),"invalid extension array"),t)}function G(t){return"string"==typeof t?(xe("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function W(t){var e,r,n,i,a=t||{},o={},s=[],l=[],u="undefined"==typeof window?1:window.devicePixelRatio,c=!1,h=function(t){t&&xe.raise(t)},f=function(){};if("string"==typeof a?(xe("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),e=document.querySelector(a),xe(e,"invalid query string for element")):"object"==typeof a?H(a)?e=a:q(a)?(i=a,n=i.canvas):(xe.constructor(a),"gl"in a?i=a.gl:"canvas"in a?n=G(a.canvas):"container"in a&&(r=G(a.container)),"attributes"in a&&(o=a.attributes,xe.type(o,"object","invalid context attributes")),"extensions"in a&&(s=Y(a.extensions)),"optionalExtensions"in a&&(l=Y(a.optionalExtensions)),"onDone"in a&&(xe.type(a.onDone,"function","invalid or missing onDone callback"),h=a.onDone),"profile"in a&&(c=!!a.profile),"pixelRatio"in a&&(u=+a.pixelRatio,xe(u>0,"invalid pixel ratio"))):xe.raise("invalid arguments to regl"),e&&("canvas"===e.nodeName.toLowerCase()?n=e:r=e),!i){if(!n){xe("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var d=U(r||document.body,h,u);if(!d)return null;n=d.canvas,f=d.onDestroy}i=V(n,o)}return i?{gl:i,canvas:n,container:r,extensions:s,optionalExtensions:l,pixelRatio:u,profile:c,onDone:h,onDestroy:f}:(f(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function X(t,e){function r(e){xe.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var n={},i=0;i<e.extensions.length;++i){var a=e.extensions[i];if(!r(a))return e.onDestroy(),e.onDone('"'+a+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach(function(t){if(!r(t))throw new Error("(regl): error restoring extension "+t)})}}}function Z(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||Kt(t.data))}function J(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function Q(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}function K(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,e|t>>1}function $(t){var e=Q(t),r=lr[K(e)>>2];return r.length>0?r.pop():new ArrayBuffer(e)}function tt(t){lr[K(t.byteLength)>>2].push(t)}function et(t,e){var r=null;switch(t){case er:r=new Int8Array($(e),0,e);break;case rr:r=new Uint8Array($(e),0,e);break;case nr:r=new Int16Array($(2*e),0,e);break;case ir:r=new Uint16Array($(2*e),0,e);break;case ar:r=new Int32Array($(4*e),0,e);break;case or:r=new Uint32Array($(4*e),0,e);break;case sr:r=new Float32Array($(4*e),0,e);break;default:return null}return r.length!==e?r.subarray(0,e):r}function rt(t){tt(t.buffer)}function nt(t,e,r){for(var n=0;n<e;++n)r[n]=t[n]}function it(t,e,r,n){for(var i=0,a=0;a<e;++a)for(var o=t[a],s=0;s<r;++s)n[i++]=o[s]}function at(t,e,r,n,i,a){for(var o=a,s=0;s<e;++s)for(var l=t[s],u=0;u<r;++u)for(var c=l[u],h=0;h<n;++h)i[o++]=c[h]}function ot(t,e,r,n,i){for(var a=1,o=r+1;o<e.length;++o)a*=e[o];var s=e[r];if(e.length-r===4){var l=e[r+1],u=e[r+2],c=e[r+3];for(o=0;o<s;++o)at(t[o],l,u,c,n,i),i+=a}else for(o=0;o<s;++o)ot(t[o],e,r+1,n,i),i+=a}function st(t,e,r,n){var i=1;if(e.length)for(var a=0;a<e.length;++a)i*=e[a];else i=0;var o=n||ur.allocType(r,i);switch(e.length){case 0:break;case 1:nt(t,e[0],o);break;case 2:it(t,e[0],e[1],o);break;case 3:at(t,e[0],e[1],e[2],o,0);break;default:ot(t,e,0,o,0)}return o}function lt(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e}function ut(t){return 0|Qt[Object.prototype.toString.call(t)]}function ct(t,e){for(var r=0;r<e.length;++r)t[r]=e[r]}function ht(t,e,r,n,i,a,o){for(var s=0,l=0;l<r;++l)for(var u=0;u<n;++u)t[s++]=e[i*l+a*u+o]}function ft(t,e,r){function n(e){this.id=h++,this.buffer=t.createBuffer(),this.type=e,this.usage=kr,this.byteLength=0,this.dimension=1,this.dtype=Sr,this.persistentData=null,r.profile&&(this.stats={size:0})}function i(t,e){var r=d.pop();return r||(r=new n(t)),r.bind(),s(r,e,Tr,0,1,!1),r}function a(t){d.push(t)}function o(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function s(t,e,r,n,i,a){var s;if(t.usage=r,Array.isArray(e)){if(t.dtype=n||Er,e.length>0){var l;if(Array.isArray(e[0])){s=Ar(e);for(var u=1,c=1;c<s.length;++c)u*=s[c];t.dimension=u,l=Mr(e,s,t.dtype),o(t,l,r),a?t.persistentData=l:ur.freeType(l)}else if("number"==typeof e[0]){t.dimension=i;var h=ur.allocType(t.dtype,e.length);ct(h,e),o(t,h,r),a?t.persistentData=h:ur.freeType(h)}else Kt(e[0])?(t.dimension=e[0].length,t.dtype=n||ut(e[0])||Er,l=Mr(e,[e.length,e[0].length],t.dtype),o(t,l,r),a?t.persistentData=l:ur.freeType(l)):xe.raise("invalid buffer data")}}else if(Kt(e))t.dtype=n||ut(e),t.dimension=i,o(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(Z(e)){s=e.shape;var f=e.stride,d=e.offset,p=0,m=0,v=0,g=0;1===s.length?(p=s[0],m=1,v=f[0],g=0):2===s.length?(p=s[0],m=s[1],v=f[0],g=f[1]):xe.raise("invalid shape"),t.dtype=n||ut(e.data)||Er,t.dimension=m;var y=ur.allocType(t.dtype,p*m);ht(y,e.data,p,m,v,g,d),o(t,y,r),a?t.persistentData=y:ur.freeType(y)}else xe.raise("invalid buffer data")}function l(r){e.bufferCount--;var n=r.buffer;xe(n,"buffer must not be deleted already"),t.deleteBuffer(n),r.buffer=null,delete f[r.id]}function u(i,a,o,u){function c(e){var n=kr,i=null,a=0,o=0,l=1;return Array.isArray(e)||Kt(e)||Z(e)?i=e:"number"==typeof e?a=0|e:e&&(xe.type(e,"object","buffer arguments must be an object, a number or an array"),"data"in e&&(xe(null===i||Array.isArray(i)||Kt(i)||Z(i),"invalid data for buffer"),i=e.data),"usage"in e&&(xe.parameter(e.usage,wr,"invalid buffer usage"),n=wr[e.usage]),"type"in e&&(xe.parameter(e.type,br,"invalid buffer type"),o=br[e.type]),"dimension"in e&&(xe.type(e.dimension,"number","invalid dimension"),l=0|e.dimension),"length"in e&&(xe.nni(a,"buffer length must be a nonnegative integer"),a=0|e.length)),p.bind(),i?s(p,i,n,o,l,u):(t.bufferData(p.type,a,n),p.dtype=o||Sr,p.usage=n,p.dimension=l,p.byteLength=a),r.profile&&(p.stats.size=p.byteLength*Lr[p.dtype]),c}function h(e,r){xe(r+e.byteLength<=p.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+e.byteLength+" starting from offset "+r+" to a buffer of size "+p.byteLength),t.bufferSubData(p.type,r,e)}function d(t,e){var r,n=0|(e||0);if(p.bind(),Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var i=ur.allocType(p.dtype,t.length);ct(i,t),h(i,n),ur.freeType(i)}else if(Array.isArray(t[0])||Kt(t[0])){r=Ar(t);var a=Mr(t,r,p.dtype);h(a,n),ur.freeType(a)}else xe.raise("invalid buffer data")}else if(Kt(t))h(t,n);else if(Z(t)){r=t.shape;var o=t.stride,s=0,l=0,u=0,f=0;1===r.length?(s=r[0],l=1,u=o[0],f=0):2===r.length?(s=r[0],l=r[1],u=o[0],f=o[1]):xe.raise("invalid shape");var d=Array.isArray(t.data)?p.dtype:ut(t.data),m=ur.allocType(d,s*l);ht(m,t.data,s,l,u,f,t.offset),h(m,n),ur.freeType(m)}else xe.raise("invalid data for buffer subdata");return c}e.bufferCount++;var p=new n(a);return f[p.id]=p,o||c(i),c._reglType="buffer",c._buffer=p,c.subdata=d,r.profile&&(c.stats=p.stats),c.destroy=function(){l(p)},c}function c(){tr(f).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})}var h=0,f={};n.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},n.prototype.destroy=function(){l(this)};var d=[];return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(f).forEach(function(e){t+=f[e].stats.size}),t}),{create:u,createStream:i,destroyStream:a,clear:function(){tr(f).forEach(l),d.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof n?t._buffer:null},restore:c,_initBuffer:s}}function dt(t,e,r,n){function i(t){this.id=h++,c[this.id]=this,this.buffer=t,this.primType=Nr,this.vertCount=0,this.type=0}function a(t){var e=d.pop();return e||(e=new i(r.create(null,Gr,!0,!1)._buffer)),s(e,t,Wr,-1,-1,0,0),e}function o(t){d.push(t)}function s(n,i,a,o,s,l,u){if(n.buffer.bind(),i){var c=u;u||Kt(i)&&(!Z(i)||Kt(i.data))||(c=e.oes_element_index_uint?Yr:Hr),r._initBuffer(n.buffer,i,a,c,3)}else t.bufferData(Gr,l,a),n.buffer.dtype=h||Ur,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;var h=u;if(!u){switch(n.buffer.dtype){case Ur:case Br:h=Ur;break;case Hr:case Vr:h=Hr;break;case Yr:case qr:h=Yr;break;default:xe.raise("unsupported type for element array")}n.buffer.dtype=h}n.type=h,xe(h!==Yr||!!e.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var f=s;f<0&&(f=n.buffer.byteLength,h===Hr?f>>=1:h===Yr&&(f>>=2)),n.vertCount=f;var d=o;if(o<0){d=Nr;var p=n.buffer.dimension;1===p&&(d=jr),2===p&&(d=Fr),3===p&&(d=Nr)}n.primType=d}function l(t){n.elementsCount--,xe(null!==t.buffer,"must not double destroy elements"),delete c[t.id],t.buffer.destroy(),t.buffer=null}function u(t,e){function a(t){if(t)if("number"==typeof t)o(t),u.primType=Nr,u.vertCount=0|t,u.type=Ur;else{var e=null,r=Xr,n=-1,i=-1,l=0,c=0;Array.isArray(t)||Kt(t)||Z(t)?e=t:(xe.type(t,"object","invalid arguments for elements"),"data"in t&&(e=t.data,xe(Array.isArray(e)||Kt(e)||Z(e),"invalid data for element buffer")),"usage"in t&&(xe.parameter(t.usage,wr,"invalid element buffer usage"),r=wr[t.usage]),"primitive"in t&&(xe.parameter(t.primitive,Rr,"invalid element buffer primitive"),n=Rr[t.primitive]),"count"in t&&(xe("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),i=0|t.count),"type"in t&&(xe.parameter(t.type,f,"invalid buffer type"),c=f[t.type]),"length"in t?l=0|t.length:(l=i,c===Hr||c===Vr?l*=2:c!==Yr&&c!==qr||(l*=4))),s(u,e,r,n,i,l,c)}else o(),u.primType=Nr,u.vertCount=0,u.type=Ur;return a}var o=r.create(null,Gr,!0),u=new i(o._buffer);return n.elementsCount++,a(t),a._reglType="elements",a._elements=u,a.subdata=function(t,e){return o.subdata(t,e),a},a.destroy=function(){l(u)},a}var c={},h=0,f={uint8:Ur,uint16:Hr};e.oes_element_index_uint&&(f.uint32=Yr),i.prototype.bind=function(){this.buffer.bind()};var d=[];return{create:u,createStream:a,destroyStream:o,getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){tr(c).forEach(l)}}}function pt(t){for(var e=ur.allocType(Qr,t.length),r=0;r<t.length;++r)if(isNaN(t[r]))e[r]=65535;else if(t[r]===1/0)e[r]=31744;else if(t[r]===-(1/0))e[r]=64512;else{Zr[0]=t[r];var n=Jr[0],i=n>>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else a>15?e[r]=i+31744:e[r]=i+(a+15<<10)+o}return e}function mt(t){return Array.isArray(t)||Kt(t)}function vt(t){return"[object "+t+"]"}function gt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function yt(t){if(!Array.isArray(t))return!1;var e=t.length;return!(0===e||!mt(t[0]))}function bt(t){return Object.prototype.toString.call(t)}function xt(t){return bt(t)===ui}function _t(t){return bt(t)===ci}function wt(t){return bt(t)===hi}function Mt(t){return bt(t)===fi}function At(t){if(!t)return!1;var e=bt(t);return di.indexOf(e)>=0||(gt(t)||yt(t)||Z(t))}function kt(t){return 0|Qt[Object.prototype.toString.call(t)]}function Tt(t,e){var r=e.length;switch(t.type){case zn:case In:case Pn:case On:var n=ur.allocType(t.type,r);n.set(e),t.data=n;break;case bn:t.data=pt(e);break;default:xe.raise("unsupported texture type, must specify a typed array")}}function St(t,e){return ur.allocType(t.type===bn?On:t.type,e)}function Et(t,e){t.type===bn?(t.data=pt(e),ur.freeType(e)):t.data=e}function Lt(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,u=o*s*l,c=St(t,u),h=0,f=0;f<s;++f)for(var d=0;d<o;++d)for(var p=0;p<l;++p)c[h++]=e[r*d+n*f+i*p+a];Et(t,c)}function Ct(t,e,r,n,i,a){var o;if(o="undefined"!=typeof mi[t]?mi[t]:li[t]*pi[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function Dt(t,e,r,n,i,a,o){function s(){this.internalformat=rn,this.format=rn,this.type=zn,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=0}function l(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function u(t,n){if("object"==typeof n&&n){if("premultiplyAlpha"in n&&(xe.type(n.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=n.premultiplyAlpha),"flipY"in n&&(xe.type(n.flipY,"boolean","invalid texture flip"),t.flipY=n.flipY),"alignment"in n&&(xe.oneOf(n.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=n.alignment),"colorSpace"in n&&(xe.parameter(n.colorSpace,F,"invalid colorSpace"),t.colorSpace=F[n.colorSpace]),"type"in n){var i=n.type;xe(e.oes_texture_float||!("float"===i||"float32"===i),"you must enable the OES_texture_float extension in order to use floating point textures."),xe(e.oes_texture_half_float||!("half float"===i||"float16"===i),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),xe(e.webgl_depth_texture||!("uint16"===i||"uint32"===i||"depth stencil"===i),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),xe.parameter(i,N,"invalid texture type"),t.type=N[i]}var a=t.width,o=t.height,s=t.channels,l=!1;"shape"in n?(xe(Array.isArray(n.shape)&&n.shape.length>=2,"shape must be an array"),a=n.shape[0],o=n.shape[1],3===n.shape.length&&(s=n.shape[2],xe(s>0&&s<=4,"invalid number of channels"),l=!0),xe(a>=0&&a<=r.maxTextureSize,"invalid width"),xe(o>=0&&o<=r.maxTextureSize,"invalid height")):("radius"in n&&(a=o=n.radius,xe(a>=0&&a<=r.maxTextureSize,"invalid radius")),"width"in n&&(a=n.width,xe(a>=0&&a<=r.maxTextureSize,"invalid width")),"height"in n&&(o=n.height,xe(o>=0&&o<=r.maxTextureSize,"invalid height")),"channels"in n&&(s=n.channels,xe(s>0&&s<=4,"invalid number of channels"),l=!0)),t.width=0|a,t.height=0|o,t.channels=0|s;var u=!1;if("format"in n){var c=n.format;xe(e.webgl_depth_texture||!("depth"===c||"depth stencil"===c),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),xe.parameter(c,B,"invalid texture format");var h=t.internalformat=B[c];t.format=J[h],c in N&&("type"in n||(t.type=N[c])),c in U&&(t.compressed=!0),u=!0}!l&&u?t.channels=li[t.format]:l&&!u?t.channels!==si[t.format]&&(t.format=t.internalformat=si[t.channels]):u&&l&&xe(t.channels===li[t.format],"number of channels inconsistent with specified format")}}function c(e){t.pixelStorei(ei,e.flipY),t.pixelStorei(ri,e.premultiplyAlpha),t.pixelStorei(ni,e.colorSpace),t.pixelStorei(ti,e.unpackAlignment)}function h(){s.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function f(t,e){var n=null;if(At(e)?n=e:e&&(xe.type(e,"object","invalid pixel data type"),u(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),At(e.data)&&(n=e.data)),xe(!t.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),e.copy){xe(!n,"can not specify copy and data field for the same texture");var a=i.viewportWidth,o=i.viewportHeight;t.width=t.width||a-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0,xe(t.xOffset>=0&&t.xOffset<a&&t.yOffset>=0&&t.yOffset<o&&t.width>0&&t.width<=a&&t.height>0&&t.height<=o,"copy texture read out of bounds")}else if(n){if(Kt(n))t.channels=t.channels||4,t.data=n,"type"in e||t.type!==zn||(t.type=kt(n));else if(gt(n))t.channels=t.channels||4,Tt(t,n),t.alignment=1,t.needsFree=!0;else if(Z(n)){var s=n.data;Array.isArray(s)||t.type!==zn||(t.type=kt(s));var l,c,h,f,d,p,m=n.shape,v=n.stride;3===m.length?(h=m[2],p=v[2]):(xe(2===m.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),l=m[0],c=m[1],f=v[0],d=v[1],t.alignment=1,t.width=l,t.height=c,t.channels=h,t.format=t.internalformat=si[h],t.needsFree=!0,Lt(t,s,f,d,p,n.offset)}else if(xt(n)||_t(n))xt(n)?t.element=n:t.element=n.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(wt(n))t.element=n,t.width=n.naturalWidth,t.height=n.naturalHeight,t.channels=4;else if(Mt(n))t.element=n,t.width=n.videoWidth,t.height=n.videoHeight,t.channels=4;else if(yt(n)){var g=t.width||n[0].length,y=t.height||n.length,b=t.channels;b=mt(n[0][0])?b||n[0][0].length:b||1;for(var x=cr.shape(n),_=1,w=0;w<x.length;++w)_*=x[w];var M=St(t,_);cr.flatten(n,x,"",M),Et(t,M),t.alignment=1,t.width=g,t.height=y,t.channels=b,t.format=t.internalformat=si[b],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;t.type===On?xe(r.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):t.type===bn&&xe(r.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function d(e,r,i){var a=e.element,o=e.data,s=e.internalformat,l=e.format,u=e.type,h=e.width,f=e.height;c(e),a?t.texImage2D(r,i,l,l,u,a):e.compressed?t.compressedTexImage2D(r,i,s,h,f,0,o):e.needsCopy?(n(),t.copyTexImage2D(r,i,l,e.xOffset,e.yOffset,h,f,0)):t.texImage2D(r,i,l,h,f,0,l,u,o)}function p(e,r,i,a,o){var s=e.element,l=e.data,u=e.internalformat,h=e.format,f=e.type,d=e.width,p=e.height;c(e),s?t.texSubImage2D(r,o,i,a,h,f,s):e.compressed?t.compressedTexSubImage2D(r,o,i,a,u,d,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,i,a,e.xOffset,e.yOffset,d,p)):t.texSubImage2D(r,o,i,a,d,p,h,f,l)}function m(){return Q.pop()||new h}function v(t){t.needsFree&&ur.freeType(t.data),h.call(t),Q.push(t)}function g(){s.call(this),this.genMipmaps=!1,this.mipmapHint=Jn,this.mipmask=0,this.images=Array(16)}function y(t,e,r){var n=t.images[0]=m();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function b(t,e){var r=null;if(At(e))r=t.images[0]=m(),l(r,t),f(r,e),t.mipmask=1;else if(u(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i<n.length;++i)r=t.images[i]=m(),l(r,t),r.width>>=i,r.height>>=i,f(r,n[i]),t.mipmask|=1<<i;else r=t.images[0]=m(),l(r,t),f(r,e),t.mipmask=1;l(t,t.images[0]),(t.compressed&&t.internalformat===xn||t.internalformat===_n||t.internalformat===wn||t.internalformat===Mn)&&xe(t.width%4===0&&t.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function x(t,e){for(var r=t.images,n=0;n<r.length;++n){if(!r[n])return;d(r[n],e,n)}}function _(){var t=K.pop()||new g;s.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function w(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&v(e[r]),e[r]=null;K.push(t)}function M(){this.minFilter=Hn,this.magFilter=Hn,this.wrapS=Nn,this.wrapT=Nn,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Jn}function A(t,e){if("min"in e){var n=e.min;xe.parameter(n,j),t.minFilter=j[n],oi.indexOf(t.minFilter)>=0&&(t.genMipmaps=!0)}if("mag"in e){var i=e.mag;xe.parameter(i,R),t.magFilter=R[i]}var a=t.wrapS,o=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(xe.parameter(s,O),a=o=O[s]):Array.isArray(s)&&(xe.parameter(s[0],O),xe.parameter(s[1],O),a=O[s[0]],o=O[s[1]])}else{if("wrapS"in e){var l=e.wrapS;xe.parameter(l,O),a=O[l]}if("wrapT"in e){var u=e.wrapT;xe.parameter(u,O),o=O[u]}}if(t.wrapS=a,t.wrapT=o,"anisotropic"in e){var c=e.anisotropic;xe("number"==typeof c&&c>=1&&c<=r.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var h=!1;switch(typeof e.mipmap){case"string":xe.parameter(e.mipmap,P,"invalid mipmap hint"),t.mipmapHint=P[e.mipmap],t.genMipmaps=!0,h=!0;break;case"boolean":h=t.genMipmaps=e.mipmap;break;case"object":xe(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,h=!0;break;default:xe.raise("invalid mipmap type")}!h||"min"in e||(t.minFilter=Yn)}}function k(r,n){t.texParameteri(n,Vn,r.minFilter),t.texParameteri(n,Un,r.magFilter),t.texParameteri(n,Rn,r.wrapS),t.texParameteri(n,jn,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,$n,r.anisotropic),r.genMipmaps&&(t.hint(Zn,r.mipmapHint),t.generateMipmap(n))}function T(e){s.call(this),this.mipmask=0,this.internalformat=rn,this.id=$++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new M,o.profile&&(this.stats={size:0})}function S(e){t.activeTexture(ai),t.bindTexture(e.target,e.texture)}function E(){var e=rt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture($r,null)}function L(e){var r=e.texture;xe(r,"must not double destroy texture");var n=e.unit,i=e.target;n>=0&&(t.activeTexture(ai+n),t.bindTexture(i,null),rt[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete tt[e.id],a.textureCount--}function C(e,n){function i(t,e){var n=c.texInfo;M.call(n);var a=_();return"number"==typeof t?"number"==typeof e?y(a,0|t,0|e):y(a,0|t,0|t):t?(xe.type(t,"object","invalid arguments to regl.texture"),A(n,t),b(a,t)):y(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),c.mipmask=a.mipmask,l(c,a),xe.texture2D(n,a,r),c.internalformat=a.internalformat,i.width=a.width,i.height=a.height,S(c),x(a,$r),k(n,$r),E(),w(a),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,a.width,a.height,n.genMipmaps,!1)),i.format=q[c.internalformat],i.type=Y[c.type],i.mag=G[n.magFilter],i.min=W[n.minFilter],i.wrapS=X[n.wrapS],i.wrapT=X[n.wrapT],i}function s(t,e,r,n){xe(!!t,"must specify image data");var a=0|e,o=0|r,s=0|n,u=m();return l(u,c),u.width=0,u.height=0,f(u,t),u.width=u.width||(c.width>>s)-a,u.height=u.height||(c.height>>s)-o,xe(c.type===u.type&&c.format===u.format&&c.internalformat===u.internalformat,"incompatible format for texture.subimage"),xe(a>=0&&o>=0&&a+u.width<=c.width&&o+u.height<=c.height,"texture.subimage write out of bounds"),xe(c.mipmask&1<<s,"missing mipmap data"),xe(u.data||u.element||u.needsCopy,"missing image data"),S(c),p(u,$r,a,o,s),E(),v(u),i}function u(e,r){var n=0|e,a=0|r||n;if(n===c.width&&a===c.height)return i;i.width=c.width=n,i.height=c.height=a,S(c);for(var s=0;c.mipmask>>s;++s)t.texImage2D($r,s,c.format,n>>s,a>>s,0,c.format,c.type,null);return E(),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,n,a,!1,!1)),i}var c=new T($r);return tt[c.id]=c,a.textureCount++,i(e,n),i.subimage=s,i.resize=u,i._reglType="texture2d",i._texture=c,o.profile&&(i.stats=c.stats),i.destroy=function(){c.decRef()},i}function D(e,n,i,s,c,h){function d(t,e,n,i,a,s){var c,h=C.texInfo;for(M.call(h),c=0;c<6;++c)D[c]=_();if("number"!=typeof t&&t)if("object"==typeof t)if(e)b(D[0],t),b(D[1],e),b(D[2],n),b(D[3],i),b(D[4],a),b(D[5],s);else if(A(h,t),u(C,t),"faces"in t){var f=t.faces;for(xe(Array.isArray(f)&&6===f.length,"cube faces must be a length 6 array"),c=0;c<6;++c)xe("object"==typeof f[c]&&!!f[c],"invalid input for cube map face"),l(D[c],C),b(D[c],f[c])}else for(c=0;c<6;++c)b(D[c],t);else xe.raise("invalid arguments to cube map");else{var p=0|t||1;for(c=0;c<6;++c)y(D[c],p,p)}for(l(C,D[0]),h.genMipmaps?C.mipmask=(D[0].width<<1)-1:C.mipmask=D[0].mipmask,xe.textureCube(C,h,D,r),C.internalformat=D[0].internalformat,d.width=D[0].width,d.height=D[0].height,S(C),c=0;c<6;++c)x(D[c],en+c);for(k(h,tn),E(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,h.genMipmaps,!0)),d.format=q[C.internalformat],d.type=Y[C.type],d.mag=G[h.magFilter],d.min=W[h.minFilter],d.wrapS=X[h.wrapS],d.wrapT=X[h.wrapT],c=0;c<6;++c)w(D[c]);return d}function g(t,e,r,n,i){xe(!!e,"must specify image data"),xe("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var a=0|r,o=0|n,s=0|i,u=m();return l(u,C),u.width=0,u.height=0,f(u,e),u.width=u.width||(C.width>>s)-a,u.height=u.height||(C.height>>s)-o,xe(C.type===u.type&&C.format===u.format&&C.internalformat===u.internalformat,"incompatible format for texture.subimage"),xe(a>=0&&o>=0&&a+u.width<=C.width&&o+u.height<=C.height,"texture.subimage write out of bounds"),xe(C.mipmask&1<<s,"missing mipmap data"),xe(u.data||u.element||u.needsCopy,"missing image data"),S(C),p(u,en+t,a,o,s),E(),v(u),d}function L(e){var r=0|e;if(r!==C.width){d.width=C.width=r,d.height=C.height=r,S(C);for(var n=0;n<6;++n)for(var i=0;C.mipmask>>i;++i)t.texImage2D(en+n,i,C.format,r>>i,r>>i,0,C.format,C.type,null);return E(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,!1,!0)),d}}var C=new T(tn);tt[C.id]=C,a.cubeCount++;var D=new Array(6);return d(e,n,i,s,c,h),d.subimage=g,d.resize=L,d._reglType="textureCube",d._texture=C,o.profile&&(d.stats=C.stats),d.destroy=function(){C.decRef()},d}function z(){for(var e=0;e<et;++e)t.activeTexture(ai+e),t.bindTexture($r,null),rt[e]=null;tr(tt).forEach(L),a.cubeCount=0,a.textureCount=0}function I(){tr(tt).forEach(function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var r=0;r<32;++r)if(0!==(e.mipmask&1<<r))if(e.target===$r)t.texImage2D($r,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(en+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);k(e.texInfo,e.target)})}var P={"don't care":Jn,"dont care":Jn,nice:Kn,fast:Qn},O={repeat:Fn,clamp:Nn,mirror:Bn},R={nearest:Hn,linear:qn},j=$t({mipmap:Xn,"nearest mipmap nearest":Yn,"linear mipmap nearest":Gn,"nearest mipmap linear":Wn,"linear mipmap linear":Xn},R),F={none:0,browser:ii},N={uint8:zn,rgba4:hn,rgb565:dn,"rgb5 a1":fn},B={alpha:nn,luminance:on,"luminance alpha":sn,rgb:an,rgba:rn,rgba4:ln,"rgb5 a1":un,rgb565:cn},U={};e.ext_srgb&&(B.srgb=gn,B.srgba=yn),e.oes_texture_float&&(N.float32=N.float=On),e.oes_texture_half_float&&(N.float16=N["half float"]=bn),e.webgl_depth_texture&&($t(B,{depth:mn,"depth stencil":vn}),$t(N,{uint16:In,uint32:Pn,"depth stencil":pn})),e.webgl_compressed_texture_s3tc&&$t(U,{"rgb s3tc dxt1":xn,"rgba s3tc dxt1":_n,"rgba s3tc dxt3":wn,"rgba s3tc dxt5":Mn}),e.webgl_compressed_texture_atc&&$t(U,{"rgb atc":An,"rgba atc explicit alpha":kn,"rgba atc interpolated alpha":Tn}),e.webgl_compressed_texture_pvrtc&&$t(U,{"rgb pvrtc 4bppv1":Sn,"rgb pvrtc 2bppv1":En,"rgba pvrtc 4bppv1":Ln,"rgba pvrtc 2bppv1":Cn}),e.webgl_compressed_texture_etc1&&(U["rgb etc1"]=Dn);var V=Array.prototype.slice.call(t.getParameter(Kr));Object.keys(U).forEach(function(t){var e=U[t];V.indexOf(e)>=0&&(B[t]=e)});var H=Object.keys(B);r.textureFormats=H;var q=[];Object.keys(B).forEach(function(t){var e=B[t];q[e]=t});var Y=[];Object.keys(N).forEach(function(t){var e=N[t];Y[e]=t});var G=[];Object.keys(R).forEach(function(t){var e=R[t];G[e]=t});var W=[];Object.keys(j).forEach(function(t){var e=j[t];W[e]=t});var X=[];Object.keys(O).forEach(function(t){var e=O[t];X[e]=t});var J=H.reduce(function(t,e){var r=B[e];return r===on||r===nn||r===on||r===sn||r===mn||r===vn?t[r]=r:r===un||e.indexOf("rgba")>=0?t[r]=rn:t[r]=an,t},{}),Q=[],K=[],$=0,tt={},et=r.maxTextureUnits,rt=Array(et).map(function(){return null});return $t(T.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n<et;++n){var i=rt[n];if(i){if(i.bindCount>0)continue;i.unit=-1}rt[n]=e,r=n;break}r>=et&&xe.raise("insufficient number of texture units"),o.profile&&a.maxTextureUnits<r+1&&(a.maxTextureUnits=r+1),e.unit=r,t.activeTexture(ai+r),t.bindTexture(e.target,e.texture)}return r},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&L(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(tt).forEach(function(e){t+=tt[e].stats.size}),t}),{create2D:C,createCube:D,clear:z,getTexture:function(t){return null},restore:I}}function zt(t,e,r){return Si[t]*e*r}function It(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=0,i=0;e?(n=e.width,i=e.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){if(t)if(t.texture){var n=t.texture._texture,i=Math.max(1,n.width),a=Math.max(1,n.height);xe(i===e&&a===r,"inconsistent width/height for supplied texture"), n.refCount+=1}else{var o=t.renderbuffer._renderbuffer;xe(o.width===e&&o.height===r,"inconsistent width/height for renderbuffer"),o.refCount+=1}}function u(e,r){r&&(r.texture?t.framebufferTexture2D(Li,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(Li,e,Ci,r.renderbuffer._renderbuffer.renderbuffer))}function c(t){var e=Di,r=null,n=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),xe.type(i,"function","invalid attachment data");var a=i._reglType;return"texture2d"===a?(r=i,xe(e===Di)):"textureCube"===a?(r=i,xe(e>=zi&&e<zi+6,"invalid cube map target")):"renderbuffer"===a?(n=i,e=Ci):xe.raise("invalid regl object for attachment"),new o(e,r,n)}function h(t,e,r,a,s){if(r){var l=n.create2D({width:t,height:e,format:a,type:s});return l._texture.refCount=0,new o(Di,l,null)}var u=i.create({width:t,height:e,format:a});return u._renderbuffer.refCount=0,new o(Ci,null,u)}function f(t){return t&&(t.texture||t.renderbuffer)}function d(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r))}function p(){this.id=k++,T[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function m(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function v(e){var r=e.framebuffer;xe(r,"must not double destroy framebuffer"),t.deleteFramebuffer(r),e.framebuffer=null,a.framebufferCount--,delete T[e.id]}function g(e){var n;t.bindFramebuffer(Li,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)u(Ii+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(Li,Ii+n,Di,null,0);t.framebufferTexture2D(Li,Ri,Di,null,0),t.framebufferTexture2D(Li,Pi,Di,null,0),t.framebufferTexture2D(Li,Oi,Di,null,0),u(Pi,e.depthAttachment),u(Oi,e.stencilAttachment),u(Ri,e.depthStencilAttachment);var a=t.checkFramebufferStatus(Li);a!==ji&&xe.raise("framebuffer configuration not supported, status = "+sa[a]),t.bindFramebuffer(Li,_.next),_.cur=_.next,t.getError()}function y(t,n){function i(t,n){var a;xe(_.next!==s,"can not update framebuffer which is currently in use");var o=e.webgl_draw_buffers,u=0,d=0,p=!0,v=!0,y=null,b=!0,x="rgba",k="uint8",T=1,S=null,E=null,L=null,C=!1;if("number"==typeof t)u=0|t,d=0|n||u;else if(t){xe.type(t,"object","invalid arguments for framebuffer");var D=t;if("shape"in D){var z=D.shape;xe(Array.isArray(z)&&z.length>=2,"invalid shape for framebuffer"),u=z[0],d=z[1]}else"radius"in D&&(u=d=D.radius),"width"in D&&(u=D.width),"height"in D&&(d=D.height);("color"in D||"colors"in D)&&(y=D.color||D.colors,Array.isArray(y)&&xe(1===y.length||o,"multiple render targets not supported")),y||("colorCount"in D&&(T=0|D.colorCount,xe(T>0,"invalid color buffer count")),"colorTexture"in D&&(b=!!D.colorTexture,x="rgba4"),"colorType"in D&&(k=D.colorType,b?(xe(e.oes_texture_float||!("float"===k||"float32"===k),"you must enable OES_texture_float in order to use floating point framebuffer objects"),xe(e.oes_texture_half_float||!("half float"===k||"float16"===k),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===k||"float16"===k?(xe(e.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==k&&"float32"!==k||(xe(e.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),xe.oneOf(k,A,"invalid color type")),"colorFormat"in D&&(x=D.colorFormat,w.indexOf(x)>=0?b=!0:M.indexOf(x)>=0?b=!1:b?xe.oneOf(D.colorFormat,w,"invalid color format for texture"):xe.oneOf(D.colorFormat,M,"invalid color format for renderbuffer"))),("depthTexture"in D||"depthStencilTexture"in D)&&(C=!(!D.depthTexture&&!D.depthStencilTexture),xe(!C||e.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in D&&("boolean"==typeof D.depth?p=D.depth:(S=D.depth,v=!1)),"stencil"in D&&("boolean"==typeof D.stencil?v=D.stencil:(E=D.stencil,p=!1)),"depthStencil"in D&&("boolean"==typeof D.depthStencil?p=v=D.depthStencil:(L=D.depthStencil,p=!1,v=!1))}else u=d=1;var I=null,P=null,O=null,R=null;if(Array.isArray(y))I=y.map(c);else if(y)I=[c(y)];else for(I=new Array(T),a=0;a<T;++a)I[a]=h(u,d,b,x,k);xe(e.webgl_draw_buffers||I.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),xe(I.length<=r.maxColorAttachments,"too many color attachments, not supported"),u=u||I[0].width,d=d||I[0].height,S?P=c(S):p&&!v&&(P=h(u,d,C,"depth","uint32")),E?O=c(E):v&&!p&&(O=h(u,d,!1,"stencil","uint8")),L?R=c(L):!S&&!E&&v&&p&&(R=h(u,d,C,"depth stencil","depth stencil")),xe(!!S+!!E+!!L<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var j=null;for(a=0;a<I.length;++a)if(l(I[a],u,d),xe(!I[a]||I[a].texture&&Wi.indexOf(I[a].texture._texture.format)>=0||I[a].renderbuffer&&oa.indexOf(I[a].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+a+" is invalid"),I[a]&&I[a].texture){var F=Xi[I[a].texture._texture.format]*Zi[I[a].texture._texture.type];null===j?j=F:xe(j===F,"all color attachments much have the same number of bits per pixel.")}return l(P,u,d),xe(!P||P.texture&&P.texture._texture.format===Gi||P.renderbuffer&&P.renderbuffer._renderbuffer.format===$i,"invalid depth attachment for framebuffer object"),l(O,u,d),xe(!O||O.renderbuffer&&O.renderbuffer._renderbuffer.format===ta,"invalid stencil attachment for framebuffer object"),l(R,u,d),xe(!R||R.texture&&R.texture._texture.format===ea||R.renderbuffer&&R.renderbuffer._renderbuffer.format===ea,"invalid depth-stencil attachment for framebuffer object"),m(s),s.width=u,s.height=d,s.colorAttachments=I,s.depthAttachment=P,s.stencilAttachment=O,s.depthStencilAttachment=R,i.color=I.map(f),i.depth=f(P),i.stencil=f(O),i.depthStencil=f(R),i.width=s.width,i.height=s.height,g(s),i}function o(t,e){xe(_.next!==s,"can not resize a framebuffer which is currently in use");var r=0|t,n=0|e||r;if(r===s.width&&n===s.height)return i;for(var a=s.colorAttachments,o=0;o<a.length;++o)d(a[o],r,n);return d(s.depthAttachment,r,n),d(s.stencilAttachment,r,n),d(s.depthStencilAttachment,r,n),s.width=i.width=r,s.height=i.height=n,g(s),i}var s=new p;return a.framebufferCount++,i(t,n),$t(i,{resize:o,_reglType:"framebuffer",_framebuffer:s,destroy:function(){v(s),m(s)},use:function(t){_.setFBO({framebuffer:i},t)}})}function b(t){function i(t){var r;xe(o.indexOf(_.next)<0,"can not update framebuffer which is currently in use");var a=e.webgl_draw_buffers,s={color:null},l=0,u=null,c="rgba",h="uint8",f=1;if("number"==typeof t)l=0|t;else if(t){xe.type(t,"object","invalid arguments for framebuffer");var d=t;if("shape"in d){var p=d.shape;xe(Array.isArray(p)&&p.length>=2,"invalid shape for framebuffer"),xe(p[0]===p[1],"cube framebuffer must be square"),l=p[0]}else"radius"in d&&(l=0|d.radius),"width"in d?(l=0|d.width,"height"in d&&xe(d.height===l,"must be square")):"height"in d&&(l=0|d.height);("color"in d||"colors"in d)&&(u=d.color||d.colors,Array.isArray(u)&&xe(1===u.length||a,"multiple render targets not supported")),u||("colorCount"in d&&(f=0|d.colorCount,xe(f>0,"invalid color buffer count")),"colorType"in d&&(xe.oneOf(d.colorType,A,"invalid color type"),h=d.colorType),"colorFormat"in d&&(c=d.colorFormat,xe.oneOf(d.colorFormat,w,"invalid color format for texture"))),"depth"in d&&(s.depth=d.depth),"stencil"in d&&(s.stencil=d.stencil),"depthStencil"in d&&(s.depthStencil=d.depthStencil)}else l=1;var m;if(u)if(Array.isArray(u))for(m=[],r=0;r<u.length;++r)m[r]=u[r];else m=[u];else{m=Array(f);var v={radius:l,format:c,type:h};for(r=0;r<f;++r)m[r]=n.createCube(v)}for(s.color=Array(m.length),r=0;r<m.length;++r){var g=m[r];xe("function"==typeof g&&"textureCube"===g._reglType,"invalid cube map"),l=l||g.width,xe(g.width===l&&g.height===l,"invalid cube map shape"),s.color[r]={target:zi,data:m[r]}}for(r=0;r<6;++r){for(var b=0;b<m.length;++b)s.color[b].target=zi+r;r>0&&(s.depth=o[0].depth,s.stencil=o[0].stencil,s.depthStencil=o[0].depthStencil),o[r]?o[r](s):o[r]=y(s)}return $t(i,{width:l,height:l,color:m})}function a(t){var e,n=0|t;if(xe(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===i.width)return i;var a=i.color;for(e=0;e<a.length;++e)a[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return i.width=i.height=n,i}var o=Array(6);return i(t),$t(i,{faces:o,resize:a,_reglType:"framebufferCube",destroy:function(){o.forEach(function(t){t.destroy()})}})}function x(){tr(T).forEach(function(e){e.framebuffer=t.createFramebuffer(),g(e)})}var _={cur:null,next:null,dirty:!1,setFBO:null},w=["rgba"],M=["rgba4","rgb565","rgb5 a1"];e.ext_srgb&&M.push("srgba"),e.ext_color_buffer_half_float&&M.push("rgba16f","rgb16f"),e.webgl_color_buffer_float&&M.push("rgba32f");var A=["uint8"];e.oes_texture_half_float&&A.push("half float","float16"),e.oes_texture_float&&A.push("float","float32");var k=0,T={};return $t(_,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof p)return e}return null},create:y,createCube:b,clear:function(){tr(T).forEach(v)},restore:x})}function Pt(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=la,this.offset=0,this.stride=0,this.divisor=0}function Ot(t,e,r,n,i){for(var a=r.maxAttributes,o=new Array(a),s=0;s<a;++s)o[s]=new Pt;return{Record:Pt,scope:{},state:o}}function Rt(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;r<t.length;++r)if(t[r].id===e.id)return void(t[r].location=e.location);t.push(e)}function o(r,n,i){var a=r===ua?c:h,o=a[n];if(!o){var s=e.str(n);o=t.createShader(r),t.shaderSource(o,s),t.compileShader(o),xe.shaderError(t,o,s,r,i),a[n]=o}return o}function s(t,e){this.id=p++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function l(r,s){var l,u,c=o(ua,r.fragId),h=o(ca,r.vertId),f=r.program=t.createProgram();t.attachShader(f,c),t.attachShader(f,h),t.linkProgram(f),xe.linkError(t,f,e.str(r.fragId),e.str(r.vertId),s);var d=t.getProgramParameter(f,ha);n.profile&&(r.stats.uniformsCount=d);var p=r.uniforms;for(l=0;l<d;++l)if(u=t.getActiveUniform(f,l))if(u.size>1)for(var m=0;m<u.size;++m){var v=u.name.replace("[0]","["+m+"]");a(p,new i(v,e.id(v),t.getUniformLocation(f,v),u))}else a(p,new i(u.name,e.id(u.name),t.getUniformLocation(f,u.name),u));var g=t.getProgramParameter(f,fa);n.profile&&(r.stats.attributesCount=g);var y=r.attributes;for(l=0;l<g;++l)u=t.getActiveAttrib(f,l),u&&a(y,new i(u.name,e.id(u.name),t.getAttribLocation(f,u.name),u))}function u(){c={},h={};for(var t=0;t<d.length;++t)l(d[t])}var c={},h={},f={},d=[],p=0;return n.profile&&(r.getMaxUniformsCount=function(){var t=0;return d.forEach(function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return d.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);tr(c).forEach(e),c={},tr(h).forEach(e),h={},d.forEach(function(e){t.deleteProgram(e.program)}),d.length=0,f={},r.shaderCount=0},program:function(t,e,n){xe.command(t>=0,"missing vertex shader",n),xe.command(e>=0,"missing fragment shader",n);var i=f[e];i||(i=f[e]={});var a=i[t];return a||(a=new s(e,t),r.shaderCount++,l(a,n),i[t]=a,d.push(a)),a},restore:u,shader:o,frag:-1,vert:-1}}function jt(t,e,r,n,i,a){function o(o){var s;null===e.next?(xe(i.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),s=pa):(xe(null!==e.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),s=e.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?xe(s===pa||s===va,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"):xe(s===pa,"Reading from a framebuffer is only allowed for the type 'uint8'"));var l=0,u=0,c=n.framebufferWidth,h=n.framebufferHeight,f=null;Kt(o)?f=o:o&&(xe.type(o,"object","invalid arguments to regl.read()"),l=0|o.x,u=0|o.y,xe(l>=0&&l<n.framebufferWidth,"invalid x offset for regl.read"),xe(u>=0&&u<n.framebufferHeight,"invalid y offset for regl.read"),c=0|(o.width||n.framebufferWidth-l),h=0|(o.height||n.framebufferHeight-u),f=o.data||null),f&&(s===pa?xe(f instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):s===va&&xe(f instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),xe(c>0&&c+l<=n.framebufferWidth,"invalid width for read pixels"),xe(h>0&&h+u<=n.framebufferHeight,"invalid height for read pixels"),r();var d=c*h*4;return f||(s===pa?f=new Uint8Array(d):s===va&&(f=f||new Float32Array(d))),xe.isTypedArray(f,"data buffer for regl.read() must be a typedarray"),xe(f.byteLength>=d,"data buffer for regl.read() too small"),t.pixelStorei(ma,4),t.readPixels(l,u,c,h,da,s,f),f}function s(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=o(t)}),r}function l(t){return t&&"framebuffer"in t?s(t):o(t)}return l}function Ft(t){return Array.prototype.slice.call(t)}function Nt(t){return Ft(t).join("")}function Bt(){function t(t){for(var e=0;e<l.length;++e)if(l[e]===t)return s[e];var r="g"+o++;return s.push(r),l.push(t),r}function e(){function t(){r.push.apply(r,Ft(arguments))}function e(){var t="v"+o++;return n.push(t),arguments.length>0&&(r.push(t,"="),r.push.apply(r,Ft(arguments)),r.push(";")),t}var r=[],n=[];return $t(t,{def:e,toString:function(){return Nt([n.length>0?"var "+n+";":"",Nt(r)])}})}function r(){function t(t,e){n(t,e,"=",r.def(t,e),";")}var r=e(),n=e(),i=r.toString,a=n.toString;return $t(function(){r.apply(r,Ft(arguments))},{def:r.def,entry:r,exit:n,save:t,set:function(e,n,i){t(e,n),r(e,n,"=",i,";")},toString:function(){return i()+a()}})}function n(){var t=Nt(arguments),e=r(),n=r(),i=e.toString,a=n.toString;return $t(e,{then:function(){return e.apply(e,Ft(arguments)),this},else:function(){return n.apply(n,Ft(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),Nt(["if(",t,"){",i(),"}",e])}})}function i(t,e){function n(){var t="a"+i.length;return i.push(t),t}var i=[];e=e||0;for(var a=0;a<e;++a)n();var o=r(),s=o.toString,l=c[t]=$t(o,{arg:n,toString:function(){return Nt(["function(",i.join(),"){",s(),"}"])}});return l}function a(){var t=['"use strict";',u,"return {"];Object.keys(c).forEach(function(e){t.push('"',e,'":',c[e].toString(),",")}),t.push("}");var e=Nt(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n"),r=Function.apply(null,s.concat(e));return r.apply(null,l)}var o=0,s=[],l=[],u=e(),c={};return{global:u,link:t,block:e,proc:i,scope:r,cond:n,compile:a}}function Ut(t){return Array.isArray(t)||Kt(t)||Z(t)}function Vt(t){return t.sort(function(t,e){return t===Ka?-1:e===Ka?1:t<e?-1:1})}function Ht(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function qt(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Yt(t){return new Ht(!1,!1,!1,t)}function Gt(t,e){var r=t.type;if(r===_a){var n=t.data.length;return new Ht(!0,n>=1,n>=2,e)}if(r===ka){var i=t.data;return new Ht(i.thisDep,i.contextDep,i.propDep,e)}return new Ht(r===Aa,r===Ma,r===wa,e)}function Wt(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p){function m(t){return t.replace(".","_")}function v(t,e,r){var n=m(t);et.push(t),tt[n]=$[n]=!!r,rt[n]=e}function g(t,e,r){var n=m(t);et.push(t),Array.isArray(r)?($[n]=r.slice(),tt[n]=r.slice()):$[n]=tt[n]=r,nt[n]=e}function y(){var t=Bt(),r=t.link,n=t.global;t.id=ot++,t.batchId="0";var i=r(it),a=t.shared={props:"a0"};Object.keys(it).forEach(function(t){a[t]=n.def(i,".",t)}),xe.optional(function(){t.CHECK=r(xe),t.commandStr=xe.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},at.invalidBlendCombinations=ds});var o=t.next={},s=t.current={};Object.keys(nt).forEach(function(t){Array.isArray($[t])&&(o[t]=n.def(a.next,".",t),s[t]=n.def(a.current,".",t))});var l=t.constants={};Object.keys(at).forEach(function(t){l[t]=n.def(JSON.stringify(at[t]))}),t.invoke=function(e,n){switch(n.type){case _a:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case wa:return e.def(a.props,n.data);case Ma:return e.def(a.context,n.data);case Aa:return e.def("this",n.data);case ka:return n.data.append(t,e),n.data.ref}},t.attribCache={};var c={};return t.scopeAttrib=function(t){var n=e.id(t);if(n in c)return c[n];var i=u.scope[n];i||(i=u.scope[n]=new X);var a=c[n]=r(i);return a},t}function b(t){var e,r=t.static,n=t.dynamic;if($a in r){var i=!!r[$a];e=Yt(function(t,e){return i}),e.enable=i}else if($a in n){var a=n[$a];e=Gt(a,function(t,e){return t.invoke(e,a)})}return e}function x(t,e){var r=t.static,n=t.dynamic;if(to in r){var i=r[to];return i?(i=s.getFramebuffer(i),xe.command(i,"invalid framebuffer object"),Yt(function(t,e){var r=t.link(i),n=t.shared;e.set(n.framebuffer,".next",r);var a=n.context;return e.set(a,"."+co,r+".width"),e.set(a,"."+ho,r+".height"),r})):Yt(function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+co,n+"."+vo),e.set(n,"."+ho,n+"."+go),"null"})}if(to in n){var a=n[to];return Gt(a,function(t,e){var r=t.invoke(e,a),n=t.shared,i=n.framebuffer,o=e.def(i,".getFramebuffer(",r,")");xe.optional(function(){t.assert(e,"!"+r+"||"+o,"invalid framebuffer object")}),e.set(i,".next",o);var s=n.context;return e.set(s,"."+co,o+"?"+o+".width:"+s+"."+vo),e.set(s,"."+ho,o+"?"+o+".height:"+s+"."+go),o})}return null}function _(t,e,r){function n(t){if(t in i){var n=i[t];xe.commandType(n,"object","invalid "+t,r.commandStr);var o,s,l=!0,u=0|n.x,c=0|n.y;return"width"in n?(o=0|n.width,xe.command(o>=0,"invalid "+t,r.commandStr)):l=!1,"height"in n?(s=0|n.height,xe.command(s>=0,"invalid "+t,r.commandStr)):l=!1,new Ht(!l&&e&&e.thisDep,!l&&e&&e.contextDep,!l&&e&&e.propDep,function(t,e){var r=t.shared.context,i=o;"width"in n||(i=e.def(r,".",co,"-",u));var a=s;return"height"in n||(a=e.def(r,".",ho,"-",c)),[u,c,i,a]})}if(t in a){var h=a[t],f=Gt(h,function(e,r){var n=e.invoke(r,h);xe.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)});var i=e.shared.context,a=r.def(n,".x|0"),o=r.def(n,".y|0"),s=r.def('"width" in ',n,"?",n,".width|0:","(",i,".",co,"-",a,")"),l=r.def('"height" in ',n,"?",n,".height|0:","(",i,".",ho,"-",o,")");return xe.optional(function(){e.assert(r,s+">=0&&"+l+">=0","invalid "+t)}),[a,o,s,l]});return e&&(f.thisDep=f.thisDep||e.thisDep,f.contextDep=f.contextDep||e.contextDep,f.propDep=f.propDep||e.propDep),f}return e?new Ht(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",co),e.def(r,".",ho)]}):null}var i=t.static,a=t.dynamic,o=n(Ka);if(o){var s=o;o=new Ht(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=s.append(t,e),n=t.shared.context;return e.set(n,"."+fo,r[2]),e.set(n,"."+po,r[3]),r})}return{viewport:o,scissor_box:n(Qa)}}function w(t){function r(t){if(t in i){var r=e.id(i[t]);xe.optional(function(){c.shader(vs[t],r,xe.guessCommand())});var n=Yt(function(){return r});return n.id=r,n}if(t in a){var o=a[t];return Gt(o,function(e,r){var n=e.invoke(r,o),i=r.def(e.shared.strings,".id(",n,")");return xe.optional(function(){r(e.shared.shader,".shader(",vs[t],",",i,",",e.command,");")}),i})}return null}var n,i=t.static,a=t.dynamic,o=r(ro),s=r(eo),l=null;return qt(o)&&qt(s)?(l=c.program(s.id,o.id),n=Yt(function(t,e){return t.link(l)})):n=new Ht(o&&o.thisDep||s&&s.thisDep,o&&o.contextDep||s&&s.contextDep,o&&o.propDep||s&&s.propDep,function(t,e){var r,n=t.shared.shader;r=o?o.append(t,e):e.def(n,".",ro);var i;i=s?s.append(t,e):e.def(n,".",eo);var a=n+".program("+i+","+r;return xe.optional(function(){a+=","+t.command}),e.def(a+")")}),{frag:o,vert:s,progVar:n,program:l}}function M(t,e){function r(){if(no in s){var t=s[no];Ut(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),xe.command(t,"invalid elements",e.commandStr));var r=Yt(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return r.value=t,r}if(no in l){var n=l[no];return Gt(n,function(t,e){var r=t.shared,i=r.isBufferArgs,a=r.elements,o=t.invoke(e,n),s=e.def("null"),l=e.def(i,"(",o,")"),u=t.cond(l).then(s,"=",a,".createStream(",o,");").else(s,"=",a,".getElements(",o,");");return xe.optional(function(){t.assert(u.else,"!"+o+"||"+s,"invalid elements")}),e.entry(u),e.exit(t.cond(l).then(a,".destroyStream(",s,");")),t.ELEMENTS=s,s})}return null}function n(){if(io in s){var t=s[io];return xe.commandParameter(t,Rr,"invalid primitve",e.commandStr),Yt(function(e,r){return Rr[t]})}if(io in l){var r=l[io];return Gt(r,function(t,e){var n=t.constants.primTypes,i=t.invoke(e,r);return xe.optional(function(){t.assert(e,i+" in "+n,"invalid primitive, must be one of "+Object.keys(Rr))}),e.def(n,"[",i,"]")})}return u?qt(u)?Yt(u.value?function(t,e){return e.def(t.ELEMENTS,".primType")}:function(){return Qo}):new Ht(u.thisDep,u.contextDep,u.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",Qo)}):null}function i(t,r){if(t in s){var n=0|s[t];return xe.command(!r||n>=0,"invalid "+t,e.commandStr),Yt(function(t,e){return r&&(t.OFFSET=n),n})}if(t in l){var i=l[t];return Gt(i,function(e,n){var a=e.invoke(n,i);return r&&(e.OFFSET=a,xe.optional(function(){e.assert(n,a+">=0","invalid "+t)})),a})}return r&&u?Yt(function(t,e){return t.OFFSET="0",0}):null}function o(){if(ao in s){var t=0|s[ao];return xe.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),Yt(function(){return t})}if(ao in l){var r=l[ao];return Gt(r,function(t,e){var n=t.invoke(e,r);return xe.optional(function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")}),n})}if(u){if(qt(u)){if(u)return c?new Ht(c.thisDep,c.contextDep,c.propDep,function(t,e){var r=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return xe.optional(function(){t.assert(e,r+">=0","invalid vertex offset/element buffer too small")}),r}):Yt(function(t,e){return e.def(t.ELEMENTS,".vertCount")});var n=Yt(function(){return-1});return xe.optional(function(){n.MISSING=!0}),n}var i=new Ht(u.thisDep||c.thisDep,u.contextDep||c.contextDep,u.propDep||c.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")});return xe.optional(function(){i.DYNAMIC=!0}),i}return null}var s=t.static,l=t.dynamic,u=r(),c=i(oo,!0);return{elements:u,primitive:n(),count:o(),instances:i(so,!1),offset:c}}function A(t,e){var r=t.static,i=t.dynamic,a={};return et.forEach(function(t){function o(e,n){if(t in r){var o=e(r[t]);a[s]=Yt(function(){return o})}else if(t in i){var l=i[t];a[s]=Gt(l,function(t,e){return n(t,e,t.invoke(e,l))})}}var s=m(t);switch(t){case Ra:case Sa:case Ta:case Ya:case Da:case Ja:case Ba:case Va:case Ha:case Pa:return o(function(r){return xe.commandType(r,"boolean",t,e.commandStr),r},function(e,r,n){return xe.optional(function(){e.assert(r,"typeof "+n+'==="boolean"',"invalid flag "+t,e.commandStr)}),n});case za:return o(function(r){return xe.commandParameter(r,ps,"invalid "+t,e.commandStr),ps[r]},function(e,r,n){var i=e.constants.compareFuncs;return xe.optional(function(){e.assert(r,n+" in "+i,"invalid "+t+", must be one of "+Object.keys(ps))}),r.def(i,"[",n,"]")});case Ia:return o(function(t){return xe.command(mt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t},function(t,e,r){xe.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===2&&typeof "+r+'[0]==="number"&&typeof '+r+'[1]==="number"&&'+r+"[0]<="+r+"[1]","depth range must be a 2d array")});var n=e.def("+",r,"[0]"),i=e.def("+",r,"[1]");return[n,i]});case Ca:return o(function(t){xe.commandType(t,"object","blend.func",e.commandStr);var r="srcRGB"in t?t.srcRGB:t.src,n="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,a="dstAlpha"in t?t.dstAlpha:t.dst;return xe.commandParameter(r,fs,s+".srcRGB",e.commandStr),xe.commandParameter(n,fs,s+".srcAlpha",e.commandStr),xe.commandParameter(i,fs,s+".dstRGB",e.commandStr),xe.commandParameter(a,fs,s+".dstAlpha",e.commandStr),xe.command(ds.indexOf(r+", "+i)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+r+", "+i+")",e.commandStr),[fs[r],fs[i],fs[n],fs[a]]},function(e,r,n){function i(i,o){var s=r.def('"',i,o,'" in ',n,"?",n,".",i,o,":",n,".",i);return xe.optional(function(){e.assert(r,s+" in "+a,"invalid "+t+"."+i+o+", must be one of "+Object.keys(fs))}),s}var a=e.constants.blendFuncs;xe.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid blend func, must be an object")});var o=i("src","RGB"),s=i("dst","RGB");xe.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(r,t+".indexOf("+o+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var l=r.def(a,"[",o,"]"),u=r.def(a,"[",i("src","Alpha"),"]"),c=r.def(a,"[",s,"]"),h=r.def(a,"[",i("dst","Alpha"),"]");return[l,c,u,h]});case La:return o(function(r){return"string"==typeof r?(xe.commandParameter(r,Z,"invalid "+t,e.commandStr),[Z[r],Z[r]]):"object"==typeof r?(xe.commandParameter(r.rgb,Z,t+".rgb",e.commandStr),xe.commandParameter(r.alpha,Z,t+".alpha",e.commandStr),[Z[r.rgb],Z[r.alpha]]):void xe.commandRaise("invalid blend.equation",e.commandStr)},function(e,r,n){var i=e.constants.blendEquations,a=r.def(),o=r.def(),s=e.cond("typeof ",n,'==="string"');return xe.optional(function(){function r(t,r,n){e.assert(t,n+" in "+i,"invalid "+r+", must be one of "+Object.keys(Z))}r(s.then,t,n),e.assert(s.else,n+"&&typeof "+n+'==="object"',"invalid "+t),r(s.else,t+".rgb",n+".rgb"),r(s.else,t+".alpha",n+".alpha")}),s.then(a,"=",o,"=",i,"[",n,"];"),s.else(a,"=",i,"[",n,".rgb];",o,"=",i,"[",n,".alpha];"),r(s),[a,o]});case Ea:return o(function(t){return xe.command(mt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),J(4,function(e){return+t[e]})},function(t,e,r){return xe.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","blend.color must be a 4d array")}),J(4,function(t){return e.def("+",r,"[",t,"]")})});case Ga:return o(function(t){return xe.commandType(t,"number",s,e.commandStr),0|t},function(t,e,r){return xe.optional(function(){t.assert(e,"typeof "+r+'==="number"',"invalid stencil.mask")}),e.def(r,"|0")});case Wa:return o(function(r){xe.commandType(r,"object",s,e.commandStr);var n=r.cmp||"keep",i=r.ref||0,a="mask"in r?r.mask:-1;return xe.commandParameter(n,ps,t+".cmp",e.commandStr),xe.commandType(i,"number",t+".ref",e.commandStr),xe.commandType(a,"number",t+".mask",e.commandStr),[ps[n],i,a]},function(t,e,r){var n=t.constants.compareFuncs;xe.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(r+"&&typeof ",r,'==="object"'),i('!("cmp" in ',r,")||(",r,".cmp in ",n,")")});var i=e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",as),a=e.def(r,".ref|0"),o=e.def('"mask" in ',r,"?",r,".mask|0:-1");return[i,a,o]});case Xa:case Za:return o(function(r){xe.commandType(r,"object",s,e.commandStr);var n=r.fail||"keep",i=r.zfail||"keep",a=r.zpass||"keep";return xe.commandParameter(n,ms,t+".fail",e.commandStr),xe.commandParameter(i,ms,t+".zfail",e.commandStr),xe.commandParameter(a,ms,t+".zpass",e.commandStr),[t===Za?$o:Ko,ms[n],ms[i],ms[a]]},function(e,r,n){function i(i){return xe.optional(function(){e.assert(r,'!("'+i+'" in '+n+")||("+n+"."+i+" in "+a+")","invalid "+t+"."+i+", must be one of "+Object.keys(ms))}),r.def('"',i,'" in ',n,"?",a,"[",n,".",i,"]:",as)}var a=e.constants.stencilOps;return xe.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[t===Za?$o:Ko,i("fail"),i("zfail"),i("zpass")]});case Ua:return o(function(t){xe.commandType(t,"object",s,e.commandStr);var r=0|t.factor,n=0|t.units;return xe.commandType(r,"number",s+".factor",e.commandStr),xe.commandType(n,"number",s+".units",e.commandStr),[r,n]},function(e,r,n){xe.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)});var i=r.def(n,".factor|0"),a=r.def(n,".units|0");return[i,a]});case ja:return o(function(t){var r=0;return"front"===t?r=Ko:"back"===t&&(r=$o),xe.command(!!r,s,e.commandStr),r},function(t,e,r){return xe.optional(function(){t.assert(e,r+'==="front"||'+r+'==="back"',"invalid cull.face")}),e.def(r,'==="front"?',Ko,":",$o)});case Na:return o(function(t){return xe.command("number"==typeof t&&t>=n.lineWidthDims[0]&&t<=n.lineWidthDims[1],"invalid line width, must positive number between "+n.lineWidthDims[0]+" and "+n.lineWidthDims[1],e.commandStr),t},function(t,e,r){return xe.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">="+n.lineWidthDims[0]+"&&"+r+"<="+n.lineWidthDims[1],"invalid line width")}),r});case Fa:return o(function(t){return xe.commandParameter(t,gs,s,e.commandStr),gs[t]},function(t,e,r){return xe.optional(function(){t.assert(e,r+'==="cw"||'+r+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),e.def(r+'==="cw"?'+ts+":"+es)});case Oa:return o(function(t){return xe.command(mt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map(function(t){return!!t})},function(t,e,r){return xe.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","invalid color.mask")}),J(4,function(t){return"!!"+r+"["+t+"]"})});case qa:return o(function(t){xe.command("object"==typeof t&&t,s,e.commandStr);var r="value"in t?t.value:1,n=!!t.invert;return xe.command("number"==typeof r&&r>=0&&r<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[r,n]},function(t,e,r){xe.optional(function(){t.assert(e,r+"&&typeof "+r+'==="object"',"invalid sample.coverage")});var n=e.def('"value" in ',r,"?+",r,".value:1"),i=e.def("!!",r,".invert");return[n,i]})}}),a}function k(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var n,a=r[t];if("number"==typeof a||"boolean"==typeof a)n=Yt(function(){return a});else if("function"==typeof a){var o=a._reglType;"texture2d"===o||"textureCube"===o?n=Yt(function(t){return t.link(a)}):"framebuffer"===o||"framebufferCube"===o?(xe.command(a.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),n=Yt(function(t){return t.link(a.color[0])})):xe.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else mt(a)?n=Yt(function(e){var r=e.global.def("[",J(a.length,function(r){return xe.command("number"==typeof a[r]||"boolean"==typeof a[r],"invalid uniform "+t,e.commandStr),a[r]}),"]");return r}):xe.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);n.value=a,i[t]=n}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=Gt(e,function(t,r){return t.invoke(r,e)})}),i}function T(t,r){var n=t.static,a=t.dynamic,o={};return Object.keys(n).forEach(function(t){var a=n[t],s=e.id(t),l=new X;if(Ut(a))l.state=ba,l.buffer=i.getBuffer(i.create(a,bo,!1,!0)),l.type=0;else{var u=i.getBuffer(a);if(u)l.state=ba,l.buffer=u,l.type=0;else if(xe.command("object"==typeof a&&a,"invalid data for attribute "+t,r.commandStr),a.constant){var c=a.constant;l.buffer="null",l.state=xa,"number"==typeof c?l.x=c:(xe.command(mt(c)&&c.length>0&&c.length<=4,"invalid constant for attribute "+t,r.commandStr),ga.forEach(function(t,e){e<c.length&&(l[t]=c[e])}))}else{u=Ut(a.buffer)?i.getBuffer(i.create(a.buffer,bo,!1,!0)):i.getBuffer(a.buffer),xe.command(!!u,'missing buffer for attribute "'+t+'"',r.commandStr);var h=0|a.offset;xe.command(h>=0,'invalid offset for attribute "'+t+'"',r.commandStr);var f=0|a.stride;xe.command(f>=0&&f<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',r.commandStr);var d=0|a.size;xe.command(!("size"in a)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',r.commandStr);var p=!!a.normalized,m=0; "type"in a&&(xe.commandParameter(a.type,br,"invalid type for attribute "+t,r.commandStr),m=br[a.type]);var v=0|a.divisor;"divisor"in a&&(xe.command(0===v||Q,'cannot specify divisor for attribute "'+t+'", instancing not supported',r.commandStr),xe.command(v>=0,'invalid divisor for attribute "'+t+'"',r.commandStr)),xe.optional(function(){var e=r.commandStr,n=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(a).forEach(function(r){xe.command(n.indexOf(r)>=0,'unknown parameter "'+r+'" for attribute pointer "'+t+'" (valid parameters are '+n+")",e)})}),l.buffer=u,l.state=ba,l.size=d,l.normalized=p,l.type=m||u.dtype,l.offset=h,l.stride=f,l.divisor=v}}o[t]=Yt(function(t,e){var r=t.attribCache;if(s in r)return r[s];var n={isStream:!1};return Object.keys(l).forEach(function(t){n[t]=l[t]}),l.buffer&&(n.buffer=t.link(l.buffer),n.type=n.type||n.buffer+".dtype"),r[s]=n,n})}),Object.keys(a).forEach(function(t){function e(e,n){function i(t){n(u[t],"=",a,".",t,"|0;")}var a=e.invoke(n,r),o=e.shared,s=o.isBufferArgs,l=o.buffer;xe.optional(function(){e.assert(n,a+"&&(typeof "+a+'==="object"||typeof '+a+'==="function")&&('+s+"("+a+")||"+l+".getBuffer("+a+")||"+l+".getBuffer("+a+".buffer)||"+s+"("+a+'.buffer)||("constant" in '+a+"&&(typeof "+a+'.constant==="number"||'+o.isArrayLike+"("+a+".constant))))",'invalid dynamic attribute "'+t+'"')});var u={isStream:n.def(!1)},c=new X;c.state=ba,Object.keys(c).forEach(function(t){u[t]=n.def(""+c[t])});var h=u.buffer,f=u.type;return n("if(",s,"(",a,")){",u.isStream,"=true;",h,"=",l,".createStream(",bo,",",a,");",f,"=",h,".dtype;","}else{",h,"=",l,".getBuffer(",a,");","if(",h,"){",f,"=",h,".dtype;",'}else if("constant" in ',a,"){",u.state,"=",xa,";","if(typeof "+a+'.constant === "number"){',u[ga[0]],"=",a,".constant;",ga.slice(1).map(function(t){return u[t]}).join("="),"=0;","}else{",ga.map(function(t,e){return u[t]+"="+a+".constant.length>="+e+"?"+a+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",a,".buffer)){",h,"=",l,".createStream(",bo,",",a,".buffer);","}else{",h,"=",l,".getBuffer(",a,".buffer);","}",f,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",h,".dtype;",u.normalized,"=!!",a,".normalized;"),i("size"),i("offset"),i("stride"),i("divisor"),n("}}"),n.exit("if(",u.isStream,"){",l,".destroyStream(",h,");","}"),u}var r=a[t];o[t]=Gt(r,e)}),o}function S(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=Yt(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=Gt(e,function(t,r){return t.invoke(r,e)})}),n}function E(t,e,r,n,i){function a(t){var e=u[t];e&&(h[t]=e)}var o=t.static,s=t.dynamic;xe.optional(function(){function t(t){Object.keys(t).forEach(function(t){xe.command(e.indexOf(t)>=0,'unknown parameter "'+t+'"',i.commandStr)})}var e=[to,eo,ro,no,io,oo,ao,so,$a].concat(et);t(o),t(s)});var l=x(t,i),u=_(t,l,i),c=M(t,i),h=A(t,i),f=w(t,i);a(Ka),a(m(Qa));var d=Object.keys(h).length>0,p={framebuffer:l,draw:c,shader:f,state:h,dirty:d};return p.profile=b(t,i),p.uniforms=k(r,i),p.attributes=T(e,i),p.context=S(n,i),p}function L(t,e,r){var n=t.shared,i=n.context,a=t.scope();Object.keys(r).forEach(function(n){e.save(i,"."+n);var o=r[n];a(i,".",n,"=",o.append(t,e),";")}),e(a)}function C(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;K&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,u=t.constants,c=u.drawBuffer,h=u.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",cs,",",l,".framebuffer);"),K&&e(i,".drawBuffersWEBGL(",c,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",cs,",null);"),K&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function D(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,u=t.cond(s,".dirty");et.forEach(function(e){var n=m(e);if(!(n in r.state)){var c,h;if(n in o){c=o[n],h=a[n];var f=J($[n].length,function(t){return u.def(c,"[",t,"]")});u(t.cond(f.map(function(t,e){return t+"!=="+h+"["+e+"]"}).join("||")).then(i,".",nt[n],"(",f,");",f.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";"))}else{c=u.def(l,".",n);var d=t.cond(c,"!==",s,".",n);u(d),n in rt?d(t.cond(c).then(i,".enable(",rt[n],");").else(i,".disable(",rt[n],");"),s,".",n,"=",c,";"):d(i,".",nt[n],"(",c,");",s,".",n,"=",c,";")}}}),0===Object.keys(r.state).length&&u(s,".dirty=false;"),e(u)}function z(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;Vt(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var u=l.append(t,e);if(rt[i]){var c=rt[i];qt(l)?u?e(s,".enable(",c,");"):e(s,".disable(",c,");"):e(t.cond(u).then(s,".enable(",c,");").else(s,".disable(",c,");")),e(o,".",i,"=",u,";")}else if(mt(u)){var h=a[i];e(s,".",nt[i],"(",u,");",u.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";")}else e(s,".",nt[i],"(",u,");",o,".",i,"=",u,";")}})}function I(t,e){Q&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function P(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){u=e.def(),t(u,"=",a(),";"),"string"==typeof i?t(p,".count+=",i,";"):t(p,".count++;"),d&&(n?(c=e.def(),t(c,"=",v,".getNumPendingQueries();")):t(v,".beginQuery(",p,");"))}function s(t){t(p,".cpuTime+=",a(),"-",u,";"),d&&(n?t(v,".pushScopeStats(",c,",",v,".getNumPendingQueries(),",p,");"):t(v,".endQuery();"))}function l(t){var r=e.def(m,".profile");e(m,".profile=",t,";"),e.exit(m,".profile=",r,";")}var u,c,h,f=t.shared,p=t.stats,m=f.current,v=f.timer,g=r.profile;if(g){if(qt(g))return void(g.enable?(o(e),s(e.exit),l("true")):l("false"));h=g.append(t,e),l(h)}else h=e.def(m,".profile");var y=t.block();o(y),e("if(",h,"){",y,"}");var b=t.block();s(b),e.exit("if(",h,"){",b,"}")}function O(t,e,r,n,i){function a(t){switch(t){case Oo:case No:case Ho:return 2;case Ro:case Bo:case qo:return 3;case jo:case Uo:case Yo:return 4;default:return 1}}function o(r,n,i){function a(){e("if(!",c,".buffer){",l,".enableVertexAttribArray(",u,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",c,".type!==",a,"||",c,".size!==",r,"||",p.map(function(t){return c+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",bo,",",f,".buffer);",l,".vertexAttribPointer(",[u,r,a,i.normalized,i.stride,i.offset],");",c,".type=",a,";",c,".size=",r,";",p.map(function(t){return c+"."+t+"="+i[t]+";"}).join(""),"}"),Q){var o=i.divisor;e("if(",c,".divisor!==",o,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,o],");",c,".divisor=",o,";}")}}function o(){e("if(",c,".buffer){",l,".disableVertexAttribArray(",u,");","}if(",ga.map(function(t,e){return c+"."+t+"!=="+d[e]}).join("||"),"){",l,".vertexAttrib4f(",u,",",d,");",ga.map(function(t,e){return c+"."+t+"="+d[e]+";"}).join(""),"}")}var l=s.gl,u=e.def(r,".location"),c=e.def(s.attributes,"[",u,"]"),h=i.state,f=i.buffer,d=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];h===ba?a():h===xa?o():(e("if(",h,"===",ba,"){"),a(),e("}else{"),o(),e("}"))}var s=t.shared;n.forEach(function(n){var s,l=n.name,u=r.attributes[l];if(u){if(!i(u))return;s=u.append(t,e)}else{if(!i(ys))return;var c=t.scopeAttrib(l);xe.optional(function(){t.assert(e,c+".state","missing attribute "+l)}),s={},Object.keys(new X).forEach(function(t){s[t]=e.def(c,".",t)})}o(t.link(n),a(n.info.type),s)})}function R(t,r,n,i,a){for(var o,s=t.shared,l=s.gl,u=0;u<i.length;++u){var c,h=i[u],f=h.name,d=h.info.type,p=n.uniforms[f],m=t.link(h),v=m+".location";if(p){if(!a(p))continue;if(qt(p)){var g=p.value;if(xe.command(null!==g&&"undefined"!=typeof g,'missing uniform "'+f+'"',t.commandStr),d===Zo||d===Jo){xe.command("function"==typeof g&&(d===Zo&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||d===Jo&&("textureCube"===g._reglType||"framebufferCube"===g._reglType)),"invalid texture for uniform "+f,t.commandStr);var y=t.link(g._texture||g.color[0]._texture);r(l,".uniform1i(",v,",",y+".bind());"),r.exit(y,".unbind();")}else if(d===Go||d===Wo||d===Xo){xe.optional(function(){xe.command(mt(g),"invalid matrix for uniform "+f,t.commandStr),xe.command(d===Go&&4===g.length||d===Wo&&9===g.length||d===Xo&&16===g.length,"invalid length for matrix uniform "+f,t.commandStr)});var b=t.global.def("new Float32Array(["+Array.prototype.slice.call(g)+"])"),x=2;d===Wo?x=3:d===Xo&&(x=4),r(l,".uniformMatrix",x,"fv(",v,",false,",b,");")}else{switch(d){case Po:xe.commandType(g,"number","uniform "+f,t.commandStr),o="1f";break;case Oo:xe.command(mt(g)&&2===g.length,"uniform "+f,t.commandStr),o="2f";break;case Ro:xe.command(mt(g)&&3===g.length,"uniform "+f,t.commandStr),o="3f";break;case jo:xe.command(mt(g)&&4===g.length,"uniform "+f,t.commandStr),o="4f";break;case Vo:xe.commandType(g,"boolean","uniform "+f,t.commandStr),o="1i";break;case Fo:xe.commandType(g,"number","uniform "+f,t.commandStr),o="1i";break;case Ho:xe.command(mt(g)&&2===g.length,"uniform "+f,t.commandStr),o="2i";break;case No:xe.command(mt(g)&&2===g.length,"uniform "+f,t.commandStr),o="2i";break;case qo:xe.command(mt(g)&&3===g.length,"uniform "+f,t.commandStr),o="3i";break;case Bo:xe.command(mt(g)&&3===g.length,"uniform "+f,t.commandStr),o="3i";break;case Yo:xe.command(mt(g)&&4===g.length,"uniform "+f,t.commandStr),o="4i";break;case Uo:xe.command(mt(g)&&4===g.length,"uniform "+f,t.commandStr),o="4i"}r(l,".uniform",o,"(",v,",",mt(g)?Array.prototype.slice.call(g):g,");")}continue}c=p.append(t,r)}else{if(!a(ys))continue;c=r.def(s.uniforms,"[",e.id(f),"]")}d===Zo?r("if(",c,"&&",c,'._reglType==="framebuffer"){',c,"=",c,".color[0];","}"):d===Jo&&r("if(",c,"&&",c,'._reglType==="framebufferCube"){',c,"=",c,".color[0];","}"),xe.optional(function(){function e(e,n){t.assert(r,e,'bad data or missing for uniform "'+f+'". '+n)}function n(t){e("typeof "+c+'==="'+t+'"',"invalid type, expected "+t)}function i(r,n){e(s.isArrayLike+"("+c+")&&"+c+".length==="+r,"invalid vector, should have length "+r,t.commandStr)}function a(r){e("typeof "+c+'==="function"&&'+c+'._reglType==="texture'+(r===Mo?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(d){case Fo:n("number");break;case No:i(2,"number");break;case Bo:i(3,"number");break;case Uo:i(4,"number");break;case Po:n("number");break;case Oo:i(2,"number");break;case Ro:i(3,"number");break;case jo:i(4,"number");break;case Vo:n("boolean");break;case Ho:i(2,"boolean");break;case qo:i(3,"boolean");break;case Yo:i(4,"boolean");break;case Go:i(4,"number");break;case Wo:i(9,"number");break;case Xo:i(16,"number");break;case Zo:a(Mo);break;case Jo:a(Ao)}});var _=1;switch(d){case Zo:case Jo:var w=r.def(c,"._texture");r(l,".uniform1i(",v,",",w,".bind());"),r.exit(w,".unbind();");continue;case Fo:case Vo:o="1i";break;case No:case Ho:o="2i",_=2;break;case Bo:case qo:o="3i",_=3;break;case Uo:case Yo:o="4i",_=4;break;case Po:o="1f";break;case Oo:o="2f",_=2;break;case Ro:o="3f",_=3;break;case jo:o="4f",_=4;break;case Go:o="Matrix2fv";break;case Wo:o="Matrix3fv";break;case Xo:o="Matrix4fv"}if(r(l,".uniform",o,"(",v,","),"M"===o.charAt(0)){var M=Math.pow(d-Go+2,2),A=t.global.def("new Float32Array(",M,")");r("false,(Array.isArray(",c,")||",c," instanceof Float32Array)?",c,":(",J(M,function(t){return A+"["+t+"]="+c+"["+t+"]"}),",",A,")")}else r(_>1?J(_,function(t){return c+"["+t+"]"}):c);r(");")}}function j(t,e,r,n){function i(){var i,a=f.elements,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(h,".",no),i&&o("if("+i+")"+c+".bindBuffer("+xo+","+i+".buffer.buffer);"),i}function a(){var i,a=f.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),xe.optional(function(){a.MISSING&&t.assert(e,"false","missing vertex count"),a.DYNAMIC&&t.assert(o,i+">=0","missing vertex count")})):(i=o.def(h,".",ao),xe.optional(function(){t.assert(o,i+">=0","missing vertex count")})),i}function o(i){var a=f[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(h,".",i)}function s(){function t(){r(y,".drawElementsInstancedANGLE(",[p,v,b,m+"<<(("+b+"-"+ya+")>>1)",g],");")}function e(){r(y,".drawArraysInstancedANGLE(",[p,m,v,g],");")}d?x?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}function l(){function t(){r(c+".drawElements("+[p,v,b,m+"<<(("+b+"-"+ya+")>>1)"]+");")}function e(){r(c+".drawArrays("+[p,m,v]+");")}d?x?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}var u=t.shared,c=u.gl,h=u.draw,f=n.draw,d=i(),p=o(io),m=o(oo),v=a();if("number"==typeof v){if(0===v)return}else r("if(",v,"){"),r.exit("}");var g,y;Q&&(g=o(so),y=t.instancing);var b=d+".type",x=f.elements&&qt(f.elements);Q&&("number"!=typeof g||g>=0)?"string"==typeof g?(r("if(",g,">0){"),s(),r("}else if(",g,"<0){"),l(),r("}")):s():l()}function F(t,e,r,n,i){var a=y(),o=a.proc("body",i);return xe.optional(function(){a.commandStr=e.commandStr,a.command=a.link(e.commandStr)}),Q&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function N(t,e,r,n){I(t,e),O(t,e,r,n.attributes,function(){return!0}),R(t,e,r,n.uniforms,function(){return!0}),j(t,e,e,r)}function B(t,e){var r=t.proc("draw",1);I(t,r),L(t,r,e.context),C(t,r,e.framebuffer),D(t,r,e),z(t,r,e.state),P(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)N(t,r,e,e.shader.program);else{var i=t.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(t.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",t.link(function(r){return F(N,t,e,r,1)}),"(",n,");",o,".call(this,a0);"))}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;")}function U(t,e,r,n){function i(){return!0}t.batchId="a1",I(t,e),O(t,e,r,n.attributes,i),R(t,e,r,n.uniforms,i),j(t,e,e,r)}function V(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}I(t,e);var o=r.contextDep,s=e.def(),l="a0",u="a1",c=e.def();t.shared.props=c,t.batchId=s;var h=t.scope(),f=t.scope();if(e(h.entry,"for(",s,"=0;",s,"<",u,";++",s,"){",c,"=",l,"[",s,"];",f,"}",h.exit),r.needsContext&&L(t,f,r.context),r.needsFramebuffer&&C(t,f,r.framebuffer),z(t,f,r.state,i),r.profile&&i(r.profile)&&P(t,f,r,!1,!0),n)O(t,h,r,n.attributes,a),O(t,f,r,n.attributes,i),R(t,h,r,n.uniforms,a),R(t,f,r,n.uniforms,i),j(t,h,f,r);else{var d=t.global.def("{}"),p=r.shader.progVar.append(t,f),m=f.def(p,".id"),v=f.def(d,"[",m,"]");f(t.shared.gl,".useProgram(",p,".program);","if(!",v,"){",v,"=",d,"[",m,"]=",t.link(function(e){return F(U,t,r,e,2)}),"(",p,");}",v,".call(this,a0[",s,"],",s,");")}}function H(t,e){function r(t){return t.contextDep&&i||t.propDep}var n=t.proc("batch",2);t.batchId="0",I(t,n);var i=!1,a=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(L(t,n,e.context),a=!1);var o=e.framebuffer,s=!1;o?(o.propDep?i=s=!0:o.contextDep&&i&&(s=!0),s||C(t,n,o)):C(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),D(t,n,e),z(t,n,e.state,function(t){return!r(t)}),e.profile&&r(e.profile)||P(t,n,e,!1,"a1"),e.contextDep=i,e.needsContext=a,e.needsFramebuffer=s;var l=e.shader.progVar;if(l.contextDep&&i||l.propDep)V(t,n,e,null);else{var u=l.append(t,n);if(n(t.shared.gl,".useProgram(",u,".program);"),e.shader.program)V(t,n,e,e.shader.program);else{var c=t.global.def("{}"),h=n.def(u,".id"),f=n.def(c,"[",h,"]");n(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",c,"[",h,"]=",t.link(function(r){return F(V,t,e,r,2)}),"(",u,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}function q(t,r){function n(e){var n=r.shader[e];n&&i.set(a.shader,"."+e,n.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;L(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),Vt(Object.keys(r.state)).forEach(function(e){var n=r.state[e],o=n.append(t,i);mt(o)?o.forEach(function(r,n){i.set(t.next[e],"["+n+"]",r)}):i.set(a.next,"."+e,o)}),P(t,i,r,!0,!0),[no,oo,ao,so,io].forEach(function(e){var n=r.draw[e];n&&i.set(a.draw,"."+e,""+n.append(t,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new X).forEach(function(t){i.set(a,"."+t,n[t])})}),n(eo),n(ro),Object.keys(r.state).length>0&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}function Y(t){if("object"==typeof t&&!mt(t)){for(var e=Object.keys(t),r=0;r<e.length;++r)if(Me.isDynamic(t[e[r]]))return!0;return!1}}function G(t,e,r){function n(t,e){o.forEach(function(r){var n=i[r];if(Me.isDynamic(n)){var a=t.invoke(e,n);e(c,".",r,"=",a,";")}})}var i=e.static[r];if(i&&Y(i)){var a=t.global,o=Object.keys(i),s=!1,l=!1,u=!1,c=t.global.def("{}");o.forEach(function(e){var r=i[e];if(Me.isDynamic(r)){"function"==typeof r&&(r=i[e]=Me.unbox(r));var n=Gt(r,null);s=s||n.thisDep,u=u||n.propDep,l=l||n.contextDep}else{switch(a(c,".",e,"="),typeof r){case"number":a(r);break;case"string":a('"',r,'"');break;case"object":Array.isArray(r)&&a("[",r.join(),"]");break;default:a(t.link(r))}a(";")}}),e.dynamic[r]=new Me.DynamicVariable(ka,{thisDep:s,contextDep:l,propDep:u,ref:c,append:n}),delete e.static[r]}}function W(t,e,r,n,i){var a=y();a.stats=a.link(i),Object.keys(e.static).forEach(function(t){G(a,e,t)}),yo.forEach(function(e){G(a,t,e)});var o=E(t,e,r,n,a);return B(a,o),q(a,o),H(a,o),a.compile()}var X=u.Record,Z={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(Z.min=rs,Z.max=ns);var Q=r.angle_instanced_arrays,K=r.webgl_draw_buffers,$={dirty:!0,profile:p.profile},tt={},et=[],rt={},nt={};v(Ta,So),v(Sa,To),g(Ea,"blendColor",[0,0,0,0]),g(La,"blendEquationSeparate",[ls,ls]),g(Ca,"blendFuncSeparate",[ss,os,ss,os]),v(Da,Lo,!0),g(za,"depthFunc",us),g(Ia,"depthRange",[0,1]),g(Pa,"depthMask",!0),g(Oa,Oa,[!0,!0,!0,!0]),v(Ra,ko),g(ja,"cullFace",$o),g(Fa,Fa,es),g(Na,Na,1),v(Ba,Do),g(Ua,"polygonOffset",[0,0]),v(Va,zo),v(Ha,Io),g(qa,"sampleCoverage",[1,!1]),v(Ya,Eo),g(Ga,"stencilMask",-1),g(Wa,"stencilFunc",[is,0,-1]),g(Xa,"stencilOpSeparate",[Ko,as,as,as]),g(Za,"stencilOpSeparate",[$o,as,as,as]),v(Ja,Co),g(Qa,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),g(Ka,Ka,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var it={gl:t,context:f,strings:e,next:tt,current:$,draw:h,elements:a,buffer:i,shader:c,attributes:u.state,uniforms:l,framebuffer:s,extensions:r,timer:d,isBufferArgs:Ut},at={primTypes:Rr,compareFuncs:ps,blendFuncs:fs,blendEquations:Z,stencilOps:ms,glTypes:br,orientationType:gs};xe.optional(function(){it.isArrayLike=mt}),K&&(at.backBuffer=[$o],at.drawBuffer=J(n.maxDrawbuffers,function(t){return 0===t?[0]:J(t,function(t){return hs+t})}));var ot=0;return{next:tt,current:$,procs:function(){var e=y(),r=e.proc("poll"),i=e.proc("refresh"),a=e.block();r(a),i(a);var o=e.shared,s=o.gl,l=o.next,u=o.current;a(u,".dirty=false;"),C(e,r),C(e,i,null,!0);var c,h=t.getExtension("angle_instanced_arrays");h&&(c=e.link(h));for(var f=0;f<n.maxAttributes;++f){var d=i.def(o.attributes,"[",f,"]"),p=e.cond(d,".buffer");p.then(s,".enableVertexAttribArray(",f,");",s,".bindBuffer(",bo,",",d,".buffer.buffer);",s,".vertexAttribPointer(",f,",",d,".size,",d,".type,",d,".normalized,",d,".stride,",d,".offset);").else(s,".disableVertexAttribArray(",f,");",s,".vertexAttrib4f(",f,",",d,".x,",d,".y,",d,".z,",d,".w);",d,".buffer=null;"),i(p),h&&i(c,".vertexAttribDivisorANGLE(",f,",",d,".divisor);")}return Object.keys(rt).forEach(function(t){var n=rt[t],o=a.def(l,".",t),c=e.block();c("if(",o,"){",s,".enable(",n,")}else{",s,".disable(",n,")}",u,".",t,"=",o,";"),i(c),r("if(",o,"!==",u,".",t,"){",c,"}")}),Object.keys(nt).forEach(function(t){var n,o,c=nt[t],h=$[t],f=e.block();if(f(s,".",c,"("),mt(h)){var d=h.length;n=e.global.def(l,".",t),o=e.global.def(u,".",t),f(J(d,function(t){return n+"["+t+"]"}),");",J(d,function(t){return o+"["+t+"]="+n+"["+t+"];"}).join("")),r("if(",J(d,function(t){return n+"["+t+"]!=="+o+"["+t+"]"}).join("||"),"){",f,"}")}else n=a.def(l,".",t),o=a.def(u,".",t),f(n,");",u,".",t,"=",n,";"),r("if(",n,"!==",o,"){",f,"}");i(f)}),e.compile()}(),compile:W}}function Xt(){return{bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}function Zt(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}function Jt(t){function e(){if(0===q.length)return A&&A.update(),void(J=null);J=Ae.next(e),f();for(var t=q.length-1;t>=0;--t){var r=q[t];r&&r(E,null,0)}g.flush(),A&&A.update()}function r(){!J&&q.length>0&&(J=Ae.next(e))}function n(){J&&(Ae.cancel(e),J=null)}function i(t){t.preventDefault(),b=!0,n(),Y.forEach(function(t){t()})}function a(t){g.getError(),b=!1,x.restore(),O.restore(),z.restore(),R.restore(),j.restore(),F.restore(),A&&A.restore(),N.procs.refresh(),r(),G.forEach(function(t){t()})}function o(){q.length=0,n(),H&&(H.removeEventListener(Ss,i),H.removeEventListener(Es,a)),O.clear(),F.clear(),j.clear(),R.clear(),I.clear(),z.clear(),A&&A.clear(),Z.forEach(function(t){t()})}function s(t){function e(t){function e(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach(function(n){r[t+"."+n]=e[n]})}}var r=$t({},t);return delete r.uniforms,delete r.attributes,delete r.context,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),e("blend"),e("depth"),e("cull"),e("stencil"),e("polygonOffset"),e("scissor"),e("sample"),r}function r(t){var e={},r={};return Object.keys(t).forEach(function(n){var i=t[n];Me.isDynamic(i)?r[n]=Me.unbox(i,n):e[n]=i}),{dynamic:r,static:e}}function n(t){for(;p.length<t;)p.push(null);return p}function i(t,e){var r;if(b&&xe.raise("context lost"),"function"==typeof t)return d.call(this,null,t,0);if("function"==typeof e){if("number"==typeof t){for(r=0;r<t;++r)d.call(this,null,e,r);return}if(Array.isArray(t)){for(r=0;r<t.length;++r)d.call(this,t[r],e,r);return}return d.call(this,t,e,0)}if("number"==typeof t){if(t>0)return f.call(this,n(0|t),0|t)}else{if(!Array.isArray(t))return h.call(this,t);if(t.length)return f.call(this,t,t.length)}}xe(!!t,"invalid args to regl({...})"),xe.type(t,"object","invalid args to regl({...})");var a=r(t.context||{}),o=r(t.uniforms||{}),s=r(t.attributes||{}),l=r(e(t)),u={gpuTime:0,cpuTime:0,count:0},c=N.compile(l,s,o,a,u),h=c.draw,f=c.batch,d=c.scope,p=[];return $t(i,{stats:u})}function l(t,e){var r=0;N.procs.poll();var n=e.color;n&&(g.clearColor(+n[0]||0,+n[1]||0,+n[2]||0,+n[3]||0),r|=Ms),"depth"in e&&(g.clearDepth(+e.depth),r|=As),"stencil"in e&&(g.clearStencil(0|e.stencil),r|=ks),xe(!!r,"called regl.clear with no buffer specified"),g.clear(r)}function u(t){if(xe("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;e<6;++e)Q($t({framebuffer:t.framebuffer.faces[e]},t),l);else Q(t,l);else l(null,t)}function c(t){function e(){function e(){var t=Zt(q,e);q[t]=q[q.length-1],q.length-=1,q.length<=0&&n()}var r=Zt(q,t);xe(r>=0,"cannot cancel a frame twice"),q[r]=e}return xe.type(t,"function","regl.frame() callback must be a function"),q.push(t),r(),{cancel:e}}function h(){var t=V.viewport,e=V.scissor_box;t[0]=t[1]=e[0]=e[1]=0,E.viewportWidth=E.framebufferWidth=E.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,E.viewportHeight=E.framebufferHeight=E.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function f(){E.tick+=1,E.time=p(),h(),N.procs.poll()}function d(){h(),N.procs.refresh(),A&&A.update()}function p(){return(ke()-k)/1e3}function m(t,e){xe.type(e,"function","listener callback must be a function");var r;switch(t){case"frame":return c(e);case"lost":r=Y;break;case"restore":r=G;break;case"destroy":r=Z;break;default:xe.raise("invalid event, must be one of frame,lost,restore,destroy")}return r.push(e),{cancel:function(){for(var t=0;t<r.length;++t)if(r[t]===e)return r[t]=r[r.length-1],void r.pop()}}}var v=W(t);if(!v)return null;var g=v.gl,y=g.getContextAttributes(),b=g.isContextLost(),x=X(g,v);if(!x)return null;var _=B(),w=Xt(),M=x.extensions,A=ws(g,M),k=ke(),T=g.drawingBufferWidth,S=g.drawingBufferHeight,E={tick:0,time:0,viewportWidth:T,viewportHeight:S,framebufferWidth:T,framebufferHeight:S,drawingBufferWidth:T,drawingBufferHeight:S,pixelRatio:v.pixelRatio},L={},C={elements:null,primitive:4,count:-1,offset:0,instances:-1},D=$e(g,M),z=ft(g,w,v),I=dt(g,M,z,w),P=Ot(g,M,D,z,_),O=Rt(g,_,w,v),R=Dt(g,M,D,function(){N.procs.poll()},E,w,v),j=Ei(g,M,D,w,v),F=It(g,M,D,R,j,w),N=Wt(g,_,M,D,z,I,R,F,L,P,O,C,E,A,v),U=jt(g,F,N.procs.poll,E,y,M),V=N.next,H=g.canvas,q=[],Y=[],G=[],Z=[v.onDestroy],J=null;H&&(H.addEventListener(Ss,i,!1),H.addEventListener(Es,a,!1));var Q=F.setFBO=s({framebuffer:Me.define.call(null,Ls,"framebuffer")});d();var K=$t(s,{clear:u,prop:Me.define.bind(null,Ls),context:Me.define.bind(null,Cs),this:Me.define.bind(null,Ds),draw:s({}),buffer:function(t){return z.create(t,Ts,!1,!1)},elements:function(t){return I.create(t,!1)},texture:R.create2D,cube:R.createCube,renderbuffer:j.create,framebuffer:F.create,framebufferCube:F.createCube,attributes:y,frame:c,on:m,limits:D,hasExtension:function(t){return D.extensions.indexOf(t.toLowerCase())>=0},read:U,destroy:o,_gl:g,_refresh:d,poll:function(){f(),A&&A.update()},now:p,stats:w});return v.onDone(null,K),K}var Qt={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},Kt=function(t){return Object.prototype.toString.call(t)in Qt},$t=function(t,e){for(var r=Object.keys(e),n=0;n<r.length;++n)t[r[n]]=e[r[n]];return t},te=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"],ee=33071,re=9728,ne=9984,ie=9985,ae=9986,oe=9987,se=5120,le=5121,ue=5122,ce=5123,he=5124,fe=5125,de=5126,pe=32819,me=32820,ve=33635,ge=34042,ye=36193,be={};be[se]=be[le]=1,be[ue]=be[ce]=be[ye]=be[ve]=be[pe]=be[me]=2,be[he]=be[fe]=be[de]=be[ge]=4;var xe=$t(r,{optional:S,raise:e,commandRaise:M,command:A,parameter:i,commandParameter:k,constructor:u,type:o,commandType:T,isTypedArray:a,nni:s,oneOf:l,shaderError:b,linkError:x,callSite:m,saveCommandRef:_,saveDrawInfo:w,framebufferFormat:E,guessCommand:p,texture2D:D,textureCube:z}),_e=0,we=0,Me={DynamicVariable:I,define:j,isDynamic:F,unbox:N,accessor:R},Ae={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},ke="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},Te=3408,Se=3410,Ee=3411,Le=3412,Ce=3413,De=3414,ze=3415,Ie=33901,Pe=33902,Oe=3379,Re=3386,je=34921,Fe=36347,Ne=36348,Be=35661,Ue=35660,Ve=34930,He=36349,qe=34076,Ye=34024,Ge=7936,We=7937,Xe=7938,Ze=35724,Je=34047,Qe=36063,Ke=34852,$e=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(Je));var n=1,i=1;return e.webgl_draw_buffers&&(n=t.getParameter(Ke),i=t.getParameter(Qe)),{colorBits:[t.getParameter(Se),t.getParameter(Ee),t.getParameter(Le),t.getParameter(Ce)],depthBits:t.getParameter(De),stencilBits:t.getParameter(ze),subpixelBits:t.getParameter(Te),extensions:Object.keys(e).filter(function(t){return!!e[t]}),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:t.getParameter(Ie),lineWidthDims:t.getParameter(Pe),maxViewportDims:t.getParameter(Re),maxCombinedTextureUnits:t.getParameter(Be),maxCubeMapSize:t.getParameter(qe),maxRenderbufferSize:t.getParameter(Ye),maxTextureUnits:t.getParameter(Ve),maxTextureSize:t.getParameter(Oe),maxAttributes:t.getParameter(je),maxVertexUniforms:t.getParameter(Fe),maxVertexTextureUnits:t.getParameter(Ue),maxVaryingVectors:t.getParameter(Ne),maxFragmentUniforms:t.getParameter(He),glsl:t.getParameter(Ze),renderer:t.getParameter(We),vendor:t.getParameter(Ge),version:t.getParameter(Xe)}},tr=function(t){return Object.keys(t).map(function(e){return t[e]})},er=5120,rr=5121,nr=5122,ir=5123,ar=5124,or=5125,sr=5126,lr=J(8,function(){return[]}),ur={alloc:$,free:tt,allocType:et,freeType:rt},cr={shape:lt,flatten:st},hr=5120,fr=5122,dr=5124,pr=5121,mr=5123,vr=5125,gr=5126,yr=5126,br={int8:hr,int16:fr,int32:dr,uint8:pr,uint16:mr,uint32:vr,float:gr,float32:yr},xr=35048,_r=35040,wr={dynamic:xr,stream:_r,static:35044},Mr=cr.flatten,Ar=cr.shape,kr=35044,Tr=35040,Sr=5121,Er=5126,Lr=[];Lr[5120]=1,Lr[5122]=2,Lr[5124]=4,Lr[5121]=1,Lr[5123]=2,Lr[5125]=4,Lr[5126]=4;var Cr=0,Dr=0,zr=1,Ir=1,Pr=4,Or=4,Rr={points:Cr,point:Dr,lines:zr,line:Ir,triangles:Pr,triangle:Or,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},jr=0,Fr=1,Nr=4,Br=5120,Ur=5121,Vr=5122,Hr=5123,qr=5124,Yr=5125,Gr=34963,Wr=35040,Xr=35044,Zr=new Float32Array(1),Jr=new Uint32Array(Zr.buffer),Qr=5123,Kr=34467,$r=3553,tn=34067,en=34069,rn=6408,nn=6406,an=6407,on=6409,sn=6410,ln=32854,un=32855,cn=36194,hn=32819,fn=32820,dn=33635,pn=34042,mn=6402,vn=34041,gn=35904,yn=35906,bn=36193,xn=33776,_n=33777,wn=33778,Mn=33779,An=35986,kn=35987,Tn=34798,Sn=35840,En=35841,Ln=35842,Cn=35843,Dn=36196,zn=5121,In=5123,Pn=5125,On=5126,Rn=10242,jn=10243,Fn=10497,Nn=33071,Bn=33648,Un=10240,Vn=10241,Hn=9728,qn=9729,Yn=9984,Gn=9985,Wn=9986,Xn=9987,Zn=33170,Jn=4352,Qn=4353,Kn=4354,$n=34046,ti=3317,ei=37440,ri=37441,ni=37443,ii=37444,ai=33984,oi=[Yn,Wn,Gn,Xn],si=[0,on,sn,an,rn],li={};li[on]=li[nn]=li[mn]=1,li[vn]=li[sn]=2,li[an]=li[gn]=3,li[rn]=li[yn]=4;var ui=vt("HTMLCanvasElement"),ci=vt("CanvasRenderingContext2D"),hi=vt("HTMLImageElement"),fi=vt("HTMLVideoElement"),di=Object.keys(Qt).concat([ui,ci,hi,fi]),pi=[];pi[zn]=1,pi[On]=4,pi[bn]=2,pi[In]=2,pi[Pn]=4;var mi=[];mi[ln]=2,mi[un]=2,mi[cn]=2,mi[vn]=4,mi[xn]=.5,mi[_n]=.5,mi[wn]=1,mi[Mn]=1,mi[An]=.5,mi[kn]=1,mi[Tn]=1,mi[Sn]=.5,mi[En]=.25,mi[Ln]=.5,mi[Cn]=.25,mi[Dn]=.5;var vi=36161,gi=32854,yi=32855,bi=36194,xi=33189,_i=36168,wi=34041,Mi=35907,Ai=34836,ki=34842,Ti=34843,Si=[];Si[gi]=2,Si[yi]=2,Si[bi]=2,Si[xi]=2,Si[_i]=1,Si[wi]=4,Si[Mi]=4,Si[Ai]=16,Si[ki]=8,Si[Ti]=6;var Ei=function(t,e,r,n,i){function a(t){this.id=h++,this.refCount=1,this.renderbuffer=t,this.format=gi,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function o(e){var r=e.renderbuffer;xe(r,"must not double destroy renderbuffer"),t.bindRenderbuffer(vi,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete f[e.id],n.renderbufferCount--}function s(e,o){function s(e,n){var a=0,o=0,l=gi;if("object"==typeof e&&e){var f=e;if("shape"in f){var d=f.shape;xe(Array.isArray(d)&&d.length>=2,"invalid renderbuffer shape"),a=0|d[0],o=0|d[1]}else"radius"in f&&(a=o=0|f.radius),"width"in f&&(a=0|f.width),"height"in f&&(o=0|f.height);"format"in f&&(xe.parameter(f.format,u,"invalid renderbuffer format"),l=u[f.format])}else"number"==typeof e?(a=0|e,o="number"==typeof n?0|n:a):e?xe.raise("invalid arguments to renderbuffer constructor"):a=o=1;if(xe(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),a!==h.width||o!==h.height||l!==h.format)return s.width=h.width=a,s.height=h.height=o,h.format=l,t.bindRenderbuffer(vi,h.renderbuffer),t.renderbufferStorage(vi,l,a,o),i.profile&&(h.stats.size=zt(h.format,h.width,h.height)),s.format=c[h.format],s}function l(e,n){var a=0|e,o=0|n||a;return a===h.width&&o===h.height?s:(xe(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),s.width=h.width=a,s.height=h.height=o,t.bindRenderbuffer(vi,h.renderbuffer),t.renderbufferStorage(vi,h.format,a,o),i.profile&&(h.stats.size=zt(h.format,h.width,h.height)),s)}var h=new a(t.createRenderbuffer());return f[h.id]=h,n.renderbufferCount++,s(e,o),s.resize=l,s._reglType="renderbuffer",s._renderbuffer=h,i.profile&&(s.stats=h.stats),s.destroy=function(){h.decRef()},s}function l(){tr(f).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(vi,e.renderbuffer),t.renderbufferStorage(vi,e.format,e.width,e.height); }),t.bindRenderbuffer(vi,null)}var u={rgba4:gi,rgb565:bi,"rgb5 a1":yi,depth:xi,stencil:_i,"depth stencil":wi};e.ext_srgb&&(u.srgba=Mi),e.ext_color_buffer_half_float&&(u.rgba16f=ki,u.rgb16f=Ti),e.webgl_color_buffer_float&&(u.rgba32f=Ai);var c=[];Object.keys(u).forEach(function(t){var e=u[t];c[e]=t});var h=0,f={};return a.prototype.decRef=function(){--this.refCount<=0&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(f).forEach(function(e){t+=f[e].stats.size}),t}),{create:s,clear:function(){tr(f).forEach(o)},restore:l}},Li=36160,Ci=36161,Di=3553,zi=34069,Ii=36064,Pi=36096,Oi=36128,Ri=33306,ji=36053,Fi=36054,Ni=36055,Bi=36057,Ui=36061,Vi=36193,Hi=5121,qi=5126,Yi=6408,Gi=6402,Wi=[Yi],Xi=[];Xi[Yi]=4;var Zi=[];Zi[Hi]=1,Zi[qi]=4,Zi[Vi]=2;var Ji=32854,Qi=32855,Ki=36194,$i=33189,ta=36168,ea=34041,ra=35907,na=34836,ia=34842,aa=34843,oa=[Ji,Qi,Ki,ra,ia,aa,na],sa={};sa[ji]="complete",sa[Fi]="incomplete attachment",sa[Bi]="incomplete dimensions",sa[Ni]="incomplete, missing attachment",sa[Ui]="unsupported";var la=5126,ua=35632,ca=35633,ha=35718,fa=35721,da=6408,pa=5121,ma=3333,va=5126,ga="xyzw".split(""),ya=5121,ba=1,xa=2,_a=0,wa=1,Ma=2,Aa=3,ka=4,Ta="dither",Sa="blend.enable",Ea="blend.color",La="blend.equation",Ca="blend.func",Da="depth.enable",za="depth.func",Ia="depth.range",Pa="depth.mask",Oa="colorMask",Ra="cull.enable",ja="cull.face",Fa="frontFace",Na="lineWidth",Ba="polygonOffset.enable",Ua="polygonOffset.offset",Va="sample.alpha",Ha="sample.enable",qa="sample.coverage",Ya="stencil.enable",Ga="stencil.mask",Wa="stencil.func",Xa="stencil.opFront",Za="stencil.opBack",Ja="scissor.enable",Qa="scissor.box",Ka="viewport",$a="profile",to="framebuffer",eo="vert",ro="frag",no="elements",io="primitive",ao="count",oo="offset",so="instances",lo="Width",uo="Height",co=to+lo,ho=to+uo,fo=Ka+lo,po=Ka+uo,mo="drawingBuffer",vo=mo+lo,go=mo+uo,yo=[Ca,La,Wa,Xa,Za,qa,Ka,Qa,Ua],bo=34962,xo=34963,_o=35632,wo=35633,Mo=3553,Ao=34067,ko=2884,To=3042,So=3024,Eo=2960,Lo=2929,Co=3089,Do=32823,zo=32926,Io=32928,Po=5126,Oo=35664,Ro=35665,jo=35666,Fo=5124,No=35667,Bo=35668,Uo=35669,Vo=35670,Ho=35671,qo=35672,Yo=35673,Go=35674,Wo=35675,Xo=35676,Zo=35678,Jo=35680,Qo=4,Ko=1028,$o=1029,ts=2304,es=2305,rs=32775,ns=32776,is=519,as=7680,os=0,ss=1,ls=32774,us=513,cs=36160,hs=36064,fs={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},ds=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],ps={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},ms={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},vs={frag:_o,vert:wo},gs={cw:ts,ccw:es},ys=new Ht(!1,!1,!1,function(){}),bs=34918,xs=34919,_s=35007,ws=function(t,e){function r(){return f.pop()||h.createQueryEXT()}function n(t){f.push(t)}function i(t){var e=r();h.beginQueryEXT(_s,e),d.push(e),u(d.length-1,d.length,t)}function a(){h.endQueryEXT(_s)}function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}function s(){return p.pop()||new o}function l(t){p.push(t)}function u(t,e,r){var n=s();n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,m.push(n)}function c(){var t,e,r=d.length;if(0!==r){g.length=Math.max(g.length,r+1),v.length=Math.max(v.length,r+1),v[0]=0,g[0]=0;var i=0;for(t=0,e=0;e<d.length;++e){var a=d[e];h.getQueryObjectEXT(a,xs)?(i+=h.getQueryObjectEXT(a,bs),n(a)):d[t++]=a,v[e+1]=i,g[e+1]=t}for(d.length=t,t=0,e=0;e<m.length;++e){var o=m[e],s=o.startQueryIndex,u=o.endQueryIndex;o.sum+=v[u]-v[s];var c=g[s],f=g[u];f===c?(o.stats.gpuTime+=o.sum/1e6,l(o)):(o.startQueryIndex=c,o.endQueryIndex=f,m[t++]=o)}m.length=t}}var h=e.ext_disjoint_timer_query;if(!h)return null;var f=[],d=[],p=[],m=[],v=[],g=[];return{beginQuery:i,endQuery:a,pushScopeStats:u,update:c,getNumPendingQueries:function(){return d.length},clear:function(){f.push.apply(f,d);for(var t=0;t<f.length;t++)h.deleteQueryEXT(f[t]);d.length=0,f.length=0},restore:function(){d.length=0,f.length=0}}},Ms=16384,As=256,ks=1024,Ts=34962,Ss="webglcontextlost",Es="webglcontextrestored",Ls=1,Cs=2,Ds=3;return Jt})},{}],466:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(i!==t||"undefined"==typeof i)i=t,a="";else if(a.length>=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a+=t,a=a.substr(0,r)}var i,a="";e.exports=n},{}],467:[function(e,r,n){void function(e,i){"function"==typeof t&&t.amd?t(i):"object"==typeof n?r.exports=i():e.resolveUrl=i()}(this,function(){function t(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a<t;a++)i.href=arguments[a],n=i.href,e.href=n;return r.removeChild(e),n}return t})},{}],468:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],469:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i];r=a+o;var s=r-a,l=o-s;l&&(t[--n]=r,r=l)}for(var u=0,i=n;i<e;++i){var a=t[i],o=r;r=a+o;var s=r-a,l=o-s;l&&(t[u++]=l)}return t[u++]=r,t.length=u,t}e.exports=n},{}],470:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m[",r,"][",n,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r<t.length;++r)e.push(["scale(",s(n(t,r)),",",a(r),t[0][r],")"].join(""));return o(e)}function l(t){var e=new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",s(i(t)),")};return robustDeterminant",t].join(""));return e(h,f,c,d)}function u(){for(;m.length<p;)m.push(l(m.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<p;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var i=Function.apply(void 0,t);e.exports=i.apply(void 0,m.concat([m,l]));for(var n=0;n<m.length;++n)e.exports[n]=m[n]}var c=t("two-product"),h=t("robust-sum"),f=t("robust-scale"),d=t("robust-compress"),p=6,m=[function(){return[0]},function(t){return[t[0][0]]}];u()},{"robust-compress":469,"robust-scale":476,"robust-sum":479,"two-product":503}],471:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t[0],e[0]),n=1;n<t.length;++n)r=a(r,i(t[n],e[n]));return r}var i=t("two-product"),a=t("robust-sum");e.exports=n},{"robust-sum":479,"two-product":503}],472:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m",n,"[",t-r-2,"]"].join("")}return e}function a(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return o(e,t)}function s(t){return t&!0?"-":""}function l(t){if(2===t.length)return[["diff(",o(t[0][0],t[1][1]),",",o(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",a(l(n(t,r))),",",s(r),t[0][r],")"].join(""));return e}function u(t,e){for(var r=[],n=0;n<e-2;++n)r.push(["prod(m",t,"[",n,"],m",t,"[",n,"])"].join(""));return a(r)}function c(t){for(var e=[],r=[],o=i(t),s=0;s<t;++s)o[0][s]="1",o[t-1][s]="w"+s;for(var s=0;s<t;++s)0===(1&s)?e.push.apply(e,l(n(o,s))):r.push.apply(r,l(n(o,s)));for(var c=a(e),h=a(r),f="exactInSphere"+t,d=[],s=0;s<t;++s)d.push("m"+s);for(var p=["function ",f,"(",d.join(),"){"],s=0;s<t;++s){p.push("var w",s,"=",u(s,t),";");for(var m=0;m<t;++m)m!==s&&p.push("var w",s,"m",m,"=scale(w",s,",m",m,"[0]);")}p.push("var p=",c,",n=",h,",d=diff(p,n);return d[d.length-1];}return ",f);var x=new Function("sum","diff","prod","scale",p.join(""));return x(g,y,v,b)}function h(){return 0}function f(){return 0}function d(){return 0}function p(t){var e=_[t.length];return e||(e=_[t.length]=c(t.length)),e.apply(void 0,t)}function m(){for(;_.length<=x;)_.push(c(_.length));for(var t=[],r=["slow"],n=0;n<=x;++n)t.push("a"+n),r.push("o"+n);for(var i=["function testInSphere(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=x;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere"),r.push(i.join(""));var a=Function.apply(void 0,r);e.exports=a.apply(void 0,[p].concat(_));for(var n=0;n<=x;++n)e.exports[n]=_[n]}var v=t("two-product"),g=t("robust-sum"),y=t("robust-subtract"),b=t("robust-scale"),x=6,_=[h,f,d];m()},{"robust-scale":476,"robust-subtract":478,"robust-sum":479,"two-product":503}],473:[function(t,e,r){"use strict";function n(t){for(var e="robustLinearSolve"+t+"d",r=["function ",e,"(A,b){return ["],n=0;n<t;++n){r.push("det([");for(var i=0;i<t;++i){i>0&&r.push(","),r.push("[");for(var a=0;a<t;++a)a>0&&r.push(","),a===n?r.push("+b[",i,"]"):r.push("+A[",i,"][",a,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var o=new Function("det",r.join(""));return o(t<6?s[t]:s)}function i(){return[0]}function a(t,e){return[[e[0]],[t[0][0]]]}function o(){for(;u.length<l;)u.push(n(u.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],i=0;i<l;++i)t.push("s"+i),r.push("case ",i,":return s",i,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var a=Function.apply(void 0,t);e.exports=a.apply(void 0,u.concat([u,n]));for(var i=0;i<l;++i)e.exports[i]=u[i]}var s=t("robust-determinant"),l=6,u=[i,a];o()},{"robust-determinant":470}],474:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m",n,"[",t-r-1,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",o(s(n(t,r))),",",a(r),t[0][r],")"].join(""));return e}function l(t){for(var e=[],r=[],a=i(t),l=[],u=0;u<t;++u)0===(1&u)?e.push.apply(e,s(n(a,u))):r.push.apply(r,s(n(a,u))),l.push("m"+u);var c=o(e),m=o(r),v="orientation"+t+"Exact",g=["function ",v,"(",l.join(),"){var p=",c,",n=",m,",d=sub(p,n);return d[d.length-1];};return ",v].join(""),y=new Function("sum","prod","scale","sub",g);return y(f,h,d,p)}function u(t){var e=_[t.length];return e||(e=_[t.length]=l(t.length)),e.apply(void 0,t)}function c(){for(;_.length<=m;)_.push(l(_.length));for(var t=[],r=["slow"],n=0;n<=m;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=m;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),r.push(i.join(""));var a=Function.apply(void 0,r);e.exports=a.apply(void 0,[u].concat(_));for(var n=0;n<=m;++n)e.exports[n]=_[n]}var h=t("two-product"),f=t("robust-sum"),d=t("robust-scale"),p=t("robust-subtract"),m=5,v=1.1102230246251565e-16,g=(3+16*v)*v,y=(7+56*v)*v,b=l(3),x=l(4),_=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),o=i-a;if(i>0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=g*n;return o>=s||o<=-s?o:b(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],h=e[2]-n[2],f=r[2]-n[2],d=a*u,p=o*l,m=o*s,v=i*u,g=i*l,b=a*s,_=c*(d-p)+h*(m-v)+f*(g-b),w=(Math.abs(d)+Math.abs(p))*Math.abs(c)+(Math.abs(m)+Math.abs(v))*Math.abs(h)+(Math.abs(g)+Math.abs(b))*Math.abs(f),M=y*w;return _>M||-_>M?_:x(t,e,r,n)}];c()},{"robust-scale":476,"robust-subtract":478,"robust-sum":479,"two-product":503}],475:[function(t,e,r){"use strict";function n(t,e){if(1===t.length)return a(e,t[0]);if(1===e.length)return a(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.length<e.length)for(var n=0;n<t.length;++n)r=i(r,a(e,t[n]));else for(var n=0;n<e.length;++n)r=i(r,a(t,e[n]));return r}var i=t("robust-sum"),a=t("robust-scale");e.exports=n},{"robust-scale":476,"robust-sum":479}],476:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if(1===r){var n=i(t[0],e);return n[0]?n:[n[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;i(t[0],e,s),s[0]&&(o[u++]=s[0]);for(var c=1;c<r;++c){i(t[c],e,l);var h=s[1];a(h,l[0],s),s[0]&&(o[u++]=s[0]);var f=l[1],d=s[1],p=f+d,m=p-f,v=d-m;s[1]=p,v&&(o[u++]=v)}return s[1]&&(o[u++]=s[1]),0===u&&(o[u++]=0),o.length=u,o}var i=t("two-product"),a=t("two-sum");e.exports=n},{"two-product":503,"two-sum":504}],477:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],h=Math.min(u,c),f=Math.max(u,c);if(f<s||l<h)return!1}return!0}function i(t,e,r,i){var o=a(t,r,i),s=a(e,r,i);if(o>0&&s>0||o<0&&s<0)return!1;var l=a(r,t,e),u=a(i,t,e);return!(l>0&&u>0||l<0&&u<0)&&(0!==o||0!==s||0!==l||0!==u||n(t,e,r,i))}e.exports=i;var a=t("robust-orientation")[3]},{"robust-orientation":474}],478:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=-e[h],v=f(m);p<v?(o=d,c+=1,c<r&&(d=t[c],p=f(d))):(o=m,h+=1,h<i&&(m=-e[h],v=f(m))),c<r&&p<v||h>=i?(a=d,c+=1,c<r&&(d=t[c],p=f(d))):(a=m,h+=1,h<i&&(m=-e[h],v=f(m)));for(var g,y,b,x,_,w=a+o,M=w-a,A=o-M,k=A,T=w;c<r&&h<i;)p<v?(a=d,c+=1,c<r&&(d=t[c],p=f(d))):(a=m,h+=1,h<i&&(m=-e[h],v=f(m))),o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,k=_+x,T=g;for(;c<r;)a=d,o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,k=_+x,T=g,c+=1,c<r&&(d=t[c]);for(;h<i;)a=m,o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,k=_+x,T=g,h+=1,h<i&&(m=-e[h]);return k&&(l[u++]=k),T&&(l[u++]=T),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],479:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=e[h],v=f(m);p<v?(o=d,c+=1,c<r&&(d=t[c],p=f(d))):(o=m,h+=1,h<i&&(m=e[h],v=f(m))),c<r&&p<v||h>=i?(a=d,c+=1,c<r&&(d=t[c],p=f(d))):(a=m,h+=1,h<i&&(m=e[h],v=f(m)));for(var g,y,b,x,_,w=a+o,M=w-a,A=o-M,k=A,T=w;c<r&&h<i;)p<v?(a=d,c+=1,c<r&&(d=t[c],p=f(d))):(a=m,h+=1,h<i&&(m=e[h],v=f(m))),o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,k=_+x,T=g;for(;c<r;)a=d,o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,k=_+x,T=g,c+=1,c<r&&(d=t[c]);for(;h<i;)a=m,o=k,w=a+o,M=w-a,A=o-M,A&&(l[u++]=A),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,k=_+x,T=g,h+=1,h<i&&(m=e[h]);return k&&(l[u++]=k),T&&(l[u++]=T),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],480:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.ShelfPack=i()}(this,function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=(0|this.stats[t])+1}}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,n,i,a=[],o=0;o<t.length;o++)if(r=t[o].w||t[o].width,n=t[o].h||t[o].height,r&&n){if(i=this.packOne(r,n),!i)continue;e.inPlace&&(t[o].x=i.x,t[o].y=i.y),a.push(i)}if(this.shelves.length>0){for(var s=0,l=0,u=0;u<this.shelves.length;u++){var c=this.shelves[u];l+=c.h,s=Math.max(c.w-c.free,s)}this.resize(s,l)}return a},t.prototype.packOne=function(t,r){for(var n,i,a=0,o={shelf:-1,waste:1/0},s=0;s<this.shelves.length;s++){if(n=this.shelves[s],a+=n.h,r===n.h&&t<=n.free)return this.count(r),n.alloc(t,r);r>n.h||t>n.free||r<n.h&&t<=n.free&&(i=n.h-r,i<o.waste&&(o.waste=i,o.shelf=s))}if(o.shelf!==-1)return n=this.shelves[o.shelf],this.count(r),n.alloc(t,r);if(r<=this.h-a&&t<=this.w)return n=new e(a,this.w,r),this.shelves.push(n),this.count(r),n.alloc(t,r);if(this.autoResize){var l,u,c,h;return l=u=this.h,c=h=this.w,(c<=l||t>c)&&(h=2*Math.max(t,c)),(l<c||r>l)&&(u=2*Math.max(r,l)),this.resize(h,u),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;r<this.shelves.length;r++)this.shelves[r].resize(t);return!0},e.prototype.alloc=function(t,e){if(t>this.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],481:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],482:[function(t,e,r){"use strict";function n(t){return a(i(t))}e.exports=n;var i=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":59,"reduce-simplicial-complex":464}],483:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;n<e;++n)r=0|Math.max(r,t[n].length);return r-1}function i(t,e){for(var r=t.length,n=h.mallocUint8(r),i=0;i<r;++i)n[i]=t[i]<e|0;return n}function a(t,e){for(var r=t.length,n=e*(e+1)/2*r|0,i=h.mallocUint32(2*n),a=0,o=0;o<r;++o)for(var s=t[o],e=s.length,l=0;l<e;++l)for(var u=0;u<l;++u){var d=s[u],p=s[l];i[a++]=0|Math.min(d,p),i[a++]=0|Math.max(d,p)}var m=a/2|0;f(c(i,[m,2]));for(var v=2,o=2;o<a;o+=2)i[o-2]===i[o]&&i[o-1]===i[o+1]||(i[v++]=i[o],i[v++]=i[o+1]);return c(i,[v/2|0,2])}function o(t,e,r,n){for(var i=t.data,a=t.shape[0],o=h.mallocDouble(a),s=0,l=0;l<a;++l){var u=i[2*l],f=i[2*l+1];if(r[u]!==r[f]){var d=e[u],p=e[f];i[2*s]=u,i[2*s+1]=f,o[s++]=(p-n)/(p-d)}}return t.shape[0]=s,c(o,[s])}function s(t,e){var r=h.mallocInt32(2*e),n=t.shape[0],i=t.data;r[0]=0;for(var a=0,o=0;o<n;++o){var s=i[2*o];if(s!==a){for(r[2*a+1]=o;++a<s;)r[2*a]=o,r[2*a+1]=o;r[2*a]=o}}for(r[2*a+1]=n;++a<e;)r[2*a]=r[2*a+1]=n;return r}function l(t){for(var e=0|t.shape[0],r=t.data,n=new Array(e),i=0;i<e;++i)n[i]=[r[2*i],r[2*i+1]];return n}function u(t,e,r,u){r=r||0,"undefined"==typeof u&&(u=n(t));var c=t.length;if(0===c||u<1)return{cells:[],vertexIds:[],vertexWeights:[]};var f=i(e,+r),p=a(t,u),m=o(p,e,f,+r),v=s(p,0|e.length),g=d(u)(t,p.data,v,f),y=l(p),b=[].slice.call(m.data,0,m.shape[0]);return h.free(f),h.free(p.data),h.free(m.data),h.free(v),{cells:g,vertexIds:y,vertexWeights:b}}e.exports=u;var c=t("ndarray"),h=t("typedarray-pool"),f=t("ndarray-sort"),d=t("./lib/codegen")},{"./lib/codegen":484,ndarray:434,"ndarray-sort":432,"typedarray-pool":505}],484:[function(t,e,r){"use strict";function n(t){function e(t){if(!(t.length<=0)){u.push("R.push(");for(var e=0;e<t.length;++e){var r=t[e];e>0&&u.push(","),u.push("[");for(var n=0;n<r.length;++n){var i=r[n];n>0&&u.push(","),u.push("B(C,E,c[",i[0],"],c[",i[1],"])")}u.push("]")}u.push(");")}}var r=0,n=new Array(t+1);n[0]=[[]];for(var i=1;i<=t;++i)for(var s=n[i]=o(i),l=0;l<s.length;++l)r=Math.max(r,s[i].length);for(var u=["function B(C,E,i,j){","var a=Math.min(i,j)|0,b=Math.max(i,j)|0,l=C[2*a],h=C[2*a+1];","while(l<h){","var m=(l+h)>>1,v=E[2*m+1];","if(v===b){return m}","if(b<v){h=m}else{l=m+1}","}","return l;","};","function getContour",t,"d(F,E,C,S){","var n=F.length,R=[];","for(var i=0;i<n;++i){var c=F[i],l=c.length;"],i=t+1;i>1;--i){i<t+1&&u.push("else "),u.push("if(l===",i,"){");for(var c=[],l=0;l<i;++l)c.push("(S[c["+l+"]]<<"+l+")");u.push("var M=",c.join("+"),";if(M===0||M===",(1<<i)-1,"){continue}switch(M){");for(var s=n[i-1],l=0;l<s.length;++l)u.push("case ",l,":"),e(s[l]),u.push("break;");u.push("}}")}u.push("}return R;};return getContour",t,"d");var h=new Function("pool",u.join(""));return h(a)}function i(t){var e=s[t];return e||(e=s[t]=n(t)),e}e.exports=i;var a=t("typedarray-pool"),o=t("marching-simplex-table"),s={}},{"marching-simplex-table":412,"typedarray-pool":505}],485:[function(t,e,r){"use strict";"use restrict";function n(t){for(var e=0,r=Math.max,n=0,i=t.length;n<i;++n)e=r(e,t[n].length);return e-1}function i(t){for(var e=-1,r=Math.max,n=0,i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)e=r(e,a[o]);return e+1}function a(t){for(var e=new Array(t.length),r=0,n=t.length;r<n;++r)e[r]=t[r].slice(0);return e}function o(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:var a=t[0]+t[1]-e[0]-e[1];return a?a:i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),u=i(e[0],e[1]),a=i(l,t[2])-i(u,e[2]);return a?a:i(l+t[2],o)-i(u+e[2],s);default:var c=t.slice(0);c.sort();var h=e.slice(0);h.sort();for(var f=0;f<r;++f)if(n=c[f]-h[f])return n;return 0}}function s(t,e){return o(t[0],e[0])}function l(t,e){if(e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=[t[i],e[i]];n.sort(s);for(var i=0;i<r;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(o),t}function u(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;n<r;++n){var i=t[n];if(o(i,t[n-1])){if(n===e){e++;continue}t[e++]=i}}return t.length=e,t}function c(t,e){for(var r=0,n=t.length-1,i=-1;r<=n;){var a=r+n>>1,s=o(t[a],e);s<=0?(0===s&&(i=a),r=a+1):s>0&&(n=a-1)}return i}function h(t,e){for(var r=new Array(t.length),n=0,i=r.length;n<i;++n)r[n]=[];for(var a=[],n=0,s=e.length;n<s;++n)for(var l=e[n],u=l.length,h=1,f=1<<u;h<f;++h){a.length=b.popCount(h);for(var d=0,p=0;p<u;++p)h&1<<p&&(a[d++]=l[p]);var m=c(t,a);if(!(m<0))for(;;)if(r[m++].push(n),m>=t.length||0!==o(t[m],a))break}return r}function f(t,e){if(!e)return h(u(p(t,0)),t,0);for(var r=new Array(e),n=0;n<e;++n)r[n]=[];for(var n=0,i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)r[a[o]].push(n);return r}function d(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0|i.length,o=1,s=1<<a;o<s;++o){for(var u=[],c=0;c<a;++c)o>>>c&1&&u.push(i[c]);e.push(u)}return l(e)}function p(t,e){if(e<0)return[];for(var r=[],n=(1<<e+1)-1,i=0;i<t.length;++i)for(var a=t[i],o=n;o<1<<a.length;o=b.nextCombination(o)){for(var s=new Array(e+1),u=0,c=0;c<a.length;++c)o&1<<c&&(s[u++]=a[c]);r.push(s)}return l(r)}function m(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;++a){for(var s=new Array(i.length-1),u=0,c=0;u<o;++u)u!==a&&(s[c++]=i[u]);e.push(s)}return l(e)}function v(t,e){for(var r=new x(e),n=0;n<t.length;++n)for(var i=t[n],a=0;a<i.length;++a)for(var o=a+1;o<i.length;++o)r.link(i[a],i[o]);for(var s=[],l=r.ranks,n=0;n<l.length;++n)l[n]=-1;for(var n=0;n<t.length;++n){var u=r.find(t[n][0]);l[u]<0?(l[u]=s.length,s.push([t[n].slice(0)])):s[l[u]].push(t[n].slice(0))}return s}function g(t){for(var e=u(l(p(t,0))),r=new x(e.length),n=0;n<t.length;++n)for(var i=t[n],a=0;a<i.length;++a)for(var o=c(e,[i[a]]),s=a+1;s<i.length;++s)r.link(o,c(e,[i[s]]));for(var h=[],f=r.ranks,n=0;n<f.length;++n)f[n]=-1;for(var n=0;n<t.length;++n){var d=r.find(c(e,[t[n][0]]));f[d]<0?(f[d]=h.length,h.push([t[n].slice(0)])):h[f[d]].push(t[n].slice(0))}return h}function y(t,e){return e?v(t,e):g(t)}var b=t("bit-twiddle"),x=t("union-find");r.dimension=n,r.countVertices=i,r.cloneCells=a,r.compareCells=o,r.normalize=l,r.unique=u,r.findCell=c,r.incidence=h,r.dual=f,r.explode=d,r.skeleton=p,r.boundary=m,r.connectedComponents=y},{"bit-twiddle":57,"union-find":506}],486:[function(t,e,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],487:[function(t,e,r){arguments[4][485][0].apply(r,arguments)},{"bit-twiddle":486,dup:485,"union-find":488}],488:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},{}],489:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.abs(a(t,e,r)),i=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return n/i}function i(t,e,r){function i(t){if(x[t])return 1/0;var r=g[t],i=y[t];return r<0||i<0?1/0:n(e[t],e[r],e[i])}function a(t,e){var r=k[t],n=k[e];k[t]=n,k[e]=r,T[r]=e,T[n]=t}function s(t){return b[k[t]]}function l(t){return 1&t?t-1>>1:(t>>1)-1}function u(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(n<E){var l=s(n);l<r&&(o=n,r=l)}if(i<E){var u=s(i);u<r&&(o=i)}if(o===t)return t;a(t,o),t=o}}function c(t){for(var e=s(t);t>0;){var r=l(t);if(r>=0){var n=s(r);if(e<n){a(t,r),t=r;continue}}return t}}function h(){if(E>0){var t=k[0];return a(0,E-1),E-=1,u(0),t}return-1}function f(t,e){var r=k[t];return b[r]===e?t:(b[r]=-(1/0),c(t),h(),b[r]=e,E+=1,c(E-1))}function d(t){if(!x[t]){x[t]=!0;var e=g[t],r=y[t];g[r]>=0&&(g[r]=e),y[e]>=0&&(y[e]=r),T[e]>=0&&f(T[e],i(e)),T[r]>=0&&f(T[r],i(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!x[n]||i<0||i===n)break;if(n=i,i=t[n],!x[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var m=e.length,v=t.length,g=new Array(m),y=new Array(m),b=new Array(m),x=new Array(m),_=0;_<m;++_)g[_]=y[_]=-1,b[_]=1/0,x[_]=!1;for(var _=0;_<v;++_){var w=t[_];if(2!==w.length)throw new Error("Input must be a graph");var M=w[1],A=w[0];y[A]!==-1?y[A]=-2:y[A]=M,g[M]!==-1?g[M]=-2:g[M]=A}for(var k=[],T=new Array(m),_=0;_<m;++_){var S=b[_]=i(_);S<1/0?(T[_]=k.length,k.push(_)):T[_]=-1}for(var E=k.length,_=E>>1;_>=0;--_)u(_);for(;;){var L=h();if(L<0||b[L]>r)break;d(L)}for(var C=[],_=0;_<m;++_)x[_]||(T[_]=C.length,C.push(e[_].slice()));var D=(C.length,[]);return t.forEach(function(t){var e=p(g,t[0]),r=p(y,t[1]);if(e>=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&D.push([n,i])}}),o.unique(o.normalize(D)),{positions:C,edges:D}}e.exports=i;var a=t("robust-orientation"),o=t("simplicial-complex")},{"robust-orientation":474,"simplicial-complex":487}],490:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]<e[1][0])r=e[0],n=e[1];else{if(!(e[0][0]>e[1][0])){var i=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return o<s?o-s:i>l?i-l:o-l}r=e[1],n=e[0]}var u,c;t[0][1]<t[1][1]?(u=t[0],c=t[1]):(u=t[1],c=t[0]);var h=a(n,r,u);return h?h:(h=a(n,r,c),h?h:c-n)}function i(t,e){var r,i;if(e[0][0]<e[1][0])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]<t[1][0])o=t[0],s=t[1];else{if(!(t[0][0]>t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=a(r,i,s),u=a(r,i,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=a(s,o,i),u=a(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":474}],491:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]<o[1][0]?(n=o[0],i=o[1]):(n=o[1],i=o[0]);var s=h(n,i,e);if(s<0)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=a(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a<e;++a){var l=t[a],u=l[0][0]<l[1][0];i[2*a]=new s(l[0][0],l,u,a),i[2*a+1]=new s(l[1][0],l,!u,a)}i.sort(function(t,e){var r=t.x-e.x;return r?r:(r=t.create-e.create,r?r:Math.min(t.segment[0][1],t.segment[1][1])-Math.min(e.segment[0][1],e.segment[1][1]))});for(var h=c(f),d=[],p=[],m=[],a=0;a<r;){for(var v=i[a].x,g=[];a<r;){var y=i[a];if(y.x!==v)break;a+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]<y.segment[1][1]?(g.push(new o(y.segment[0][1],y.index,!0,!0)),g.push(new o(y.segment[1][1],y.index,!1,!1))):(g.push(new o(y.segment[1][1],y.index,!0,!1)),g.push(new o(y.segment[0][1],y.index,!1,!0)))):h=y.create?h.insert(y.segment,y.index):h.remove(y.segment)}d.push(h.root),p.push(v),m.push(g)}return new n(d,p,m)}e.exports=l;var u=t("binary-search-bounds"),c=t("functional-red-black-tree"),h=t("robust-orientation"),f=t("./lib/order-segments"),d=n.prototype;d.castUp=function(t){var e=u.le(this.coordinates,t[0]);if(e<0)return-1;var r=(this.slabs[e],a(this.slabs[e],t)),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var o=null;if(r&&(o=r.key),e>0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var c=u.ge(l,t[1],i);if(c<l.length){var d=l[c];if(t[1]===d.y){if(d.closed)return d.index;for(;c<l.length-1&&l[c+1].y===t[1];)if(c+=1,d=l[c],d.closed)return d.index;if(d.y===t[1]&&!d.start){if(c+=1,c>=l.length)return n;d=l[c]}}if(d.start)if(o){var p=h(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":490,"binary-search-bounds":56,"functional-red-black-tree":109,"robust-orientation":474}],492:[function(t,e,r){"use strict";function n(t,e){var r=u(l(t,e),[e[e.length-1]]);return r[r.length-1]}function i(t,e,r,n){var i=n-e,a=-e/i;a<0?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=new Array(s),u=0;u<s;++u)l[u]=a*t[u]+o*r[u];return l}function a(t,e){for(var r=[],a=[],o=n(t[t.length-1],e),s=t[t.length-1],l=t[0],u=0;u<t.length;++u,s=l){l=t[u];var c=n(l,e);if(o<0&&c>0||o>0&&c<0){var h=i(s,c,l,o);r.push(h),a.push(h.slice()); }c<0?a.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=c}return{positive:r,negative:a}}function o(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l<t.length;++l,o=s){s=t[l];var u=n(s,e);(a<0&&u>0||a>0&&u<0)&&r.push(i(o,u,s,a)),u>=0&&r.push(s.slice()),a=u}return r}function s(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l<t.length;++l,o=s){s=t[l];var u=n(s,e);(a<0&&u>0||a>0&&u<0)&&r.push(i(o,u,s,a)),u<=0&&r.push(s.slice()),a=u}return r}var l=t("robust-dot-product"),u=t("robust-sum");e.exports=a,e.exports.positive=o,e.exports.negative=s},{"robust-dot-product":471,"robust-sum":479}],493:[function(e,r,n){!function(e){function r(){var t=arguments[0],e=r.cache;return e[t]&&e.hasOwnProperty(t)||(e[t]=r.parse(t)),r.format.call(null,e[t],arguments)}function i(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function a(t,e){return Array(e+1).join(t)}var o={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};r.format=function(t,e){var n,s,l,u,c,h,f,d=1,p=t.length,m="",v=[],g=!0,y="";for(s=0;s<p;s++)if(m=i(t[s]),"string"===m)v[v.length]=t[s];else if("array"===m){if(u=t[s],u[2])for(n=e[d],l=0;l<u[2].length;l++){if(!n.hasOwnProperty(u[2][l]))throw new Error(r("[sprintf] property '%s' does not exist",u[2][l]));n=n[u[2][l]]}else n=u[1]?e[u[1]]:e[d++];if("function"==i(n)&&(n=n()),o.not_string.test(u[8])&&o.not_json.test(u[8])&&"number"!=i(n)&&isNaN(n))throw new TypeError(r("[sprintf] expecting number but found %s",i(n)));switch(o.number.test(u[8])&&(g=n>=0),u[8]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,u[6]?parseInt(u[6]):0);break;case"e":n=u[7]?n.toExponential(u[7]):n.toExponential();break;case"f":n=u[7]?parseFloat(n).toFixed(u[7]):parseFloat(n);break;case"g":n=u[7]?parseFloat(n).toPrecision(u[7]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&u[7]?n.substring(0,u[7]):n;break;case"u":n>>>=0;break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase()}o.json.test(u[8])?v[v.length]=n:(!o.number.test(u[8])||g&&!u[3]?y="":(y=g?"+":"-",n=n.toString().replace(o.sign,"")),h=u[4]?"0"===u[4]?"0":u[4].charAt(1):" ",f=u[6]-(y+n).length,c=u[6]&&f>0?a(h,f):"",v[v.length]=u[5]?y+n+c:"0"===h?y+c+n:c+y+n)}return v.join("")},r.cache={},r.parse=function(t){for(var e=t,r=[],n=[],i=0;e;){if(null!==(r=o.text.exec(e)))n[n.length]=r[0];else if(null!==(r=o.modulo.exec(e)))n[n.length]="%";else{if(null===(r=o.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){i|=1;var a=[],s=r[2],l=[];if(null===(l=o.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=o.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=o.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}r[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n[n.length]=r}e=e.substring(r[0].length)}return n};var s=function(t,e,n){return n=(e||[]).slice(0),n.splice(0,0,t),r.apply(null,n)};"undefined"!=typeof n?(n.sprintf=r,n.vsprintf=s):(e.sprintf=r,e.vsprintf=s,"function"==typeof t&&t.amd&&t(function(){return{sprintf:r,vsprintf:s}}))}("undefined"==typeof window?this:window)},{}],494:[function(t,e,r){"use strict";function n(t){return new i(t)}function i(t){this.options=d(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function a(t,e,r,n){return{x:t,y:e,zoom:1/0,id:n,numPoints:r}}function o(t,e){var r=t.geometry.coordinates;return a(u(r[0]),c(r[1]),1,e)}function s(t){return{type:"Feature",properties:l(t),geometry:{type:"Point",coordinates:[h(t.x),f(t.y)]}}}function l(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return{cluster:!0,point_count:e,point_count_abbreviated:r}}function u(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function h(t){return 360*(t-.5)}function f(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function d(t,e){for(var r in e)t[r]=e[r];return t}function p(t){return t.x}function m(t){return t.y}var v=t("kdbush");e.exports=n,i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(o);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=v(n,p,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-a)}return this.trees[this.options.minZoom]=v(n,p,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(u(t[0]),c(t[3]),u(t[2]),c(t[1])),i=[],a=0;a<n.length;a++){var o=r.points[n[a]];i.push(o.id!==-1?this.points[o.id]:s(o))}return i},getTile:function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),a=this.options.extent,o=this.options.radius,s=o/a,l=(r-s)/i,u=(r+1+s)/i,c={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,u),n.points,e,r,i,c),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,u),n.points,i,r,i,c),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,u),n.points,-1,r,i,c),c.features.length?c:null},_addTileFeatures:function(t,e,r,n,i,a){for(var o=0;o<t.length;o++){var s=e[t[o]];a.features.push({type:1,geometry:Math.round(this.options.extent*(s.x*i-r)),Math.round(this.options.extent*(s.y*i-n)),tags:s.id!==-1?this.points[s.id].properties:l(s)})}},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var r=[],n=this.options.radius/(this.options.extent*Math.pow(2,e)),i=0;i<t.length;i++){var o=t[i];if(!(o.zoom<=e)){o.zoom=e;for(var s=this.trees[e+1],l=s.within(o.x,o.y,n),u=!1,c=o.numPoints,h=o.x*c,f=o.y*c,d=0;d<l.length;d++){var p=s.points[l[d]];e<p.zoom&&(u=!0,p.zoom=e,h+=p.x*p.numPoints,f+=p.y*p.numPoints,c+=p.numPoints)}r.push(u?a(h/c,f/c,c,-1):o)}}return r}}},{kdbush:265}],495:[function(t,e,r){"use strict";function n(t){return t.split("").map(function(t){return t in i?i[t]:""}).join("")}e.exports=n;var i={" ":" ",0:"\u2070",1:"\xb9",2:"\xb2",3:"\xb3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079","+":"\u207a","-":"\u207b",a:"\u1d43",b:"\u1d47",c:"\u1d9c",d:"\u1d48",e:"\u1d49",f:"\u1da0",g:"\u1d4d",h:"\u02b0",i:"\u2071",j:"\u02b2",k:"\u1d4f",l:"\u02e1",m:"\u1d50",n:"\u207f",o:"\u1d52",p:"\u1d56",r:"\u02b3",s:"\u02e2",t:"\u1d57",u:"\u1d58",v:"\u1d5b",w:"\u02b7",x:"\u02e3",y:"\u02b8",z:"\u1dbb"}},{}],496:[function(t,e,r){"use strict";function n(t,e){var r=t.length,n=["'use strict';"],i="surfaceNets"+t.join("_")+"d"+e;n.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&n.push("getters:[0],");for(var a=[],l=[],u=0;u<r;++u)a.push("d"+u),l.push("d"+u);for(var u=0;u<1<<r;++u)a.push("v"+u),l.push("v"+u);for(var u=0;u<1<<r;++u)a.push("p"+u),l.push("p"+u);a.push("a","b","c"),l.push("a","c"),n.push("vertex:function vertexFunc(",a.join(),"){");for(var c=[],u=0;u<1<<r;++u)c.push("(p"+u+"<<"+u+")");n.push("var m=(",c.join("+"),")|0;if(m===0||m===",(1<<(1<<r))-1,"){return}");var h=[],f=[];1<<(1<<r)<=128?(n.push("switch(m){"),f=n):n.push("switch(m>>>7){");for(var u=0;u<1<<(1<<r);++u){if(1<<(1<<r)>128&&u%128===0){h.length>0&&f.push("}}");var d="vExtra"+h.length;n.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),f=["function ",d,"(m,",l.join(),"){switch(m){"],h.push(f)}f.push("case ",127&u,":");for(var p=new Array(r),m=new Array(r),v=new Array(r),g=new Array(r),y=0,b=0;b<r;++b)p[b]=[],m[b]=[],v[b]=0,g[b]=0;for(var b=0;b<1<<r;++b)for(var x=0;x<r;++x){var _=b^1<<x;if(!(_>b)&&!(u&1<<_)!=!(u&1<<b)){var w=1;u&1<<_?m[x].push("v"+_+"-v"+b):(m[x].push("v"+b+"-v"+_),w=-w),w<0?(p[x].push("-v"+b+"-v"+_),v[x]+=2):(p[x].push("v"+b+"+v"+_),v[x]-=2),y+=1;for(var M=0;M<r;++M)M!==x&&(_&1<<M?g[M]+=1:g[M]-=1)}}for(var A=[],x=0;x<r;++x)if(0===p[x].length)A.push("d"+x+"-0.5");else{var k="";v[x]<0?k=v[x]+"*c":v[x]>0&&(k="+"+v[x]+"*c");var T=.5*(p[x].length/y),S=.5+.5*(g[x]/y);A.push("d"+x+"-"+S+"-"+T+"*("+p[x].join("+")+k+")/("+m[x].join("+")+")")}f.push("a.push([",A.join(),"]);","break;")}n.push("}},"),h.length>0&&f.push("}}");for(var E=[],u=0;u<1<<r-1;++u)E.push("v"+u);E.push("c0","c1","p0","p1","a","b","c"),n.push("cell:function cellFunc(",E.join(),"){");var L=s(r-1);n.push("if(p0){b.push(",L.map(function(t){return"["+t.map(function(t){return"v"+t})+"]"}).join(),")}else{b.push(",L.map(function(t){var e=t.slice();return e.reverse(),"["+e.map(function(t){return"v"+t})+"]"}).join(),")}}});function ",i,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",i,";");for(var u=0;u<h.length;++u)n.push(h[u].join(""));var C=new Function("genContour",n.join(""));return C(o)}function i(t,e){for(var r=l(t,e),n=r.length,i=new Array(n),a=new Array(n),o=0;o<n;++o)i[o]=[r[o]],a[o]=[o];return{positions:i,cells:a}}function a(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return i(t,e);var r=t.order.join()+"-"+t.dtype,a=u[r],e=+e||0;return a||(a=u[r]=n(t.order,t.dtype)),a(t,e)}e.exports=a;var o=t("ndarray-extract-contour"),s=t("triangulate-hypercube"),l=t("zero-crossings"),u={}},{"ndarray-extract-contour":423,"triangulate-hypercube":501,"zero-crossings":548}],497:[function(t,e,r){(function(r){"use strict";function n(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o<e.length;++o)for(var s=e[o],l=0;l<3;++l){var u=r[s[l]];n[i++]=u[0],n[i++]=u[1]+1.4,a=Math.max(u[0],a)}return{data:n,shape:a}}function i(t,e,r){var r=r||{},o=s[t];o||(o=s[t]={" ":{data:new Float32Array(0),shape:.2}});var l=o[e];if(!l)if(e.length<=1||!/\d/.test(e))l=o[e]=n(a(e,{triangles:!0,font:t,textAlign:r.textAlign||"left",textBaseline:"alphabetic"}));else{for(var u=e.split(/(\d|\s)/),c=new Array(u.length),h=0,f=0,d=0;d<u.length;++d)c[d]=i(t,u[d]),h+=c[d].data.length,f+=c[d].shape,d>0&&(f+=.02);for(var p=new Float32Array(h),m=0,v=-.5*f,d=0;d<c.length;++d){for(var g=c[d].data,y=0;y<g.length;y+=2)p[m++]=g[y]+v,p[m++]=g[y+1];v+=c[d].shape+.02}l=o[e]={data:p,shape:f}}return l}e.exports=i;var a=t("vectorize-text"),o=window||r.global||{},s=o.__TEXT_CACHE||{};o.__TEXT_CACHE={}}).call(this,t("_process"))},{_process:453,"vectorize-text":518}],498:[function(e,r,n){!function(e){function n(t,e){if(t=t?t:"",e=e||{},t instanceof n)return t;if(!(this instanceof n))return new n(t,e);var r=i(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=H(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=H(this._r)),this._g<1&&(this._g=H(this._g)),this._b<1&&(this._b=H(this._b)),this._ok=r.ok,this._tc_id=V++}function i(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,o=null,l=!1,c=!1;return"string"==typeof t&&(t=F(t)),"object"==typeof t&&(j(t.r)&&j(t.g)&&j(t.b)?(e=a(t.r,t.g,t.b),l=!0,c="%"===String(t.r).substr(-1)?"prgb":"rgb"):j(t.h)&&j(t.s)&&j(t.v)?(n=P(t.s),i=P(t.v),e=u(t.h,n,i),l=!0,c="hsv"):j(t.h)&&j(t.s)&&j(t.l)&&(n=P(t.s),o=P(t.l),e=s(t.h,n,o),l=!0,c="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=S(r),{ok:l,format:t.format||c,r:q(255,Y(e.r,0)),g:q(255,Y(e.g,0)),b:q(255,Y(e.b,0)),a:r}}function a(t,e,r){return{r:255*E(t,255),g:255*E(e,255),b:255*E(r,255)}}function o(t,e,r){t=E(t,255),e=E(e,255),r=E(r,255);var n,i,a=Y(t,e,r),o=q(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,l:s}}function s(t,e,r){function n(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;if(t=E(t,360),e=E(e,100),r=E(r,100),0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function l(t,e,r){t=E(t,255),e=E(e,255),r=E(r,255);var n,i,a=Y(t,e,r),o=q(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,v:s}}function u(t,r,n){t=6*E(t,360),r=E(r,100),n=E(n,100);var i=e.floor(t),a=t-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),u=i%6,c=[n,s,o,o,l,n][u],h=[l,n,n,s,o,o][u],f=[o,o,l,n,n,s][u];return{r:255*c,g:255*h,b:255*f}}function c(t,e,r,n){var i=[I(H(t).toString(16)),I(H(e).toString(16)),I(H(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function h(t,e,r,n,i){var a=[I(H(t).toString(16)),I(H(e).toString(16)),I(H(r).toString(16)),I(O(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function f(t,e,r,n){var i=[I(O(n)),I(H(t).toString(16)),I(H(e).toString(16)),I(H(r).toString(16))];return i.join("")}function d(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s-=e/100,r.s=L(r.s),n(r)}function p(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s+=e/100,r.s=L(r.s),n(r)}function m(t){return n(t).desaturate(100)}function v(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l+=e/100,r.l=L(r.l),n(r)}function g(t,e){e=0===e?0:e||10;var r=n(t).toRgb();return r.r=Y(0,q(255,r.r-H(255*-(e/100)))),r.g=Y(0,q(255,r.g-H(255*-(e/100)))),r.b=Y(0,q(255,r.b-H(255*-(e/100)))),n(r)}function y(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l-=e/100,r.l=L(r.l),n(r)}function b(t,e){var r=n(t).toHsl(),i=(r.h+e)%360;return r.h=i<0?360+i:i,n(r)}function x(t){var e=n(t).toHsl();return e.h=(e.h+180)%360,n(e)}function _(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+120)%360,s:e.s,l:e.l}),n({h:(r+240)%360,s:e.s,l:e.l})]}function w(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+90)%360,s:e.s,l:e.l}),n({h:(r+180)%360,s:e.s,l:e.l}),n({h:(r+270)%360,s:e.s,l:e.l})]}function M(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+72)%360,s:e.s,l:e.l}),n({h:(r+216)%360,s:e.s,l:e.l})]}function A(t,e,r){e=e||6,r=r||30;var i=n(t).toHsl(),a=360/r,o=[n(t)];for(i.h=(i.h-(a*e>>1)+720)%360;--e;)i.h=(i.h+a)%360,o.push(n(i));return o}function k(t,e){e=e||6;for(var r=n(t).toHsv(),i=r.h,a=r.s,o=r.v,s=[],l=1/e;e--;)s.push(n({h:i,s:a,v:o})),o=(o+l)%1;return s}function T(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function S(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function E(t,r){D(t)&&(t="100%");var n=z(t);return t=q(r,Y(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function L(t){return q(1,Y(0,t))}function C(t){return parseInt(t,16)}function D(t){return"string"==typeof t&&t.indexOf(".")!=-1&&1===parseFloat(t)}function z(t){return"string"==typeof t&&t.indexOf("%")!=-1}function I(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function O(t){return e.round(255*parseFloat(t)).toString(16)}function R(t){return C(t)/255}function j(t){return!!Z.CSS_UNIT.exec(t)}function F(t){t=t.replace(B,"").replace(U,"").toLowerCase();var e=!1;if(W[t])t=W[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Z.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Z.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Z.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Z.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Z.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Z.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Z.hex8.exec(t))?{r:C(r[1]),g:C(r[2]),b:C(r[3]),a:R(r[4]),format:e?"name":"hex8"}:(r=Z.hex6.exec(t))?{r:C(r[1]),g:C(r[2]),b:C(r[3]),format:e?"name":"hex"}:(r=Z.hex4.exec(t))?{r:C(r[1]+""+r[1]),g:C(r[2]+""+r[2]),b:C(r[3]+""+r[3]),a:R(r[4]+""+r[4]),format:e?"name":"hex8"}:!!(r=Z.hex3.exec(t))&&{r:C(r[1]+""+r[1]),g:C(r[2]+""+r[2]),b:C(r[3]+""+r[3]),format:e?"name":"hex"}}function N(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var B=/^\s+/,U=/\s+$/,V=0,H=e.round,q=e.min,Y=e.max,G=e.random;n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,r,n,i,a,o,s=this.toRgb();return t=s.r/255,r=s.g/255,n=s.b/255,i=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),a=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=S(t),this._roundA=H(100*this._a)/100,this},toHsv:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=l(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),n=H(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=o(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=o(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),n=H(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return c(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return h(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:H(this._r),g:H(this._g),b:H(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+H(this._r)+", "+H(this._g)+", "+H(this._b)+")":"rgba("+H(this._r)+", "+H(this._g)+", "+H(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:H(100*E(this._r,255))+"%",g:H(100*E(this._g,255))+"%",b:H(100*E(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+H(100*E(this._r,255))+"%, "+H(100*E(this._g,255))+"%, "+H(100*E(this._b,255))+"%)":"rgba("+H(100*E(this._r,255))+"%, "+H(100*E(this._g,255))+"%, "+H(100*E(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(X[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=n(t);r="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0,i=!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"hex4"===t||"hex8"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return n(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(x,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},n.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?r[i]=t[i]:r[i]=P(t[i]));t=r}return n(t,e)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:G(),g:G(),b:G()})},n.mix=function(t,e,r){r=0===r?0:r||50;var i=n(t).toRgb(),a=n(e).toRgb(),o=r/100,s={r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a};return n(s)},n.readability=function(t,r){var i=n(t),a=n(r);return(e.max(i.getLuminance(),a.getLuminance())+.05)/(e.min(i.getLuminance(),a.getLuminance())+.05)},n.isReadable=function(t,e,r){var i,a,o=n.readability(t,e);switch(a=!1,i=N(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},n.mostReadable=function(t,e,r){var i,a,o,s,l=null,u=0;r=r||{},a=r.includeFallbackColors,o=r.level,s=r.size;for(var c=0;c<e.length;c++)i=n.readability(t,e[c]),i>u&&(u=i,l=n(e[c]));return n.isReadable(t,l,{level:o,size:s})||!a?l:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var W=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},X=n.hexNames=T(W),Z=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof r&&r.exports?r.exports=n:"function"==typeof t&&t.amd?t(function(){return n}):window.tinycolor=n}(Math)},{}],499:[function(t,e,r){"use strict";function n(t,e){var r=o(getComputedStyle(t).getPropertyValue(e));return r[0]*a(r[1],t)}function i(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}function a(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return i(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return s;case"cm":return s/2.54;case"mm":return s/25.4;case"pt":return s/72;case"pc":return s/6}return 1}var o=t("parse-unit");e.exports=a;var s=96},{"parse-unit":441}],500:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.topojson=e.topojson||{})}(this,function(t){"use strict";function e(t,e){var n=e.id,i=e.bbox,a=null==e.properties?{}:e.properties,o=r(t,e);return null==n&&null==i?{type:"Feature",properties:a,geometry:o}:null==i?{type:"Feature",id:n,properties:a,geometry:o}:{type:"Feature",id:n,bbox:i,properties:a,geometry:o}}function r(t,e){function r(t,e){e.length&&e.pop();for(var r=h[t<0?~t:t],n=0,i=r.length;n<i;++n)e.push(u(r[n].slice(),n));t<0&&c(e,i)}function n(t){return u(t.slice())}function i(t){for(var e=[],n=0,i=t.length;n<i;++n)r(t[n],e);return e.length<2&&e.push(e[0].slice()),e}function a(t){for(var e=i(t);e.length<4;)e.push(e[0].slice());return e}function o(t){return t.map(a)}function s(t){var e,r=t.type;switch(r){case"GeometryCollection":return{type:r,geometries:t.geometries.map(s)};case"Point":e=n(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(n);break;case"LineString":e=i(t.arcs);break;case"MultiLineString":e=t.arcs.map(i);break;case"Polygon":e=o(t.arcs);break;case"MultiPolygon":e=t.arcs.map(o);break;default:return null}return{type:r,coordinates:e}}var u=l(t),h=t.arcs;return s(e)}function n(t,e,r){var n,a,o;if(arguments.length>1)n=i(t,e,r);else for(a=0,n=new Array(o=t.arcs.length);a<o;++a)n[a]=a;return{type:"MultiLineString",arcs:f(t,n)}}function i(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:l})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){t.forEach(a)}function s(t){switch(l=t,t.type){case"GeometryCollection":t.geometries.forEach(s);break;case"LineString":i(t.arcs);break;case"MultiLineString":case"Polygon":a(t.arcs);break;case"MultiPolygon":o(t.arcs)}}var l,u=[],c=[];return s(e),c.forEach(null==r?function(t){u.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&u.push(t[0].i)}),u}function a(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++r<n;)e=i,i=t[r],a+=e[0]*i[1]-e[1]*i[0];return Math.abs(a)}function o(t,e){function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Polygon":i(t.arcs);break;case"MultiPolygon":t.arcs.forEach(i)}}function i(t){t.forEach(function(e){e.forEach(function(e){(s[e=e<0?~e:e]||(s[e]=[])).push(t)})}),l.push(t)}function o(e){return a(r(t,{type:"Polygon",arcs:[e]}).coordinates[0])}var s={},l=[],u=[];return e.forEach(n),l.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,u.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){s[t<0?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),l.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:u.map(function(e){var r,n=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){s[t<0?~t:t].length<2&&n.push(t)})})}),n=f(t,n),(r=n.length)>1)for(var i,a,l=1,u=o(n[0]);l<r;++l)(i=o(n[l]))>u&&(a=n[0],n[0]=n[l],n[l]=a,u=i);return n})}}var s=function(t){return t},l=function(t){if(null==(e=t.transform))return s;var e,r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+o,t[1]=(n+=t[1])*a+l,t}},u=function(t){function e(t){s[0]=t[0],s[1]=t[1],o(s),s[0]<u&&(u=s[0]),s[0]>h&&(h=s[0]),s[1]<c&&(c=s[1]),s[1]>f&&(f=s[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,o=l(t),s=new Array(2),u=1/0,c=u,h=-u,f=-u;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++e<r;)i=t[e],s[0]=i[0],s[1]=i[1],o(s,e),s[0]<u&&(u=s[0]),s[0]>h&&(h=s[0]),s[1]<c&&(c=s[1]),s[1]>f&&(f=s[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[u,c,h,f]}return n},c=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},h=function(t,r){return"GeometryCollection"===r.type?{type:"FeatureCollection",features:r.geometries.map(function(r){return e(t,r)})}:e(t,r)},f=function(t,e){function r(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}function n(t,e){for(var r in t){var n=t[r];delete e[n.start],delete n.start,delete n.end,n.forEach(function(t){i[t<0?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++l],e[l]=r,e[n]=i)}),e.forEach(function(t){var e,n,i=r(t),s=i[0],l=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=l,n=a[l]){delete a[n.start];var u=n===e?e:e.concat(n);a[u.start=e.start]=o[u.end=n.end]=u}else a[e.start]=o[e.end]=e;else if(e=a[l])if(delete a[e.start],e.unshift(t),e.start=s,n=o[s]){delete o[n.end];var c=n===e?e:n.concat(e);a[c.start=n.start]=o[c.end=e.end]=c}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=l]=e}),n(o,a),n(a,o),e.forEach(function(t){i[t<0?~t:t]||s.push([t])}),s},d=function(t){return r(t,n.apply(this,arguments))},p=function(t){return r(t,o.apply(this,arguments))},m=function(t,e){for(var r=0,n=t.length;r<n;){var i=r+n>>>1;t[i]<e?r=i+1:n=i}return r},v=function(t){function e(t,e){t.forEach(function(t){t<0&&(t=~t);var r=i[t];r?r.push(e):i[t]=[e]})}function r(t,r){t.forEach(function(t){e(t,r)})}function n(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){n(t,e)}):t.type in o&&o[t.type](t.arcs,e)}var i={},a=t.map(function(){return[]}),o={LineString:e, MultiLineString:r,Polygon:r,MultiPolygon:function(t,e){t.forEach(function(t){r(t,e)})}};t.forEach(n);for(var s in i)for(var l=i[s],u=l.length,c=0;c<u;++c)for(var h=c+1;h<u;++h){var f,d=l[c],p=l[h];(f=a[d])[s=m(f,p)]!==p&&f.splice(s,0,p),(f=a[p])[s=m(f,d)]!==d&&f.splice(s,0,d)}return a},g=function(t,e){function r(t){t[0]=Math.round((t[0]-o)/s),t[1]=Math.round((t[1]-l)/c)}function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Point":r(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(r)}}if(!((e=Math.floor(e))>=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=u(t),o=a[0],s=(a[2]-o)/(e-1)||1,l=a[1],c=(a[3]-l)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,u=t.length,h=t[0],f=h[0]=Math.round((h[0]-o)/s),d=h[1]=Math.round((h[1]-l)/c);i<u;++i)h=t[i],r=Math.round((h[0]-o)/s),n=Math.round((h[1]-l)/c),r===f&&n===d||(e=t[a++],e[0]=r-f,f=r,e[1]=n-d,d=n);a<2&&(e=t[a++],e[0]=0,e[1]=0),t.length=a});for(i in t.objects)n(t.objects[i]);return t.transform={scale:[s,c],translate:[o,l]},t},y=function(t){if(null==(e=t.transform))return s;var e,r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],l=e.translate[1];return function(t,e){e||(r=n=0);var s=Math.round((t[0]-o)/i),u=Math.round((t[1]-l)/a);return t[0]=s-r,r=s,t[1]=u-n,n=u,t}};t.bbox=u,t.feature=h,t.mesh=d,t.meshArcs=n,t.merge=p,t.mergeArcs=o,t.neighbors=v,t.quantize=g,t.transform=l,t.untransform=y,Object.defineProperty(t,"__esModule",{value:!0})})},{}],501:[function(t,e,r){"use strict";function n(t){if(t<0)return[];if(0===t)return0;for(var e=0|Math.round(o(t+1)),r=[],n=0;n<e;++n){for(var s=i.unrank(t,n),l=[0],u=0,c=0;c<s.length;++c)u+=1<<s[c],l.push(u);a(s)<1&&(l[0]=u,l[t]=0),r.push(l)}return r}e.exports=n;var i=t("permutation-rank"),a=t("permutation-parity"),o=t("gamma")},{gamma:110,"permutation-parity":445,"permutation-rank":446}],502:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t){return Math.min(1,Math.max(-1,t))}function a(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(var s=0;s<3;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([a]),this.angle=l([o,s]),this.angle.bounds=[[-(1/0),-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var c=t.eye,p=[c[0]-e[0],c[1]-e[1],c[2]-e[2]];h(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var m=d(r,p)/s,v=d(i,p)/s;u=Math.acos(m),l=Math.acos(v)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,u)}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),h=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),d=t("gl-vec3/dot"),p=o.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-(1/0),e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var u=Math.sqrt(l),o=0;o<3;++o)r[o]/=u;var c=this.computedToward;h(c,e,r),f(c,c);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],v=Math.cos(p),g=Math.sin(p),y=Math.cos(m),b=Math.sin(m),x=this.computedCenter,_=v*y,w=g*y,M=b,A=-v*b,k=-g*b,T=y,S=this.computedEye,E=this.computedMatrix,o=0;o<3;++o){var L=_*r[o]+w*c[o]+M*e[o];E[4*o+1]=A*r[o]+k*c[o]+T*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],D=E[5],z=E[9],I=E[2],P=E[6],O=E[10],R=D*O-z*P,j=z*I-C*O,F=C*P-D*I,N=n(R,j,F);R/=N,j/=N,F/=N,E[0]=R,E[4]=j,E[8]=F;for(var o=0;o<3;++o)S[o]=x[o]+E[2+4*o]*d;for(var o=0;o<3;++o){for(var l=0,B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var m=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;m[0]=i[2],m[1]=i[6],m[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,m);for(var l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},p.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var m=c*e+o*r,v=h*e+s*r,g=f*e+l*r;this.center.move(t,m,v,g);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var l=e[o],c=e[o+4],h=e[o+8];if(a){var f=Math.abs(l),d=Math.abs(c),p=Math.abs(h),m=Math.max(f,d,p);f===m?(l=l<0?-1:1,c=h=0):p===m?(h=h<0?-1:1,l=c=0):(c=c<0?-1:1,l=h=0)}else{var v=n(l,c,h);l/=v,c/=v,h/=v}var g=e[s],y=e[s+4],b=e[s+8],x=g*l+y*c+b*h;g-=l*x,y-=c*x,b-=h*x;var _=n(g,y,b);g/=_,y/=_,b/=_;var w=c*b-h*y,M=h*g-l*b,A=l*y-c*g,k=n(w,M,A);w/=k,M/=k,A/=k,this.center.jump(t,q,Y,G),this.radius.idle(t),this.up.jump(t,l,c,h),this.right.jump(t,g,y,b);var T,S;if(2===o){var E=e[1],L=e[5],C=e[9],D=E*g+L*y+C*b,z=E*w+L*M+C*A;T=R<0?-Math.PI/2:Math.PI/2,S=Math.atan2(z,D)}else{var I=e[2],P=e[6],O=e[10],R=I*l+P*c+O*h,j=I*g+P*y+O*b,F=I*w+P*M+O*A;T=Math.asin(i(R)),S=Math.atan2(F,j)}this.angle.jump(t,S,T),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],V=this.computedMatrix;u(V,e);var H=V[15],q=V[12]/H,Y=V[13]/H,G=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*W,Y-B*W,G-U*W)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter,a=a||this.computedUp;var o=a[0],s=a[1],l=a[2],u=n(o,s,l);if(!(u<1e-6)){o/=u,s/=u,l/=u;var c=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],d=n(c,h,f);if(!(d<1e-6)){c/=d,h/=d,f/=d;var p=this.computedRight,m=p[0],v=p[1],g=p[2],y=o*m+s*v+l*g;m-=y*o,v-=y*s,g-=y*l;var b=n(m,v,g);if(!(b<.01&&(m=s*f-l*h,v=l*c-o*f,g=o*h-s*c,b=n(m,v,g),b<1e-6))){m/=b,v/=b,g/=b,this.up.set(t,o,s,l),this.right.set(t,m,v,g),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*g-l*v,_=l*m-o*g,w=o*v-s*m,M=n(x,_,w);x/=M,_/=M,w/=M;var A=o*c+s*h+l*f,k=m*c+v*h+g*f,T=x*c+_*h+w*f,S=Math.asin(i(A)),E=Math.atan2(T,k),L=this.angle._state,C=L[L.length-1],D=L[L.length-2];C%=2*Math.PI;var z=Math.abs(C+2*Math.PI-E),I=Math.abs(C-E),P=Math.abs(C-2*Math.PI-E);z<I&&(C+=2*Math.PI),P<I&&(C-=2*Math.PI),this.angle.jump(this.angle.lastT(),C,D),this.angle.set(t,E,S)}}}}},{"filtered-vector":108,"gl-mat4/invert":154,"gl-mat4/rotate":158,"gl-vec3/cross":242,"gl-vec3/dot":243,"gl-vec3/normalize":246}],503:[function(t,e,r){"use strict";function n(t,e,r){var n=t*e,a=i*t,o=a-t,s=a-o,l=t-s,u=i*e,c=u-e,h=u-c,f=e-h,d=n-s*h,p=d-l*h,m=p-s*f,v=l*f-m;return r?(r[0]=v,r[1]=n,r):[v,n]}e.exports=n;var i=+(Math.pow(2,27)+1)},{}],504:[function(t,e,r){"use strict";function n(t,e,r){var n=t+e,i=n-t,a=n-i,o=e-i,s=t-a;return r?(r[0]=s+o,r[1]=n,r):[s+o,n]}e.exports=n},{}],505:[function(t,e,r){(function(e,n){"use strict";function i(t){if(t){var e=t.length||t.byteLength,r=y.log2(e);w[r].push(t)}}function a(t){i(t.buffer)}function o(t){var t=y.nextPow2(t),e=y.log2(t),r=w[e];return r.length>0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(o(t),0,t)}function l(t){return new Uint16Array(o(2*t),0,t)}function u(t){return new Uint32Array(o(4*t),0,t)}function c(t){return new Int8Array(o(t),0,t)}function h(t){return new Int16Array(o(2*t),0,t)}function f(t){return new Int32Array(o(4*t),0,t)}function d(t){return new Float32Array(o(4*t),0,t)}function p(t){return new Float64Array(o(8*t),0,t)}function m(t){return x?new Uint8ClampedArray(o(t),0,t):s(t)}function v(t){return new DataView(o(t),0,t)}function g(t){t=y.nextPow2(t);var e=y.log2(t),r=M[e];return r.length>0?r.pop():new n(t)}var y=t("bit-twiddle"),b=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var x="undefined"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=b([32,0])),_.BUFFER||(_.BUFFER=b([32,0]));var w=_.DATA,M=_.BUFFER;r.free=function(t){if(n.isBuffer(t))M[y.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=a,r.freeArrayBuffer=i,r.freeBuffer=function(t){M[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return s(t);case"uint16":return l(t);case"uint32":return u(t);case"int8":return c(t);case"int16":return h(t);case"int32":return f(t);case"float":case"float32":return d(t);case"double":case"float64":return p(t);case"uint8_clamped":return m(t);case"buffer":return g(t);case"data":case"dataview":return v(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=h,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=m,r.mallocDataView=v,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,M[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":57,buffer:67,dup:100}],506:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n;var i=n.prototype;Object.defineProperty(i,"length",{get:function(){return this.roots.length}}),i.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},i.find=function(t){for(var e=t,r=this.roots;r[t]!==t;)t=r[t];for(;r[e]!==t;){var n=r[e];r[e]=t,e=n}return t},i.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},{}],507:[function(t,e,r){"use strict";function n(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;o<n;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;a<r;++a,i=n)if(i=n,n=t[a],n!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],508:[function(t,e,r){function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}e.exports=n,n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){"undefined"==typeof e&&(e=1e-6);var r,n,i,a,o;for(i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if(r=0,n=1,i=t,i<r)return r;if(i>n)return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],509:[function(t,e,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&u.isObject(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}function a(t){return u.isString(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)}function o(t,e){return i(t,!1,!0).resolve(e)}function s(t,e){return t?i(t,!1,!0).resolveObject(e):e}var l=t("punycode"),u=t("./util");r.parse=i,r.resolve=o,r.resolveObject=s,r.format=a,r.Url=n;var c=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),v=["%","/","?",";","#"].concat(m),g=["/","?","#"],y=255,b=/^[+a-z0-9A-Z_-]{0,63}$/,x=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},M={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=t("querystring");n.prototype.parse=function(t,e,r){if(!u.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=n!==-1&&n<t.indexOf("#")?"?":"#",a=t.split(i),o=/\\/g;a[0]=a[0].replace(o,"/"),t=a.join(i);var s=t;if(s=s.trim(),!r&&1===t.split("#").length){var h=f.exec(s);if(h)return this.path=s,this.href=s,this.pathname=h[1],h[2]?(this.search=h[2],e?this.query=A.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var d=c.exec(s);if(d){d=d[0];var p=d.toLowerCase();this.protocol=p,s=s.substr(d.length)}if(r||d||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var k="//"===s.substr(0,2);!k||d&&w[d]||(s=s.substr(2),this.slashes=!0)}if(!w[d]&&(k||d&&!M[d])){for(var T=-1,S=0;S<g.length;S++){var E=s.indexOf(g[S]);E!==-1&&(T===-1||E<T)&&(T=E)}var L,C;C=T===-1?s.lastIndexOf("@"):s.lastIndexOf("@",T),C!==-1&&(L=s.slice(0,C),s=s.slice(C+1),this.auth=decodeURIComponent(L)),T=-1;for(var S=0;S<v.length;S++){var E=s.indexOf(v[S]);E!==-1&&(T===-1||E<T)&&(T=E)}T===-1&&(T=s.length),this.host=s.slice(0,T),s=s.slice(T),this.parseHost(),this.hostname=this.hostname||"";var D="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!D)for(var z=this.hostname.split(/\./),S=0,I=z.length;S<I;S++){var P=z[S];if(P&&!P.match(b)){for(var O="",R=0,j=P.length;R<j;R++)O+=P.charCodeAt(R)>127?"x":P[R];if(!O.match(b)){var F=z.slice(0,S),N=z.slice(S+1),B=P.match(x);B&&(F.push(B[1]),N.unshift(B[2])),N.length&&(s="/"+N.join(".")+s),this.hostname=F.join(".");break}}}this.hostname.length>y?this.hostname="":this.hostname=this.hostname.toLowerCase(),D||(this.hostname=l.toASCII(this.hostname));var U=this.port?":"+this.port:"",V=this.hostname||"";this.host=V+U,this.href+=this.host,D&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!_[p])for(var S=0,I=m.length;S<I;S++){var H=m[S];if(s.indexOf(H)!==-1){var q=encodeURIComponent(H);q===H&&(q=escape(H)),s=s.split(H).join(q)}}var Y=s.indexOf("#");Y!==-1&&(this.hash=s.substr(Y),s=s.slice(0,Y));var G=s.indexOf("?");if(G!==-1?(this.search=s.substr(G),this.query=s.substr(G+1),e&&(this.query=A.parse(this.query)),s=s.slice(0,G)):e&&(this.search="",this.query={}),s&&(this.pathname=s),M[p]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var U=this.pathname||"",W=this.search||"";this.path=U+W}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,a="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&u.isObject(this.query)&&Object.keys(this.query).length&&(a=A.stringify(this.query));var o=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||M[e])&&i!==!1?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),o&&"?"!==o.charAt(0)&&(o="?"+o),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),o=o.replace("#","%23"),e+i+r+o+n},n.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(u.isString(t)){var e=new n;e.parse(t,!1,!0),t=e}for(var r=new n,i=Object.keys(this),a=0;a<i.length;a++){var o=i[a];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),l=0;l<s.length;l++){var c=s[l];"protocol"!==c&&(r[c]=t[c])}return M[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!M[t.protocol]){for(var h=Object.keys(t),f=0;f<h.length;f++){var d=h[f];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||w[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var m=r.pathname||"",v=r.search||"";r.path=m+v}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),y=t.host||t.pathname&&"/"===t.pathname.charAt(0),b=y||g||r.host&&t.pathname,x=b,_=r.pathname&&r.pathname.split("/")||[],p=t.pathname&&t.pathname.split("/")||[],A=r.protocol&&!M[r.protocol];if(A&&(r.hostname="",r.port=null,r.host&&(""===_[0]?_[0]=r.host:_.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),b=b&&(""===p[0]||""===_[0])),y)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,_=p;else if(p.length)_||(_=[]),_.pop(),_=_.concat(p),r.search=t.search,r.query=t.query;else if(!u.isNullOrUndefined(t.search)){if(A){r.hostname=r.host=_.shift();var k=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");k&&(r.auth=k.shift(),r.host=r.hostname=k.shift())}return r.search=t.search,r.query=t.query,u.isNull(r.pathname)&&u.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=_.slice(-1)[0],S=(r.host||t.host||_.length>1)&&("."===T||".."===T)||""===T,E=0,L=_.length;L>=0;L--)T=_[L],"."===T?_.splice(L,1):".."===T?(_.splice(L,1),E++):E&&(_.splice(L,1),E--);if(!b&&!x)for(;E--;E)_.unshift("..");!b||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),S&&"/"!==_.join("/").substr(-1)&&_.push("");var C=""===_[0]||_[0]&&"/"===_[0].charAt(0);if(A){r.hostname=r.host=C?"":_.length?_.shift():"";var k=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");k&&(r.auth=k.shift(),r.host=r.hostname=k.shift())}return b=b||r.host&&_.length,b&&!C&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),u.isNull(r.pathname)&&u.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=h.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":510,punycode:454,querystring:458}],510:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],511:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],512:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],513:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),l(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function l(t,e,n){if(t.customInspect&&e&&T(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return b(i)||(i=l(t,i,n)),i}var a=u(t,e);if(a)return a;var o=Object.keys(e),m=s(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),k(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(e);if(0===o.length){if(T(e)){var v=e.name?": "+e.name:"";return t.stylize("[Function"+v+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(A(e))return t.stylize(Date.prototype.toString.call(e),"date");if(k(e))return c(e)}var g="",y=!1,x=["{","}"];if(p(e)&&(y=!0,x=["[","]"]),T(e)){var _=e.name?": "+e.name:"";g=" [Function"+_+"]"}if(w(e)&&(g=" "+RegExp.prototype.toString.call(e)),A(e)&&(g=" "+Date.prototype.toUTCString.call(e)),k(e)&&(g=" "+c(e)),0===o.length&&(!y||0==e.length))return x[0]+g+x[1];if(n<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var M;return M=y?h(t,e,n,m,o):o.map(function(r){return f(t,e,n,m,r,y)}),t.seen.pop(),d(M,g,x)}function u(t,e){if(_(e))return t.stylize("undefined","undefined");if(b(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return y(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)D(e,String(o))?a.push(f(t,e,r,n,String(o),!0)):a.push("");return i.forEach(function(i){i.match(/^\d+$/)||a.push(f(t,e,r,n,i,!0))}),a}function f(t,e,r,n,i,a){var o,s,u;if(u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},u.get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),D(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=v(r)?l(t,u.value,null):l(t,u.value,r-1),s.indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function d(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function v(t){return null===t}function g(t){return null==t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function _(t){return void 0===t}function w(t){return M(t)&&"[object RegExp]"===E(t)}function M(t){return"object"==typeof t&&null!==t}function A(t){return M(t)&&"[object Date]"===E(t)}function k(t){return M(t)&&("[object Error]"===E(t)||t instanceof Error)}function T(t){return"function"==typeof t}function S(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function E(t){return Object.prototype.toString.call(t)}function L(t){return t<10?"0"+t.toString(10):t.toString(10)}function C(){var t=new Date,e=[L(t.getHours()),L(t.getMinutes()),L(t.getSeconds())].join(":");return[t.getDate(),O[t.getMonth()],e].join(" ")}function D(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var z=/%[sdj%]/g;r.format=function(t){if(!b(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(i(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,a=n.length,o=String(t).replace(z,function(t){if("%%"===t)return"%";if(r>=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r<a;s=n[++r])o+=v(s)||!M(s)?" "+s:" "+i(s);return o},r.deprecate=function(t,i){function a(){if(!o){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),o=!0}return t.apply(this,arguments)}if(_(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var o=!1;return a};var I,P={};r.debuglog=function(t){if(_(I)&&(I=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!P[t])if(new RegExp("\\b"+t+"\\b","i").test(I)){var n=e.pid;P[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else P[t]=function(){};return P[t]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=m,r.isNull=v,r.isNullOrUndefined=g,r.isNumber=y,r.isString=b,r.isSymbol=x,r.isUndefined=_,r.isRegExp=w,r.isObject=M,r.isDate=A,r.isError=k,r.isFunction=T,r.isPrimitive=S,r.isBuffer=t("./support/isBuffer");var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",C(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!M(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":512,_process:453,inherits:511}],514:[function(t,e,r){e.exports.VectorTile=t("./lib/vectortile.js"),e.exports.VectorTileFeature=t("./lib/vectortilefeature.js"),e.exports.VectorTileLayer=t("./lib/vectortilelayer.js")},{"./lib/vectortile.js":515,"./lib/vectortilefeature.js":516,"./lib/vectortilelayer.js":517}],515:[function(t,e,r){"use strict";function n(t,e){this.layers=t.readFields(i,{},e)}function i(t,e,r){if(3===t){var n=new a(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}var a=t("./vectortilelayer");e.exports=n},{"./vectortilelayer":517}],516:[function(t,e,r){"use strict";function n(t,e,r,n,a){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=a,t.readFields(i,this,e)}function i(t,e,r){1==t?e.id=r.readVarint():2==t?a(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function a(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}function o(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var o=s(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]))}return r&&i.push(r),i}function s(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.x-e.x)*(e.y+r.y);return n}var l=t("point-geometry");e.exports=n,n.types=["Unknown","Point","LineString","Polygon"],n.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,a=0,o=0,s=[];t.pos<r;){if(!i){var u=t.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new l(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-(1/0),l=1/0,u=-(1/0);t.pos<e;){if(!n){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),i<o&&(o=i),i>s&&(s=i),a<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+c)/l;t[e]=[360*(r.x+u)/l-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}var a,s,l=this.extent*Math.pow(2,r),u=this.extent*t,c=this.extent*e,h=this.loadGeometry(),f=n.types[this.type];switch(this.type){case 1:var d=[];for(a=0;a<h.length;a++)d[a]=h[a][0];h=d,i(h);break;case 2:for(a=0;a<h.length;a++)i(h[a]);break;case 3:for(h=o(h),a=0;a<h.length;a++)for(s=0;s<h[a].length;s++)i(h[a][s])}1===h.length?h=h[0]:f="Multi"+f;var p={type:"Feature",geometry:{type:f,coordinates:h},properties:this.properties};return"id"in this&&(p.id=this.id),p}},{"point-geometry":450}],517:[function(t,e,r){"use strict";function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(i,this,e),this.length=this._features.length}function i(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(a(r))}function a(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var o=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new o(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":516}],518:[function(t,e,r){"use strict";function n(t,e){return"object"==typeof e&&null!==e||(e={}),i(t,e.canvas||a,e.context||o,e)}e.exports=n;var i=t("./lib/vtext"),a=null,o=null;"undefined"!=typeof document&&(a=document.createElement("canvas"),a.width=8192,a.height=1024,o=a.getContext("2d")); },{"./lib/vtext":519}],519:[function(t,e,r){"use strict";function n(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l<s;++l)for(var u=t[l],c=0;c<2;++c)a[c]=0|Math.min(a[c],u[c]),o[c]=0|Math.max(o[c],u[c]);var h=0;switch(n){case"center":h=-.5*(a[0]+o[0]);break;case"right":case"end":h=-o[0];break;case"left":case"start":h=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var f=0;switch(i){case"hanging":case"top":f=-a[1];break;case"middle":f=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":f=-3*r;break;case"bottom":f=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var d=1/r;return"lineHeight"in e?d*=+e.lineHeight:"width"in e?d=e.width/(o[0]-a[0]):"height"in e&&(d=e.height/(o[1]-a[1])),t.map(function(t){return[d*(t[0]+h),d*(t[1]+f)]})}function i(t,e,r,n){var i=0|Math.ceil(e.measureText(r).width+2*n);if(i>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height<a&&(t.height=a),e.fillStyle="#000",e.fillRect(0,0,t.width,t.height),e.fillStyle="#fff",e.fillText(r,n,2*n);var o=e.getImageData(0,0,i,a),s=c(o.data,[a,i,4]);return s.pick(-1,-1,0).transpose(1,0)}function a(t,e){var r=u(t,128);return e?h(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function o(t,e,r,i){var o=a(t,i),s=n(o.positions,e,r),l=o.edges,u="ccw"===e.orientation;if(f(s,l),e.polygons||e.polygon||e.polyline){for(var c=p(l,s),h=new Array(c.length),m=0;m<c.length;++m){for(var v=c[m],g=new Array(v.length),y=0;y<v.length;++y){for(var b=v[y],x=new Array(b.length),_=0;_<b.length;++_)x[_]=s[b[_]].slice();u&&x.reverse(),g[y]=x}h[m]=g}return h}return e.triangles||e.triangulate||e.triangle?{cells:d(s,l,{delaunay:!1,exterior:!1,interior:!0}),positions:s}:{edges:l,positions:s}}function s(t,e,r){try{return o(t,e,r,!0)}catch(t){}try{return o(t,e,r,!1)}catch(t){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function l(t,e,r,n){var a=n.size||64,o=n.font||"normal";r.font=a+"px "+o,r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr";var l=i(e,r,t,a);return s(l,n,a)}e.exports=l,e.exports.processPixels=s;var u=t("surface-nets"),c=t("ndarray"),h=t("simplify-planar-graph"),f=t("clean-pslg"),d=t("cdt2d"),p=t("planar-graph-to-polyline")},{cdt2d:69,"clean-pslg":78,ndarray:434,"planar-graph-to-polyline":449,"simplify-planar-graph":489,"surface-nets":496}],520:[function(t,e,r){function n(t){var e=[];for(var r in t.layers)e.push(a(t.layers[r]));var n=new c;return h.tile.write({layers:e},n),n.finish()}function i(t){var e={};for(var r in t)e[r]=new f(t[r].features),e[r].name=r;return n({layers:e})}function a(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},r={},n={},i=0;i<t.length;i++){var a=t.feature(i);a.geometry=l(a.loadGeometry());var o=[];for(var s in a.properties){var c=r[s];"undefined"==typeof c&&(e.keys.push(s),c=e.keys.length-1,r[s]=c);var h=u(a.properties[s]),f=n[h.key];"undefined"==typeof f&&(e.values.push(h),f=e.values.length-1,n[h.key]=f),o.push(c),o.push(f)}a.tags=o,e.features.push(a)}return e}function o(t,e){return(e<<3)+(7&t)}function s(t){return t<<1^t>>31}function l(t){for(var e=[],r=0,n=0,i=t.length,a=0;a<i;a++){var l=t[a];e.push(o(1,1));for(var u=0;u<l.length;u++){1===u&&e.push(o(2,l.length-1));var c=l[u].x-r,h=l[u].y-n;e.push(s(c),s(h)),r+=c,n+=h}}return e}function u(t){var e,r=typeof t;return"string"===r?e={string_value:t}:"boolean"===r?e={bool_value:t}:"number"===r?e=t%1!==0?{double_value:t}:t<0?{sint_value:t}:{uint_value:t}:(t=JSON.stringify(t),e={string_value:t}),e.key=r+":"+t,e}var c=t("pbf"),h=t("./vector-tile-pb"),f=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=i,e.exports.GeoJSONWrapper=f},{"./lib/geojson_wrapper":521,"./vector-tile-pb":522,pbf:444}],521:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature;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},{"point-geometry":450,"vector-tile":514}],522:[function(t,e,r){"use strict";function n(t,e){return t.readFields(i,{layers:[]},e)}function i(t,e,r){3===t&&e.layers.push(f(r,r.readVarint()+r.pos))}function a(t,e){var r;if(void 0!==t.layers)for(r=0;r<t.layers.length;r++)e.writeMessage(3,p,t.layers[r])}function o(t,e){return t.readFields(s,{},e)}function s(t,e,r){1===t?e.string_value=r.readString():2===t?e.float_value=r.readFloat():3===t?e.double_value=r.readDouble():4===t?e.int_value=r.readVarint():5===t?e.uint_value=r.readVarint():6===t?e.sint_value=r.readSVarint():7===t&&(e.bool_value=r.readBoolean())}function l(t,e){void 0!==t.string_value&&e.writeStringField(1,t.string_value),void 0!==t.float_value&&e.writeFloatField(2,t.float_value),void 0!==t.double_value&&e.writeDoubleField(3,t.double_value),void 0!==t.int_value&&e.writeVarintField(4,t.int_value),void 0!==t.uint_value&&e.writeVarintField(5,t.uint_value),void 0!==t.sint_value&&e.writeSVarintField(6,t.sint_value),void 0!==t.bool_value&&e.writeBooleanField(7,t.bool_value)}function u(t,e){var r=t.readFields(c,{},e);return void 0===r.type&&(r.type="Unknown"),r}function c(t,e,r){1===t?e.id=r.readVarint():2===t?e.tags=r.readPackedVarint():3===t?e.type=r.readVarint():4===t&&(e.geometry=r.readPackedVarint())}function h(t,e){void 0!==t.id&&e.writeVarintField(1,t.id),void 0!==t.tags&&e.writePackedVarint(2,t.tags),void 0!==t.type&&e.writeVarintField(3,t.type),void 0!==t.geometry&&e.writePackedVarint(4,t.geometry)}function f(t,e){return t.readFields(d,{features:[],keys:[],values:[]},e)}function d(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():2===t?e.features.push(u(r,r.readVarint()+r.pos)):3===t?e.keys.push(r.readString()):4===t?e.values.push(o(r,r.readVarint()+r.pos)):5===t&&(e.extent=r.readVarint())}function p(t,e){void 0!==t.version&&e.writeVarintField(15,t.version),void 0!==t.name&&e.writeStringField(1,t.name);var r;if(void 0!==t.features)for(r=0;r<t.features.length;r++)e.writeMessage(2,h,t.features[r]);if(void 0!==t.keys)for(r=0;r<t.keys.length;r++)e.writeStringField(3,t.keys[r]);if(void 0!==t.values)for(r=0;r<t.values.length;r++)e.writeMessage(4,l,t.values[r]);void 0!==t.extent&&e.writeVarintField(5,t.extent)}var m=r.tile={read:n,write:a};m.GeomType={Unknown:0,Point:1,LineString:2,Polygon:3},m.value={read:o,write:l},m.feature={read:u,write:h},m.layer={read:f,write:p}},{}],523:[function(t,e,r){!function(){"use strict";function t(e){e.permitHostObjects___&&e.permitHostObjects___(t)}function r(t){return!(t.substr(0,d.length)==d&&"___"===t.substr(t.length-3))}function n(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[p];if(e&&e.key===t)return e;if(f(t)){e={key:t};try{return h(t,p,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function i(t){return t.prototype=null,Object.freeze(t)}function a(){y||"undefined"==typeof console||(y=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=t);var o=!1;if("function"==typeof WeakMap){var s=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var l=new s,u=Object.freeze({});if(l.set(u,1),1===l.get(u))return void(e.exports=WeakMap);o=!0}}var c=(Object.prototype.hasOwnProperty,Object.getOwnPropertyNames),h=Object.defineProperty,f=Object.isExtensible,d="weakmap:",p=d+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var m=new ArrayBuffer(25),v=new Uint8Array(m);crypto.getRandomValues(v),p=d+"rand:"+Array.prototype.map.call(v,function(t){return(t%36).toString(36)}).join("")+"___"}if(h(Object,"getOwnPropertyNames",{value:function(t){return c(t).filter(r)}}),"getPropertyNames"in Object){var g=Object.getPropertyNames;h(Object,"getPropertyNames",{value:function(t){return g(t).filter(r)}})}!function(){var t=Object.freeze;h(Object,"freeze",{value:function(e){return n(e),t(e)}});var e=Object.seal;h(Object,"seal",{value:function(t){return n(t),e(t)}});var r=Object.preventExtensions;h(Object,"preventExtensions",{value:function(t){return n(t),r(t)}})}();var y=!1,b=0,x=function(){function t(t,e){var r,i=n(t);return i?u in i?i[u]:e:(r=s.indexOf(t),r>=0?l[r]:e)}function e(t){var e=n(t);return e?u in e:s.indexOf(t)>=0}function r(t,e){var r,i=n(t);return i?i[u]=e:(r=s.indexOf(t),r>=0?l[r]=e:(r=s.length,l[r]=e,s[r]=t)),this}function o(t){var e,r,i=n(t);return i?u in i&&delete i[u]:(e=s.indexOf(t),!(e<0)&&(r=s.length-1,s[e]=void 0,l[e]=l[r],s[e]=s[r],s.length=r,l.length=r,!0))}this instanceof x||a();var s=[],l=[],u=b++;return Object.create(x.prototype,{get___:{value:i(t)},has___:{value:i(e)},set___:{value:i(r)},delete___:{value:i(o)}})};x.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof s?!function(){function r(){function e(t,e){return c?u.has(t)?u.get(t):c.get___(t,e):u.get(t,e)}function r(t){return u.has(t)||!!c&&c.has___(t)}function n(t){var e=!!u.delete(t);return c?c.delete___(t)||e:e}this instanceof x||a();var l,u=new s,c=void 0,h=!1;return l=o?function(t,e){return u.set(t,e),u.has(t)||(c||(c=new x),c.set(t,e)),this}:function(t,e){if(h)try{u.set(t,e)}catch(r){c||(c=new x),c.set___(t,e)}else u.set(t,e);return this},Object.create(x.prototype,{get___:{value:i(e)},has___:{value:i(r)},set___:{value:i(l)},delete___:{value:i(n)},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");h=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=x.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=x)}}()},{}],524:[function(t,e,r){function n(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:i(e,t)}}var i=t("./hidden-store.js");e.exports=n},{"./hidden-store.js":525}],525:[function(t,e,r){function n(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}e.exports=n},{}],526:[function(t,e,r){function n(){var t=i();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){t(e).value=r},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}var i=t("./create-store.js");e.exports=n},{"./create-store.js":524}],527:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":121}],528:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){v[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];v[n]||r(n)}}for(var s,l=Object.keys(a),u=0,c=l.length;u<c;u++){var h=l[u],f=a[h].exports;if(f===t||f&&f.default===t){s=h;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var d={},u=0,c=l.length;u<c;u++){var h=l[u];d[h]=h}i[s]=[Function(["require","module","exports"],"("+t+")(self)"),d]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[s]=s,i[p]=[Function(["require"],"var f = require("+ o(s) +");(f.default ? f.default : f)(self);"),m];var v={};r(p);var g="("+n+")({"+Object.keys(v).map(function(t){return o(t)+":["+i[t][0]+","+o(i[t][1])+"]"}).join(",")+"},{},["+o(p)+"])",y=window.URL||window.webkitURL||window.mozURL||window.msURL,b=new Blob([g],{type:"text/javascript"});if(e&&e.bare)return b;var x=y.createObjectURL(b),_=new Worker(x);return _.objectURL=x,_}},{}],529:[function(t,e,r){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],530:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.WhooTS=e.WhooTS||{})}(this,function(t){function e(t,e,n,i,a,o){o=o||{};var s=t+"?"+["bbox="+r(n,i,a),"format="+(o.format||"image/png"),"service="+(o.service||"WMS"),"version="+(o.version||"1.1.1"),"request="+(o.request||"GetMap"),"srs="+(o.srs||"EPSG:3857"),"width="+(o.width||256),"height="+(o.height||256),"layers="+e].join("&");return s}function r(t,e,r){e=Math.pow(2,r)-e-1;var i=n(256*t,256*e,r),a=n(256*(t+1),256*(e+1),r);return i[0]+","+i[1]+","+a[0]+","+a[1]}function n(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,a=e*n-2*Math.PI*6378137/2;return[i,a]}t.getURL=e,t.getTileBBox=r,t.getMercCoords=n,Object.defineProperty(t,"__esModule",{value:!0})})},{}],531:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{var o="number"==typeof t&&t>=1888&&t<=2111;if(!o)throw new Error("Solar year outside range 1888-2111");var s="number"==typeof e&&e>=1&&e<=12;if(!s)throw new Error("Solar month outside range 1 - 12");var l="number"==typeof r&&r>=1&&r<=31;if(!l)throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var u=p[i.year-p[0]],c=i.year<<9|i.month<<5|i.day;a.year=c>=u?i.year:i.year-1,u=p[a.year-p[0]];var h,f=u>>9&4095,m=u>>5&15,v=31&u,g=new Date(f,m-1,v),y=new Date(i.year,i.month-1,i.day);h=Math.round((y-g)/864e5);var b,x=d[a.year-d[0]];for(b=0;b<13;b++){var _=x&1<<12-b?30:29;if(h<_)break;h-=_}var w=x>>13;return!w||b<w?(a.isIntercalary=!1,a.month=1+b):b===w?(a.isIntercalary=!0,a.month=b):(a.isIntercalary=!1,a.month=b),a.day=1+h,a}function a(t,e,r,n,i){var a,o;if("object"==typeof t)o=t,a=e||{};else{var s="number"==typeof t&&t>=1888&&t<=2111;if(!s)throw new Error("Lunar year outside range 1888-2111");var l="number"==typeof e&&e>=1&&e<=12;if(!l)throw new Error("Lunar month outside range 1 - 12");var u="number"==typeof r&&r>=1&&r<=30;if(!u)throw new Error("Lunar day outside range 1 - 30");var c;"object"==typeof n?(c=!1,a=n):(c=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:c}}var h;h=o.day-1;var f,m=d[o.year-d[0]],v=m>>13;f=v?o.month>v?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var g=0;g<f;g++){var y=m&1<<12-g?30:29;h+=y}var b=p[o.year-p[0]],x=b>>9&4095,_=b>>5&15,w=31&b,M=new Date(x,_-1,w+h);return a.year=M.getFullYear(),a.month=1+M.getMonth(),a.day=M.getDate(),a}var o=t("../main"),s=t("object-assign"),l=o.instance();n.prototype=new o.baseCalendar,s(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(c);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(h);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][i-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(f);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][i-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}var a=this.toMonthIndex(t,n,r);return a},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t),i=r&&e!==n;if(i||e<1||e>12)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);var a;return a=n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t),n=r?12:11;if(e<0||e>n)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);var i;return i=r?e<r?e+1:e:e+1},intercalaryMonth:function(t){t=this._validateYear(t);var e=d[t-d[0]],r=e>>13;return r},isIntercalaryMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,i=this._validateYear(t,o.local.invalidyear),a=p[i-p[0]],s=a>>9&4095,u=a>>5&15,c=31&a;n=l.newDate(s,u,c),n.add(4-(n.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-n.toJD();return 1+Math.floor(h/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=d[t-d[0]],n=r>>13,i=n?12:11;if(e>i)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);var a=r&1<<12-e?30:29;return a},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,o.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var i=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),u=a(t,s,r,i);return l.toJD(u.year,u.month,u.day)},fromJD:function(t){var e=l.fromJD(t),r=i(e.year(),e.month(),e.day()),n=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,n,r.day)},fromString:function(t){var e=t.match(u),r=this._validateYear(+e[1]),n=+e[2],i=!!e[3],a=this.toMonthIndex(r,n,i),o=+e[4];return this.newDate(r,a,o)},add:function(t,e,r){var i=t.year(),a=t.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),l=Object.getPrototypeOf(n.prototype).add.call(this,t,e,r);if("y"===r){var u=l.year(),c=l.month(),h=this.isIntercalaryMonth(u,s),f=o&&h?this.toMonthIndex(u,s,!0):this.toMonthIndex(u,s,!1);f!==c&&l.month(f)}return l}});var u=/^\s*(-?\d\d\d\d|\d\d)[-\/](\d?\d)([iI]?)[-\/](\d?\d)/m,c=/^\d?\d[iI]?/m,h=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?\u6708/m,f=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?/m;o.calendars.chinese=n;var d=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],p=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]},{"../main":545,"object-assign":437}],532:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Coptic",jdEpoch:1825029.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4===3||t%4===-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),t<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.coptic=n},{"../main":545,"object-assign":437}],533:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),400},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return(n.day()+1)%8},weekDay:function(t,e,r){var n=this.dayOfWeek(t,e,r);return n>=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:o[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),r=n.day(),r+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":545,"object-assign":437}],534:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4===3||t%4===-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),t<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":545,"object-assign":437}],535:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main"),o=t("object-assign");n.prototype=new a.baseCalendar,o(n.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return t=e.year(),this.toJD(t===-1?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(var s=1;s<e;s++)o+=this.daysInMonth(t,s)}else for(var s=7;s<e;s++)o+=this.daysInMonth(t,s);return o},_delay1:function(t){var e=Math.floor((235*t-234)/19),r=12084+13753*e,n=29*e+Math.floor(r/25920);return i(3*(n+1),7)<3&&n++,n},_delay2:function(t){var e=this._delay1(t-1),r=this._delay1(t),n=this._delay1(t+1);return n-r===356?2:r-e===382?1:0},fromJD:function(t){t=Math.floor(t)+.5;for(var e=Math.floor(98496*(t-this.jdEpoch)/35975351)-1;t>=this.toJD(e===-1?1:e+1,7,1);)e++;for(var r=t<this.toJD(e,1,1)?7:1;t>this.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),a.calendars.hebrew=n},{"../main":545,"object-assign":437}],536:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]; }var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return(11*e.year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":545,"object-assign":437}],537:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()<0?e.year()+1:e.year();return t%4===0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=e+1524,n=Math.floor((r-122.1)/365.25),i=Math.floor(365.25*n),a=Math.floor((r-i)/30.6001),o=a-Math.floor(a<14?1:13),s=n-Math.floor(o>2?4716:4715),l=r-i-Math.floor(30.6001*a);return s<=0&&s--,this.newDate(s,o,l)}}),i.calendars.julian=n},{"../main":545,"object-assign":437}],538:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main"),s=t("object-assign");n.prototype=new o.baseCalendar,s(n.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),!1},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear);t=e.year();var r=Math.floor(t/400);t%=400,t+=t<0?400:0;var n=Math.floor(t/20);return r+"."+n+"."+t%20},forYear:function(t){if(t=t.split("."),t.length<3)throw"Invalid Mayan year";for(var e=0,r=0;r<t.length;r++){var n=parseInt(t[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate),i=n.toJD(),a=this._toHaab(i),s=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[s[0]-1],tzolkinDay:s[0],tzolkinTrecena:s[1]}},_toHaab:function(t){t-=this.jdEpoch;var e=i(t+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":545,"object-assign":437}],539:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth),t=n.year();t<0&&t++;for(var a=n.day(),s=1;s<n.month();s++)a+=this.daysPerMonth[s-1];return a+o.toJD(t+1468,3,13)},fromJD:function(t){t=Math.floor(t+.5);for(var e=Math.floor((t-(this.jdEpoch-1))/366);t>=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),i.calendars.nanakshahi=n},{"../main":545,"object-assign":437}],540:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);if(t=e.year(),"undefined"==typeof this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[t][n];return r},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,i.local.invalidMonth),"undefined"==typeof this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0],o<0&&(o+=a.daysInYear(u))):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance(),r=e.fromJD(t),n=r.year(),a=r.dayOfYear(),o=n+56;this._createMissingCalendarData(o);for(var s=9,l=this.NEPALI_CALENDAR_DATA[o][0],u=this.NEPALI_CALENDAR_DATA[o][s]-l+1;a>u;)s++,s>12&&(s=1,o++),u+=this.NEPALI_CALENDAR_DATA[o][s];var c=this.NEPALI_CALENDAR_DATA[o][s]-(u-a);return this.newDate(o,s,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r<t+2;r++)"undefined"==typeof this.NEPALI_CALENDAR_DATA[r]&&(this.NEPALI_CALENDAR_DATA[r]=e)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),i.calendars.nepali=n},{"../main":545,"object-assign":437}],541:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main"),o=t("object-assign");n.prototype=new a.baseCalendar,o(n.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Ch\xe6harshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Ch\xe6","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return 682*((e.year()-(e.year()>0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-((n.dayOfWeek()+1)%7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=t-this.toJD(475,1,1),r=Math.floor(e/1029983),n=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var u=t-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),h=t-this.toJD(l,c,1)+1;return this.newDate(l,c,h)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":545,"object-assign":437}],542:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();n.prototype=new i.baseCalendar,a(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),i.calendars.taiwan=n},{"../main":545,"object-assign":437}],543:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();n.prototype=new i.baseCalendar,a(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),i.calendars.thai=n},{"../main":545,"object-assign":437}],544:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,i.local.invalidMonth),n=r.toJD()-24e5+.5,a=0,s=0;s<o.length;s++){if(o[s]>n)return o[a]-o[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),a=12*(n.year()-1)+n.month()-15292,s=n.day()+o[a-1]-1;return s+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;n<o.length&&!(o[n]>e);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(t=null!=t.year?t.year:t,n=t>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]; },{"../main":545,"object-assign":437}],545:[function(t,e,r){function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance(),n.newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),l(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return e.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0),i=t.day(),s=function(t){for(;o<t.minMonth;)a--,o+=t.monthsInYear(a);for(var e=t.monthsInYear(a);o>e-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)};"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(s(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var l=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,l}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth<this.monthsInYear(i)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(i)}return this._validateLevel--,n},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return u.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(t){return this.fromJD(u.instance().fromJSDate(t).toJD())},_validate:function(t,e,r,n){if(t.year){if(0===this._validateLevel&&this.name!==t.calendar().name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,t.calendar().local.name);return t}try{if(this._validateLevel++,1===this._validateLevel&&!this.isValid(t,e,r))throw n.replace(/\{0\}/,this.local.name);var i=this.newDate(t,e,r);return this._validateLevel--,i}catch(t){throw this._validateLevel--,t}}}),s.prototype=new o,l(s.prototype,{name:"Gregorian",jdEpoch:1721425.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),t=e.year()+(e.year()<0?1:0);return t%4===0&&(t%100!==0||t%400===0)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<3&&(e+=12,t--);var i=Math.floor(t/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r+a-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=Math.floor((e-1867216.25)/36524.25);r=e+1+r-Math.floor(r/4);var n=r+1524,i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(30.6001*o),l=o-(o>13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new n;u.cdate=i,u.baseCalendar=o,u.calendars.gregorian=s},{"object-assign":437}],546:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat,r=r||{};for(var n=r.dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,u=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;b+n<t.length&&t.charAt(b+n)===e;)n++;return b+=n-1,Math.floor(n/(r||1))>1}),c=function(t,e,r,n){var i=""+e;if(u(t,n))for(;i.length<r;)i="0"+i;return i},h=function(t,e,r,n){return u(t)?n[e]:r[e]},f=this,d=function(t){return"function"==typeof o?o.call(f,t,u("m")):v(c("m",t.month(),2))},p=function(t,e){return e?"function"==typeof l?l.call(f,t):l[t.month()-f.minMonth]:"function"==typeof s?s.call(f,t):s[t.month()-f.minMonth]},m=this.local.digits,v=function(t){return r.localNumbers&&m?m(t):t},g="",y=!1,b=0;b<t.length;b++)if(y)"'"!==t.charAt(b)||u("'")?g+=t.charAt(b):y=!1;else switch(t.charAt(b)){case"d":g+=v(c("d",e.day(),2));break;case"D":g+=h("D",e.dayOfWeek(),n,a);break;case"o":g+=c("o",e.dayOfYear(),3);break;case"w":g+=c("w",e.weekOfYear(),2);break;case"m":g+=d(e);break;case"M":g+=p(e,u("M"));break;case"y":g+=u("y",2)?e.year():(e.year()%100<10?"0":"")+e.year()%100;break;case"Y":u("Y",2),g+=e.formatYear();break;case"J":g+=e.toJD();break;case"@":g+=(e.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":g+=(e.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":u("'")?g+="'":y=!0;break;default:g+=t.charAt(b)}return g},parseDate:function(t,e,r){if(null==e)throw i.local.invalidArguments||i.regionalOptions[""].invalidArguments;if(e="object"==typeof e?e.toString():e+"",""===e)return null;t=t||this.local.dateFormat,r=r||{};var n=r.shortYearCutoff||this.shortYearCutoff;n="string"!=typeof n?n:this.today().year()%100+parseInt(n,10);for(var a=r.dayNamesShort||this.local.dayNamesShort,o=r.dayNames||this.local.dayNames,s=r.parseMonth||this.local.parseMonth,l=r.monthNumbers||this.local.monthNumbers,u=r.monthNamesShort||this.local.monthNamesShort,c=r.monthNames||this.local.monthNames,h=-1,f=-1,d=-1,p=-1,m=-1,v=!1,g=!1,y=function(e,r){for(var n=1;T+n<t.length&&t.charAt(T+n)===e;)n++;return T+=n-1,Math.floor(n/(r||1))>1},b=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(k).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(k));return k+=t.length,t}return b("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s<o.length;s++)if(e.substr(k,o[s].length).toLowerCase()===o[s].toLowerCase())return k+=o[s].length,s+x.minMonth;throw(i.local.unknownNameAt||i.regionalOptions[""].unknownNameAt).replace(/\{0\}/,k)},M=function(){if("function"==typeof c){var t=y("M")?c.call(x,e.substring(k)):u.call(x,e.substring(k));return k+=t.length,t}return w("M",u,c)},A=function(){if(e.charAt(k)!==t.charAt(T))throw(i.local.unexpectedLiteralAt||i.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,k);k++},k=0,T=0;T<t.length;T++)if(g)"'"!==t.charAt(T)||y("'")?A():g=!1;else switch(t.charAt(T)){case"d":p=b("d");break;case"D":w("D",a,o);break;case"o":m=b("o");break;case"w":b("w");break;case"m":d=_();break;case"M":d=M();break;case"y":var S=T;v=!y("y",2),T=S,f=b("y",2);break;case"Y":f=b("Y",2);break;case"J":h=b("J")+.5,"."===e.charAt(k)&&(k++,b("J"));break;case"@":h=b("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":h=b("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":k=e.length;break;case"'":y("'")?A():g=!0;break;default:A()}if(k<e.length)throw i.local.unexpectedText||i.regionalOptions[""].unexpectedText;if(f===-1?f=this.today().year():f<100&&v&&(f+=n===-1?1900:this.today().year()-this.today().year()%100-(f<=n?0:100)),"string"==typeof d&&(d=s.call(this,f,d)),m>-1){d=1,p=m;for(var E=this.daysInMonth(f,d);p>E;E=this.daysInMonth(f,d))d++,p-=E}return h>-1?this.fromJD(h):this.newDate(f,d,p)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this,o=function(t){try{return a.parseDate(n,t,i)}catch(t){}t=t.toLowerCase();for(var e=(t.match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e};return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?o(t):"number"==typeof t?isNaN(t)||t===1/0||t===-(1/0)?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":545,"object-assign":437}],547:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":93}],548:[function(t,e,r){"use strict";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t("./lib/zc-core")},{"./lib/zc-core":547}],549:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("../../plots/cartesian/axes"),o=t("./attributes");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,o,r,i)}s=s||{},l=l||{};var c=u("visible",!l.itemIsNotPlainObject),h=u("clicktoshow");if(!c&&!h)return e;u("opacity"),u("align"),u("bgcolor");var f=u("bordercolor"),d=i.opacity(f);u("borderpad");var p=u("borderwidth"),m=u("showarrow");u("text",m?" ":"new text"),u("textangle"),n.coerceFont(u,"font",r.font);for(var v=["x","y"],g=[-10,-30],y={_fullLayout:r},b=0;b<2;b++){var x=v[b],_=a.coerceRef(t,e,y,x,"","paper");if(a.coercePosition(e,y,u,_,x,.5),m){var w="a"+x,M=a.coerceRef(t,e,y,w,"pixel");"pixel"!==M&&M!==_&&(M=e[w]="pixel");var A="pixel"===M?g[b]:.4;a.coercePosition(e,y,u,M,w,A)}u(x+"anchor")}if(n.noneOrAll(t,e,["x","y"]),m&&(u("arrowcolor",d?e.bordercolor:i.defaultLine),u("arrowhead"),u("arrowsize"),u("arrowwidth",2*(d&&p||1)),u("standoff"),n.noneOrAll(t,e,["ax","ay"])),h){var k=u("xclick"),T=u("yclick");e._xclick=void 0===k?e.x:k,e._yclick=void 0===T?e.y:T}return e}},{"../../lib":667,"../../plots/cartesian/axes":706,"../color":562,"./attributes":551}],550:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],551:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0},text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:o({},i,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},standoff:{valType:"number",min:0,dflt:0},ax:{valType:"any"},ay:{valType:"any"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()]},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()]},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()]},x:{valType:"any"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()]},y:{valType:"any"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1},xclick:{valType:"any"},yclick:{valType:"any"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":659,"../../plots/cartesian/constants":711,"../../plots/font_attributes":726,"./arrow_paths":550}],552:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=3*e.arrowsize*e.arrowwidth||0;r&&r.autorange&&(e.axref===e.xref?(a.expand(r,[r.r2c(e.x)],{ppadplus:i,ppadminus:i}),a.expand(r,[r.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):a.expand(r,[r.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,i)})),n&&n.autorange&&(e.ayref===e.yref?(a.expand(n,[n.r2c(e.y)],{ppadplus:i,ppadminus:i}),a.expand(n,[n.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):a.expand(n,[n.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,i)}))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=!0,s[t.yref]=!0});var l=a.list(t).filter(function(t){return t.autorange&&s[t._id]});if(l.length)return i.syncOrAsync([o,n],t)}}},{"../../lib":667,"../../plots/cartesian/axes":706,"./draw":556}],553:[function(t,e,r){"use strict";function n(t,e){var r=a(t,e);return r.on.length>0||r.explicitOff.length>0}function i(t,e){var r,n=a(t,e),i=n.on,s=n.off.concat(n.explicitOff),l={};if(i.length||s.length){for(r=0;r<i.length;r++)l["annotations["+i[r]+"].visible"]=!0;for(r=0;r<s.length;r++)l["annotations["+s[r]+"].visible"]=!1;return o.update(t,{},l)}}function a(t,e){var r,n,i,a,o,s,l=t._fullLayout.annotations,u=[],c=[],h=[],f=(e||[]).length;for(r=0;r<l.length;r++)if(i=l[r],a=i.clicktoshow){for(n=0;n<f;n++)if(o=e[n],o.x===i._xclick&&o.y===i._yclick&&o.xaxis._id===i.xref&&o.yaxis._id===i.yref){s=i.visible?"onout"===a?c:h:u,s.push(r);break}n===f&&i.visible&&"onout"===a&&c.push(r)}return{on:u,off:c,explicitOff:h}}var o=t("../../plotly");e.exports={hasClickToShow:n,onClick:i}},{"../../plotly":701}],554:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib/to_log_range");e.exports=function(t,e,r,a){function o(t){var r=u[t],o=null;o=s?i(r,e.range):Math.pow(10,r),n(o)||(o=null),a(c+t,o)}var s="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(s||l)for(var u,c,h=t._fullLayout.annotations,f=e._id.charAt(0),d=0;d<h.length;d++)u=h[d],c="annotations["+d+"].",u[f+"ref"]===e._id&&o(f),u["a"+f+"ref"]===e._id&&o("a"+f)}},{"../../lib/to_log_range":687,"fast-isnumeric":106}],555:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),i=t("./annotation_defaults");e.exports=function(t,e){var r={name:"annotations",handleItemDefaults:i};n(t,e,r)}},{"../../plots/array_container_defaults":703,"./annotation_defaults":549}],556:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&i(t,r);return l.previousPromises(t)}function i(t,e){function r(t){return t.call(f.font,D).attr({"text-anchor":{left:"start",right:"end"}[b.align]||"middle"}),d.convertToTspans(t,n),t}function n(){function r(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}z.selectAll("tspan.line").attr({y:0,x:0});var n=T.select(".annotation-math-group"),i=!n.empty(),d=f.bBox((i?n:z).node()),y=d.width,E=d.height,D=Math.round(y+2*L),I=Math.round(E+2*L);b._w=y,b._h=E;var P=!1;if(["x","y"].forEach(function(e){var n,i,a,o,s,h=b[e+"ref"]||e,f=b["a"+e+"ref"],d=c.getFromId(t,h),p=(M+("x"===e?0:-90))*Math.PI/180,m=D*Math.cos(p),v=I*Math.sin(p),y=Math.abs(m)+Math.abs(v),x=b[e+"anchor"],_=w[e];if(d){var A=d.r2fraction(b[e]);if((t._dragging||!d.autorange)&&(A<0||A>1)&&(f===h?(A=d.r2fraction(b["a"+e]),(A<0||A>1)&&(P=!0)):P=!0,P))return;n=d._offset+d.r2p(b[e]),o=.5}else"x"===e?(a=b[e],n=g.l+g.w*a):(a=1-b[e],n=g.t+g.h*a),o=b.showarrow?.5:a;if(b.showarrow){_.head=n;var k=b["a"+e];s=m*r(.5,b.xanchor)-v*r(.5,b.yanchor),f===h?(_.tail=d._offset+d.r2p(k),i=s):(_.tail=n+k,i=s+k),_.text=_.tail+s;var T=l["x"===e?"width":"height"];if("paper"===h&&(_.head=u.constrain(_.head,1,T-1)),"pixel"===f){var S=-Math.max(_.tail-3,_.text),E=Math.min(_.tail+3,_.text)-T;S>0?(_.tail+=S,_.text+=S):E>0&&(_.tail-=E,_.text-=E)}}else s=y*r(o,x),i=s,_.text=n+s;b["_"+e+"padplus"]=y/2+i,b["_"+e+"padminus"]=y/2-i}),P)return void T.remove();if(i)n.select("svg").attr({x:L-1,y:L});else{var O=L-d.top,R=L-d.left;z.attr({x:R,y:O}),z.selectAll("tspan.line").attr({y:O,x:R})}C.call(f.setRect,S/2,S/2,D-S,I-S),T.call(f.setTranslate,Math.round(w.x.text-D/2),Math.round(w.y.text-I/2)),k.attr({transform:"rotate("+M+","+w.x.text+","+w.y.text+")"});var j="annotations["+e+"]",F=function(r,n){o.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i=w.x.head,l=w.y.head,c=w.x.tail+r,d=w.y.tail+n,p=w.x.text+r,y=w.y.text+n,S=u.rotationXYMatrix(M,p,y),E=u.apply2DTransform(S),L=u.apply2DTransform2(S),D=+C.attr("width"),z=+C.attr("height"),I=p-.5*D,P=I+D,O=y-.5*z,R=O+z,F=[[I,O,I,R],[I,R,P,R],[P,R,P,O],[P,O,I,O]].map(L);if(!F.reduce(function(t,e){return t^!!a(i,l,i+1e6,l+1e6,e[0],e[1],e[2],e[3])},!1)){F.forEach(function(t){var e=a(c,d,i,l,t[0],t[1],t[2],t[3]);e&&(c=e.x,d=e.y)});var N=b.arrowwidth,B=b.arrowcolor,U=A.append("g").style({opacity:h.opacity(B)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),V=U.append("path").attr("d","M"+c+","+d+"L"+i+","+l).style("stroke-width",N+"px").call(h.stroke,h.rgb(B));if(v(V,b.arrowhead,"end",b.arrowsize,b.standoff),t._context.editable&&V.node().parentNode){var H=i,q=l;if(b.standoff){var Y=Math.sqrt(Math.pow(i-c,2)+Math.pow(l-d,2));H+=b.standoff*(c-i)/Y,q+=b.standoff*(d-l)/Y}var G,W,X,Z=U.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(c-H)+","+(d-q),transform:"translate("+H+","+q+")"}).style("stroke-width",N+6+"px").call(h.stroke,"rgba(0,0,0,0)").call(h.fill,"rgba(0,0,0,0)");m.init({element:Z.node(),prepFn:function(){var t=f.getTranslate(T);W=t.x,X=t.y,G={},x&&x.autorange&&(G[x._name+".autorange"]=!0),_&&_.autorange&&(G[_._name+".autorange"]=!0)},moveFn:function(t,e){var r=E(W,X),n=r[0]+t,a=r[1]+e;T.call(f.setTranslate,n,a),G[j+".x"]=x?x.p2r(x.r2p(b.x)+t):(i+t-g.l)/g.w,G[j+".y"]=_?_.p2r(_.r2p(b.y)+e):1-(l+e-g.t)/g.h,b.axref===b.xref&&(G[j+".ax"]=x?x.p2r(x.r2p(b.ax)+t):(i+t-g.l)/g.w),b.ayref===b.yref&&(G[j+".ay"]=_?_.p2r(_.r2p(b.ay)+e):1-(l+e-g.t)/g.h),U.attr("transform","translate("+t+","+e+")"),k.attr({transform:"rotate("+M+","+n+","+a+")"})},doneFn:function(e){if(e){s.relayout(t,G);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};if(b.showarrow&&F(0,0),t._context.editable){var N,B;m.init({element:T.node(),prepFn:function(){B=k.attr("transform"),N={}},moveFn:function(t,e){var r="pointer";if(b.showarrow)b.axref===b.xref?N[j+".ax"]=x.p2r(x.r2p(b.ax)+t):N[j+".ax"]=b.ax+t,b.ayref===b.yref?N[j+".ay"]=_.p2r(_.r2p(b.ay)+e):N[j+".ay"]=b.ay+e,F(t,e);else{if(x)N[j+".x"]=b.x+t/x._m;else{var n=b._xsize/g.w,i=b.x+b._xshift/g.w-n/2;N[j+".x"]=m.align(i+t/g.w,n,0,1,b.xanchor)}if(_)N[j+".y"]=b.y+e/_._m;else{var a=b._ysize/g.h,o=b.y-b._yshift/g.h-a/2;N[j+".y"]=m.align(o-e/g.h,a,0,1,b.yanchor)}x&&_||(r=m.getCursor(x?.5:N[j+".x"],_?.5:N[j+".y"],b.xanchor,b.yanchor))}k.attr({transform:"translate("+t+","+e+")"+B}),p(T,r)},doneFn:function(e){if(p(T),e){s.relayout(t,N);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var i=t.layout,l=t._fullLayout,g=t._fullLayout._size;l._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var y=i.annotations[e],b=l.annotations[e];if(y&&b.visible!==!1){var x=c.getFromId(t,b.xref),_=c.getFromId(t,b.yref),w={x:{},y:{}},M=+b.textangle||0,A=l._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",b.opacity).on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:y,fullAnnotation:b})}),k=A.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),T=k.append("g"),S=b.borderwidth,E=b.borderpad,L=S+E,C=T.append("rect").attr("class","bg").style("stroke-width",S+"px").call(h.stroke,b.bordercolor).call(h.fill,b.bgcolor),D=b.font,z=T.append("text").classed("annotation",!0).attr("data-unformatted",b.text).text(b.text);t._context.editable?z.call(d.makeEditable,T).call(r).on("edit",function(n){b.text=n,this.attr({"data-unformatted":b.text}),this.call(r);var i={};i["annotations["+e+"].text"]=b.text,x&&x.autorange&&(i[x._name+".autorange"]=!0),_&&_.autorange&&(i[_._name+".autorange"]=!0),s.relayout(t,i)}):z.call(r)}}function a(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,h=n-e,f=a-e,d=s-a,p=l*d-c*h;if(0===p)return null;var m=(u*d-c*f)/p,v=(u*h-l*f)/p;return v<0||v>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}var o=t("d3"),s=t("../../plotly"),l=t("../../plots/plots"),u=t("../../lib"),c=t("../../plots/cartesian/axes"),h=t("../color"),f=t("../drawing"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),m=t("../dragelement"),v=t("./draw_arrow_head");e.exports={draw:n,drawOne:i}},{"../../lib":667,"../../lib/setcursor":682,"../../lib/svg_text_utils":686,"../../plotly":701,"../../plots/cartesian/axes":706,"../../plots/plots":766,"../color":562,"../dragelement":583,"../drawing":585,"./draw_arrow_head":557,d3:97}],557:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../color"),o=t("../drawing"),s=t("./arrow_paths");e.exports=function(t,e,r,l,u){function c(){t.style("stroke-dasharray","0px,100px")}function h(r,i){d.path&&(e>5&&(i=0),n.select(f.parentElement).append("path").attr({class:t.attr("class"),d:d.path,transform:"translate("+r.x+","+r.y+")rotate("+180*i/Math.PI+")scale("+y+")"}).style({fill:b,opacity:x,"stroke-width":0}))}i(l)||(l=1);var f=t.node(),d=s[e||0];"string"==typeof r&&r||(r="end");var p,m,v,g,y=(o.getPx(t,"stroke-width")||1)*l,b=t.style("stroke")||a.defaultLine,x=t.style("stroke-opacity")||1,_=r.indexOf("start")>=0,w=r.indexOf("end")>=0,M=d.backoff*y+u;if("line"===f.nodeName){p={x:+t.attr("x1"),y:+t.attr("y1")},m={x:+t.attr("x2"),y:+t.attr("y2")};var A=p.x-m.x,k=p.y-m.y;if(v=Math.atan2(k,A),g=v+Math.PI,M){if(M*M>A*A+k*k)return void c();var T=M*Math.cos(v),S=M*Math.sin(v);_&&(p.x-=T,p.y-=S,t.attr({x1:p.x,y1:p.y})),w&&(m.x+=T,m.y+=S,t.attr({x2:m.x,y2:m.y}))}}else if("path"===f.nodeName){var E=f.getTotalLength(),L="";if(E<M)return void c();if(_){var C=f.getPointAtLength(0),D=f.getPointAtLength(.1);v=Math.atan2(C.y-D.y,C.x-D.x),p=f.getPointAtLength(Math.min(M,E)),M&&(L="0px,"+M+"px,")}if(w){var z=f.getPointAtLength(E),I=f.getPointAtLength(E-.1);if(g=Math.atan2(z.y-I.y,z.x-I.x),m=f.getPointAtLength(Math.max(0,E-M)),M){var P=L?2*M:M;L+=E-P+"px,"+E+"px"}}else L&&(L+=E+"px");L&&t.style("stroke-dasharray",L)}_&&h(p,v),w&&h(m,g)}},{"../color":562,"../drawing":585,"./arrow_paths":550,d3:97,"fast-isnumeric":106}],558:[function(t,e,r){"use strict";var n=t("./draw"),i=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,hasClickToShow:i.hasClickToShow,onClick:i.onClick,convertCoords:t("./convert_coords")}},{"./attributes":551,"./calc_autorange":552,"./click":553,"./convert_coords":554,"./defaults":555,"./draw":556}],559:[function(t,e,r){"use strict";e.exports=t("world-calendars/dist/main"),t("world-calendars/dist/plus"),t("world-calendars/dist/calendars/chinese"),t("world-calendars/dist/calendars/coptic"),t("world-calendars/dist/calendars/discworld"),t("world-calendars/dist/calendars/ethiopian"),t("world-calendars/dist/calendars/hebrew"), t("world-calendars/dist/calendars/islamic"),t("world-calendars/dist/calendars/julian"),t("world-calendars/dist/calendars/mayan"),t("world-calendars/dist/calendars/nanakshahi"),t("world-calendars/dist/calendars/nepali"),t("world-calendars/dist/calendars/persian"),t("world-calendars/dist/calendars/taiwan"),t("world-calendars/dist/calendars/thai"),t("world-calendars/dist/calendars/ummalqura")},{"world-calendars/dist/calendars/chinese":531,"world-calendars/dist/calendars/coptic":532,"world-calendars/dist/calendars/discworld":533,"world-calendars/dist/calendars/ethiopian":534,"world-calendars/dist/calendars/hebrew":535,"world-calendars/dist/calendars/islamic":536,"world-calendars/dist/calendars/julian":537,"world-calendars/dist/calendars/mayan":538,"world-calendars/dist/calendars/nanakshahi":539,"world-calendars/dist/calendars/nepali":540,"world-calendars/dist/calendars/persian":541,"world-calendars/dist/calendars/taiwan":542,"world-calendars/dist/calendars/thai":543,"world-calendars/dist/calendars/ummalqura":544,"world-calendars/dist/main":545,"world-calendars/dist/plus":546}],560:[function(t,e,r){"use strict";function n(t,e,r){for(var n,a,o,s,l,u=Math.floor((e+.05)/h)+c,f=i(r).fromJD(u),d=0;(d=t.indexOf("%",d))!==-1;)n=t.charAt(d+1),"0"===n||"-"===n||"_"===n?(o=3,a=t.charAt(d+2),"_"===n&&(n="-")):(a=n,n="0",o=2),s=b[a],s?(l=s===y?y:f.formatDate(s[n]),t=t.substr(0,d)+l+t.substr(d+o),d+=l.length):d+=o;return t}function i(t){var e=x[t];return e?e:e=x[t]=s.instance(t)}function a(t){return l.extendFlat({},f,{description:t})}function o(t){return"Sets the calendar system to use with `"+t+"` date data."}var s=t("./calendars"),l=t("../../lib"),u=t("../../constants/numerical"),c=u.EPOCHJD,h=u.ONEDAY,f={valType:"enumerated",values:Object.keys(s.calendars),dflt:"gregorian"},d=function(t,e,r,n){var i={};return i[r]=f,l.coerce(t,e,i,r,n)},p=function(t,e,r,n){for(var i=0;i<r.length;i++)d(t,e,r[i]+"calendar",n.calendar)},m={chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},v={chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},g={chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},y="##",b={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:y,w:y,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},x={},_={xcalendar:a(o("x"))},w=l.extendFlat({},_,{ycalendar:a(o("y"))}),M=l.extendFlat({},w,{zcalendar:a(o("z"))}),A=a(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));e.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:w,bar:w,heatmap:w,contour:w,histogram:w,histogram2d:w,histogram2dcontour:w,scatter3d:M,surface:M,mesh3d:M,scattergl:w,ohlc:_,candlestick:_},layout:{calendar:a(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" ")),"xaxis.calendar":A,"yaxis.calendar":A,"scene.xaxis.calendar":A,"scene.yaxis.calendar":A,"scene.zaxis.calendar":A},transforms:{filter:{valuecalendar:a(["Sets the calendar system to use for `value`, if it is a date."].join(" ")),targetcalendar:a(["Sets the calendar system to use for `target`, if it is an","array of dates. If `target` is a string (eg *x*) we use the","corresponding trace attribute (eg `xcalendar`) if it exists,","even if `targetcalendar` is provided."].join(" "))}}},layoutAttributes:f,handleDefaults:d,handleTraceDefaults:p,CANONICAL_SUNDAY:v,CANONICAL_TICK:m,DFLTRANGE:g,getCal:i,worldCalFmt:n}},{"../../constants/numerical":649,"../../lib":667,"./calendars":559}],561:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],562:[function(t,e,r){"use strict";function n(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o<n.length;o++){if(!n[o].length)return t;if(n[o]=Number(n[o]),!(n[o]>=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults,o.defaultLine=s.defaultLine,o.lightLine=s.lightLine,o.background=s.background,o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||o.background).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},s={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return i(s).toRgbString()},o.contrast=function(t,e,r){var n=i(t),a=n.isLight()?n.darken(r):n.lighten(e);return a.toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e<s.length;e++)if(i=s[e],a=t[i],"color"===i.substr(i.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=n(a[r]);else t[i]=n(a);else if("colorscale"===i.substr(i.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=n(a[r][1]));else if(Array.isArray(a)){var l=a[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<a.length;r++)o.clean(a[r])}else a&&"object"==typeof a&&o.clean(a)}}},{"./attributes":561,"fast-isnumeric":106,tinycolor2:498}],563:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),a=t("../../lib/extend").extendFlat;e.exports={thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:a({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:"string",dflt:"Click to enter colorscale title"},titlefont:a({},i,{}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},{"../../lib/extend":659,"../../plots/cartesian/layout_attributes":715,"../../plots/font_attributes":726}],564:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/tick_value_defaults"),a=t("../../plots/cartesian/tick_mark_defaults"),o=t("../../plots/cartesian/tick_label_defaults"),s=t("./attributes");e.exports=function(t,e,r){function l(t,e){return n.coerce(c,u,s,t,e)}var u=e.colorbar={},c=t.colorbar||{},h=l("thicknessmode");l("thickness","fraction"===h?30/(r.width-r.margin.l-r.margin.r):30);var f=l("lenmode");l("len","fraction"===f?1:r.height-r.margin.t-r.margin.b),l("x"),l("xanchor"),l("xpad"),l("y"),l("yanchor"),l("ypad"),n.noneOrAll(c,u,["x","y"]),l("outlinecolor"),l("outlinewidth"),l("bordercolor"),l("borderwidth"),l("bgcolor"),i(c,u,l,"linear"),o(c,u,l,"linear",{outerTicks:!1,font:r.font,noHover:!0}),a(c,u,l,"linear",{outerTicks:!1,font:r.font,noHover:!0}),l("title"),n.coerceFont(l,"titlefont",r.font),l("titleside")}},{"../../lib":667,"../../plots/cartesian/tick_label_defaults":721,"../../plots/cartesian/tick_mark_defaults":722,"../../plots/cartesian/tick_value_defaults":723,"./attributes":563}],565:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../registry"),l=t("../../plots/cartesian/axes"),u=t("../dragelement"),c=t("../../lib"),h=t("../../lib/extend").extendFlat,f=t("../../lib/setcursor"),d=t("../drawing"),p=t("../color"),m=t("../titles"),v=t("../../plots/cartesian/axis_defaults"),g=t("../../plots/cartesian/position_defaults"),y=t("../../plots/cartesian/layout_attributes"),b=t("./attributes");e.exports=function(t,e){function r(){function b(t,e){return c.coerce(K,$,y,t,e)}function w(){if(["top","bottom"].indexOf(_.titleside)!==-1){var e=at.select(".cbtitle"),r=e.select("text"),a=[-_.outlinewidth/2,_.outlinewidth/2],o=e.select(".h"+$._id+"title-math-group").node(),s=15.6;if(r.node()&&(s=1.3*parseInt(r.style("font-size"),10)),o?(st=d.bBox(o).height,st>s&&(a[1]-=(st-s)/2)):r.node()&&!r.classed("js-placeholder")&&(st=d.bBox(e.node()).height),st){if(st+=5,"top"===_.titleside)$.domain[1]-=st/T.h,a[1]*=-1;else{$.domain[0]+=st/T.h;var u=Math.max(1,r.selectAll("tspan.line").size());a[1]+=(1-u)*s}e.attr("transform","translate("+a+")"),$.setScale()}}at.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(T.h*(1-$.domain[1]))+")");var h=at.select(".cbfills").selectAll("rect.cbfill").data(C);h.enter().append("rect").classed("cbfill",!0).style("stroke","none"),h.exit().remove(),h.each(function(t,e){var r=[0===e?E[0]:(C[e]+C[e-1])/2,e===C.length-1?E[1]:(C[e]+C[e+1])/2].map($.c2p).map(Math.round);e!==C.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=z(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:W,width:Math.max(B,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var f=at.select(".cblines").selectAll("path.cbline").data(_.line.color&&_.line.width?L:[]);return f.enter().append("path").classed("cbline",!0),f.exit().remove(),f.each(function(t){n.select(this).attr("d","M"+W+","+(Math.round($.c2p(t))+_.line.width/2%1)+"h"+B).call(d.lineGroupStyle,_.line.width,D(t),_.line.dash)}),$._axislayer.selectAll("g."+$._id+"tick,path").remove(),$._pos=W+B+(_.outlinewidth||0)/2-("outside"===_.ticks?1:0),$.side="right",c.syncOrAsync([function(){return l.doTicks(t,$,!0)},function(){if(["top","bottom"].indexOf(_.titleside)===-1){var e=$.titlefont.size,r=$._offset+$._length/2,i=T.l+($.position||0)*T.w+("right"===$.side?10+e*($.showticklabels?1:.5):-10-e*($.showticklabels?.5:0));M("h"+$._id+"title",{avoid:{selection:n.select(t).selectAll("g."+$._id+"tick"),side:_.titleside,offsetLeft:T.l,offsetTop:T.t,maxShift:k.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function M(e,r){var n,i=x();n=s.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var a={propContainer:$,propName:n,traceIndex:i.index,dfltName:"colorscale",containerGroup:at.select(".cbtitle")},o="h"===e.charAt(0)?e.substr(1):"h"+e;at.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(t,e,h(a,r||{}))}function A(){var r=B+_.outlinewidth/2+d.bBox($._axislayer.node()).width;if(j=ot.select("text"),j.node()&&!j.classed("js-placeholder")){var n,i=ot.select(".h"+$._id+"title-math-group").node();n=i&&["top","bottom"].indexOf(_.titleside)!==-1?d.bBox(i).width:d.bBox(ot.node()).right-W-T.l,r=Math.max(r,n)}var a=2*_.xpad+r+_.borderwidth+_.outlinewidth/2,s=J-Q;at.select(".cbbg").attr({x:W-_.xpad-(_.borderwidth+_.outlinewidth)/2,y:Q-Y,width:Math.max(a,2),height:Math.max(s+2*Y,2)}).call(p.fill,_.bgcolor).call(p.stroke,_.bordercolor).style({"stroke-width":_.borderwidth}),at.selectAll(".cboutline").attr({x:W,y:Q+_.ypad+("top"===_.titleside?st:0),width:Math.max(B,2),height:Math.max(s-2*_.ypad-st,2)}).call(p.stroke,_.outlinecolor).style({fill:"None","stroke-width":_.outlinewidth});var l=({center:.5,right:1}[_.xanchor]||0)*a;at.attr("transform","translate("+(T.l-l)+","+T.t+")"),o.autoMargin(t,e,{x:_.x,y:_.y,l:a*({right:1,center:.5}[_.xanchor]||0),r:a*({left:1,center:.5}[_.xanchor]||0),t:s*({bottom:1,middle:.5}[_.yanchor]||0),b:s*({top:1,middle:.5}[_.yanchor]||0)})}var k=t._fullLayout,T=k._size;if("function"!=typeof _.fillcolor&&"function"!=typeof _.line.color)return void k._infolayer.selectAll("g."+e).remove();var S,E=n.extent(("function"==typeof _.fillcolor?_.fillcolor:_.line.color).domain()),L=[],C=[],D="function"==typeof _.line.color?_.line.color:function(){return _.line.color},z="function"==typeof _.fillcolor?_.fillcolor:function(){return _.fillcolor},I=_.levels.end+_.levels.size/100,P=_.levels.size,O=1.001*E[0]-.001*E[1],R=1.001*E[1]-.001*E[0];for(S=_.levels.start;(S-I)*P<0;S+=P)S>O&&S<R&&L.push(S);if("function"==typeof _.fillcolor)if(_.filllevels)for(I=_.filllevels.end+_.filllevels.size/100,P=_.filllevels.size,S=_.filllevels.start;(S-I)*P<0;S+=P)S>E[0]&&S<E[1]&&C.push(S);else C=L.map(function(t){return t-_.levels.size/2}),C.push(C[C.length-1]+_.levels.size);else _.fillcolor&&"string"==typeof _.fillcolor&&(C=[0]);_.levels.size<0&&(L.reverse(),C.reverse());var j,F=k.height-k.margin.t-k.margin.b,N=k.width-k.margin.l-k.margin.r,B=Math.round(_.thickness*("fraction"===_.thicknessmode?N:1)),U=B/T.w,V=Math.round(_.len*("fraction"===_.lenmode?F:1)),H=V/T.h,q=_.xpad/T.w,Y=(_.borderwidth+_.outlinewidth)/2,G=_.ypad/T.h,W=Math.round(_.x*T.w+_.xpad),X=_.x-U*({middle:.5,right:1}[_.xanchor]||0),Z=_.y+H*(({top:-.5,bottom:.5}[_.yanchor]||0)-.5),J=Math.round(T.h*(1-Z)),Q=J-V,K={type:"linear",range:E,tickmode:_.tickmode,nticks:_.nticks,tick0:_.tick0,dtick:_.dtick,tickvals:_.tickvals,ticktext:_.ticktext,ticks:_.ticks,ticklen:_.ticklen,tickwidth:_.tickwidth,tickcolor:_.tickcolor,showticklabels:_.showticklabels,tickfont:_.tickfont,tickangle:_.tickangle,tickformat:_.tickformat,exponentformat:_.exponentformat,separatethousands:_.separatethousands,showexponent:_.showexponent,showtickprefix:_.showtickprefix,tickprefix:_.tickprefix,showticksuffix:_.showticksuffix,ticksuffix:_.ticksuffix,title:_.title,titlefont:_.titlefont,anchor:"free",position:1},$={},tt={letter:"y",font:k.font,noHover:!0,calendar:k.calendar};if(v(K,$,b,tt),g(K,$,b,tt),$._id="y"+e,$._gd=t,$.position=_.x+q+U,r.axis=$,["top","bottom"].indexOf(_.titleside)!==-1&&($.titleside=_.titleside,$.titlex=_.x+q,$.titley=Z+("top"===_.titleside?H-G:G)),_.line.color&&"auto"===_.tickmode){$.tickmode="linear",$.tick0=_.levels.start;var et=_.levels.size,rt=c.constrain((J-Q)/50,4,15)+1,nt=(E[1]-E[0])/((_.nticks||rt)*et);if(nt>1){var it=Math.pow(10,Math.floor(Math.log(nt)/Math.LN10));et*=it*c.roundUp(nt/it,[2,5,10]),(Math.abs(_.levels.start)/_.levels.size+1e-6)%1<2e-6&&($.tick0=0)}$.dtick=et}$.domain=[Z+G,Z+H-G],$.setScale();var at=k._infolayer.selectAll("g."+e).data([0]);at.enter().append("g").classed(e,!0).each(function(){var t=n.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),at.attr("transform","translate("+Math.round(T.l)+","+Math.round(T.t)+")");var ot=at.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(T.l)+",-"+Math.round(T.t)+")");$._axislayer=at.select(".cbaxis");var st=0;if(["top","bottom"].indexOf(_.titleside)!==-1){var lt,ut=T.l+(_.x+q)*T.w,ct=$.titlefont.size;lt="top"===_.titleside?(1-(Z+H-G))*T.h+T.t+3+.75*ct:(1-(Z+G))*T.h+T.t-3-.25*ct,M($._id+"title",{attributes:{x:ut,y:lt,"text-anchor":"start"}})}var ht=c.syncOrAsync([o.previousPromises,w,o.previousPromises,A],t);if(ht&&ht.then&&(t._promises||[]).push(ht),t._context.editable){var ft,dt,pt;u.init({element:at.node(),prepFn:function(){ft=at.attr("transform"),f(at)},moveFn:function(t,e){at.attr("transform",ft+" translate("+t+","+e+")"),dt=u.align(X+t/T.w,U,0,1,_.xanchor),pt=u.align(Z-e/T.h,H,0,1,_.yanchor);var r=u.getCursor(dt,pt,_.xanchor,_.yanchor);f(at,r)},doneFn:function(e){f(at),e&&void 0!==dt&&void 0!==pt&&a.restyle(t,{"colorbar.x":dt,"colorbar.y":pt},x().index)}})}return ht}function x(){var r,n,i=e.substr(2);for(r=0;r<t._fullData.length;r++)if(n=t._fullData[r],n.uid===i)return n}var _={};return Object.keys(b).forEach(function(t){_[t]=null}),_.fillcolor=null,_.line={color:null,width:null,dash:null},_.levels={start:null,end:null,size:null},_.filllevels=null,Object.keys(_).forEach(function(t){r[t]=function(e){return arguments.length?(_[t]=c.isPlainObject(_[t])?c.extendFlat(_[t],e):e,r):_[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=_,r}},{"../../lib":667,"../../lib/extend":659,"../../lib/setcursor":682,"../../plotly":701,"../../plots/cartesian/axes":706,"../../plots/cartesian/axis_defaults":708,"../../plots/cartesian/layout_attributes":715,"../../plots/cartesian/position_defaults":718,"../../plots/plots":766,"../../registry":781,"../color":562,"../dragelement":583,"../drawing":585,"../titles":638,"./attributes":563,d3:97,tinycolor2:498}],566:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":667}],567:[function(t,e,r){"use strict";e.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0}}},{}],568:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./scales"),a=t("./flip_scale");e.exports=function(t,e,r,o){var s,l;r?(s=n.nestedProperty(t,r).get(),l=n.nestedProperty(t._input,r).get()):(s=t,l=t._input);var u=o+"auto",c=o+"min",h=o+"max",f=s[u],d=s[c],p=s[h],m=s.colorscale;f===!1&&void 0!==d||(d=n.aggNums(Math.min,null,e)),f===!1&&void 0!==p||(p=n.aggNums(Math.max,null,e)),d===p&&(d-=.5,p+=.5),s[c]=d,s[h]=p,l[c]=d,l[h]=p,l[u]=f!==!1||void 0===d&&void 0===p,s.autocolorscale&&(m=d*p<0?i.RdBu:d>=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":667,"./flip_scale":573,"./scales":580}],569:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{}),cmax:i({},n.zmax,{}),cmin:i({},n.zmin,{}),autocolorscale:i({},n.autocolorscale,{}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":659,"./attributes":567,"./scales.js":580}],570:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":580}],571:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,u,c){var h=c.prefix,f=c.cLetter,d=h.slice(0,h.length-1),p=h?i.nestedProperty(t,d).get()||{}:t,m=h?i.nestedProperty(e,d).get()||{}:e,v=p[f+"min"],g=p[f+"max"],y=p.colorscale,b=n(v)&&n(g)&&v<g;u(h+f+"auto",!b),u(h+f+"min"),u(h+f+"max");var x;void 0!==y&&(x=!s(y)),u(h+"autocolorscale",x);var _=u(h+"colorscale"),w=u(h+"reversescale");if(w&&(m.colorscale=l(_)),"marker.line."!==h){var M;h&&(M=a(p));var A=u(h+"showscale",M);A&&o(p,m,r)}}},{"../../lib":667,"../colorbar/defaults":564,"../colorbar/has_colorbar":566,"./flip_scale":573,"./is_valid_scale":577,"fast-isnumeric":106}],572:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n=t.length,i=new Array(n),a=new Array(n),o=0;o<n;o++){var s=t[o];i[o]=e+s[0]*(r-e),a[o]=s[1]}return{domain:i,range:a}}},{}],573:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),i=r-1,a=0;i>=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],574:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":570,"./is_valid_scale_array":578,"./scales":580}],575:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l<o.length;l++)if(n(o[l])){s=!0;break}return i.isPlainObject(r)&&(s||r.showscale===!0||n(r.cmin)&&n(r.cmax)||a(r.colorscale)||i.isPlainObject(r.colorbar))}},{"../../lib":667,"./is_valid_scale":577,"fast-isnumeric":106}],576:[function(t,e,r){"use strict";r.scales=t("./scales"),r.defaultScale=t("./default_scale"),r.attributes=t("./attributes"),r.handleDefaults=t("./defaults"),r.calc=t("./calc"),r.hasColorscale=t("./has_colorscale"),r.isValidScale=t("./is_valid_scale"),r.getScale=t("./get_scale"),r.flipScale=t("./flip_scale"),r.extractScale=t("./extract_scale"),r.makeColorScaleFunc=t("./make_color_scale_func")},{"./attributes":567,"./calc":568,"./default_scale":570,"./defaults":571,"./extract_scale":572,"./flip_scale":573,"./get_scale":574,"./has_colorscale":575,"./is_valid_scale":577,"./make_color_scale_func":579,"./scales":580}],577:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./is_valid_scale_array");e.exports=function(t){return void 0!==n[t]||i(t)}},{"./is_valid_scale_array":578,"./scales":580}],578:[function(t,e,r){"use strict";var n=t("tinycolor2");e.exports=function(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!==+t[0][0]||1!==+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var i=t[r];if(2!==i.length||+i[0]<e||!n(i[1]).isValid())return!1;e=+i[0]}return!0}},{tinycolor2:498}],579:[function(t,e,r){"use strict";function n(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return a(e).toRgbString()}var i=t("d3"),a=t("tinycolor2"),o=t("fast-isnumeric"),s=t("../color");e.exports=function(t,e){e=e||{};for(var r=t.domain,l=t.range,u=l.length,c=new Array(u),h=0;h<u;h++){var f=a(l[h]).toRgb();c[h]=[f.r,f.g,f.b,f.a]}var d,p=i.scale.linear().domain(r).range(c).clamp(!0),m=e.noNumericCheck,v=e.returnArray;return d=m&&v?p:m?function(t){return n(p(t))}:v?function(t){return o(t)?p(t):a(t).isValid()?t:s.defaultLine}:function(t){return o(t)?n(p(t)):a(t).isValid()?t:s.defaultLine},d.domain=p.domain,d.range=function(){return l},d}},{"../color":562,d3:97,"fast-isnumeric":106,tinycolor2:498}],580:[function(t,e,r){"use strict";e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],581:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:a<2/3-s?a:o>4/3-s?o:s}},{}],582:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":667}],583:[function(t,e,r){"use strict";function n(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function i(t){t._dragging=!1,t._replotPending&&a.plot(t)}var a=t("../../plotly"),o=t("../../lib"),s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){function e(e){return t.element.onmousemove=p,m._dragged=!1,m._dragging=!0,u=e.clientX,c=e.clientY,d=e.target,h=(new Date).getTime(),h-m._mouseDownTime<g?v+=1:(v=1,m._mouseDownTime=h),t.prepFn&&t.prepFn(e,u,c),f=n(),f.onmousemove=r,f.onmouseup=a,f.onmouseout=a,f.style.cursor=window.getComputedStyle(t.element).cursor,o.pauseEvent(e)}function r(e){var r=e.clientX-u,n=e.clientY-c,i=t.minDrag||s.MINDRAG;return Math.abs(r)<i&&(r=0),Math.abs(n)<i&&(n=0),(r||n)&&(m._dragged=!0,l.unhover(m)),t.moveFn&&t.moveFn(r,n,m._dragged),o.pauseEvent(e)}function a(e){if(p=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),f.onmousemove=null,f.onmouseup=null,f.onmouseout=null,o.removeElement(f),!m._dragging)return void(m._dragged=!1);if(m._dragging=!1,(new Date).getTime()-m._mouseDownTime>g&&(v=Math.max(v-1,1)),t.doneFn&&t.doneFn(m._dragged,v),!m._dragged){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),d.dispatchEvent(r)}return i(m),m._dragged=!1,o.pauseEvent(e)}var u,c,h,f,d,p,m=o.getPlotDiv(t.element)||{},v=1,g=s.DBLCLICKDELAY;m._mouseDownTime||(m._mouseDownTime=0),p=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"},l.coverSlip=n},{"../../lib":667,"../../plotly":701,"../../plots/cartesian/constants":711,"./align":581,"./cursor":582,"./unhover":584}],584:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=e.exports={};i.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),i.raw(t,e,r)},i.raw=function(t,e){var r=t._fullLayout;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),e.target&&t._hoverdata&&t.emit("plotly_unhover",{points:t._hoverdata}),t._hoverdata=void 0)}},{"../../lib/events":658}],585:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){if(s.traceIs(r,"symbols")){var u=p(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===a.size?3:d.isBubble(r)?u(t.ms):(a.size||6)/2,t.mrc=e;var n=m.symbolNumber(t.mx||a.symbol)||0,i=n%100;return t.om=n%200>=100,m.symbolFuncs[i](e)+(n>=200?y:"")}).style("opacity",function(t){return(t.mo+1||a.opacity+1)-1})}var c,h,f;t.so?(f=o.outlierwidth,h=o.outliercolor,c=a.outliercolor):(f=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,h="mlc"in t?t.mlcc=i(t.mlc):Array.isArray(o.color)?l.defaultLine:o.color,c="mc"in t?t.mcc=n(t.mc):Array.isArray(a.color)?l.defaultLine:a.color||"rgba(0,0,0,0)"),t.om?e.call(l.stroke,c).style({"stroke-width":(f||1)+"px",fill:"none"}):(e.style("stroke-width",f+"px").call(l.fill,c),f&&e.call(l.stroke,h))}function i(t,e,r,n){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(i*i+o*o,_/2),c=Math.pow(s*s+l*l,_/2),h=(c*c*i-u*u*s)*n,f=(c*c*o-u*u*l)*n,d=3*c*(u+c),p=3*u*(u+c);return[[a.round(e[0]+(d&&h/d),2),a.round(e[1]+(d&&f/d),2)],[a.round(e[0]-(p&&h/p),2),a.round(e[1]-(p&&f/p),2)]]}var a=t("d3"),o=t("fast-isnumeric"),s=t("../../registry"),l=t("../color"),u=t("../colorscale"),c=t("../../lib"),h=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../traces/scatter/subtypes"),p=t("../../traces/scatter/make_bubble_size_func"),m=e.exports={};m.font=function(t,e,r,n){e&&e.family&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(l.fill,n)},m.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},m.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},m.setRect=function(t,e,r,n,i){t.call(m.setPosition,e,r).call(m.setSize,n,i)},m.translatePoint=function(t,e,r,n){var i=t.xp||r.c2p(t.x),a=t.yp||n.c2p(t.y);o(i)&&o(a)&&e.node()?"text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"):e.remove(); },m.translatePoints=function(t,e,r,n){t.each(function(t){var i=a.select(this);m.translatePoint(t,i,e,r,n)})},m.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},m.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";l.stroke(e,n||a.color),m.dashLine(e,s,o)},m.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=n||i.dash||"";a.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)})},m.dashLine=function(t,e,r){r=+r||0;var n=Math.max(r,3);"solid"===e?e="":"dot"===e?e=n+"px,"+n+"px":"dash"===e?e=3*n+"px,"+3*n+"px":"longdash"===e?e=5*n+"px,"+5*n+"px":"dashdot"===e?e=3*n+"px,"+n+"px,"+n+"px,"+n+"px":"longdashdot"===e&&(e=5*n+"px,"+2*n+"px,"+n+"px,"+2*n+"px"),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},m.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=a.select(this);try{r.call(l.fill,e[0].trace.fillcolor)}catch(e){c.error(e,t),r.remove()}})};var v=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolList=[],Object.keys(v).forEach(function(t){var e=v[t];m.symbolList=m.symbolList.concat([e.n,t,e.n+100,t+"-open"]),m.symbolNames[e.n]=t,m.symbolFuncs[e.n]=e.f,e.needLine&&(m.symbolNeedLines[e.n]=!0),e.noDot?m.symbolNoDot[e.n]=!0:m.symbolList=m.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var g=m.symbolNames.length,y="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";m.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=m.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=g||t>=400?0:Math.floor(Math.max(t,0))},m.singlePointStyle=function(t,e,r){var i=r.marker,a=i.line,o=m.tryColorscale(i,""),s=m.tryColorscale(i,"line");n(t,e,r,o,s,i,a)},m.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=m.tryColorscale(r,""),i=m.tryColorscale(r,"line");t.each(function(t){m.singlePointStyle(t,a.select(this),e,n,i)})}},m.tryColorscale=function(t,e){var r=e?c.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?u.makeColorScaleFunc(u.extractScale(n,r.cmin,r.cmax)):c.identity};var b={start:1,end:-1,middle:0,bottom:1,top:-1},x=1.3;m.textPointStyle=function(t,e){t.each(function(t){var r=a.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var i=t.tp||e.textposition,s=i.indexOf("top")!==-1?"top":i.indexOf("bottom")!==-1?"bottom":"middle",l=i.indexOf("left")!==-1?"end":i.indexOf("right")!==-1?"start":"middle",u=t.ts||e.textfont.size,c=t.mrc?t.mrc/.8+1:0;u=o(u)&&u>0?u:0,r.call(m.font,t.tf||e.textfont.family,u,t.tc||e.textfont.color).attr("text-anchor",l).text(n).call(h.convertToTspans);var f=a.select(this.parentNode),d=r.selectAll("tspan.line"),p=((d[0].length||1)-1)*x+1,v=b[l]*c,g=.75*u+b[s]*c+(b[s]-1)*p*u/2;f.attr("transform","translate("+v+","+g+")"),p>1&&d.attr({x:r.attr("x"),y:r.attr("y")})})};var _=.5;m.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r<t.length-1;r++)a.push(i(t[r-1],t[r],t[r+1],e));for(n+="Q"+a[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+a[r-2][1]+" "+a[r-1][0]+" "+t[r];return n+="Q"+a[t.length-3][1]+" "+t[t.length-1]},m.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],a=t.length-1,o=[i(t[a],t[0],t[1],e)];for(r=1;r<a;r++)o.push(i(t[r-1],t[r],t[r+1],e));for(o.push(i(t[a-1],t[a],t[0],e)),r=1;r<=a;r++)n+="C"+o[r-1][1]+" "+o[r][0]+" "+t[r];return n+="C"+o[a][1]+" "+o[0][0]+" "+t[0]+"Z"};var w={hv:function(t,e){return"H"+a.round(e[0],2)+"V"+a.round(e[1],2)},vh:function(t,e){return"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},hvh:function(t,e){return"H"+a.round((t[0]+e[0])/2,2)+"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},vhv:function(t,e){return"V"+a.round((t[1]+e[1])/2,2)+"H"+a.round(e[0],2)+"V"+a.round(e[1],2)}},M=function(t,e){return"L"+a.round(e[0],2)+","+a.round(e[1],2)};m.steps=function(t){var e=w[t]||M;return function(t){for(var r="M"+a.round(t[0][0],2)+","+a.round(t[0][1],2),n=1;n<t.length;n++)r+=e(t[n-1],t[n]);return r}},m.makeTester=function(t){var e=a.select("body").selectAll("#js-plotly-tester").data([0]);e.enter().append("svg").attr("id","js-plotly-tester").attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"});var r=e.selectAll(".js-reference-point").data([0]);r.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),e.node()._cache||(e.node()._cache={}),t._tester=e,t._testref=r};var A=[],k=1e4;m.bBox=function(t){var e=t.attributes["data-bb"];if(e&&e.value)return c.extendFlat({},A[e.value]);var r=a.select("#js-plotly-tester"),n=r.node(),i=t.cloneNode(!0);n.appendChild(i),a.select(i).attr({x:0,y:0,transform:""});var o=i.getBoundingClientRect(),s=r.select(".js-reference-point").node().getBoundingClientRect();n.removeChild(i);var l={height:o.height,width:o.width,left:o.left-s.left,top:o.top-s.top,right:o.right-s.left,bottom:o.bottom-s.top};return A.length>=k&&(a.selectAll("[data-bb]").attr("data-bb",null),A=[]),t.setAttribute("data-bb",A.length),A.push(l),c.extendFlat({},l)},m.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=a.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")},m.getTranslate=function(t){var e=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",n=t[r]("transform")||"",i=n.replace(e,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+i[0]||0,y:+i[1]||0}},m.setTranslate=function(t,e,r){var n=/(\btranslate\(.*?\);?)/,i=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[i]("transform")||"";return e=e||0,r=r||0,o=o.replace(n,"").trim(),o+=" translate("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},m.getScale=function(t){var e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",n=t[r]("transform")||"",i=n.replace(e,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+i[0]||1,y:+i[1]||1}},m.setScale=function(t,e,r){var n=/(\bscale\(.*?\);?)/,i=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[i]("transform")||"";return e=e||1,r=r||1,o=o.replace(n,"").trim(),o+=" scale("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},m.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n+=i,n=n.trim(),this.setAttribute("transform",n)}),i}},{"../../constants/xmlns_namespaces":651,"../../lib":667,"../../lib/svg_text_utils":686,"../../registry":781,"../../traces/scatter/make_bubble_size_func":926,"../../traces/scatter/subtypes":931,"../color":562,"../colorscale":576,"./symbol_defs":586,d3:97,"fast-isnumeric":106}],586:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+","+r+"H"+e+"L0,-"+i+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+e+",-"+r+"H"+e+"L0,"+i+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M"+r+",-"+e+"V"+e+"L-"+i+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2),r=n.round(t/2,2),i=n.round(t,2);return"M-"+r+",-"+e+"V"+e+"L"+i+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(t*-.309,2),o=n.round(.809*t,2);return"M"+e+","+a+"L"+r+","+o+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(e*-.309,2),u=n.round(.118*e,2),c=n.round(.809*e,2),h=n.round(.382*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+h+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:97}],587:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],588:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=a.visible&&["linear","log"].indexOf(r.type)!==-1,u=[];if(l){for(var c=s(a),h=0;h<t.length;h++){var f=t[h],d=f[n];if(i(r.c2l(d))){var p=c(d,h);if(i(p[0])&&i(p[1])){var m=f[n+"s"]=d-p[0],v=f[n+"h"]=d+p[1];u.push(m,v)}}}o.expand(r,u,{padded:!0})}}var i=t("fast-isnumeric"),a=t("../../registry"),o=t("../../plots/cartesian/axes"),s=t("./compute_error");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var i=e[r],s=i[0].trace;if(a.traceIs(s,"errorBarsOK")){var l=o.getFromId(t,s.xaxis),u=o.getFromId(t,s.yaxis);n(i,s,l,"x"),n(i,s,u,"y")}}}},{"../../plots/cartesian/axes":706,"../../registry":781,"./compute_error":589,"fast-isnumeric":106}],589:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var i=t.array,a=t.arrayminus;return r||void 0===a?function(t,e){var r=+i[e];return[r,r]}:function(t,e){return[+a[e],+i[e]]}}var o=n(e,t.value),s=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[s(t),o(t)]}}},{}],590:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../lib"),o=t("./attributes");e.exports=function(t,e,r,s){function l(t,e){return a.coerce(h,c,o,t,e)}var u="error_"+s.axis,c=e[u]={},h=t[u]||{},f=void 0!==h.array||void 0!==h.value||"sqrt"===h.type,d=l("visible",f);if(d!==!1){var p=l("type","array"in h?"data":"percent"),m=!0;if("sqrt"!==p&&(m=l("symmetric",!(("data"===p?"arrayminus":"valueminus")in h))),"data"===p){var v=l("array");if(v||(c.array=[]),l("traceref"),!m){var g=l("arrayminus");g||(c.arrayminus=[]),l("tracerefminus")}}else"percent"!==p&&"constant"!==p||(l("value"),m||l("valueminus"));var y="copy_"+s.inherit+"style";if(s.inherit){var b=e["error_"+s.inherit];(b||{}).visible&&l(y,!(h.color||n(h.thickness)||n(h.width)))}s.inherit&&c[y]||(l("color",r),l("thickness"),l("width",i.traceIs(e,"gl3d")?0:4))}}},{"../../lib":667,"../../registry":781,"./attributes":587,"fast-isnumeric":106}],591:[function(t,e,r){"use strict";var n=e.exports={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.calcFromTrace=function(t,e){for(var r=t.x||[],i=t.y,a=r.length||i.length,o=new Array(a),s=0;s<a;s++)o[s]={x:r[s],y:i[s]};return o[0].trace=t,n.calc({calcdata:[o],_fullLayout:e}),o},n.plot=t("./plot"),n.style=t("./style"),n.hoverInfo=function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"./attributes":587,"./calc":588,"./defaults":590,"./plot":592,"./style":593}],592:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var i=t("d3"),a=t("fast-isnumeric"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r){var s,l=e.xaxis,u=e.yaxis,c=r&&r.duration>0;t.each(function(t){var e,h=t[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(e=function(t){return t.id});var p=o.hasMarkers(h)&&h.marker.maxdisplayed>0;if(d.visible||f.visible){var m=i.select(this).selectAll("g.errorbar").data(t,e);m.exit().remove(),m.style("opacity",1);var v=m.enter().append("g").classed("errorbar",!0);c&&v.style("opacity",0).transition().duration(r.duration).style("opacity",1),m.each(function(t){var e=i.select(this),o=n(t,l,u);if(!p||t.vis){var h;if(d.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var m=d.width;h="M"+(o.x-m)+","+o.yh+"h"+2*m+"m-"+m+",0V"+o.ys,o.noYS||(h+="m-"+m+",0h"+2*m);var v=e.select("path.yerror");s=!v.size(),s?v=e.append("path").classed("yerror",!0):c&&(v=v.transition().duration(r.duration).ease(r.easing)),v.attr("d",h)}if(f.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var g=(f.copy_ystyle?d:f).width;h="M"+o.xh+","+(o.y-g)+"v"+2*g+"m0,-"+g+"H"+o.xs,o.noXS||(h+="m0,-"+g+"v"+2*g);var y=e.select("path.xerror");s=!y.size(),s?y=e.append("path").classed("xerror",!0):c&&(y=y.transition().duration(r.duration).ease(r.easing)),y.attr("d",h)}}})}})}},{"../../traces/scatter/subtypes":931,d3:97,"fast-isnumeric":106}],593:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":562,d3:97}],594:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"image",visible:{valType:"boolean",dflt:!0},source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"any",dflt:0},y:{valType:"any",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":711}],595:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib/to_log_range");e.exports=function(t,e,r,a){var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.images,h=e._id.charAt(0),f=0;f<c.length;f++)if(l=c[f],u="images["+f+"].",l[h+"ref"]===e._id){var d=l[h],p=l["size"+h],m=null,v=null;if(o){m=i(d,e.range);var g=p/Math.pow(10,m)/2;v=2*Math.log(g+Math.sqrt(1+g*g))/Math.LN10}else m=Math.pow(10,d),v=m*(Math.pow(10,p/2)-Math.pow(10,-p/2));n(m)?n(v)||(v=null):(m=null,v=null),a(u+h,m),a(u+"size"+h,v)}}},{"../../lib/to_log_range":687,"fast-isnumeric":106}],596:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,s,r,n)}var o=n("source"),l=n("visible",!!o);if(!l)return e;n("layer"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var u={_fullLayout:r},c=["x","y"],h=0;h<2;h++){var f=c[h],d=a.coerceRef(t,e,u,f,"paper");a.coercePosition(e,u,n,d,f,0)}return e}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l="images";e.exports=function(t,e){var r={name:l,handleItemDefaults:n};o(t,e,r)}},{"../../lib":667,"../../plots/array_container_defaults":703,"../../plots/cartesian/axes":706,"./attributes":594}],597:[function(t,e,r){"use strict";var n=t("d3"),i=t("../drawing"),a=t("../../plots/cartesian/axes"),o=t("../../constants/xmlns_namespaces");e.exports=function(t){function e(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",o.svg);var i=new Promise(function(t){function n(){r.remove(),t()}var i=new Image;this.img=i,i.setAttribute("crossOrigin","anonymous"),i.onerror=n,i.onload=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height;var e=t.getContext("2d");e.drawImage(this,0,0);var n=t.toDataURL("image/png");r.attr("xlink:href",n)},r.on("error",n),r.on("load",t),i.src=e.source}.bind(this));t._promises.push(i)}}function r(e){var r=n.select(this),o=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),u=s._size,c=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*u.w,h=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*u.h,f=c*d.x[e.xanchor].offset,p=h*d.y[e.yanchor].offset,m=d.x[e.xanchor].sizing+d.y[e.yanchor].sizing,v=(o?o.r2p(e.x)+o._offset:e.x*u.w+u.l)+f,g=(l?l.r2p(e.y)+l._offset:u.h-e.y*u.h+u.t)+p;switch(e.sizing){case"fill":m+=" slice";break;case"stretch":m="none"}r.attr({x:v,y:g,width:c,height:h,preserveAspectRatio:m,opacity:e.opacity});var y=o?o._id:"",b=l?l._id:"",x=y+b;x&&r.call(i.setClipUrl,"clip"+s._uid+x)}for(var s=t._fullLayout,l=[],u=[],c=[],h=0;h<s.images.length;h++){var f=s.images[h];f.visible&&("below"===f.layer&&"paper"!==f.xref&&"paper"!==f.yref?u.push(f):"above"===f.layer?l.push(f):c.push(f))}var d={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}}},p=s._imageLowerLayer.selectAll("image").data(c),m=s._imageSubplotLayer.selectAll("image").data(u),v=s._imageUpperLayer.selectAll("image").data(l);p.enter().append("image"),m.enter().append("image"),v.enter().append("image"),p.exit().remove(),m.exit().remove(),v.exit().remove(),p.each(function(t){e.bind(this)(t),r.bind(this)(t)}),m.each(function(t){e.bind(this)(t),r.bind(this)(t)}),v.each(function(t){e.bind(this)(t),r.bind(this)(t)})}},{"../../constants/xmlns_namespaces":651,"../../plots/cartesian/axes":706,"../drawing":585,d3:97}],598:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"./attributes":594,"./convert_coords":595,"./defaults":596,"./draw":597}],599:[function(t,e,r){"use strict";r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],600:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:a({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":659,"../../plots/font_attributes":726,"../color/attributes":561}],601:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],602:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var u,c,h,f,d=t.legend||{},p=e.legend={},m=0,v="normal",g=0;g<r.length;g++){var y=r[g];s.legendGetsTrace(y)&&(m++,n.traceIs(y,"pie")&&m++),(n.traceIs(y,"bar")&&"stack"===e.barmode||["tonextx","tonexty"].indexOf(y.fill)!==-1)&&(v=s.isGrouped({traceorder:v})?"grouped+reversed":"reversed"),void 0!==y.legendgroup&&""!==y.legendgroup&&(v=s.isReversed({traceorder:v})?"reversed+grouped":"grouped")}var b=i.coerce(t,e,o,"showlegend",m>1);if(b!==!1){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(u=0,h="left",c=1.1,f="bottom"):(u=0,h="left",c=-.1,f="top")}l("traceorder",v),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",u),l("xanchor",h),l("y",c),l("yanchor",f),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":667,"../../plots/layout_attributes":757,"../../registry":781,"./attributes":600,"./helpers":605}],603:[function(t,e,r){"use strict";function n(t,e){function r(r){g.convertToTspans(r,function(){r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(a,e)})}var n=t.data()[0][0],i=e._fullLayout,o=n.trace,s=d.traceIs(o,"pie"),l=o.index,u=s?n.label:o.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr({x:40,y:0,"data-unformatted":u}).style("text-anchor","start").classed("user-select-none",!0).call(m.font,i.legend.font).text(u),e._context.editable&&!s?h.call(g.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t=" ");var i,a=n.trace._fullInput||{};if(["ohlc","candlestick"].indexOf(a.type)!==-1){var o=n.trace.transforms,s=o[o.length-1].direction;i=s+".name"}else i="name";c.restyle(e,i,t,l)}):h.call(r)}function i(t,e){var r=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(v.fill,"rgba(0,0,0,0)"),n.on("click",function(){if(!e._dragged){var n,i,a=t.data()[0][0],o=e._fullData,s=a.trace,l=s.legendgroup,u=[];if(d.traceIs(s,"pie")){var h=a.label,f=r.indexOf(h);f===-1?r.push(h):r.splice(f,1),c.relayout(e,"hiddenlabels",r)}else{if(""===l)u=[s.index];else for(var p=0;p<o.length;p++)n=o[p],n.legendgroup===l&&u.push(n.index);i=s.visible!==!0||"legendonly",c.restyle(e,"visible",i,u)}}})}function a(t,e){var r,n,i=t.data()[0][0],a=t.select("g[class*=math-group]"),o=e._fullLayout.legend,s=1.3*o.font.size;if(!i.trace.showlegend)return void t.remove();if(a.node()){var l=m.bBox(a.node());r=l.height,n=l.width,m.setTranslate(a,0,r/4)}else{var u=t.selectAll(".legendtext"),c=t.selectAll(".legendtext>tspan"),h=c[0].length||1;r=s*h,n=u.node()&&m.bBox(u.node()).width;var f=s*(.3+(1-h)/2);u.attr("y",f),c.attr("y",f)}r=Math.max(r,16)+3,i.height=r,i.width=n}function o(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=_.isGrouped(i);if(_.isVertical(i))o&&e.each(function(t,e){m.setTranslate(this,0,e*i.tracegroupgap)}),i.width=0,i.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;m.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0],n=u.select(this).select(".legendtoggle");n.call(m.setRect,0,-r.height/2,(t._context.editable?0:i.width)+40,r.height)});else if(o){i.width=0,i.height=0;for(var s=[i.width],l=e.data(),c=0,h=l.length;c<h;c++){var f=l[c].map(function(t){return t[0].width}),d=40+Math.max.apply(null,f);i.width+=i.tracegroupgap+d,s.push(i.width)}e.each(function(t,e){m.setTranslate(this,s[e],0)}),e.each(function(){var t=u.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;m.setTranslate(this,0,5+a+r+n/2),r+=n}),i.height=Math.max(i.height,r)}),i.height+=10+2*a,i.width+=2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0],n=u.select(this).select(".legendtoggle");n.call(m.setRect,0,-r.height/2,t._context.editable?0:i.width,r.height)})}else{i.width=0,i.height=0;var p=0,v=0,g=0,y=0;r.each(function(t){g=Math.max(40+t[0].width,g)}),r.each(function(t){var e=t[0],r=g,o=i.tracegroupgap||5;a+y+o+r>n.width-(n.margin.r+n.margin.l)&&(y=0,p+=v,i.height=i.height+v,v=0),m.setTranslate(this,a+y,5+a+e.height/2+p),i.width+=o+r,i.height=Math.max(i.height,e.height),y+=o+r,v=Math.max(e.height,v)}),i.width+=2*a,i.height+=10+2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0],n=u.select(this).select(".legendtoggle");n.call(m.setRect,0,-r.height/2,t._context.editable?0:i.width,r.height)})}}function s(t){var e=t._fullLayout,r=e.legend,n="left";w.isRightAnchor(r)?n="right":w.isCenterAnchor(r)&&(n="center");var i="top";w.isBottomAnchor(r)?i="bottom":w.isMiddleAnchor(r)&&(i="middle"),f.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[i]||0),t:r.height*({bottom:1,middle:.5}[i]||0)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";w.isRightAnchor(r)?n="right":w.isCenterAnchor(r)&&(n="center"),f.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var u=t("d3"),c=t("../../plotly"),h=t("../../lib"),f=t("../../plots/plots"),d=t("../../registry"),p=t("../dragelement"),m=t("../drawing"),v=t("../color"),g=t("../../lib/svg_text_utils"),y=t("./constants"),b=t("./get_legend_data"),x=t("./style"),_=t("./helpers"),w=t("./anchor_utils");e.exports=function(t){function e(t,e){S.attr("data-scroll",e).call(m.setTranslate,0,e),E.call(m.setRect,N,t,y.scrollBarWidth,y.scrollBarHeight),k.select("rect").attr({y:g.borderwidth-e})}var r=t._fullLayout,a="legend"+r._uid;if(r._infolayer&&t.calcdata){var g=r.legend,_=r.showlegend&&b(t.calcdata,g),M=r.hiddenlabels||[];if(!r.showlegend||!_.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+a).remove(),void f.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var k=r._topdefs.selectAll("#"+a).data([0]);k.enter().append("clipPath").attr("id",a).append("rect");var T=A.selectAll("rect.bg").data([0]);T.enter().append("rect").attr({class:"bg", "shape-rendering":"crispEdges"}),T.call(v.stroke,g.bordercolor),T.call(v.fill,g.bgcolor),T.style("stroke-width",g.borderwidth+"px");var S=A.selectAll("g.scrollbox").data([0]);S.enter().append("g").attr("class","scrollbox");var E=A.selectAll("rect.scrollbar").data([0]);E.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(v.fill,"#808BA4");var L=S.selectAll("g.groups").data(_);L.enter().append("g").attr("class","groups"),L.exit().remove();var C=L.selectAll("g.traces").data(h.identity);C.enter().append("g").attr("class","traces"),C.exit().remove(),C.call(x).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?M.indexOf(t[0].label)!==-1?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(i,t)});var D=0!==A.enter().size();D&&(o(t,L,C),s(t));var z=0,I=r.width,P=0,O=r.height;o(t,L,C),g.height>O?l(t):s(t);var R=r._size,j=R.l+R.w*g.x,F=R.t+R.h*(1-g.y);w.isRightAnchor(g)?j-=g.width:w.isCenterAnchor(g)&&(j-=g.width/2),w.isBottomAnchor(g)?F-=g.height:w.isMiddleAnchor(g)&&(F-=g.height/2);var N=g.width,B=R.w;N>B?(j=R.l,N=B):(j+N>I&&(j=I-N),j<z&&(j=z),N=Math.min(I-j,g.width));var U=g.height,V=R.h;U>V?(F=R.t,U=V):(F+U>O&&(F=O-U),F<P&&(F=P),U=Math.min(O-F,g.height)),m.setTranslate(A,j,F);var H,q,Y=U-y.scrollBarHeight-2*y.scrollBarMargin,G=g.height-U;if(g.height<=U||t._context.staticPlot)T.attr({width:N-g.borderwidth,height:U-g.borderwidth,x:g.borderwidth/2,y:g.borderwidth/2}),m.setTranslate(S,0,0),k.select("rect").attr({width:N-2*g.borderwidth,height:U-2*g.borderwidth,x:g.borderwidth,y:g.borderwidth}),S.call(m.setClipUrl,a);else{H=y.scrollBarMargin,q=S.attr("data-scroll")||0,T.attr({width:N-2*g.borderwidth+y.scrollBarWidth+y.scrollBarMargin,height:U-g.borderwidth,x:g.borderwidth/2,y:g.borderwidth/2}),k.select("rect").attr({width:N-2*g.borderwidth+y.scrollBarWidth+y.scrollBarMargin,height:U-2*g.borderwidth,x:g.borderwidth,y:g.borderwidth-q}),S.call(m.setClipUrl,a),D&&e(H,q),A.on("wheel",null),A.on("wheel",function(){q=h.constrain(S.attr("data-scroll")-u.event.deltaY/Y*G,-G,0),H=y.scrollBarMargin-q/G*Y,e(H,q),u.event.preventDefault()}),E.on(".drag",null),S.on(".drag",null);var W=u.behavior.drag().on("drag",function(){H=h.constrain(u.event.y-y.scrollBarHeight/2,y.scrollBarMargin,y.scrollBarMargin+Y),q=-(H-y.scrollBarMargin)/Y*G,e(H,q)});E.call(W),S.call(W)}if(t._context.editable){var X,Z,J,Q;A.classed("cursor-move",!0),p.init({element:A.node(),prepFn:function(){var t=m.getTranslate(A);J=t.x,Q=t.y},moveFn:function(t,e){var r=J+t,n=Q+e;m.setTranslate(A,r,n),X=p.align(r,0,R.l,R.l+R.w,g.xanchor),Z=p.align(n,0,R.t+R.h,R.t,g.yanchor)},doneFn:function(e){e&&void 0!==X&&void 0!==Z&&c.relayout(t,{"legend.x":X,"legend.y":Z})}})}}}},{"../../lib":667,"../../lib/svg_text_utils":686,"../../plotly":701,"../../plots/plots":766,"../../registry":781,"../color":562,"../dragelement":583,"../drawing":585,"./anchor_utils":599,"./constants":601,"./get_legend_data":604,"./helpers":605,"./style":607,d3:97}],604:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))l.indexOf(t)===-1?(l.push(t),u=!0,s[t]=r):s[t].push([r]);else{var n="~~i"+h;l.push(n),s[n]=r,h++}}var a,o,s={},l=[],u=!1,c={},h=0;for(a=0;a<t.length;a++){var f=t[a],d=f[0],p=d.trace,m=p.legendgroup;if(i.legendGetsTrace(p)&&p.showlegend)if(n.traceIs(p,"pie"))for(c[m]||(c[m]={}),o=0;o<f.length;o++){var v=f[o].label;c[m][v]||(r(m,{label:v,color:f[o].color,i:f[o].i,trace:p}),c[m][v]=!0)}else r(m,d)}if(!l.length)return[];var g,y,b=l.length;if(u&&i.isGrouped(e))for(y=new Array(b),a=0;a<b;a++)g=s[l[a]],y[a]=i.isReversed(e)?g.reverse():g;else{for(y=[new Array(b)],a=0;a<b;a++)g=s[l[a]][0],y[0][i.isReversed(e)?b-a-1:a]=g;b=1}return e._lgroupsLength=b,y}},{"../../registry":781,"./helpers":605}],605:[function(t,e,r){"use strict";var n=t("../../registry");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return(t.traceorder||"").indexOf("grouped")!==-1},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return(t.traceorder||"").indexOf("reversed")!==-1}},{"../../registry":781}],606:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":600,"./defaults":602,"./draw":603,"./style":607}],607:[function(t,e,r){"use strict";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=d.hasLines(e),i=l.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(h.fillGroupStyle);var a=l.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);a.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),a.exit().remove(),a.call(h.lineGroupStyle)}function i(t){function e(t,e,r){var n=c.nestedProperty(o,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(i<r[0])return r[0];if(i>r[1])return r[1]}return i}function r(t){return t[0]}var n,i,a=t[0],o=a.trace,s=d.hasMarkers(o),u=d.hasText(o),f=d.hasLines(o);if(s||u||f){var p={},m={};s&&(p.mc=e("marker.color",r),p.mo=e("marker.opacity",c.mean,[.2,1]),p.ms=e("marker.size",c.mean,[2,16]),p.mlc=e("marker.line.color",r),p.mlw=e("marker.line.width",c.mean,[0,5]),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),f&&(m.line={width:e("line.width",r,[0,10])}),u&&(p.tx="Aa",p.tp=e("textposition",r),p.ts=10,p.tc=e("textfont.color",r),p.tf=e("textfont.family",r)),n=[c.minExtend(a,p)],i=c.minExtend(o,m)}var v=l.select(this).select("g.legendpoints"),g=v.selectAll("path.scatterpts").data(s?n:[]);g.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),g.exit().remove(),g.call(h.pointStyle,i),s&&(n[0].mrc=3);var y=v.selectAll("g.pointtext").data(u?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(h.textPointStyle,i)}function a(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=l.select(this).select("g.legendpoints").selectAll("path.legendbar").data(u.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=l.select(this),i=t[0],a=(i.mlw+1||n.width+1)-1;e.style("stroke-width",a+"px").call(f.fill,i.mc||r.color),a&&e.call(f.stroke,i.mlc||n.color)})}function o(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendbox").data(u.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=l.select(this);r.style("stroke-width",t+"px").call(f.fill,e.fillcolor),t&&r.call(f.stroke,e.line.color)})}function s(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendpie").data(u.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(p,t[0],e)}var l=t("d3"),u=t("../../registry"),c=t("../../lib"),h=t("../drawing"),f=t("../color"),d=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=l.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity);var n=r.selectAll("g.legendfill").data([t]);n.enter().append("g").classed("legendfill",!0);var i=r.selectAll("g.legendlines").data([t]);i.enter().append("g").classed("legendlines",!0);var a=r.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(a).each(o).each(s).each(n).each(i)}},{"../../lib":667,"../../registry":781,"../../traces/pie/style_one":905,"../../traces/scatter/subtypes":931,"../color":562,"../drawing":585,d3:97}],608:[function(t,e,r){"use strict";function n(t,e){var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o={};if("zoom"===n){for(var s,l,c="in"===i?.5:2,f=(1+c)/2,d=(1-c)/2,p=h.list(t,null,!0),m=0;m<p.length;m++)if(s=p[m],!s.fixedrange)if(l=s._name,"auto"===i)o[l+".autorange"]=!0;else if("reset"===i)if(void 0===s._rangeInitial)o[l+".autorange"]=!0;else{var v=s._rangeInitial.slice();o[l+".range[0]"]=v[0],o[l+".range[1]"]=v[1]}else{var g=[s.r2l(s.range[0]),s.r2l(s.range[1])],y=[f*g[0]+d*g[1],f*g[1]+d*g[0]];o[l+".range[0]"]=s.l2r(y[0]),o[l+".range[1]"]=s.l2r(y[1])}}else"hovermode"!==n||"x"!==i&&"y"!==i||(i=a._isHoriz?"y":"x",r.setAttribute("data-val",i)),o[n]=i;u.relayout(t,o)}function i(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o=c.getSubplotIds(a,"gl3d"),s={},l=n.split("."),h=0;h<o.length;h++)s[o[h]+"."+l[1]]=i;u.relayout(t,s)}function a(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=t._fullLayout,a=c.getSubplotIds(i,"gl3d"),o={},s=0;s<a.length;s++){var l=a[s],h=l+".camera",d=i[l]._scene;"resetDefault"===n?o[h]=null:"resetLastSave"===n&&(o[h]=f.extendDeep({},d.cameraInitial))}u.relayout(t,o)}function o(t,e){var r=e.currentTarget,n=r._previousVal||!1,i=t.layout,a=t._fullLayout,o=c.getSubplotIds(a,"gl3d"),s=["xaxis","yaxis","zaxis"],l=["showspikes","spikesides","spikethickness","spikecolor"],h={},d={},p={};if(n)p=f.extendDeep(i,n),r._previousVal=null;else{p={"allaxes.showspikes":!1};for(var m=0;m<o.length;m++){var v=o[m],g=a[v],y=h[v]={};y.hovermode=g.hovermode,p[v+".hovermode"]=!1;for(var b=0;b<3;b++){var x=s[b];d=y[x]={};for(var _=0;_<l.length;_++){var w=l[_];d[w]=g[x][w]}}}r._previousVal=f.extendDeep({},h)}u.relayout(t,p)}function s(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o=c.getSubplotIds(a,"geo"),s=0;s<o.length;s++){var l=a[o[s]]._subplot;if("zoom"===n){var u=l.projection.scale(),h="in"===i?2*u:.5*u;l.projection.scale(h),l.zoom.scale(h),l.render()}else"reset"===n&&l.zoomReset()}}function l(t){var e,r=t._fullLayout;e=r._has("cartesian")?r._isHoriz?"y":"x":"closest";var n=!t._fullLayout.hovermode&&e;u.relayout(t,"hovermode",n)}var u=t("../../plotly"),c=t("../../plots/plots"),h=t("../../plots/cartesian/axes"),f=t("../../lib"),d=t("../../snapshot/download"),p=t("../../../build/ploticon"),m=e.exports={};m.toImage={name:"toImage",title:"Download plot as a png",icon:p.camera,click:function(t){var e="png";f.notifier("Taking snapshot - this may take a few seconds","long"),f.isIE()&&(f.notifier("IE only supports svg. Changing format to svg.","long"),e="svg"),d(t,{format:e}).then(function(t){f.notifier("Snapshot succeeded - "+t,"long")}).catch(function(){f.notifier("Sorry there was a problem downloading your snapshot!","long")})}},m.sendDataToCloud={name:"sendDataToCloud",title:"Save and edit plot in cloud",icon:p.disk,click:function(t){c.sendDataToCloud(t)}},m.zoom2d={name:"zoom2d",title:"Zoom",attr:"dragmode",val:"zoom",icon:p.zoombox,click:n},m.pan2d={name:"pan2d",title:"Pan",attr:"dragmode",val:"pan",icon:p.pan,click:n},m.select2d={name:"select2d",title:"Box Select",attr:"dragmode",val:"select",icon:p.selectbox,click:n},m.lasso2d={name:"lasso2d",title:"Lasso Select",attr:"dragmode",val:"lasso",icon:p.lasso,click:n},m.zoomIn2d={name:"zoomIn2d",title:"Zoom in",attr:"zoom",val:"in",icon:p.zoom_plus,click:n},m.zoomOut2d={name:"zoomOut2d",title:"Zoom out",attr:"zoom",val:"out",icon:p.zoom_minus,click:n},m.autoScale2d={name:"autoScale2d",title:"Autoscale",attr:"zoom",val:"auto",icon:p.autoscale,click:n},m.resetScale2d={name:"resetScale2d",title:"Reset axes",attr:"zoom",val:"reset",icon:p.home,click:n},m.hoverClosestCartesian={name:"hoverClosestCartesian",title:"Show closest data on hover",attr:"hovermode",val:"closest",icon:p.tooltip_basic,gravity:"ne",click:n},m.hoverCompareCartesian={name:"hoverCompareCartesian",title:"Compare data on hover",attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:p.tooltip_compare,gravity:"ne",click:n},m.zoom3d={name:"zoom3d",title:"Zoom",attr:"scene.dragmode",val:"zoom",icon:p.zoombox,click:i},m.pan3d={name:"pan3d",title:"Pan",attr:"scene.dragmode",val:"pan",icon:p.pan,click:i},m.orbitRotation={name:"orbitRotation",title:"orbital rotation",attr:"scene.dragmode",val:"orbit",icon:p["3d_rotate"],click:i},m.tableRotation={name:"tableRotation",title:"turntable rotation",attr:"scene.dragmode",val:"turntable",icon:p["z-axis"],click:i},m.resetCameraDefault3d={name:"resetCameraDefault3d",title:"Reset camera to default",attr:"resetDefault",icon:p.home,click:a},m.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:"Reset camera to last save",attr:"resetLastSave",icon:p.movie,click:a},m.hoverClosest3d={name:"hoverClosest3d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:p.tooltip_basic,gravity:"ne",click:o},m.zoomInGeo={name:"zoomInGeo",title:"Zoom in",attr:"zoom",val:"in",icon:p.zoom_plus,click:s},m.zoomOutGeo={name:"zoomOutGeo",title:"Zoom out",attr:"zoom",val:"out",icon:p.zoom_minus,click:s},m.resetGeo={name:"resetGeo",title:"Reset",attr:"reset",val:null,icon:p.autoscale,click:s},m.hoverClosestGeo={name:"hoverClosestGeo",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:p.tooltip_basic,gravity:"ne",click:l},m.hoverClosestGl2d={name:"hoverClosestGl2d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:p.tooltip_basic,gravity:"ne",click:l},m.hoverClosestPie={name:"hoverClosestPie",title:"Toggle show closest data on hover",attr:"hovermode",val:"closest",icon:p.tooltip_basic,gravity:"ne",click:l},m.toggleHover={name:"toggleHover",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:p.tooltip_basic,gravity:"ne",click:function(t,e){l(t),o(t,e)}},m.resetViews={name:"resetViews",title:"Reset views",icon:p.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),n(t,e),r.setAttribute("data-attr","resetLastSave"),a(t,e)}}},{"../../../build/ploticon":2,"../../lib":667,"../../plotly":701,"../../plots/cartesian/axes":706,"../../plots/plots":766,"../../snapshot/download":783}],609:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":610}],610:[function(t,e,r){"use strict";function n(t,e,r){function n(t){for(var r=[],n=0;n<t.length;n++){var i=t[n];e.indexOf(i)===-1&&r.push(h[i])}v.push(r)}var s=t._fullLayout,l=t._fullData,u=s._has("cartesian"),c=s._has("gl3d"),f=s._has("geo"),d=s._has("pie"),p=s._has("gl2d"),m=s._has("ternary"),v=[];if(n(["toImage","sendDataToCloud"]),(u||p||d||m)+f+c>1)return n(["resetViews","toggleHover"]),o(v,r);c&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var g=i(s),y=[];return((u||p)&&!g||m)&&(y=["zoom2d","pan2d"]),(u||m)&&a(l)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!u&&!p||g||m||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):u?n(["hoverClosestCartesian","hoverCompareCartesian"]):d&&n(["hoverClosestPie"]),o(v,r)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),r=!0,n=0;n<e.length;n++)if(!e[n].fixedrange){r=!1;break}return r}function a(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&("scatter"===n.type||"scatterternary"===n.type?(u.hasMarkers(n)||u.hasText(n))&&(e=!0):e=!0)}return e}function o(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}function s(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var i=r[n];if("string"==typeof i){if(void 0===h[i])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=h[i]}}return t}var l=t("../../plots/cartesian/axes"),u=t("../../traces/scatter/subtypes"),c=t("./modebar"),h=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,i=e._modeBar;if(!r.displayModeBar)return void(i&&(i.destroy(),delete e._modeBar));if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var a,o=r.modeBarButtons;a=Array.isArray(o)&&o.length?s(o):n(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),i?i.update(t,a):e._modeBar=c(t,a)}},{"../../plots/cartesian/axes":706,"../../traces/scatter/subtypes":931,"./buttons":608,"./modebar":611}],611:[function(t,e,r){"use strict";function n(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}function i(t,e){var r=t._fullLayout,i=new n({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&a.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}var a=t("d3"),o=t("../../lib"),s=t("../../../build/ploticon"),l=n.prototype;l.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context;"hover"===r.displayModeBar?this.element.className="modebar modebar--hover":this.element.className="modebar";var n=!this.hasButtons(e),i=this.hasLogo!==r.displaylogo;(n||i)&&(this.removeAllButtons(),this.updateButtons(e),r.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},l.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(e.buttonsNames.indexOf(n)!==-1)throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var i=e.createButton(t);e.buttonElements.push(i),r.appendChild(i)}),e.element.appendChild(r)})},l.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},l.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var n=t.title;void 0===n&&(n=t.name),(n||0===n)&&r.setAttribute("data-title",n),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var i=t.val;void 0!==i&&("function"==typeof i&&(i=i(this.graphInfo)),r.setAttribute("data-val",i));var o=t.click;if("function"!=typeof o)throw new Error("must provide button 'click' function in button config");return r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&a.select(r).classed("active",!0),r.appendChild(this.createIcon(t.icon||s.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},l.createIcon=function(t){var e=t.ascent-t.descent,r="http://www.w3.org/2000/svg",n=document.createElementNS(r,"svg"),i=document.createElementNS(r,"path");return n.setAttribute("height","1em"),n.setAttribute("width",t.width/e+"em"),n.setAttribute("viewBox",[0,0,t.width,e].join(" ")),i.setAttribute("d",t.path),i.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),n.appendChild(i),n},l.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var n=t.getAttribute("data-val")||!0,i=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=a.select(t);if(s)i===r&&l.classed("active",!l.classed("active"));else{var u=null===i?i:o.nestedProperty(e,i).get();l.classed("active",u===n)}})},l.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},l.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title","Produced with Plotly"),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(s.plotlylogo)),t.appendChild(e),t},l.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},l.destroy=function(){o.removeElement(this.container.querySelector(".modebar"))},e.exports=i},{"../../../build/ploticon":2,"../../lib":667,d3:97}],612:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("./button_attributes");o=a(o,{_isLinkedToArray:"button"}),e.exports={visible:{valType:"boolean"},buttons:o,x:{valType:"number",min:-2,max:3},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom"},font:a({},n,{}),bgcolor:{valType:"color",dflt:i.lightLine},activecolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0}}},{"../../lib/extend":659,"../../plots/font_attributes":726,"../color/attributes":561,"./button_attributes":613}],613:[function(t,e,r){"use strict";e.exports={step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward"},count:{valType:"number",min:0,dflt:1},label:{valType:"string"}}},{}],614:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],615:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){return a.coerce(i,o,l,t,e)}for(var i,o,s=t.buttons||[],u=e.buttons=[],c=0;c<s.length;c++)if(i=s[c],o={},a.isPlainObject(i)){var h=n("step");"all"!==h&&(!r||"gregorian"===r||"month"!==h&&"year"!==h?n("stepmode"):o.stepmode="backward",n("count")),n("label"),o._index=c,u.push(o)}return u}function i(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a<n.length;a++){var o=e[n[a]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+u.yPad]}var a=t("../../lib"),o=t("../color"),s=t("./attributes"),l=t("./button_attributes"),u=t("./constants");e.exports=function(t,e,r,l,c){function h(t,e){return a.coerce(f,d,s,t,e)}var f=t.rangeselector||{},d=e.rangeselector={},p=n(f,d,c),m=h("visible",p.length>0);if(m){var v=i(e,r,l);h("x",v[0]),h("y",v[1]),a.noneOrAll(t,e,["x","y"]),h("xanchor"),h("yanchor"),a.coerceFont(h,"font",r.font);var g=h("bgcolor");h("activecolor",o.contrast(g,u.lightAmount,u.darkAmount)),h("bordercolor"),h("borderwidth")}}},{"../../lib":667,"../color":562,"./attributes":612,"./button_attributes":613,"./constants":614}],616:[function(t,e,r){"use strict";function n(t){for(var e=g.list(t,"x",!0),r=[],n=0;n<e.length;n++){var i=e[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}function i(t){return t._id}function a(t,e,r){if("all"===e.step)return t.autorange===!0;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}function o(t,e,r){var n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("selector-rect",!0),n.attr("shape-rendering","crispEdges"),n.attr({rx:b.rx,ry:b.ry}),n.call(p.stroke,e.bordercolor).call(p.fill,s(e,r)).style("stroke-width",e.borderwidth+"px")}function s(t,e){return e.isActive||e.isHovered?t.activecolor:t.bgcolor}function l(t,e,r){function n(t){v.convertToTspans(t)}var i=t.selectAll("text").data([0]);i.enter().append("text").classed("selector-text",!0).classed("user-select-none",!0),i.attr("text-anchor","middle"),i.call(m.font,e.font).text(u(r)).call(n)}function u(t){return t.label?t.label:"all"===t.step?"all":t.count+t.step.charAt(0)}function c(t,e,r,n){r.width=0,r.height=0;var i=r.borderwidth;e.each(function(){var t=h.select(this),e=t.select(".selector-text"),n=e.selectAll("tspan"),i=1.3*r.font.size,a=n[0].length||1,o=Math.max(i*a,16)+3;r.height=Math.max(r.height,o)}),e.each(function(){var t=h.select(this),e=t.select(".selector-rect"),n=t.select(".selector-text"),a=n.selectAll("tspan"),o=n.node()&&m.bBox(n.node()).width,s=1.3*r.font.size,l=a[0].length||1,u=Math.max(o+10,b.minButtonWidth);t.attr("transform","translate("+(i+r.width)+","+i+")"),e.attr({x:0,y:0,width:u,height:r.height});var c={x:u/2,y:r.height/2-(l-1)*s/2+3};n.attr(c),a.attr(c),r.width+=u+5}),e.selectAll("rect").attr("height",r.height);var a=t._fullLayout._size;r.lx=a.l+a.w*r.x,r.ly=a.t+a.h*(1-r.y);var o="left";y.isRightAnchor(r)&&(r.lx-=r.width,o="right"),y.isCenterAnchor(r)&&(r.lx-=r.width/2,o="center");var s="top";y.isBottomAnchor(r)&&(r.ly-=r.height,s="bottom"),y.isMiddleAnchor(r)&&(r.ly-=r.height/2,s="middle"),r.width=Math.ceil(r.width),r.height=Math.ceil(r.height),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),d.autoMargin(t,n+"-range-selector",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[o]||0),r:r.width*({left:1,center:.5}[o]||0),b:r.height*({top:1,middle:.5}[s]||0),t:r.height*({bottom:1,middle:.5}[s]||0)})}var h=t("d3"),f=t("../../plotly"),d=t("../../plots/plots"),p=t("../color"),m=t("../drawing"),v=t("../../lib/svg_text_utils"),g=t("../../plots/cartesian/axis_ids"),y=t("../legend/anchor_utils"),b=t("./constants"),x=t("./get_update_object");e.exports=function(t){var e=t._fullLayout,r=e._infolayer.selectAll(".rangeselector").data(n(t),i);r.enter().append("g").classed("rangeselector",!0),r.exit().remove(),r.style({cursor:"pointer","pointer-events":"all"}),r.each(function(e){var r=h.select(this),n=e,i=n.rangeselector,s=r.selectAll("g.button").data(i.buttons);s.enter().append("g").classed("button",!0),s.exit().remove(),s.each(function(e){var r=h.select(this),s=x(n,e);e.isActive=a(n,e,s),r.call(o,i,e),r.call(l,i,e),r.on("click",function(){t._dragged||f.relayout(t,s)}),r.on("mouseover",function(){e.isHovered=!0,r.call(o,i,e)}),r.on("mouseout",function(){e.isHovered=!1,r.call(o,i,e)})}),c(t,s,i,n._name),r.attr("transform","translate("+i.lx+","+i.ly+")")})}},{"../../lib/svg_text_utils":686,"../../plotly":701,"../../plots/cartesian/axis_ids":709,"../../plots/plots":766,"../color":562,"../drawing":585,"../legend/anchor_utils":599,"./constants":614,"./get_update_object":617,d3:97}],617:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range,a=new Date(t.r2l(n[1])),o=e.step,s=e.count;switch(e.stepmode){case"backward":r=t.l2r(+i.time[o].utc.offset(a,-s));break;case"todate":var l=i.time[o].utc.offset(a,-s);r=t.l2r(+i.time[o].utc.ceil(l))}var u=n[1];return[r,u]}var i=t("d3");e.exports=function(t,e){var r=t._name,i={};if("all"===e.step)i[r+".autorange"]=!0;else{var a=n(t,e);i[r+".range[0]"]=a[0],i[r+".range[1]"]=a[1]}return i}},{d3:97}],618:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{layout:{"xaxis.rangeselector":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":612,"./defaults":615,"./draw":616}],619:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background},bordercolor:{valType:"color",dflt:n.defaultLine},borderwidth:{valType:"integer",dflt:0,min:0},autorange:{valType:"boolean",dflt:!0},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},thickness:{valType:"number",dflt:.15,min:0,max:1},visible:{valType:"boolean",dflt:!0}}},{"../color/attributes":561}],620:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./constants");e.exports=function(t){for(var e=n.list(t,"x",!0),r=0;r<e.length;r++){var a=e[r],o=a[i.name];o&&o.visible&&o.autorange&&a._min.length&&a._max.length&&(o._input.autorange=!0,o._input.range=o.range=n.getAutoRange(a))}}},{"../../plots/cartesian/axes":706,"./constants":621}],621:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskColor:"rgba(0,0,0,0.4)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],622:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(t,e){return n.coerce(o,l,i,t,e)}if(t[r].rangeslider){n.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var o=t[r].rangeslider,s=e[r],l=s.rangeslider={},u=a("visible");if(u){if(a("bgcolor",e.plot_bgcolor),a("bordercolor"),a("borderwidth"),a("thickness"),a("autorange",!s.isValidRange(o.range)),a("range"),l.range){var c=l.range,h=s.range;c[0]=s.l2r(Math.min(s.r2l(c[0]),s.r2l(h[0]))),c[1]=s.l2r(Math.max(s.r2l(c[1]),s.r2l(h[1])))}s.cleanRange("rangeslider.range"),l._input=o}}}},{"../../lib":667,"./attributes":619}],623:[function(t,e,r){"use strict";function n(t){var e=w.list({_fullLayout:t},"x",!0),r=k.name,n=[];if(t._has("gl2d"))return n;for(var i=0;i<e.length;i++){var a=e[i];a[r]&&a[r].visible&&n.push(a)}return n}function i(t,e,r,n){var i=t.select("rect."+k.slideBoxClassName).node(),o=t.select("rect."+k.grabAreaMinClassName).node(),s=t.select("rect."+k.grabAreaMaxClassName).node();t.on("mousedown",function(){function l(l){var u,c,y,b=+l.clientX-f;switch(h){case i:y="ew-resize",u=p+b,c=v+b;break;case o:y="col-resize",u=p+b,c=v;break;case s:y="col-resize",u=p,c=v+b;break;default:y="ew-resize",u=d,c=d+b}if(c<u){var x=c;c=u,u=x}n._pixelMin=u,n._pixelMax=c,A(m.select(g),y),a(t,e,r,n)}function u(){g.removeEventListener("mousemove",l),g.removeEventListener("mouseup",u),y.removeElement(g)}var c=m.event,h=c.target,f=c.clientX,d=f-t.node().getBoundingClientRect().left,p=n.d2p(r._rl[0]),v=n.d2p(r._rl[1]),g=M.coverSlip();g.addEventListener("mousemove",l),g.addEventListener("mouseup",u)})}function a(t,e,r,n){function i(t){return r.l2r(y.constrain(t,n._rl[0],n._rl[1]))}var a=i(n.p2d(n._pixelMin)),o=i(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){v.relayout(e,r._name+".range",[a,o])})}function o(t,e,r,n){function i(t){return y.constrain(t,0,n._width)}function a(t){return y.constrain(t,-o,n._width+o)}var o=k.handleWidth/2,s=i(n.d2p(r._rl[0])),l=i(n.d2p(r._rl[1]));t.select("rect."+k.slideBoxClassName).attr("x",s).attr("width",l-s),t.select("rect."+k.maskMinClassName).attr("width",s),t.select("rect."+k.maskMaxClassName).attr("x",l).attr("width",n._width-l);var u=.5,c=Math.round(a(s-o))-u,h=Math.round(a(l-o))+u;t.select("g."+k.grabberMinClassName).attr("transform","translate("+c+","+u+")"),t.select("g."+k.grabberMaxClassName).attr("transform","translate("+h+","+u+")")}function s(t,e,r,n){var i=t.selectAll("rect."+k.bgClassName).data([0]);i.enter().append("rect").classed(k.bgClassName,!0).attr({x:0,y:0,"shape-rendering":"crispEdges"});var a=n.borderwidth%2===0?n.borderwidth:n.borderwidth-1,o=-n._offsetShift,s=b.crispRound(e,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:"translate("+o+","+o+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":s})}function l(t,e,r,n){var i=e._fullLayout,a=i._topdefs.selectAll("#"+n._clipId).data([0]);a.enter().append("clipPath").attr("id",n._clipId).append("rect").attr({x:0,y:0}),a.select("rect").attr({width:n._width,height:n._height})}function u(t,e,r,n){var i=w.getSubplots(e,r),a=e.calcdata,o=t.selectAll("g."+k.rangePlotClassName).data(i,y.identity); o.enter().append("g").attr("class",function(t){return k.rangePlotClassName+" "+t}).call(b.setClipUrl,n._clipId),o.order(),o.exit().remove();var s;o.each(function(t,i){var o=m.select(this),l=0===i,u=w.getFromId(e,t,"y"),h=u._name,f={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:n.range.slice(),calendar:r.calendar},width:n._width,height:n._height,margin:{t:0,b:0,l:0,r:0}}};f.layout[h]={domain:[0,1],range:u.range.slice(),calendar:u.calendar},g.supplyDefaults(f);var d=f._fullLayout.xaxis,p=f._fullLayout[h],v={id:t,plotgroup:o,xaxis:d,yaxis:p};l?s=v:(v.mainplot="xy",v.mainplotinfo=s),_.rangePlot(e,v,c(a,t)),l&&v.bg.remove()})}function c(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a.xaxis+a.yaxis===e&&r.push(i)}return r}function h(t,e,r,n){var i=t.selectAll("rect."+k.maskMinClassName).data([0]);i.enter().append("rect").classed(k.maskMinClassName,!0).attr({x:0,y:0}).attr("shape-rendering","crispEdges"),i.attr("height",n._height).call(x.fill,k.maskColor);var a=t.selectAll("rect."+k.maskMaxClassName).data([0]);a.enter().append("rect").classed(k.maskMaxClassName,!0).attr("y",0).attr("shape-rendering","crispEdges"),a.attr("height",n._height).call(x.fill,k.maskColor)}function f(t,e,r,n){if(!e._context.staticPlot){var i=t.selectAll("rect."+k.slideBoxClassName).data([0]);i.enter().append("rect").classed(k.slideBoxClassName,!0).attr("y",0).attr("cursor",k.slideBoxCursor).attr("shape-rendering","crispEdges"),i.attr({height:n._height,fill:k.slideBoxFill})}}function d(t,e,r,n){var i=t.selectAll("g."+k.grabberMinClassName).data([0]);i.enter().append("g").classed(k.grabberMinClassName,!0);var a=t.selectAll("g."+k.grabberMaxClassName).data([0]);a.enter().append("g").classed(k.grabberMaxClassName,!0);var o={x:0,width:k.handleWidth,rx:k.handleRadius,fill:x.background,stroke:x.defaultLine,"stroke-width":k.handleStrokeWidth,"shape-rendering":"crispEdges"},s={y:Math.round(n._height/4),height:Math.round(n._height/2)},l=i.selectAll("rect."+k.handleMinClassName).data([0]);l.enter().append("rect").classed(k.handleMinClassName,!0).attr(o),l.attr(s);var u=a.selectAll("rect."+k.handleMaxClassName).data([0]);if(u.enter().append("rect").classed(k.handleMaxClassName,!0).attr(o),u.attr(s),!e._context.staticPlot){var c={width:k.grabAreaWidth,x:0,y:0,fill:k.grabAreaFill,cursor:k.grabAreaCursor},h=i.selectAll("rect."+k.grabAreaMinClassName).data([0]);h.enter().append("rect").classed(k.grabAreaMinClassName,!0).attr(c),h.attr("height",n._height);var f=a.selectAll("rect."+k.grabAreaMaxClassName).data([0]);f.enter().append("rect").classed(k.grabAreaMaxClassName,!0).attr(c),f.attr("height",n._height)}}function p(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];i.indexOf(k.name)!==-1&&g.autoMargin(t,i)}}var m=t("d3"),v=t("../../plotly"),g=t("../../plots/plots"),y=t("../../lib"),b=t("../drawing"),x=t("../color"),_=t("../../plots/cartesian"),w=t("../../plots/cartesian/axes"),M=t("../dragelement"),A=t("../../lib/setcursor"),k=t("./constants");e.exports=function(t){function e(t){return t._name}var r=t._fullLayout,a=n(r),c=r._infolayer.selectAll("g."+k.containerClassName).data(a,e);c.enter().append("g").classed(k.containerClassName,!0).attr("pointer-events","all"),c.exit().each(function(t){var e=m.select(this),n=t[k.name];e.remove(),r._topdefs.select("#"+n._clipId).remove()}),c.exit().size()&&p(t),0!==a.length&&c.each(function(e){var n=m.select(this),a=e[k.name],c=r[w.id2name(e.anchor)],p=r.margin,v=r._size,y=e.domain,b=c.domain,x=(e._boundingBox||{}).height||0;a._id=k.name+e._id,a._clipId=a._id+"-"+r._uid,a._width=v.w*(y[1]-y[0]),a._height=(r.height-p.b-p.t)*a.thickness,a._offsetShift=Math.floor(a.borderwidth/2);var _=Math.round(p.l+v.w*y[0]),M=Math.round(p.t+v.h*(1-b[0])+x+a._offsetShift+k.extraPad);n.attr("transform","translate("+_+","+M+")");var A=e.r2l(a.range[0]),T=e.r2l(a.range[1]),S=T-A;a.p2d=function(t){return t/a._width*S+A},a.d2p=function(t){return(t-A)/S*a._width},a._rl=[A,T],n.call(s,t,e,a).call(l,t,e,a).call(u,t,e,a).call(h,t,e,a).call(f,t,e,a).call(d,t,e,a),i(n,t,e,a),o(n,t,e,a),g.autoMargin(t,a._id,{x:y[0],y:b[0],l:0,r:0,t:0,b:a._height+p.b+x,pad:k.extraPad+2*a._offsetShift})})}},{"../../lib":667,"../../lib/setcursor":682,"../../plotly":701,"../../plots/cartesian":714,"../../plots/cartesian/axes":706,"../../plots/plots":766,"../color":562,"../dragelement":583,"../drawing":585,"./constants":621,d3:97}],624:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeslider",schema:{layout:{"xaxis.rangeslider":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw")}},{"./attributes":619,"./calc_autorange":620,"./defaults":622,"./draw":623}],625:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes"),a=t("../../lib/extend").extendFlat,o=i.line;e.exports={_isLinkedToArray:"shape",visible:{valType:"boolean",dflt:!0},type:{valType:"enumerated",values:["circle","rect","path","line"]},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},xref:a({},n.xref,{}),x0:{valType:"any"},x1:{valType:"any"},yref:a({},n.yref,{}),y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string"},opacity:{valType:"number",min:0,max:1,dflt:1},line:{color:o.color,width:o.width,dash:o.dash},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"}}},{"../../lib/extend":659,"../../traces/scatter/attributes":911,"../annotations/attributes":551}],626:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a="category"===t.type?Number:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var l,u,c,h,f,d=1/0,p=-(1/0),m=n.match(o.segmentRE);for("date"===t.type&&(a=s.decodeDate(a)),l=0;l<m.length;l++)u=m[l],c=i[u.charAt(0)].drawn,void 0!==c&&(h=m[l].substr(1).match(o.paramRE),!h||h.length<c||(f=a(h[c]),f<d&&(d=f),f>p&&(p=f)));return p>=d?[d,p]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;s<r.length;s++){var l,u,c=r[s],h=c.line.width/2;"paper"!==c.xref&&(l=a.getFromId(t,c.xref),u=n(l,c.x0,c.x1,c.path,o.paramIsX),u&&a.expand(l,u,{ppad:h})),"paper"!==c.yref&&(l=a.getFromId(t,c.yref),u=n(l,c.y0,c.y1,c.path,o.paramIsY),u&&a.expand(l,u,{ppad:h}))}}},{"../../lib":667,"../../plots/cartesian/axes":706,"./constants":627,"./helpers":630}],627:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],628:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),i=t("./shape_defaults");e.exports=function(t,e){var r={name:"shapes",handleItemDefaults:i};n(t,e,r)}},{"../../plots/array_container_defaults":703,"./shape_defaults":632}],629:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayer.selectAll("path").remove();for(var r=0;r<e.shapes.length;r++)e.shapes[r].visible&&i(t,r)}function i(t,e){function r(r){var n={"data-index":e,"fill-rule":"evenodd",d:s(t,u)},i=u.line.width?u.line.color:"rgba(0,0,0,0)",o=r.append("path").attr(n).style("opacity",u.opacity).call(d.stroke,i).call(d.fill,u.fillcolor).call(p.dashLine,u.line.dash,u.line.width);c&&o.call(p.setClipUrl,"clip"+t._fullLayout._uid+c),t._context.editable&&a(t,o,u,e)}var n,i;t._fullLayout._paper.selectAll('.shapelayer [data-index="'+e+'"]').remove();var l=t.layout.shapes[e],u=t._fullLayout.shapes[e];if(l&&u.visible!==!1){var c;if("below"!==u.layer)c=(u.xref+u.yref).replace(/paper/g,""),r(t._fullLayout._shapeUpperLayer);else if("paper"===u.xref&&"paper"===u.yref)c="",r(t._fullLayout._shapeLowerLayer);else{var h,f=t._fullLayout._plots||{},m=Object.keys(f);for(n=0,i=m.length;n<i;n++)h=f[m[n]],c=m[n],o(t,u,h)&&r(h.shapelayer)}}}function a(t,e,r,n){function i(t){var r=Z.right-Z.left,n=Z.bottom-Z.top,i=t.clientX-Z.left,a=t.clientY-Z.top,o=r>G&&n>W&&!t.shiftKey?m.getCursor(i/r,1-a/n):"move";v(e,o),Y=o.split("-")[0]}function a(e){N=f.getFromId(t,r.xref),B=f.getFromId(t,r.yref),U=y.getDataToPixel(t,N),V=y.getDataToPixel(t,B,!0),H=y.getPixelToData(t,N),q=y.getPixelToData(t,B,!0);var a="shapes["+n+"]";"path"===r.type?(j=r.path,F=a+".path"):(p=U(r.x0),g=V(r.y0),b=U(r.x1),x=V(r.y1),_=a+".x0",w=a+".y0",M=a+".x1",A=a+".y1"),p<b?(S=p,D=a+".x0",O="x0",E=b,z=a+".x1",R="x1"):(S=b,D=a+".x1",O="x1",E=p,z=a+".x0",R="x0"),g<x?(k=g,L=a+".y0",I="y0",T=x,C=a+".y1",P="y1"):(k=x,L=a+".y1",I="y1",T=g,C=a+".y0",P="y0"),d={},i(e),X.moveFn="move"===Y?l:h}function o(r){v(e),r&&c.relayout(t,d)}function l(n,i){if("path"===r.type){var a=function(t){return H(U(t)+n)};N&&"date"===N.type&&(a=y.encodeDate(a));var o=function(t){return q(V(t)+i)};B&&"date"===B.type&&(o=y.encodeDate(o)),r.path=u(j,a,o),d[F]=r.path}else d[_]=r.x0=H(p+n),d[w]=r.y0=q(g+i),d[M]=r.x1=H(b+n),d[A]=r.y1=q(x+i);e.attr("d",s(t,r))}function h(n,i){if("path"===r.type){var a=function(t){return H(U(t)+n)};N&&"date"===N.type&&(a=y.encodeDate(a));var o=function(t){return q(V(t)+i)};B&&"date"===B.type&&(o=y.encodeDate(o)),r.path=u(j,a,o),d[F]=r.path}else{var l=~Y.indexOf("n")?k+i:k,c=~Y.indexOf("s")?T+i:T,h=~Y.indexOf("w")?S+n:S,f=~Y.indexOf("e")?E+n:E;c-l>W&&(d[L]=r[I]=q(l),d[C]=r[P]=q(c)),f-h>G&&(d[D]=r[O]=H(h),d[z]=r[R]=H(f))}e.attr("d",s(t,r))}var d,p,g,b,x,_,w,M,A,k,T,S,E,L,C,D,z,I,P,O,R,j,F,N,B,U,V,H,q,Y,G=10,W=10,X={setCursor:i,element:e.node(),prepFn:a,doneFn:o},Z=X.element.getBoundingClientRect();m.init(X)}function o(t,e,r){var n=f.getFromId(t,r.id,"x")._id,i=f.getFromId(t,r.id,"y")._id,a="below"===e.layer,o=n===e.xref||i===e.yref,s=!!r.shapelayer;return a&&o&&s}function s(t,e){var r,n,i,a,o=e.type,s=f.getFromId(t,e.xref),u=f.getFromId(t,e.yref),c=t._fullLayout._size;if(s?(r=y.shapePositionToRange(s),n=function(t){return s._offset+s.r2p(r(t,!0))}):n=function(t){return c.l+c.w*t},u?(i=y.shapePositionToRange(u),a=function(t){return u._offset+u.r2p(i(t,!0))}):a=function(t){return c.t+c.h*(1-t)},"path"===o)return s&&"date"===s.type&&(n=y.decodeDate(n)),u&&"date"===u.type&&(a=y.decodeDate(a)),l(e.path,n,a);var h=n(e.x0),d=n(e.x1),p=a(e.y0),m=a(e.y1);if("line"===o)return"M"+h+","+p+"L"+d+","+m;if("rect"===o)return"M"+h+","+p+"H"+d+"V"+m+"H"+h+"Z";var v=(h+d)/2,g=(p+m)/2,b=Math.abs(v-h),x=Math.abs(g-p),_="A"+b+","+x,w=v+b+","+g,M=v+","+(g-x);return"M"+w+_+" 0 1,1 "+M+_+" 0 0,1 "+w+"Z"}function l(t,e,r){return t.replace(g.segmentRE,function(t){var n=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i],l=t.substr(1).replace(g.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),h.log("Ignoring extra params in segment "+t)),i+l})}function u(t,e,r){return t.replace(g.segmentRE,function(t){var n=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i],l=t.substr(1).replace(g.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)});return i+l})}var c=t("../../plotly"),h=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../color"),p=t("../drawing"),m=t("../dragelement"),v=t("../../lib/setcursor"),g=t("./constants"),y=t("./helpers");e.exports={draw:n,drawOne:i}},{"../../lib":667,"../../lib/setcursor":682,"../../plotly":701,"../../plots/cartesian/axes":706,"../color":562,"../dragelement":583,"../drawing":585,"./constants":627,"./helpers":630}],630:[function(t,e,r){"use strict";r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.getDataToPixel=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(i=r.decodeDate(i))}else i=n?function(t){return a.t+a.h*(1-t)}:function(t){return a.l+a.w*t};return i},r.getPixelToData=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);i=function(t){return o(e.p2r(t-e._offset))}}else i=n?function(t){return 1-(t-a.t)/a.h}:function(t){return(t-a.l)/a.w};return i}},{}],631:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"./attributes":625,"./calc_autorange":626,"./defaults":628,"./draw":629}],632:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,a,r,i)}s=s||{},l=l||{};var c=u("visible",!l.itemIsNotPlainObject);if(!c)return e;u("layer"),u("opacity"),u("fillcolor"),u("line.color"),u("line.width"),u("line.dash");for(var h=t.path?"path":"rect",f=u("type",h),d=["x","y"],p=0;p<2;p++){var m=d[p],v={_fullLayout:r},g=i.coerceRef(t,e,v,m,"","paper");if("path"!==f){var y,b,x,_=.25,w=.75;"paper"!==g?(y=i.getFromId(v,g),x=o.rangeToShapePosition(y),b=o.shapePositionToRange(y)):b=x=n.identity;var M=m+"0",A=m+"1",k=t[M],T=t[A];t[M]=b(t[M],!0),t[A]=b(t[A],!0),i.coercePosition(e,v,u,g,M,_),i.coercePosition(e,v,u,g,A,w),e[M]=x(e[M]),e[A]=x(e[A]),t[M]=k,t[A]=T}}return"path"===f?u("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":667,"../../plots/cartesian/axes":706,"./attributes":625,"./helpers":630}],633:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendFlat,o=t("../../lib/extend").extendDeep,s=t("../../plots/animation_attributes"),l=t("./constants"),u={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"}};e.exports={_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:o({},i,{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:a({},n,{})},font:a({},n,{}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}}},{"../../lib/extend":659,"../../plots/animation_attributes":702,"../../plots/font_attributes":726,"../../plots/pad_attributes":765,"./constants":634}],634:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,fontSizeToHeight:1.3,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],635:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}var o=i(t,e),l=n("visible",o.length>0);if(l){n("active"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font);var u=n("currentvalue.visible");u&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),a.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen")}}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.steps||[],s=e.steps=[],l=0;l<o.length;l++)n=o[l],i={},a.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label","step-"+l),r("value",i.label),s.push(i));return s}var a=t("../../lib"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l=t("./constants"),u=l.name,c=s.steps;e.exports=function(t,e){var r={name:u,handleItemDefaults:n};o(t,e,r)}},{"../../lib":667,"../../plots/array_container_defaults":703,"./attributes":633,"./constants":634}],636:[function(t,e,r){"use strict";function n(t){for(var e=t[E.name],r=[],n=0;n<e.length;n++){var i=e[n];i.visible&&i.steps.length&&r.push(i)}return r}function i(t){return t._index}function a(t,e){var r=t._tester.selectAll("g."+E.labelGroupClass).data(e.steps);r.enter().append("g").classed(E.labelGroupClass,!0);var n=0,i=0;if(r.each(function(t){var r=w.select(this),a=u(r,{step:t},e),o=a.node()&&k.bBox(a.node()).width||0;i=a.node()&&k.bBox(a.node()).height||0,n=Math.max(n,o)}),r.remove(),e.inputAreaWidth=Math.max(E.railWidth,E.gripHeight),e.currentValueMaxWidth=0,e.currentValueHeight=0,e.currentValueTotalHeight=0,e.currentvalue.visible){var a=t._tester.append("g");r.each(function(t){var r=s(a,e,t.label),n=r.node()&&k.bBox(r.node())||{width:0,height:0};e.currentValueMaxWidth=Math.max(e.currentValueMaxWidth,Math.ceil(n.width)),e.currentValueHeight=Math.max(e.currentValueHeight,Math.ceil(n.height))}),e.currentValueTotalHeight=e.currentValueHeight+e.currentvalue.offset,a.remove()}var o=t._fullLayout._size;e.lx=o.l+o.w*e.x,e.ly=o.t+o.h*(1-e.y),"fraction"===e.lenmode?e.outerLength=Math.round(o.w*e.len):e.outerLength=e.len,e.lenPad=Math.round(.5*E.gripWidth),e.inputAreaStart=0,e.inputAreaLength=Math.round(e.outerLength-e.pad.l-e.pad.r);var l=e.inputAreaLength-2*E.stepInset,c=l/(e.steps.length-1),h=n+E.labelPadding;e.labelStride=Math.max(1,Math.ceil(h/c)),e.labelHeight=i,e.height=e.currentValueTotalHeight+E.tickOffset+e.ticklen+E.labelOffset+e.labelHeight+e.pad.t+e.pad.b;var f="left";S.isRightAnchor(e)&&(e.lx-=e.outerLength,f="right"),S.isCenterAnchor(e)&&(e.lx-=e.outerLength/2,f="center");var d="top";S.isBottomAnchor(e)&&(e.ly-=e.height,d="bottom"),S.isMiddleAnchor(e)&&(e.ly-=e.height/2,d="middle"),e.outerLength=Math.ceil(e.outerLength),e.height=Math.ceil(e.height),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),M.autoMargin(t,E.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:e.outerLength*({right:1,center:.5}[f]||0),r:e.outerLength*({left:1,center:.5}[f]||0),b:e.height*({top:1,middle:.5}[d]||0),t:e.height*({bottom:1,middle:.5}[d]||0)})}function o(t,e,r){r.active>=r.steps.length&&(r.active=0),e.call(s,r).call(x,r).call(c,r).call(p,r).call(b,t,r).call(l,t,r),k.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(s,r)}function s(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-E.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=E.currentValueInset,i="left"}a.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr("text-anchor",i);var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{var s=e.steps[e.active].label;o+=s}return e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(k.font,e.currentvalue.font).text(o).call(T.convertToTspans),k.setTranslate(a,n,e.currentValueHeight),a}}function l(t,e,r){var n=t.selectAll("rect."+E.gripRectClass).data([0]);n.enter().append("rect").classed(E.gripRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:E.gripWidth,height:E.gripHeight,rx:E.gripRadius,ry:E.gripRadius}).call(A.stroke,r.bordercolor).call(A.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function u(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr("text-anchor","middle"),n.call(k.font,r.font).text(e.step.label).call(T.convertToTspans),n}function c(t,e){var r=t.selectAll("g."+E.labelsClass).data([0]);r.enter().append("g").classed(E.labelsClass,!0);var n=r.selectAll("g."+E.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(E.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(u,t,e),k.setTranslate(r,g(e,t.fraction),E.tickOffset+e.ticklen+e.labelHeight+E.labelOffset+e.currentValueTotalHeight)})}function h(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&f(t,e,r,a,!0,i)}function f(t,e,r,n,i,a){var o=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),a),e.call(s,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=a):(e._nextMethod={step:l,doCallback:i,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(M.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+E.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(A.fill,t.activebgcolor);var s=y(t,w.mouse(i)[0]);h(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=y(t,w.mouse(i)[0]);h(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(A.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+E.tickRectClass).data(e.steps);r.enter().append("rect").classed(E.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride===0,i=w.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(A.fill,n?e.tickcolor:e.tickcolor),k.setTranslate(i,g(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?E.tickOffset:E.minorTickOffset)+e.currentValueTotalHeight)})}function m(t){t.labelSteps=[];for(var e=0,r=t.steps.length,n=e;n<r;n+=t.labelStride)t.labelSteps.push({fraction:n/(r-1),step:t.steps[n]})}function v(t,e,r,n){var i=t.select("rect."+E.gripRectClass),a=g(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*E.gripWidth)+","+e.currentValueTotalHeight+")")}}function g(t,e){return t.inputAreaStart+E.stepInset+(t.inputAreaLength-2*E.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-E.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*E.stepInset-2*t.inputAreaStart)))}function b(t,e,r){var n=t.selectAll("rect."+E.railTouchRectClass).data([0]);n.enter().append("rect").classed(E.railTouchRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,E.tickOffset+r.ticklen+r.labelHeight)}).call(A.fill,r.bgcolor).attr("opacity",0),k.setTranslate(n,0,r.currentValueTotalHeight)}function x(t,e){var r=t.selectAll("rect."+E.railRectClass).data([0]);r.enter().append("rect").classed(E.railRectClass,!0);var n=e.inputAreaLength-2*E.railInset;r.attr({width:n,height:E.railWidth,rx:E.railRadius,ry:E.railRadius,"shape-rendering":"crispEdges"}).call(A.stroke,e.bordercolor).call(A.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),k.setTranslate(r,E.railInset,.5*(e.inputAreaWidth-E.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];i.indexOf(E.autoMarginIdRoot)!==-1&&M.autoMargin(t,i)}}var w=t("d3"),M=t("../../plots/plots"),A=t("../color"),k=t("../drawing"),T=t("../../lib/svg_text_utils"),S=t("../legend/anchor_utils"),E=t("./constants");e.exports=function(t){var e=t._fullLayout,r=n(e),s=e._infolayer.selectAll("g."+E.containerClassName).data(r.length>0?[0]:[]);if(s.enter().append("g").classed(E.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&_(t),0!==r.length){var l=s.selectAll("g."+E.groupClassName).data(r,i);l.enter().append("g").classed(E.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,E.autoMarginIdRoot+e._index)});for(var u=0;u<r.length;u++){var c=r[u];a(t,c)}l.each(function(e){if(!(e.steps.length<2)){var r=w.select(this);m(e),M.manageCommandObserver(t,e,e.steps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||f(t,r,n,e.index,!1,!0))}),o(t,w.select(this),e)}})}}},{"../../lib/svg_text_utils":686,"../../plots/plots":766,"../color":562,"../drawing":585,"../legend/anchor_utils":599,"./constants":634,d3:97}],637:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":633,"./constants":634,"./defaults":635,"./draw":636}],638:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),u=t("../color"),c=t("../../lib/svg_text_utils"),h=t("../../constants/interactions"),f=e.exports={};f.draw=function(t,e,r){function f(t){s.syncOrAsync([d,p],t)}function d(e){return e.attr("transform",w?"rotate("+[w.rotate,_.x,_.y]+") translate(0, "+w.offset+")":null),e.style({"font-family":k,"font-size":n.round(T,2)+"px",fill:u.rgb(S),opacity:E*u.opacity(S),"font-weight":o.fontWeight}).attr(_).call(c.convertToTspans).attr(_),e.selectAll("tspan.line").attr(_),o.previousPromises(t)}function p(t){var e=n.select(t.node().parentNode);if(x&&x.selection&&x.side&&C){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[x.side],o=["left","top"].indexOf(x.side)!==-1?-1:1,u=i(x.pad)?x.pad:2,c=l.bBox(e.node()),h={left:0,top:0,right:A.width,bottom:A.height},f=x.maxShift||(h[x.side]-c[x.side])*("left"===x.side||"top"===x.side?-1:1);if(f<0)r=f;else{var d=x.offsetLeft||0,p=x.offsetTop||0;c.left-=d,c.right-=d,c.top-=p,c.bottom-=p,x.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,o*(t[x.side]-c[a])+u))}),r=Math.min(f,r)}if(r>0||f<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[x.side];e.attr("transform","translate("+m+")")}}}function m(){E=0,L=!0,C=z,D.attr({"data-unformatted":C}).text(C).on("mouseover.opacity",function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})}var v=r.propContainer,g=r.propName,y=r.traceIndex,b=r.dfltName,x=r.avoid||{},_=r.attributes,w=r.transform,M=r.containerGroup,A=t._fullLayout,k=v.titlefont.family,T=v.titlefont.size,S=v.titlefont.color,E=1,L=!1,C=v.title.trim();""===C&&(E=0),C.match(/Click to enter .+ title/)&&(E=.2,L=!0),M||(M=A._infolayer.selectAll(".g-"+e).data([0]),M.enter().append("g").classed("g-"+e,!0));var D=M.selectAll("text").data([0]);D.enter().append("text"),D.text(C).attr("class",e),D.attr({"data-unformatted":C}).call(f);var z="Click to enter "+b+" title";t._context.editable?(C?D.on(".opacity",null):m(),D.call(c.makeEditable).on("edit",function(e){void 0!==y?a.restyle(t,g,e,y):a.relayout(t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(f)}).on("input",function(t){this.text(t||" ").attr(_).selectAll("tspan.line").attr(_)})):C&&!C.match(/Click to enter .+ title/)||D.remove(),D.classed("js-placeholder",L)}},{"../../constants/interactions":648,"../../lib":667,"../../lib/svg_text_utils":686,"../../plotly":701,"../../plots/plots":766,"../color":562,"../drawing":585,d3:97,"fast-isnumeric":106}],639:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:s,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a({},o,{}),font:a({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":659,"../../plots/font_attributes":726,"../../plots/pad_attributes":765,"../color/attributes":561}],640:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],641:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}var o=i(t,e),l=n("visible",o.length>0);l&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"), n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.buttons||[],s=e.buttons=[],l=0;l<o.length;l++)n=o[l],i={},a.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label"),i._index=l,s.push(i));return s}var a=t("../../lib"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l=t("./constants"),u=l.name,c=s.buttons;e.exports=function(t,e){var r={name:u,handleItemDefaults:n};o(t,e,r)}},{"../../lib":667,"../../plots/array_container_defaults":703,"./attributes":639,"./constants":640}],642:[function(t,e,r){"use strict";function n(t){for(var e=t[E.name],r=[],n=0;n<e.length;n++){var i=e[n];i.visible&&r.push(i)}return r}function i(t){return t._index}function a(t){return+t.attr(E.menuIndexAttrName)===-1}function o(t,e){return+t.attr(E.menuIndexAttrName)===e._index}function s(t,e,r,n,i,a,o,s){e._input.active=e.active=o,"buttons"===e.type?u(t,n,null,null,e):"dropdown"===e.type&&(i.attr(E.menuIndexAttrName,"-1"),l(t,n,i,a,e),s||u(t,n,i,a,e))}function l(t,e,r,n,i){var a=e.selectAll("g."+E.headerClassName).data([0]);a.enter().append("g").classed(E.headerClassName,!0).style("pointer-events","all");var s=i.active,l=i.buttons[s]||E.blankHeaderOpts,c={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},h={width:i.headerWidth,height:i.headerHeight};a.call(f,i,l).call(b,i,c,h);var d=e.selectAll("text."+E.headerArrowClassName).data([0]);d.enter().append("text").classed(E.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(k.font,i.font).text("\u25bc"),d.attr({x:i.headerWidth-E.arrowOffsetX+i.pad.l,y:i.headerHeight/2+E.textOffsetY+i.pad.t}),a.on("click",function(){r.call(x),r.attr(E.menuIndexAttrName,o(r,i)?-1:String(i._index)),u(t,e,r,n,i)}),a.on("mouseover",function(){a.call(v)}),a.on("mouseout",function(){a.call(g,i)}),k.setTranslate(e,i.lx,i.ly)}function u(t,e,r,n,i){r||(r=e,r.attr("pointer-events","all"));var o=a(r)&&"buttons"!==i.type?[]:i.buttons,l="dropdown"===i.type?E.dropdownButtonClassName:E.buttonClassName,u=r.selectAll("g."+l).data(o),d=u.enter().append("g").classed(l,!0),p=u.exit();"dropdown"===i.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var y=0,x=0,_=["up","down"].indexOf(i.direction)!==-1;"dropdown"===i.type&&(_?x=i.headerHeight+E.gapButtonHeader:y=i.headerWidth+E.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(x=-E.gapButtonHeader+E.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(y=-E.gapButtonHeader+E.gapButton-i.openWidth);var A={x:i.lx+y+i.pad.l,y:i.ly+x+i.pad.t,yPad:E.gapButton,xPad:E.gapButton,index:0},k={l:A.x+i.borderwidth,t:A.y+i.borderwidth};u.each(function(a,o){var l=w.select(this);l.call(f,i,a).call(b,i,A),l.on("click",function(){w.event.defaultPrevented||(s(t,i,a,e,r,n,o),M.executeAPICommand(t,a.method,a.args),t.emit("plotly_buttonclicked",{menu:i,button:a,active:i.active}))}),l.on("mouseover",function(){l.call(v)}),l.on("mouseout",function(){l.call(g,i),u.call(m,i)})}),u.call(m,i),_?(k.w=Math.max(i.openWidth,i.headerWidth),k.h=A.y-k.t):(k.w=A.x-k.l,k.h=Math.max(i.openHeight,i.headerHeight)),k.direction=i.direction,n&&(u.size()?c(t,e,r,n,i,k):h(n))}function c(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i.active;if(c)for(s=0,l=0;l<h;l++)s+=i.heights[l]+E.gapButton;else for(o=0,l=0;l<h;l++)o+=i.widths[l]+E.gapButton;n.enable(a,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1"),n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}function h(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()}),r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}function f(t,e,r){t.call(d,e).call(p,e,r)}function d(t,e){var r=t.selectAll("rect").data([0]);r.enter().append("rect").classed(E.itemRectClassName,!0).attr({rx:E.rx,ry:E.ry,"shape-rendering":"crispEdges"}),r.call(A.stroke,e.bordercolor).call(A.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function p(t,e,r){var n=t.selectAll("text").data([0]);n.enter().append("text").classed(E.itemTextClassName,!0).classed("user-select-none",!0).attr("text-anchor","start"),n.call(k.font,e.font).text(r.label).call(T.convertToTspans)}function m(t,e){var r=e.active;t.each(function(t,n){var i=w.select(this);n===r&&e.showactive&&i.select("rect."+E.itemRectClassName).call(A.fill,E.activeColor)})}function v(t){t.select("rect."+E.itemRectClassName).call(A.fill,E.hoverColor)}function g(t,e){t.select("rect."+E.itemRectClassName).call(A.fill,e.bgcolor)}function y(t,e){e.width1=0,e.height1=0,e.heights=[],e.widths=[],e.totalWidth=0,e.totalHeight=0,e.openWidth=0,e.openHeight=0,e.lx=0,e.ly=0;var r=t._tester.selectAll("g."+E.dropdownButtonClassName).data(e.buttons);r.enter().append("g").classed(E.dropdownButtonClassName,!0);var n=["up","down"].indexOf(e.direction)!==-1;r.each(function(t,r){var i=w.select(this);i.call(f,e,t);var a=i.select("."+E.itemTextClassName),o=a.selectAll("tspan"),s=a.node()&&k.bBox(a.node()).width,l=Math.max(s+E.textPadX,E.minWidth),u=e.font.size*E.fontSizeToHeight,c=o[0].length||1,h=Math.max(u*c,E.minHeight)+E.textOffsetY;h=Math.ceil(h),l=Math.ceil(l),e.widths[r]=l,e.heights[r]=h,e.height1=Math.max(e.height1,h),e.width1=Math.max(e.width1,l),n?(e.totalWidth=Math.max(e.totalWidth,l),e.openWidth=e.totalWidth,e.totalHeight+=h+E.gapButton,e.openHeight+=h+E.gapButton):(e.totalWidth+=l+E.gapButton,e.openWidth+=l+E.gapButton,e.totalHeight=Math.max(e.totalHeight,h),e.openHeight=e.totalHeight)}),n?e.totalHeight-=E.gapButton:e.totalWidth-=E.gapButton,e.headerWidth=e.width1+E.arrowPadX,e.headerHeight=e.height1,"dropdown"===e.type&&(n?(e.width1+=E.arrowPadX,e.totalHeight=e.height1):e.totalWidth=e.width1,e.totalWidth+=E.arrowPadX),r.remove();var i=e.totalWidth+e.pad.l+e.pad.r,a=e.totalHeight+e.pad.t+e.pad.b,o=t._fullLayout._size;e.lx=o.l+o.w*e.x,e.ly=o.t+o.h*(1-e.y);var s="left";S.isRightAnchor(e)&&(e.lx-=i,s="right"),S.isCenterAnchor(e)&&(e.lx-=i/2,s="center");var l="top";S.isBottomAnchor(e)&&(e.ly-=a,l="bottom"),S.isMiddleAnchor(e)&&(e.ly-=a/2,l="middle"),e.totalWidth=Math.ceil(e.totalWidth),e.totalHeight=Math.ceil(e.totalHeight),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),M.autoMargin(t,E.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:i*({right:1,center:.5}[s]||0),r:i*({left:1,center:.5}[s]||0),b:a*({top:1,middle:.5}[l]||0),t:a*({bottom:1,middle:.5}[l]||0)})}function b(t,e,r,n){n=n||{};var i=t.select("."+E.itemRectClassName),a=t.select("."+E.itemTextClassName),o=a.selectAll("tspan"),s=e.borderwidth,l=r.index;k.setTranslate(t,s+r.x,s+r.y);var u=["up","down"].indexOf(e.direction)!==-1;i.attr({x:0,y:0,width:n.width||(u?e.width1:e.widths[l]),height:n.height||(u?e.heights[l]:e.height1)});var c=e.font.size*E.fontSizeToHeight,h=o[0].length||1,f=(h-1)*c/4,d={x:E.textOffsetX,y:e.heights[l]/2-f+E.textOffsetY};a.attr(d),o.attr(d),u?r.y+=e.heights[l]+r.yPad:r.x+=e.widths[l]+r.xPad,r.index++}function x(t){t.selectAll("g."+E.dropdownButtonClassName).remove()}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];i.indexOf(E.autoMarginIdRoot)!==-1&&M.autoMargin(t,i)}}var w=t("d3"),M=t("../../plots/plots"),A=t("../color"),k=t("../drawing"),T=t("../../lib/svg_text_utils"),S=t("../legend/anchor_utils"),E=t("./constants"),L=t("./scrollbox");e.exports=function(t){var e=t._fullLayout,r=n(e),a=e._infolayer.selectAll("g."+E.containerClassName).data(r.length>0?[0]:[]);if(a.enter().append("g").classed(E.containerClassName,!0).style("cursor","pointer"),a.exit().remove(),a.exit().size()&&_(t),0!==r.length){var c=a.selectAll("g."+E.headerGroupClassName).data(r,i);c.enter().append("g").classed(E.headerGroupClassName,!0);var h=a.selectAll("g."+E.dropdownButtonGroupClassName).data([0]);h.enter().append("g").classed(E.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var f=0;f<r.length;f++){var d=r[f];y(t,d)}var p="updatemenus"+e._uid,m=new L(t,h,p);c.enter().size()&&h.call(x).attr(E.menuIndexAttrName,"-1"),c.exit().each(function(e){w.select(this).remove(),h.call(x).attr(E.menuIndexAttrName,"-1"),M.autoMargin(t,E.autoMarginIdRoot+e._index)}),c.each(function(e){var r=w.select(this),n="dropdown"===e.type?h:null;M.manageCommandObserver(t,e,e.buttons,function(i){s(t,e,e.buttons[i.index],r,n,m,i.index,!0)}),"dropdown"===e.type?(l(t,r,h,m,e),o(h,e)&&u(t,r,h,m,e)):u(t,r,null,null,e)})}}},{"../../lib/svg_text_utils":686,"../../plots/plots":766,"../color":562,"../drawing":585,"../legend/anchor_utils":599,"./constants":640,"./scrollbox":644,d3:97}],643:[function(t,e,r){arguments[4][637][0].apply(r,arguments)},{"./attributes":639,"./constants":640,"./defaults":641,"./draw":642,dup:637}],644:[function(t,e,r){"use strict";function n(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.exports=n;var i=t("d3"),a=t("../color"),o=t("../drawing"),s=t("../../lib");n.barWidth=2,n.barLength=20,n.barRadius=2,n.barPad=1,n.barColor="#808BA4",n.prototype.enable=function(t,e,r){var s=this.gd._fullLayout,l=s.width,u=s.height;this.position=t;var c,h,f,d,p=this.position.l,m=this.position.w,v=this.position.t,g=this.position.h,y=this.position.direction,b="down"===y,x="left"===y,_="right"===y,w="up"===y,M=m,A=g;b||x||_||w||(this.position.direction="down",b=!0);var k=b||w;k?(c=p,h=c+M,b?(f=v,d=Math.min(f+A,u),A=d-f):(d=v+A,f=Math.max(d-A,0),A=d-f)):(f=v,d=f+A,x?(h=p+M,c=Math.max(h-M,0),M=h-c):(c=p,h=Math.min(c+M,l),M=h-c)),this._box={l:c,t:f,w:M,h:A};var T=m>M,S=n.barLength+2*n.barPad,E=n.barWidth+2*n.barPad,L=p,C=v+g;C+E>u&&(C=u-E);var D=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),T?(this.hbar=D.attr({rx:n.barRadius,ry:n.barRadius,x:L,y:C,width:S,height:E}),this._hbarXMin=L+S/2,this._hbarTranslateMax=M-S):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var z=g>A,I=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,O=p+m,R=v;O+I>l&&(O=l-I);var j=this.container.selectAll("rect.scrollbar-vertical").data(z?[0]:[]);j.exit().on(".drag",null).remove(),j.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),z?(this.vbar=j.attr({rx:n.barRadius,ry:n.barRadius,x:O,y:R,width:I,height:P}),this._vbarYMin=R+P/2,this._vbarTranslateMax=A-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,N=c-.5,B=z?h+I+.5:h+.5,U=f-.5,V=T?d+E+.5:d+.5,H=s._topdefs.selectAll("#"+F).data(T||z?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",F).append("rect"),T||z?(this._clipRect=H.select("rect").attr({x:Math.floor(N),y:Math.floor(U),width:Math.ceil(B)-Math.floor(N),height:Math.ceil(V)-Math.floor(U)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:v,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),T||z){var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(q);var Y=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(Y),z&&this.vbar.on(".drag",null).call(Y)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax,a=s.constrain(i.event.x,r,n),o=(a-r)/(n-r),l=this.position.w-this._box.w;t=o*l}if(this.vbar){var u=e+this._vbarYMin,c=u+this._vbarTranslateMax,h=s.constrain(i.event.y,u,c),f=(h-u)/(c-u),d=this.position.h-this._box.h;e=f*d}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":667,"../color":562,"../drawing":585,d3:97}],645:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],646:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],647:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],648:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3}},{}],649:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5}},{}],650:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],651:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],652:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.24.0",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/legend"),t("./components/annotations"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=n.Fx,r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":558,"./components/images":598,"./components/legend":606,"./components/rangeselector":618,"./components/rangeslider":624,"./components/shapes":631,"./components/sliders":637,"./components/updatemenus":643,"./fonts/mathjax_config":653,"./lib/queue":679,"./plot_api/plot_schema":695,"./plot_api/register":696,"./plot_api/set_plot_config":697,"./plot_api/to_image":699,"./plot_api/validate":700,"./plotly":701,"./snapshot":786,"./snapshot/download":783,"./traces/scatter":921,d3:97,"es6-promise":103}],653:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],654:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],655:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":649,"fast-isnumeric":106}],656:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../components/colorscale/get_scale"),o=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=/^([2-9]|[1-9][0-9]+)$/;r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),n.values.indexOf(t)===-1?e.set(r):e.set(t)}},boolean:{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,i){!n(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;n.strict!==!0&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(a(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;return"string"==typeof t&&t.substr(0,n)===r&&s.test(t.substr(n))?void e.set(t):void e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r||"string"==typeof t&&!(t.substr(0,n)!==r||!s.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if((n.extras||[]).indexOf(t)!==-1)return void e.set(t);for(var i=t.split("+"),a=0;a<i.length;){var o=i[a];n.flags.indexOf(o)===-1||i.indexOf(o)<a?i.splice(a,1):a++}i.length?e.set(i.join("+")):e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,i){if(!Array.isArray(t))return void e.set(n);var a=i.items,o=[];n=Array.isArray(n)?n:[];for(var s=0;s<a.length;s++)r.coerce(t,o,a,"["+s+"]",n[s]);e.set(o)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var n=e.items;if(!e.freeLength&&t.length!==n.length)return!1;for(var i=0;i<t.length;i++){var a=r.validate(t[i],e.items[i]);if(!a)return!1}return!0}}},r.coerce=function(t,e,n,i,a){var s=o(n,i).get(),l=o(t,i),u=o(e,i),c=l.get();return void 0===a&&(a=s.dflt),s.arrayOk&&Array.isArray(c)?(u.set(c),c):(r.valObjects[s.valType].coerceFunction(c,u,a,s),u.get())},r.coerce2=function(t,e,n,i,a){var s=o(t,i),l=r.coerce(t,e,n,i,a),u=s.get();return void 0!==u&&null!==u&&l},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.validate=function(t,e){var n=r.valObjects[e.valType];if(e.arrayOk&&Array.isArray(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var i={},a=i,o={set:function(t){a=t}};return n.coerceFunction(t,o,i,e),a!==i}},{"../components/colorscale/get_scale":574,"../components/colorscale/scales":580,"./nested_property":673,"fast-isnumeric":106,tinycolor2:498}],657:[function(t,e,r){"use strict";function n(t){return t&&M.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function i(t,e){return String(t+Math.pow(10,e)).substr(1)}function a(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+i(e,2)+":"+i(r,2),(n||a)&&(t+=":"+i(n,2),a))){for(var o=4;a%10===0;)o-=1,a/=10;t+="."+i(a,o)}return t}function o(t,e,r){t=t.replace(I,function(t){var r=Math.min(+t.charAt(1)||6,6),n=(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0";return n});var i=new Date(Math.floor(e+.05));if(n(r))try{t=M.getComponentMethod("calendars","worldCalFmt")(t,e,r)}catch(t){return"Invalid"}return A(t)(i)}function s(t,e){var r=m(t+.05,y),n=i(Math.floor(r/b),2)+":"+i(m(Math.floor(r/x),60),2);if("M"!==e){d(e)||(e=0);var a=Math.min(m(t/_,60),P[e]),o=(100+a).toFixed(e).substr(1);e>0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function h(t){return t.formatDate("M d, yyyy")}var f=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,m=t("./mod"),v=t("../constants/numerical"),g=v.BADNUM,y=v.ONEDAY,b=v.ONEHOUR,x=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,M=t("../registry"),A=f.time.format.utc,k=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,T=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,S=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var E,L;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*x,t>=E&&t<=L?t:g;if("string"!=typeof t&&"number"!=typeof t)return g;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?T:k);if(!s)return g;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),h=Number(s[7]||0),f=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return g;l=Number(l);var p;try{var m=M.getComponentMethod("calendars","getCal")(e);if(o){var v="i"===u.charAt(u.length-1);u=parseInt(u,10),p=m.newDate(l,m.toMonthIndex(l,u,v),c)}else p=m.newDate(l,Number(u),c)}catch(t){return g}return p?(p.toJD()-w)*y+h*b+f*x+d*_:g}l=2===l.length?(Number(l)+2e3-S)%100+S:Number(l),u-=1;var A=new Date(Date.UTC(2e3,u,c,h,f));return A.setUTCFullYear(l),A.getUTCMonth()!==u?g:A.getUTCDate()!==c?g:A.getTime()+d*_},E=r.MIN_MS=r.dateTime2ms("-9999"),L=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==g};var C=90*y,D=3*b,z=5*x;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=E&&t<=L))return g;e||(e=0);var i,o,s,l,u,c,h=Math.floor(10*m(t+.05,1)),f=Math.round(t-h/10);if(n(r)){var d=Math.floor(f/y)+w,p=Math.floor(m(t,y));try{i=M.getComponentMethod("calendars","getCal")(r).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=A("G%Y-%m-%d")(new Date(f))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e<C?Math.floor(p/b):0,s=e<C?Math.floor(p%b/x):0,l=e<D?Math.floor(p%x/_):0,u=e<z?p%_*10+h:0}else c=new Date(f),i=A("%Y-%m-%d")(c),o=e<C?c.getUTCHours():0,s=e<C?c.getUTCMinutes():0,l=e<D?c.getUTCSeconds():0,u=e<z?10*c.getUTCMilliseconds()+h:0;return a(i,o,s,l,u)},r.ms2DateTimeLocal=function(t){if(!(t>=E+y&&t<=L-y))return g;var e=Math.floor(10*m(t+.05,1)),r=new Date(Math.round(t-e/10)),n=f.time.format("%Y-%m-%d")(r),i=r.getHours(),o=r.getMinutes(),s=r.getSeconds(),l=10*r.getUTCMilliseconds()+e;return a(n,i,o,s,l)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(t=r.ms2DateTimeLocal(+t),!t&&void 0!==e)return e}else if(!r.isDateTime(t,i))return p("unrecognized date",t),e;return t};var I=/%\d?f/g,P=[59,59.9,59.99,59.999,59.9999],O=A("%Y"),R=A("%b %Y"),j=A("%b %-d"),F=A("%b %-d, %Y");r.formatDate=function(t,e,r,i){var a,f;if(i=n(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===r?f=l(p):"m"===r?f=u(p):"d"===r?(a=l(p),f=c(p)):(a=h(p),f=s(t,r))}catch(t){return"Invalid"}else{var m=new Date(Math.floor(t+.05));"y"===r?f=O(m):"m"===r?f=R(m):"d"===r?(a=O(m),f=j(m)):(a=F(m),f=s(t,r))}return f+(a?"\n"+a:"")};var N=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=m(t,y);if(t=Math.round(t-i),r)try{var a=Math.round(t/y)+w,o=M.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*y+i}catch(e){p("invalid ms "+t+" in calendar "+r)}var l=new Date(t+N);return l.setUTCMonth(l.getUTCMonth()+e)+i-N},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c<t.length;c++)if(i=t[c],d(i)){if(!(i%y))if(u)try{r=u.fromJD(i/y+w),1===r.day()?1===r.month()?a++:o++:s++}catch(t){}else r=new Date(i),1===r.getUTCDate()?0===r.getUTCMonth()?a++:o++:s++}else l++;o+=a,s+=o;var h=t.length-l;return{exactYears:a/h,exactMonths:o/h,exactDays:s/h}}},{"../constants/numerical":649,"../registry":781,"./loggers":670,"./mod":672,d3:97,"fast-isnumeric":106}],658:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,i){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,i),e.emit(n,i),r.emit(n,i)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;l<o.length;l++)o[l](r);return i=s(r),void 0!==n?n:i},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=i},{events:104}],659:[function(t,e,r){"use strict";function n(t,e){var r,n;for(r=0;r<t.length;r++){if(n=t[r],null!==n&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}function i(t,e,r,s){var l,u,c,h,f,d,p,m=t[0],v=t.length;if(2===v&&o(m)&&o(t[1])&&0===m.length){if(p=n(t[1],m))return m;m.splice(0,m.length)}for(var g=1;g<v;g++){l=t[g];for(u in l)c=m[u],h=l[u],s&&o(h)?m[u]=h:e&&h&&(a(h)||(f=o(h)))?(f?(f=!1,d=c&&o(c)?c:[]):d=c&&a(c)?c:{},m[u]=i([d,h],e,r,s)):("undefined"!=typeof h||r)&&(m[u]=h)}return m}var a=t("./is_plain_object.js"),o=Array.isArray;r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{"./is_plain_object.js":669}],660:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,i=0;i<t.length;i++){var a=t[i];1!==e[a]&&(e[a]=1,r[n++]=a)}return r}},{}],661:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n.visible===!0&&e.push(n)}return e}},{}],662:[function(t,e,r){"use strict";function n(t,e){var r=l[t];return r(e)}function i(t){for(var e=0;e<s.length;e++){var r=s[e],n=new RegExp(a[r]);if(n.test(t.trim().toLowerCase()))return r}return o.warn("Unrecognized country name: "+t+"."),!1}var a=t("country-regex"),o=t("../lib"),s=Object.keys(a),l={"ISO-3":o.identity,"USA-states":o.identity,"country names":i};r.locationToFeature=function(t,e,r){var i=n(t,e);if(i){for(var a=0;a<r.length;a++){var s=r[a];if(s.id===i)return s}o.warn(["Location with id",i,"does not have a matching topojson feature at this resolution."].join(" "))}return!1}},{"../lib":667,"country-regex":90}],663:[function(t,e,r){"use strict";r.calcTraceToLineCoords=function(t){for(var e=t[0].trace,r=e.connectgaps,n=[],i=[],a=0;a<t.length;a++){var o=t[a];i.push(o.lonlat),!r&&o.gapAfter&&i.length>0&&(n.push(i),i=[])}return i.length>0&&n.push(i),n},r.makeLine=function(t,e){var r={};return r=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t},e&&(r.trace=e),r},r.makePolygon=function(t,e){var r={};if(1===t.length)r={type:"Polygon",coordinates:t};else{for(var n=new Array(t.length),i=0;i<t.length;i++)n[i]=[t[i]];r={type:"MultiPolygon",coordinates:n}}return e&&(r.trace=e),r},r.makeBlank=function(){return{type:"Point",coordinates:[]}}},{}],664:[function(t,e,r){"use strict";function n(t,e){var r=h(t);return r[3]*=e,r}function i(t){return s(t).isValid()?t:c}function a(t){return l(t)?t:f}function o(t,e,r){var o,s,l,h,d,p=t.color,m=Array.isArray(p),v=Array.isArray(e),g=[];if(o=void 0!==t.colorscale?u.makeColorScaleFunc(u.extractScale(t.colorscale,t.cmin,t.cmax)):i,s=m?function(t,e){return void 0===t[e]?c:o(t[e])}:i,l=v?function(t,e){return void 0===t[e]?f:a(t[e])}:a,m||v)for(var y=0;y<r;y++)h=s(p,y),d=l(e,y),g[y]=n(h,d);else g=n(p,e);return g}var s=t("tinycolor2"),l=t("fast-isnumeric"),u=t("../components/colorscale"),c=t("../components/color/attributes").defaultLine,h=t("./str2rgbarray"),f=1;e.exports=o},{"../components/color/attributes":561,"../components/colorscale":576,"./str2rgbarray":685,"fast-isnumeric":106,tinycolor2:498}],665:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(r<e)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\<br\>/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(n<r)r+=1;else{var i=e[t.slice(r+1,n)];t=i?t.slice(0,r)+i+t.slice(n+1):t.slice(0,r)+t.slice(n+1)}}return t}function s(t){return""+o(a(n(i(t))))}var l=t("superscript-text"),u=t("../constants/string_mappings");e.exports=s},{"../constants/string_mappings":650,"superscript-text":495}],666:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],667:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object"),i.isArray=t("./is_array"),i.mod=t("./mod"),i.toLogRange=t("./to_log_range"),i.relinkPrivateKeys=t("./relink_private");var a=t("./coerce");i.valObjects=a.valObjects,i.coerce=a.coerce,i.coerce2=a.coerce2,i.coerceFont=a.coerceFont,i.validate=a.validate;var o=t("./dates");i.dateTime2ms=o.dateTime2ms,i.isDateTime=o.isDateTime,i.ms2DateTime=o.ms2DateTime,i.ms2DateTimeLocal=o.ms2DateTimeLocal,i.cleanDate=o.cleanDate,i.isJSDate=o.isJSDate,i.formatDate=o.formatDate,i.incrementMonth=o.incrementMonth,i.dateTick0=o.dateTick0,i.dfltRange=o.dfltRange,i.findExactDates=o.findExactDates,i.MIN_MS=o.MIN_MS,i.MAX_MS=o.MAX_MS;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.sorterDes=s.sorterDes,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t("./matrix");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged, i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t("./extend");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll,i.extendDeepNoArrays=c.extendDeepNoArrays;var h=t("./loggers");i.log=h.log,i.warn=h.warn,i.error=h.error,i.notifier=t("./notifier"),i.filterUnique=t("./filter_unique"),i.filterVisible=t("./filter_visible"),i.pushUnique=t("./push_unique"),i.cleanNumber=t("./clean_number"),i.noop=t("./noop"),i.identity=t("./identity"),i.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;a<e.length;a++){var o=e[a],s=i.nestedProperty(t,o.replace("?",r)),l=i.nestedProperty(t,o.replace("?",n)),u=s.get();s.set(l.get()),l.set(u)}},i.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1},i.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},i.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o<i;o++)a[o]=e(t[o],r,n);return a},i.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,a,o,s=Math.log(Math.pow(2,r))/Math.log(n),l="";for(i=2;s===1/0;i*=2)s=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var u=s-Math.floor(s);for(i=0;i<Math.floor(s);i++)o=Math.floor(Math.random()*n).toString(n),l=o+l;u&&(a=Math.pow(n,u),o=Math.floor(Math.random()*a).toString(n),l=o+l);var c=parseInt(l,n);return e&&e.indexOf(l)>-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):l},i.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},i.smooth=function(t,e){if(e=Math.round(e)||0,e<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r<l;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)i=r+n+1-e,i<-o?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},i.syncOrAsync=function(t,e,r){function n(){return i.syncOrAsync(t,e,r)}for(var a,o;t.length;)if(o=t.splice(0,1)[0],a=o(e),a&&a.then)return a.then(n).then(void 0,i.promiseError);return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n<r.length;n++)i=t[r[n]],void 0!==i&&null!==i?a=!0:o=!1;if(a&&!o)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},i.mergeArray=function(t,e,r){if(Array.isArray(t))for(var n=Math.min(t.length,e.length),i=0;i<n;i++)e[i][r]=t[i]},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,o,s=3,l=Object.keys(t);for(n=0;n<l.length;n++)a=l[n],o=t[a],"_"!==a.charAt(0)&&"function"!=typeof o&&("module"===a?r[a]=o:Array.isArray(o)?r[a]=o.slice(0,s):o&&"object"==typeof o?r[a]=i.minExtend(t[a],e[a]):r[a]=o);for(l=Object.keys(e),n=0;n<l.length;n++)a=l[n],o=e[a],"object"==typeof o&&a in r&&"object"==typeof r[a]||(r[a]=o);return r},i.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},i.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])!==-1)return!0;return!1},i.getPlotDiv=function(t){for(;t&&t.removeAttribute;t=t.parentNode)if(i.isPlotDiv(t))return t},i.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},i.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},i.addStyleRule=function(t,e){if(!i.styleSheet){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r),i.styleSheet=r.sheet}var n=i.styleSheet;n.insertRule?n.insertRule(t+"{"+e+"}",0):n.addRule?n.addRule(t,e,0):i.warn("addStyleRule failed")},i.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob},i.isD3Selection=function(t){return t&&"function"==typeof t.classed},i.objectFromPath=function(t,e){for(var r,n=t.split("."),i=r={},a=0;a<n.length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],a===n.length-1?r[s]=e:r[s]={},r=r[s]):(a===n.length-1?r[o]=e:r[o]={},r=r[o])}return i};var f=/^([^\[\.]+)\.(.+)?/,d=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;i.expandObjectPaths=function(t){var e,r,n,a,o,s,l;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(f))?(a=t[r],n=e[1],delete t[r],t[n]=i.extendDeepNoArrays(t[n]||{},i.objectFromPath(r,i.expandObjectPaths(a))[n])):(e=r.match(d))?(a=t[r],n=e[1],o=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(l=e[4],s=t[n][o]=t[n][o]||{},i.extendDeepNoArrays(s,i.objectFromPath(l,i.expandObjectPaths(a)))):t[n][o]=i.expandObjectPaths(a)):t[r]=i.expandObjectPaths(t[r]));return t},i.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,i=e.charAt(0),a=e.charAt(1),o=t.split("."),s=o[0],l=o.length>1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l}},{"./clean_number":655,"./coerce":656,"./dates":657,"./extend":659,"./filter_unique":660,"./filter_visible":661,"./identity":666,"./is_array":668,"./is_plain_object":669,"./loggers":670,"./matrix":671,"./mod":672,"./nested_property":673,"./noop":674,"./notifier":675,"./push_unique":678,"./relink_private":680,"./search":681,"./stats":684,"./to_log_range":687,d3:97}],668:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],669:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],670:[function(t,e,r){"use strict";function n(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r<e.length;r++)t(e[r])}var i=t("../plot_api/plot_config"),a=e.exports={};a.log=function(){if(i.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},a.warn=function(){if(i.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},a.error=function(){if(i.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.error,t)}}},{"../plot_api/plot_config":694}],671:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;e<i;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;e<n;e++)for(a[e]=new Array(i),r=0;r<i;r++)a[e][r]=t[r][e];return a},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;i<a;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),i=0;i<o.length;i++)n[i]=r.dot(t,o[i])}else for(n=0,i=0;i<a;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],672:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t%e;return r<0?r+e:r}},{}],673:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,a,o,s,l=t;for(o=0;o<e.length-1;o++){if(r=e[o],r===-1){for(i=!0,a=[],s=0;s<l.length;s++)a[s]=n(l[s],e.slice(o+1))(),a[s]!==a[0]&&(i=!1);return i?a[0]:a}if("number"==typeof r&&!d(l))return;if(l=l[r],"object"!=typeof l||null===l)return}if("object"==typeof l&&null!==l&&(a=l[e[o]],null!==a))return a}}function i(t,e){if(!c(t)||p(t)&&"]"===e.charAt(e.length-1)||e.match(g)&&void 0!==t)return!1;if(!d(t))return!0;if(e.match(v))return!0;var r=m(e);return r&&""===r.index}function a(t,e,r){return function(n){var a,c,h=t,f="",p=t,f,m=i(n,r);for(c=0;c<e.length-1;c++){if(a=e[c],"number"==typeof a&&!d(h))throw"array index but container is not an array";if(a===-1){if(m=!s(h,e.slice(c+1),n,r))break;return}if(!l(h,a,e[c+1],m))break;if(h=h[a],"object"!=typeof h||null===h)throw"container is not an object";f=o(f,a),p.push([h,f])}m?(c===e.length-1&&delete h[e[c]],u(p)):h[e[c]]=n}}function o(t,e){var r=e;return f(e)?r="["+e+"]":t&&(r="."+e),t+r}function s(t,e,r,n){var o,s=d(r),u=!0,c=r,h=n.replace("-1",0),f=!s&&i(r,h),p=e[0];for(o=0;o<t.length;o++)h=n.replace("-1",o),s&&(c=r[o%r.length],f=i(c,h)),f&&(u=!1),l(t,o,p,f)&&a(t[o],e,n.replace("-1",o))(c);return u}function l(t,e,r,n){if(void 0===t[e]){if(n)return!1;"number"==typeof r?t[e]=[]:t[e]={}}return!0}function u(t){var e,r,n,a,s,l;for(e=t.length-1;e>=0;e--){if(n=t[e][0],a=t[e][1],l=!1,d(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}function c(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function h(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var f=t("fast-isnumeric"),d=t("./is_array"),p=t("./is_plain_object"),m=t("../plot_api/container_array_match");e.exports=function(t,e){if(f(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,l=e.split(".");s<l.length;){if(r=String(l[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])l[s]=r[1];else{if(0!==s)throw"bad property string";l.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split("]["),o=0;o<i.length;o++)s++,l.splice(s,0,Number(i[o]))}s++}return"object"!=typeof t?h(t,e,l):{set:a(t,l,e),get:n(t,l),astr:e,parts:l,obj:t}};var v=/(^|\.)((domain|range)(\.[xy])?|args|parallels)$/,g=/(^|\.)args\[/},{"../plot_api/container_array_match":690,"./is_array":668,"./is_plain_object":669,"fast-isnumeric":106}],674:[function(t,e,r){"use strict";e.exports=function(){}},{}],675:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=[];e.exports=function(t,e){function r(t){t.duration(700).style("opacity",0).each("end",function(t){var e=a.indexOf(t);e!==-1&&a.splice(e,1),n.select(this).remove()})}if(a.indexOf(t)===-1){a.push(t);var o=1e3;i(e)?o=e:"long"===e&&(o=3e3);var s=n.select("body").selectAll(".plotly-notifier").data([0]);s.enter().append("div").classed("plotly-notifier",!0);var l=s.selectAll(".notifier-note").data(a);l.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var e=n.select(this);e.append("button").classed("notifier-close",!0).html("×").on("click",function(){e.transition().call(r)});for(var i=e.append("p"),a=t.split(/<br\s*\/?>/g),s=0;s<a.length;s++)s&&i.append("br"),i.append("span").text(a[s]);e.transition().duration(700).style("opacity",1).transition().delay(o).call(r)})}}},{d3:97,"fast-isnumeric":106}],676:[function(t,e,r){"use strict";var n=t("./setcursor"),i="data-savedcursor",a="!!";e.exports=function(t,e){var r=t.attr(i);if(e){if(!r){for(var o=(t.attr("class")||"").split(" "),s=0;s<o.length;s++){var l=o[s];0===l.indexOf("cursor-")&&t.attr(i,l.substr(7)).classed(l,!1)}t.attr(i)||t.attr(i,a)}n(t,e)}else r&&(t.attr(i,null),r===a?n(t):n(t,r))}},{"./setcursor":682}],677:[function(t,e,r){"use strict";var n=t("./matrix").dot,i=e.exports={};i.tester=function(t){function e(t,e){var r=t[0],n=t[1];return!(r<i||r>a||n<o||n>s)&&(!e||!u(t))}function r(t,e){var r=t[0],l=t[1];if(r<i||r>a||l<o||l>s)return!1;var u,c,h,f,d,p=n.length,m=n[0][0],v=n[0][1],g=0;for(u=1;u<p;u++)if(c=m,h=v,m=n[u][0],v=n[u][1],f=Math.min(c,m),!(r<f||r>Math.max(c,m)||l>Math.max(h,v)))if(l<Math.min(h,v))r!==f&&g++;else{if(d=m===c?l:h+(r-c)*(v-h)/(m-c),l===d)return 1!==u||!e;l<=d&&r!==f&&g++}return g%2===1}var n=t.slice(),i=n[0][0],a=i,o=n[0][1],s=o;n.push(n[0]);for(var l=1;l<n.length;l++)i=Math.min(i,n[l][0]),a=Math.max(a,n[l][0]),o=Math.min(o,n[l][1]),s=Math.max(s,n[l][1]);var u,c=!1;return 5===n.length&&(n[0][0]===n[1][0]?n[2][0]===n[3][0]&&n[0][1]===n[3][1]&&n[1][1]===n[2][1]&&(c=!0,u=function(t){return t[0]===n[0][0]}):n[0][1]===n[1][1]&&n[2][1]===n[3][1]&&n[0][0]===n[3][0]&&n[1][0]===n[2][0]&&(c=!0,u=function(t){return t[1]===n[0][1]})),{xmin:i,xmax:a,ymin:o,ymax:s,pts:n,contains:c?e:r,isRect:c}};var a=i.isSegmentBent=function(t,e,r,i){var a,o,s,l=t[e],u=[t[r][0]-l[0],t[r][1]-l[1]],c=n(u,u),h=Math.sqrt(c),f=[-u[1]/h,u[0]/h];for(a=e+1;a<r;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],s=n(o,u),s<0||s>c||Math.abs(n(o,f))>i)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(o+1);for(var u=l+1;u<t.length;u++)(u===t.length-1||a(t,l,u+1,e))&&(n.push(t[u]),n.length<s-2&&(i=u,o=n.length-1),l=u)}var n=[t[0]],i=0,o=0;if(t.length>1){var s=t.pop();r(s)}return{addPt:r,raw:t,filtered:n}}},{"./matrix":671}],678:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;r<t.length;r++)if(t[r]instanceof RegExp&&t[r].toString()===n)return t;t.push(e)}else e&&t.indexOf(e)===-1&&t.push(e);return t}},{}],679:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],a=0;a<e.length;a++)r=e[a],r===t?n[a]=r:"object"==typeof r?n[a]=Array.isArray(r)?i.extendDeep([],r):i.extendDeepAll({},r):n[a]=r;return n}var i=t("../lib"),a=t("../plot_api/plot_config"),o={};o.add=function(t,e,r,n,i){var o,s;return t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?void(t.undoQueue.inSequence||(t.autoplay=!1)):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,o),t.undoQueue.index+=1):o=t.undoQueue.queue[s-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(i)),void(t.undoQueue.queue.length>a.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)))},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)o.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},o.redo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.redo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)o.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},o.plotDo=function(t,e,r){t.autoplay=!0,r=n(t,r),e.apply(null,r)},e.exports=o},{"../lib":667,"../plot_api/plot_config":694}],680:[function(t,e,r){"use strict";var n=t("./is_array"),i=t("./is_plain_object");e.exports=function t(e,r){for(var a=Object.keys(r||{}),o=0;o<a.length;o++){var s=a[o],l=r[s],u=e[s];if("_"===s.charAt(0)||"function"==typeof l){if(s in e)continue;e[s]=l}else if(n(l)&&n(u)&&i(l[0]))for(var c=0;c<l.length;c++)i(l[c])&&i(u[c])&&t(u[c],l[c]);else i(l)&&i(u)&&(t(u,l),Object.keys(u).length||delete e[s])}}},{"./is_array":668,"./is_plain_object":669}],681:[function(t,e,r){"use strict";function n(t,e){return t<e}function i(t,e){return t<=e}function a(t,e){return t>e}function o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,h=0,f=e.length,d=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?o:a;h<f&&d++<100;)u=Math.floor((h+f)/2),c(e[u],t)?h=u+1:f=u;return d>90&&l.log("Long binary search..."),h-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;s<n;s++)e[s+1]>e[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i<a&&o++<100;)n=u((i+a)/2),e[n]<=t?i=n+s:a=n-l;return e[i]}},{"./loggers":670,"fast-isnumeric":106}],682:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],683:[function(t,e,r){"use strict";var n=t("../components/color"),i=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=i);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");return r.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../components/color":562}],684:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,a){var o,s;if(a||(a=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(a),o=0;o<a;o++)s[o]=r.aggNums(t,e,i[o]);i=s}for(o=0;o<a;o++)n(e)?n(i[o])&&(e=t(+e,+i[o])):e=i[o];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if(e=e*t.length-.5,e<0)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":106}],685:[function(t,e,r){"use strict";function n(t){return t=i(t),a.str2RgbaArray(t.toRgbString())}var i=t("tinycolor2"),a=t("arraytools");e.exports=n},{arraytools:36,tinycolor2:498}],686:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function a(t,e,r){var n="math-output-"+f.randstr([],64),a=h.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=h.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())f.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t,e){for(var r=t||"",n=0;n<e.length;n++){var i=e[n];r=r.replace(i.regExp,i.sub)}return r}function s(t){return o(t,y)}function l(t){return o(t,b)}function u(t){t=s(t),t=t.replace(x," ");for(var e=t.split(/(<[^<>]*>)/).map(function(t){var e=t.match(/<(\/?)([^ >]*)\s*(.*)>/i),n=e&&e[2].toLowerCase(),i=m[n];if(void 0!==i){var a=e[1],o=e[3],s=o.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===n){if(a)return"</a>";if("href"!==o.substr(0,4).toLowerCase())return"<a>";var u=o.substr(4).replace(/["']/g,"").replace(/=/,""),c=document.createElement("a");return c.href=u,v.indexOf(c.protocol)===-1?"<a>":'<a xlink:show="new" xlink:href="'+l(u)+'">'}if("br"===n)return"
";if(a)return"sup"===n?'</tspan><tspan dy="0.42em">​</tspan>':"sub"===n?'</tspan><tspan dy="-0.21em">​</tspan>':"</tspan>";var h="<tspan";return"sup"!==n&&"sub"!==n||(h="​"+h),s&&(s=s[1].replace(/(^|;)\s*color:/,"$1 fill:"),i=l(s)+(i?";"+i:"")),h+(i?' style="'+i+'"':"")+">"}return r.xml_entity_encode(t).replace(/</g,"<")}),n=[],i=e.indexOf("
");i>0;i=e.indexOf("
",i+1))n.push(i);var a=0;n.forEach(function(t){for(var r=t+a,n=e.slice(0,r),i="",o=n.length-1;o>=0;o--){var s=n[o].match(/<(\/?).*>/i);if(s&&"
"!==n[o]){s[1]||(i=n[o]);break}}i&&(e.splice(r+1,0,i),e.splice(r,0,"</tspan>"),a+=2)});var o=e.join(""),u=o.split(/
/gi);return u.length>1&&(e=u.map(function(t,e){return'<tspan class="line" dy="'+1.3*e+'em">'+t+"</tspan>"})),e.join("")}function c(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}var h=t("d3"),f=t("../lib"),d=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings");h.selection.prototype.appendSVG=function(t){for(var e=['<svg xmlns="',d.svg,'" ','xmlns:xlink="',d.xlink,'">',t,"</svg>"].join(""),r=(new DOMParser).parseFromString(e,"application/xml"),n=r.documentElement.firstChild;n;)this.node().appendChild(this.node().ownerDocument.importNode(n,!0)),n=n.nextSibling;return r.querySelector("parsererror")?(f.log(r.querySelector("parsererror div").textContent),null):h.select(this.node().lastChild)},r.html_entity_decode=function(t){var e=h.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":t.indexOf("<")!==-1||t.indexOf(">")!==-1?"":e.html(t).text()});return e.remove(),r},r.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},r.convertToTspans=function(t,e){function r(){d.empty()||(p=s.attr("class")+"-math",d.select("svg."+p).remove()),t.text("").style({visibility:"inherit","white-space":"pre"}),c=t.appendSVG(o),c||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(s)}var i=t.text(),o=u(i),s=t,l=!s.attr("data-notex")&&o.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),c=i,d=h.select(s.node().parentNode);if(!d.empty()){var p=s.attr("class")?s.attr("class").split(" ")[0]:"text";p+="-math",d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var m=t.node();m&&m.removeAttribute;m=m.parentNode)m.removeAttribute("data-bb");if(l){var v=f.getPlotDiv(s.node());(v&&v._promises||[]).push(new Promise(function(t){s.style({visibility:"hidden"});var i={fontSize:parseInt(s.style("font-size"),10)};a(l[2],i,function(i,a,o){d.selectAll("svg."+p).remove(),d.selectAll("g."+p+"-group").remove();var l=i&&i.select("svg");if(!l||!l.node())return r(),void t();var u=d.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});u.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:p,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=s.style("fill")||"black";l.select("g").attr({fill:c,stroke:c});var h=n(l,"width"),f=n(l,"height"),m=+s.attr("x")-h*{start:0,middle:.5,end:1}[s.attr("text-anchor")||"start"],v=parseInt(s.style("font-size"),10)||n(s,"height"),g=-v/4;"y"===p[0]?(u.attr({transform:"rotate("+[-90,+s.attr("x"),+s.attr("y")]+") translate("+[-h/2,g-f/2]+")"}),l.attr({x:+s.attr("x"),y:+s.attr("y")})):"l"===p[0]?l.attr({x:s.attr("x"),y:g-f/2}):"a"===p[0]?l.attr({x:0,y:g}):l.attr({x:m,y:+s.attr("y")+g-f/2}),e&&e.call(s,u),t(u)})}))}else r();return t}};var m={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},v=["http:","https:","mailto:"],g=new RegExp("</?("+Object.keys(m).join("|")+")( [^>]*)?/?>","g"),y=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),b=Object.keys(p.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+p.unicodeToEntity[t]+";"}}),x=/(\r\n?|\n)/g;r.plainText=function(t){return(t||"").replace(g," ")},r.makeEditable=function(t,e,r){function n(){a(),o.style({opacity:0});var t,e=u.attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&h.select(o.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var t=h.select(f.getPlotDiv(o.node())),e=t.select(".svg-container"),n=e.append("div");n.classed("plugin-editable editable",!0).style({position:"absolute","font-family":o.style("font-family")||"Arial","font-size":o.style("font-size")||12,color:r.fill||o.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(o.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||o.attr("data-unformatted")).call(c(o,e,r)).on("blur",function(){o.text(this.textContent).style({opacity:1});var t,e=h.select(this).attr("class");t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]",t&&h.select(o.node().parentNode).select(t).style({opacity:0});var r=this.textContent;h.select(this).transition().duration(0).remove(),h.select(document).on("mouseup",null),s.edit.call(o,r)}).on("focus",function(){var t=this;h.select(document).on("mouseup",function(){return h.event.target!==t&&void(document.activeElement===n.node()&&n.node().blur())})}).on("keyup",function(){27===h.event.which?(o.style({opacity:1}),h.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(o,this.textContent)):(s.input.call(o,this.textContent),h.select(this).call(c(o,e,r)))}).on("keydown",function(){13===h.event.which&&this.blur()}).call(i)}r||(r={});var o=this,s=h.dispatch("edit","input","cancel"),l=h.select(this.node()).style({"pointer-events":"all"}),u=e||l;return e&&l.style({"pointer-events":"none"}),r.immediate?n():u.on("click",n),h.rebind(this,s,"on")}},{"../constants/string_mappings":650,"../constants/xmlns_namespaces":651,"../lib":667,d3:97}],687:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":106}],688:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":728,"topojson-client":500}],689:[function(t,e,r){"use strict";function n(t,e){for(var r=new Float32Array(e),n=0;n<e;n++)r[n]=t[n];return r}function i(t,e){for(var r=new Float64Array(e),n=0;n<e;n++)r[n]=t[n];return r}e.exports=function(t,e){if(t instanceof Float32Array)return n(t,e);if(t instanceof Float64Array)return i(t,e);throw new Error("This array type is not yet supported by `truncate`.")}},{}],690:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s<a.length;s++)if(r=t.match(a[s]),r&&0===r.index){e=r[0];break}if(e||(e=i[i.indexOf(o)]),!e)return!1;var l=t.substr(e.length);return l?(r=l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/),!!r&&{array:e,index:Number(r[1]),property:r[3]||""}):{array:e,index:"",property:""}}},{"../registry":781}],691:[function(t,e,r){"use strict";function n(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=f.cleanId(r,n))}function i(t){var e="middle",r="center";return t.indexOf("top")!==-1?e="top":t.indexOf("bottom")!==-1&&(e="bottom"),t.indexOf("left")!==-1?r="left":t.indexOf("right")!==-1&&(r="right"),e+" "+r}function a(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}function o(t){var e=t.search(p);if(e>0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),u=t("../registry"),c=t("../lib"),h=t("../plots/plots"),f=t("../plots/cartesian/axes"),d=t("../components/color");r.getGraphDiv=function(t){var e;if("string"==typeof t){if(e=document.getElementById(t),null===e)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t},r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&c.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var i=f.list({_fullLayout:t});for(e=0;e<i.length;e++){var o=i[e];o.anchor&&"free"!==o.anchor&&(o.anchor=f.cleanId(o.anchor)),o.overlaying&&(o.overlaying=f.cleanId(o.overlaying)),o.type||(o.isdate?o.type="date":o.islog?o.type="log":o.isdate===!1&&o.islog===!1&&(o.type="linear")),"withzero"!==o.autorange&&"tozero"!==o.autorange||(o.autorange=!0,o.rangemode="tozero"),delete o.islog,delete o.isdate,delete o.categories,a(o,"domain")&&delete o.domain,void 0!==o.autotick&&(void 0===o.tickmode&&(o.tickmode=o.autotick?"auto":"linear"),delete o.autotick)}var s=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<s;e++){var u=t.annotations[e];c.isPlainObject(u)&&(u.ref&&("paper"===u.ref?(u.xref="paper",u.yref="paper"):"data"===u.ref&&(u.xref="x",u.yref="y"),delete u.ref),n(u,"xref"),n(u,"yref"))}var p=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<p;e++){var m=t.shapes[e];c.isPlainObject(m)&&(n(m,"xref"),n(m,"yref"))}var v=t.legend;v&&(v.x>3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var g=h.getSubplotIds(t,"gl3d");for(e=0;e<g.length;e++){var y=t[g[e]],b=y.cameraposition;if(Array.isArray(b)&&4===b[0].length){var x=b[0],_=b[1],w=b[2],M=l([],x),A=[];for(r=0;r<3;++r)A[r]=_[e]+w*M[2+4*r];y.camera={eye:{x:A[0],y:A[1],z:A[2]},center:{x:_[0],y:_[1],z:_[2]},up:{x:M[1],y:M[5],z:M[9]}},delete y.cameraposition}}return d.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),s=0;s<t.length;s++){var l,p=t[s];if(!("uid"in p)||n.indexOf(p.uid)!==-1){var m;for(l=0;l<100&&(m=c.randstr(o),n.indexOf(m)!==-1);l++);p.uid=c.randstr(o),o.push(p.uid)}if(n.push(p.uid),"histogramy"===p.type&&"xbins"in p&&!("ybins"in p)&&(p.ybins=p.xbins,delete p.xbins),p.error_y&&"opacity"in p.error_y){var v=d.defaults,g=p.error_y.color||(u.traceIs(p,"bar")?d.defaultLine:v[s%v.length]);p.error_y.color=d.addOpacity(d.rgb(g),d.opacity(g)*p.error_y.opacity), delete p.error_y.opacity}if("bardir"in p&&("h"!==p.bardir||!u.traceIs(p,"bar")&&"histogram"!==p.type.substr(0,9)||(p.orientation="h",r.swapXYData(p)),delete p.bardir),"histogramy"===p.type&&r.swapXYData(p),"histogramx"!==p.type&&"histogramy"!==p.type||(p.type="histogram"),"scl"in p&&(p.colorscale=p.scl,delete p.scl),"reversescl"in p&&(p.reversescale=p.reversescl,delete p.reversescl),p.xaxis&&(p.xaxis=f.cleanId(p.xaxis,"x")),p.yaxis&&(p.yaxis=f.cleanId(p.yaxis,"y")),u.traceIs(p,"gl3d")&&p.scene&&(p.scene=h.subplotsRegistry.gl3d.cleanId(p.scene)),u.traceIs(p,"pie")||u.traceIs(p,"bar")||(Array.isArray(p.textposition)?p.textposition=p.textposition.map(i):p.textposition&&(p.textposition=i(p.textposition))),u.traceIs(p,"2dMap")&&("YIGnBu"===p.colorscale&&(p.colorscale="YlGnBu"),"YIOrRd"===p.colorscale&&(p.colorscale="YlOrRd")),u.traceIs(p,"markerColorscale")&&p.marker){var y=p.marker;"YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd")}if("surface"===p.type&&c.isPlainObject(p.contours)){var b=["x","y","z"];for(l=0;l<b.length;l++){var x=p.contours[b[l]];c.isPlainObject(x)&&(x.highlightColor&&(x.highlightcolor=x.highlightColor,delete x.highlightColor),x.highlightWidth&&(x.highlightwidth=x.highlightWidth,delete x.highlightWidth))}}if(Array.isArray(p.transforms)){var _=p.transforms;for(l=0;l<_.length;l++){var w=_[l];c.isPlainObject(w)&&"filter"===w.type&&(w.filtersrc&&(w.target=w.filtersrc,delete w.filtersrc),w.calendar&&(w.valuecalendar||(w.valuecalendar=w.calendar),delete w.calendar))}}a(p,"line")&&delete p.line,"marker"in p&&(a(p.marker,"line")&&delete p.marker.line,a(p,"marker")&&delete p.marker),d.clean(p)}},r.swapXYData=function(t){var e;if(c.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);c.swapAttrs(t,["error_?.copy_ystyle"]),n&&c.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if(t.hoverinfo){var i=t.hoverinfo.split("+");for(e=0;e<i.length;e++)"x"===i[e]?i[e]="y":"y"===i[e]&&(i[e]="x");t.hoverinfo=i.join("+")}},r.coerceTraceIndices=function(t,e){return s(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},r.manageArrayContainers=function(t,e,r){var n=t.obj,i=t.parts,a=i.length,o=i[a-1],l=s(o);if(l&&null===e){var u=i.slice(0,a-1).join("."),h=c.nestedProperty(n,u).get();h.splice(o,1)}else l&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var p=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;r.hasParent=function(t,e){for(var r=o(e);r;){if(r in t)return!0;r=o(r)}return!1}},{"../components/color":562,"../lib":667,"../plots/cartesian/axes":706,"../plots/plots":766,"../registry":781,"fast-isnumeric":106,"gl-mat4/fromQuat":151}],692:[function(t,e,r){"use strict";var n=t("../lib/nested_property"),i=t("../lib/is_plain_object"),a=t("../lib/noop"),o=t("../lib/loggers"),s=t("../registry");r.containerArrayMatch=t("./container_array_match");var l=r.isAddVal=function(t){return"add"===t||i(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,i){var c=e.astr,h=s.getComponentMethod(c,"supplyLayoutDefaults"),f=s.getComponentMethod(c,"draw"),d=s.getComponentMethod(c,"drawOne"),p=i.replot||i.recalc||h===a||f===a,m=t.layout,v=t._fullLayout;if(r[""]){Object.keys(r).length>1&&o.warn("Full array edits are incompatible with other edits",c);var g=r[""][""];if(u(g))e.set(null);else{if(!Array.isArray(g))return o.warn("Unrecognized full array edit value",c,g),!0;e.set(g)}return!p&&(h(m,v),f(t),!0)}var y,b,x,_,w,M,A,k=Object.keys(r).map(Number).sort(),T=e.get(),S=T||[],E=n(v,c).get(),L=[],C=-1,D=S.length;for(y=0;y<k.length;y++)if(x=k[y],_=r[x],w=Object.keys(_),M=_[""],A=l(M),x<0||x>S.length-(A?0:1))o.warn("index out of range",c,x);else if(void 0!==M)w.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",c,x),u(M)?L.push(x):A?("add"===M&&(M={}),S.splice(x,0,M),E&&E.splice(x,0,{})):o.warn("Unrecognized full object edit value",c,x,M),C===-1&&(C=x);else for(b=0;b<w.length;b++)n(S[x],w[b]).set(_[w[b]]);for(y=L.length-1;y>=0;y--)S.splice(L[y],1),E&&E.splice(L[y],1);if(S.length?T||e.set(S):e.set(null),p)return!1;if(h(m,v),d!==a){var z;if(C===-1)z=k;else{for(D=Math.max(S.length,D),z=[],y=0;y<k.length&&(x=k[y],!(x>=C));y++)z.push(x);for(y=C;y<D;y++)z.push(y)}for(y=0;y<z.length;y++)d(t,z[y])}else f(t);return!0}},{"../lib/is_plain_object":669,"../lib/loggers":670,"../lib/nested_property":673,"../lib/noop":674,"../registry":781,"./container_array_match":690}],693:[function(t,e,r){"use strict";function n(t,e){t._fullLayout._paperdiv.style("background","white"),y.defaultConfig.setBackground(t,e)}function i(t,e){t._context||(t._context=b.extendFlat({},y.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=n:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function a(t,e,r){var n=v.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=n.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e),r&&(t.layout=r),k.manager.fillLayout(t),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=k.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var a=t.framework.svg(),o=1,s=t._fullLayout.title;""!==s&&s||(o=0);var l="Click to enter title",u=function(){this.call(L.convertToTspans)},c=a.select(".title-group text").call(u);if(t._context.editable){c.attr({"data-unformatted":s}),s&&s!==l||(o=.2,c.attr({"data-unformatted":l}).text(l).style({opacity:o}).on("mouseover.opacity",function(){v.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){v.select(this).transition().duration(1e3).style("opacity",0)}));var h=function(){this.call(L.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(u),this.call(h)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(u)})};c.call(h)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),M.addLinks(t),Promise.resolve()}function o(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)n=t[r],n<0?a.push(i+n):a.push(n);return a}function s(t,e,r){var n,i;for(n=0;n<e.length;n++){if(i=e[n],i!==parseInt(i,10))throw new Error("all values in "+r+" must be integers");if(i>=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function l(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),s(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&s(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function u(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if(i=e[n],"object"!=typeof i||Array.isArray(i)||null===i)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function c(t,e,r,n){var i=b.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!b.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");s(t,r,"indices");for(var a in e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function h(t,e,r,n){var i,a,s,l,u,c=b.isPlainObject(n),h=[];Array.isArray(r)||(r=[r]),r=o(r,t.data.length-1);for(var f in e)for(var d=0;d<r.length;d++){if(i=t.data[r[d]],s=b.nestedProperty(i,f),a=s.get(),l=e[f][d],!Array.isArray(l))throw new Error("attribute: "+f+" index: "+d+" must be an array");if(!Array.isArray(a))throw new Error("cannot extend missing or non-array attribute: "+f);u=c?n[f][d]:n,g(u)||(u=-1),h.push({prop:s,target:a,insert:l,maxp:Math.floor(u)})}return h}function f(t,e,r,n,i,a){c(t,e,r,n);for(var o,s,l,u=h(t,e,r,n),f=[],d={},p={},m=0;m<u.length;m++)s=u[m].prop,l=u[m].maxp,o=i(u[m].target,u[m].insert),l>=0&&l<o.length&&(f=a(o,l)),l=u[m].target.length,s.set(o),Array.isArray(d[s.astr])||(d[s.astr]=[]),Array.isArray(p[s.astr])||(p[s.astr]=[]),d[s.astr].push(f),p[s.astr].push(l);return{update:d,maxPoints:p}}function d(t,e,r){function n(){return d.map(function(){})}function i(t){var e=y.Axes.id2name(t);u.indexOf(e)===-1&&u.push(e)}function a(t){return"LAYOUT"+t+".autorange"}function o(t){return"LAYOUT"+t+".range"}function s(r,i,a){if(Array.isArray(r))return void r.forEach(function(t){s(t,i,a)});if(!(r in e||D.hasParent(e,r))){var o;o="LAYOUT"===r.substr(0,6)?b.nestedProperty(t.layout,r.replace("LAYOUT","")):b.nestedProperty(f[d[a]],r),r in v||(v[r]=n()),void 0===v[r][a]&&(v[r][a]=o.get()),void 0!==i&&o.set(i)}}var l,u,c=t._fullLayout,h=t._fullData,f=t.data,d=D.coerceTraceIndices(t,r),p={docalc:!1,docalcAutorange:!1,doplot:!1,dostyle:!1,docolorbars:!1,autorangeOn:!1,clearCalc:!1,fullReplot:!1},m={},v={},g={},x=["mode","visible","type","orientation","fill","histfunc","histnorm","text","x","y","z","a","b","c","open","high","low","close","base","width","offset","xtype","x0","dx","ytype","y0","dy","xaxis","yaxis","line.width","connectgaps","transpose","zsmooth","showscale","marker.showscale","zauto","marker.cauto","autocolorscale","marker.autocolorscale","colorscale","marker.colorscale","reversescale","marker.reversescale","autobinx","nbinsx","xbins","xbins.start","xbins.end","xbins.size","autobiny","nbinsy","ybins","ybins.start","ybins.end","ybins.size","autocontour","ncontours","contours","contours.coloring","error_y","error_y.visible","error_y.value","error_y.type","error_y.traceref","error_y.array","error_y.symmetric","error_y.arrayminus","error_y.valueminus","error_y.tracerefminus","error_x","error_x.visible","error_x.value","error_x.type","error_x.traceref","error_x.array","error_x.symmetric","error_x.arrayminus","error_x.valueminus","error_x.tracerefminus","swapxy","swapxyaxes","orientationaxes","marker.colors","values","labels","label0","dlabel","sort","textinfo","textposition","textfont.size","textfont.family","textfont.color","insidetextfont.size","insidetextfont.family","insidetextfont.color","outsidetextfont.size","outsidetextfont.family","outsidetextfont.color","hole","scalegroup","domain","domain.x","domain.y","domain.x[0]","domain.x[1]","domain.y[0]","domain.y[1]","tilt","tiltaxis","depth","direction","rotation","pull","line.showscale","line.cauto","line.autocolorscale","line.reversescale","marker.line.showscale","marker.line.cauto","marker.line.autocolorscale","marker.line.reversescale","xcalendar","ycalendar","cumulative","cumulative.enabled","cumulative.direction","cumulative.currentbin"];for(l=0;l<d.length;l++)if(w.traceIs(h[d[l]],"box")){x.push("name");break}var _=["marker","marker.size","textfont","boxpoints","jitter","pointpos","whiskerwidth","boxmean","tickwidth"],A=["zmin","zmax","zauto","xgap","ygap","marker.cmin","marker.cmax","marker.cauto","line.cmin","line.cmax","marker.line.cmin","marker.line.cmax","contours.start","contours.end","contours.size","contours.showlines","line","line.smoothing","line.shape","error_y.width","error_x.width","error_x.copy_ystyle","marker.maxdisplayed"],k=["type","x","y","x0","y0","orientation","xaxis","yaxis"],T=["zmin","zmax"],S=["xbins.start","xbins.end","xbins.size"],E=["ybins.start","ybins.end","ybins.size"],L=["contours.start","contours.end","contours.size"],C=["cartesian","pie","ternary"];c._basePlotModules.forEach(function(t){C.indexOf(t.name)===-1&&(p.docalc=!0)});for(var z in e){if(D.hasParent(e,z))throw new Error("cannot set "+z+"and a parent attribute simultaneously");var I,P,O,R,j,F=e[z];if(m[z]=F,"LAYOUT"!==z.substr(0,6)){for(v[z]=n(),l=0;l<d.length;l++)if(I=f[d[l]],P=h[d[l]],O=b.nestedProperty(I,z),R=O.get(),j=Array.isArray(F)?F[l%F.length]:F,void 0!==j){if(T.indexOf(z)!==-1)s("zauto",!1,l);else if("colorscale"===z)s("autocolorscale",!1,l);else if("autocolorscale"===z)s("colorscale",void 0,l);else if("marker.colorscale"===z)s("marker.autocolorscale",!1,l);else if("marker.autocolorscale"===z)s("marker.colorscale",void 0,l);else if("zauto"===z)s(T,void 0,l);else if(S.indexOf(z)!==-1)s("autobinx",!1,l);else if("autobinx"===z)s(S,void 0,l);else if(E.indexOf(z)!==-1)s("autobiny",!1,l);else if("autobiny"===z)s(E,void 0,l);else if(L.indexOf(z)!==-1)s("autocontour",!1,l);else if("autocontour"===z)s(L,void 0,l);else if(["x0","dx"].indexOf(z)!==-1&&P.x&&"scaled"!==P.xtype)s("xtype","scaled",l);else if(["y0","dy"].indexOf(z)!==-1&&P.y&&"scaled"!==P.ytype)s("ytype","scaled",l);else if("colorbar.thicknessmode"===z&&O.get()!==j&&["fraction","pixels"].indexOf(j)!==-1&&P.colorbar){var N=["top","bottom"].indexOf(P.colorbar.orient)!==-1?c.height-c.margin.t-c.margin.b:c.width-c.margin.l-c.margin.r;s("colorbar.thickness",P.colorbar.thickness*("fraction"===j?1/N:N),l)}else if("colorbar.lenmode"===z&&O.get()!==j&&["fraction","pixels"].indexOf(j)!==-1&&P.colorbar){var B=["top","bottom"].indexOf(P.colorbar.orient)!==-1?c.width-c.margin.l-c.margin.r:c.height-c.margin.t-c.margin.b;s("colorbar.len",P.colorbar.len*("fraction"===j?1/B:B),l)}else"colorbar.tick0"===z||"colorbar.dtick"===z?s("colorbar.tickmode","linear",l):"colorbar.tickmode"===z&&s(["colorbar.tick0","colorbar.dtick"],void 0,l);if("type"===z&&"pie"===j!=("pie"===R)){var U="x",V="y";"bar"!==j&&"bar"!==R||"h"!==I.orientation||(U="y",V="x"),b.swapAttrs(I,["?","?src"],"labels",U),b.swapAttrs(I,["d?","?0"],"label",U),b.swapAttrs(I,["?","?src"],"values",V),"pie"===R?(b.nestedProperty(I,"marker.color").set(b.nestedProperty(I,"marker.colors").get()),c._pielayer.selectAll("g.trace").remove()):w.traceIs(I,"cartesian")&&(b.nestedProperty(I,"marker.colors").set(b.nestedProperty(I,"marker.color").get()),g[I.xaxis||"x"]=!0,g[I.yaxis||"y"]=!0)}v[z][l]=R;var H=["swapxy","swapxyaxes","orientation","orientationaxes"];if(H.indexOf(z)!==-1){if("orientation"===z){if(O.set(j),O.get()===v[z][l])continue}else"orientationaxes"===z&&(I.orientation={v:"h",h:"v"}[P.orientation]);D.swapXYData(I)}else M.dataArrayContainers.indexOf(O.parts[0])!==-1?(D.manageArrayContainers(O,j,v),p.docalc=!0):O.set(j)}if(["swapxyaxes","orientationaxes"].indexOf(z)!==-1&&y.Axes.swap(t,d),"orientationaxes"===z){var q=b.nestedProperty(t.layout,"hovermode");"x"===q.get()?q.set("y"):"y"===q.get()&&q.set("x")}d.indexOf(0)!==-1&&k.indexOf(z)!==-1&&(y.Axes.clearTypes(t,d),p.docalc=!0),["autobinx","autobiny","zauto"].indexOf(z)!==-1&&j===!1||(p.dostyle=!0),(["colorbar","line"].indexOf(O.parts[0])!==-1||"marker"===O.parts[0]&&"colorbar"===O.parts[1])&&(p.docolorbars=!0);var Y=z.indexOf("["),G=Y===-1?z:z.substr(0,Y);if(x.indexOf(G)!==-1){if(["orientation","type"].indexOf(z)!==-1){for(u=[],l=0;l<d.length;l++){var W=f[d[l]];w.traceIs(W,"cartesian")&&(i(W.xaxis||"x"),i(W.yaxis||"y"),"type"===z&&s(["autobinx","autobiny"],!0,l))}s(u.map(a),!0,0),s(u.map(o),[0,1],0)}p.docalc=!0}else A.indexOf(G)!==-1?p.doplot=!0:_.indexOf(G)!==-1&&(p.docalcAutorange=!0)}else O=b.nestedProperty(t.layout,z.replace("LAYOUT","")),v[z]=[O.get()],O.set(Array.isArray(F)?F[0]:F),p.docalc=!0}y.Axes.list(t).forEach(function(t){t.autorange&&(p.autorangeOn=!0)});var X=Object.keys(g);t:for(l=0;l<X.length;l++){for(var Z=X[l],J=Z.charAt(0),Q=J+"axis",K=0;K<f.length;K++)if(w.traceIs(f[K],"cartesian")&&(f[K][Q]||J)===Z)continue t;s("LAYOUT"+y.Axes.id2name(Z),null,0)}return(p.docalc||p.docalcAutorange&&p.autorangeOn)&&(p.clearCalc=!0),(p.docalc||p.doplot||p.docalcAutorange)&&(p.fullReplot=!0),{flags:p,undoit:v,redoit:m,traces:d,eventData:b.extendDeepNoArrays([],[m,d])}}function p(t,e){function r(t,n){if(Array.isArray(t))return void t.forEach(function(t){r(t,n)});if(!(t in e||D.hasParent(e,t))){var i=b.nestedProperty(s,t);t in g||(g[t]=i.get()),void 0!==n&&i.set(n)}}function n(e,r){if(!b.isPlainObject(e))return!1;var n=e[r+"ref"]||r,i=y.Axes.getFromId(t,n);return i||n.charAt(0)!==r||(i=y.Axes.getFromId(t,r)),(i||{}).autorange}var i,a,o,s=t.layout,l=t._fullLayout,u=Object.keys(e),c=y.Axes.list(t),h={};for(a=0;a<u.length;a++)if(0===u[a].indexOf("allaxes")){for(o=0;o<c.length;o++){var f=c[o]._id.substr(1),d=f.indexOf("scene")!==-1?f+".":"",p=u[a].replace("allaxes",d+c[o]._name);e[p]||(e[p]=e[u[a]])}delete e[u[a]]}var m={dolegend:!1,doticks:!1,dolayoutstyle:!1,doplot:!1,docalc:!1,domodebar:!1,docamera:!1,layoutReplot:!1},v={},g={};for(var x in e){if(D.hasParent(e,x))throw new Error("cannot set "+x+"and a parent attribute simultaneously");var _=b.nestedProperty(s,x),A=e[x],k=_.parts.length,T="string"==typeof _.parts[k-1]?k-1:k-2,S=_.parts[0],E=_.parts[T],L=_.parts[T-1]+"."+E,z=_.parts.slice(0,T).join("."),P=b.nestedProperty(t.layout,z).get(),O=b.nestedProperty(l,z).get();if(void 0!==A){if(v[x]=A,g[x]="reverse"===E?A:_.get(),["width","height"].indexOf(x)!==-1&&null===A?t._fullLayout[x]=t._initialAutoSize[x]:L.match(/^[xyz]axis[0-9]*\.range(\1]\])?$/)?r(z+".autorange",!1):L.match(/^[xyz]axis[0-9]*\.autorange$/)?r([z+".range[0]",z+".range[1]"],void 0):L.match(/^aspectratio\.[xyz]$/)?r(S+".aspectmode","manual"):L.match(/^aspectmode$/)?r([z+".x",z+".y",z+".z"],void 0):"tick0"===E||"dtick"===E?r(z+".tickmode","linear"):"tickmode"===E?r([z+".tick0",z+".dtick"],void 0):/[xy]axis[0-9]*?$/.test(E)&&!Object.keys(A||{}).length?m.docalc=!0:/[xy]axis[0-9]*\.categoryorder$/.test(L)?m.docalc=!0:/[xy]axis[0-9]*\.categoryarray/.test(L)&&(m.docalc=!0),L.indexOf("rangeslider")!==-1&&(m.docalc=!0),"type"===E){var R=P,j="linear"===O.type&&"log"===A,F="log"===O.type&&"linear"===A;if(j||F){if(R&&R.range)if(O.autorange)j&&(R.range=R.range[1]>R.range[0]?[1,2]:[2,1]);else{var N=R.range[0],B=R.range[1];j?(N<=0&&B<=0&&r(z+".autorange",!0),N<=0?N=B/1e6:B<=0&&(B=N/1e6),r(z+".range[0]",Math.log(N)/Math.LN10),r(z+".range[1]",Math.log(B)/Math.LN10)):(r(z+".range[0]",Math.pow(10,N)),r(z+".range[1]",Math.pow(10,B)))}else r(z+".autorange",!0);w.getComponentMethod("annotations","convertCoords")(t,O,A,r),w.getComponentMethod("images","convertCoords")(t,O,A,r)}else r(z+".autorange",!0)}else if(E.match(I.AX_NAME_PATTERN)){var U=b.nestedProperty(l,x).get(),V=(A||{}).type;V&&"-"!==V||(V="linear"),w.getComponentMethod("annotations","convertCoords")(t,U,V,r),w.getComponentMethod("images","convertCoords")(t,U,V,r)}var H=C.containerArrayMatch(x);if(H){i=H.array,a=H.index;var q=H.property,Y=b.nestedProperty(s,i),G=(Y||[])[a]||{};if(""===a)x.indexOf("updatemenus")===-1&&(m.docalc=!0);else if(""===q){var W=A;C.isAddVal(A)?g[x]=null:C.isRemoveVal(A)?(g[x]=G,W=G):b.warn("unrecognized full object value",e),(n(W,"x")||n(W,"y")&&x.indexOf("updatemenus")===-1)&&(m.docalc=!0)}else!n(G,"x")&&!n(G,"y")||b.containsAny(x,["color","opacity","align","dash","updatemenus"])||(m.docalc=!0);h[i]||(h[i]={});var X=h[i][a];X||(X=h[i][a]={}),X[q]=A,delete e[x]}else if("reverse"===E)P.range?P.range.reverse():(r(z+".autorange",!0),P.range=[1,0]),O.autorange?m.docalc=!0:m.doplot=!0;else{var Z=String(_.parts[1]||"");0===S.indexOf("scene")?"camera"===_.parts[1]?m.docamera=!0:m.doplot=!0:0===S.indexOf("geo")?m.doplot=!0:0===S.indexOf("ternary")?m.doplot=!0:"paper_bgcolor"===x?m.doplot=!0:!l._has("gl2d")||x.indexOf("axis")===-1&&"plot_bgcolor"!==x?"hiddenlabels"===x?m.docalc=!0:S.indexOf("legend")!==-1?m.dolegend=!0:x.indexOf("title")!==-1?m.doticks=!0:S.indexOf("bgcolor")!==-1?m.dolayoutstyle=!0:k>1&&b.containsAny(Z,["tick","exponent","grid","zeroline"])?m.doticks=!0:x.indexOf(".linewidth")!==-1&&x.indexOf("axis")!==-1?m.doticks=m.dolayoutstyle=!0:k>1&&Z.indexOf("line")!==-1?m.dolayoutstyle=!0:k>1&&"mirror"===Z?m.doticks=m.dolayoutstyle=!0:"margin.pad"===x?m.doticks=m.dolayoutstyle=!0:"margin"===S||"autorange"===Z||"rangemode"===Z||"type"===Z||"domain"===Z||x.indexOf("calendar")!==-1||x.match(/^(bar|box|font)/)?m.docalc=!0:["hovermode","dragmode"].indexOf(x)!==-1?m.domodebar=!0:["hovermode","dragmode","height","width","autosize"].indexOf(x)===-1&&(m.doplot=!0):m.doplot=!0,_.set(A)}}}for(i in h){var J=C.applyContainerArrayChanges(t,b.nestedProperty(s,i),h[i],m);J||(m.doplot=!0)}var Q=t._fullLayout.width,K=t._fullLayout.height;t.layout.autosize&&M.plotAutoSize(t,t.layout,t._fullLayout);var $=e.height||e.width||t._fullLayout.width!==Q||t._fullLayout.height!==K;return $&&(m.docalc=!0),(m.doplot||m.docalc)&&(m.layoutReplot=!0),{flags:m,undoit:g,redoit:v,eventData:b.extendDeep({},v)}}function m(t){var e=v.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];v.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=b.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(E.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0);var a=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=a.append("g").classed("imagelayer",!0),r._shapeUpperLayer=a.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}var v=t("d3"),g=t("fast-isnumeric"),y=t("../plotly"),b=t("../lib"),x=t("../lib/events"),_=t("../lib/queue"),w=t("../registry"),M=t("../plots/plots"),A=t("../plots/cartesian/graph_interact"),k=t("../plots/polar"),T=t("../components/drawing"),S=t("../components/errorbars"),E=t("../constants/xmlns_namespaces"),L=t("../lib/svg_text_utils"),C=t("./manage_arrays"),D=t("./helpers"),z=t("./subroutines"),I=t("../plots/cartesian/constants");y.plot=function(t,e,r,n){function o(){if(g)return y.addFrames(t,g)}function s(){for(var e=L._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return b.syncOrAsync([z.layoutStyles,f,A.init],t)}function l(){var e,r,n,i=t.calcdata;for(w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t),e=0;e<i.length;e++)r=i[e],n=r[0].trace,n.visible===!0&&n._module.colorbar?n._module.colorbar(t,r):M.autoMargin(t,"cb"+n.uid);return M.doAutoMargin(t),M.previousPromises(t)}function u(){var e=JSON.stringify(L._size)===P?[]:[l,z.layoutStyles];return e=e.concat(A.init),b.syncOrAsync(e,t)}function c(){if(C){for(var e,r,n=M.getSubplotIds(L,"cartesian"),i=L._modules,a=0;a<n.length;a++){e=L._plots[n[a;for(var o=0;o<i.length;o++)r=i[o],r.setPositions&&r.setPositions(t,e)}return S.calc(t),b.syncOrAsync([w.getComponentMethod("shapes","calcAutorange"),w.getComponentMethod("annotations","calcAutorange"),h,w.getComponentMethod("rangeslider","calcAutorange")],t)}}function h(){if(!t._transitioning)for(var e=y.Axes.list(t,"",!0),r=0;r<e.length;r++)y.Axes.doAutoRange(e[r])}function f(){return y.Axes.doTicks(t,"redraw")}function d(){var e,r=t.calcdata;for(e=0;e<r.length;e++){var n=r[e][0].trace,i=n.visible===!0,a=n.uid;i&&w.traceIs(n,"2dMap")||L._paper.selectAll(".hm"+a+",.contour"+a+",#clip"+a).remove(),i&&n._module.colorbar||L._infolayer.selectAll(".cb"+a).remove()}var o=L._basePlotModules;for(e=0;e<o.length;e++)o[e].plot(t);var s=L._paper.selectAll(".layer-subplot");return L._imageSubplotLayer=s.selectAll(".imagelayer"),L._shapeSubplotLayer=s.selectAll(".shapelayer"),M.style(t),w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("annotations","draw")(t),M.addLinks(t),t._replotting=!1,M.previousPromises(t)}function p(){w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("images","draw")(t),w.getComponentMethod("annotations","draw")(t),w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeslider","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t)}var g;if(t=D.getGraphDiv(t),x.init(t),b.isPlainObject(e)){var _=e;e=_.data,r=_.layout,n=_.config,g=_.frames}var k=x.triggerHandler(t,"plotly_beforeplot",[e,r,n]);if(k===!1)return Promise.reject();e||r||b.isPlotDiv(t)||b.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),i(t,n),r||(r={}),v.select(t).classed("js-plotly-plot",!0),T.makeTester(t),t._promises=[];var E=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(D.cleanData(e,t.data),E?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!E||(t.layout=D.cleanLayout(r)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();if(t._replotPending=!1,M.supplyDefaults(t),e&&e[0]&&e[0].r)return a(t,e,r);t._replotting=!0,E&&m(t),t.framework!==m&&(t.framework=m,m(t)),E&&y.Axes.saveRangeInitial(t);var L=t._fullLayout,C=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;C&&M.doCalcdata(t);for(var I=0;I<t.calcdata.length;I++)t.calcdata[I][0].trace=t._fullData[I];var P=JSON.stringify(L._size),O=[M.previousPromises,o,s,l,u,c,z.layoutStyles,f,d,p,M.rehover];return b.syncOrAsync(O,t),Promise.all(t._promises).then(function(){return t.emit("plotly_afterplot"),t})},y.redraw=function(t){if(t=D.getGraphDiv(t),!b.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return D.cleanData(t.data,t.data),D.cleanLayout(t.layout),t.calcdata=void 0,y.plot(t).then(function(){return t.emit("plotly_redraw"),t})},y.newPlot=function(t,e,r,n){return t=D.getGraphDiv(t),M.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),M.purge(t),y.plot(t,e,r,n)},y.extendTraces=function t(e,r,n,i){e=D.getGraphDiv(e);var a=f(e,r,n,i,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)}),o=y.redraw(e),s=[e,a.update,n,a.maxPoints];return _.add(e,y.prependTraces,s,t,arguments),o},y.prependTraces=function t(e,r,n,i){e=D.getGraphDiv(e);var a=f(e,r,n,i,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)}),o=y.redraw(e),s=[e,a.update,n,a.maxPoints];return _.add(e,y.extendTraces,s,t,arguments),o},y.addTraces=function t(e,r,n){e=D.getGraphDiv(e);var i,a,o=[],s=y.deleteTraces,c=t,h=[e,o],f=[e,r];for(u(e,r,n),Array.isArray(r)||(r=[r]),r=r.map(function(t){return b.extendFlat({},t)}),D.cleanData(r,e.data),i=0;i<r.length;i++)e.data.push(r[i]);for(i=0;i<r.length;i++)o.push(-r.length+i);if("undefined"==typeof n)return a=y.redraw(e),_.add(e,s,h,c,f),a;Array.isArray(n)||(n=[n]);try{l(e,o,n)}catch(t){throw e.data.splice(e.data.length-r.length,r.length),t}return _.startSequence(e),_.add(e,s,h,c,f),a=y.moveTraces(e,o,n),_.stopSequence(e),a},y.deleteTraces=function t(e,r){e=D.getGraphDiv(e);var n,i,a=[],l=y.addTraces,u=t,c=[e,a,r],h=[e,r];if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(r)||(r=[r]),s(e,r,"indices"),r=o(r,e.data.length-1),r.sort(b.sorterDes),n=0;n<r.length;n+=1)i=e.data.splice(r[n],1)[0],a.push(i);var f=y.redraw(e);return _.add(e,l,c,u,h),f},y.moveTraces=function t(e,r,n){e=D.getGraphDiv(e);var i,a=[],s=[],u=t,c=t,h=[e,n,r],f=[e,r,n];if(l(e,r,n),r=Array.isArray(r)?r:[r],"undefined"==typeof n)for(n=[],i=0;i<r.length;i++)n.push(-r.length+i);for(n=Array.isArray(n)?n:[n],r=o(r,e.data.length-1),n=o(n,e.data.length-1),i=0;i<e.data.length;i++)r.indexOf(i)===-1&&a.push(e.data[i]);for(i=0;i<r.length;i++)s.push({newIndex:n[i],trace:e.data[r[i]]});for(s.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<s.length;i+=1)a.splice(s[i].newIndex,0,s[i].trace);e.data=a;var d=y.redraw(e);return _.add(e,u,h,c,f),d},y.restyle=function t(e,r,n,i){e=D.getGraphDiv(e),D.clearPromiseQueue(e);var a={};if("string"==typeof r)a[r]=n;else{if(!b.isPlainObject(r))return b.warn("Restyle fail.",r,n,i),Promise.reject();a=b.extendFlat({},r),void 0===i&&(i=n)}Object.keys(a).length&&(e.changed=!0);var o=d(e,a,i),s=o.flags;s.clearCalc&&(e.calcdata=void 0);var l=[];s.fullReplot?l.push(y.plot):(l.push(M.previousPromises),M.supplyDefaults(e),s.dostyle&&l.push(z.doTraceStyle),s.docolorbars&&l.push(z.doColorBars)),l.push(M.rehover),_.add(e,t,[e,o.undoit,o.traces],t,[e,o.redoit,o.traces]);var u=b.syncOrAsync(l,e);return u&&u.then||(u=Promise.resolve()),u.then(function(){return e.emit("plotly_restyle",o.eventData),e})},y.relayout=function t(e,r,n){if(e=D.getGraphDiv(e),D.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var i={};if("string"==typeof r)i[r]=n;else{if(!b.isPlainObject(r))return b.warn("Relayout fail.",r,n),Promise.reject();i=b.extendFlat({},r)}Object.keys(i).length&&(e.changed=!0);var a=p(e,i),o=a.flags;o.docalc&&(e.calcdata=void 0);var s=[M.previousPromises];o.layoutReplot?s.push(z.layoutReplot):Object.keys(i).length&&(M.supplyDefaults(e),o.dolegend&&s.push(z.doLegend),o.dolayoutstyle&&s.push(z.layoutStyles),o.doticks&&s.push(z.doTicksRelayout),o.domodebar&&s.push(z.doModeBar),o.docamera&&s.push(z.doCamera)),s.push(M.rehover),_.add(e,t,[e,a.undoit],t,[e,a.redoit]);var l=b.syncOrAsync(s,e);return l&&l.then||(l=Promise.resolve(e)),l.then(function(){return e.emit("plotly_relayout",a.eventData),e})},y.update=function t(e,r,n,i){if(e=D.getGraphDiv(e),D.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);b.isPlainObject(r)||(r={}),b.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var a=d(e,b.extendFlat({},r),i),o=a.flags,s=p(e,b.extendFlat({},n)),l=s.flags;(o.clearCalc||l.docalc)&&(e.calcdata=void 0);var u=[];if(o.fullReplot&&l.layoutReplot){var c=e.data,h=e.layout;e.data=void 0,e.layout=void 0,u.push(function(){return y.plot(e,c,h)})}else o.fullReplot?u.push(y.plot):l.layoutReplot?u.push(z.layoutReplot):(u.push(M.previousPromises),M.supplyDefaults(e),o.dostyle&&u.push(z.doTraceStyle),o.docolorbars&&u.push(z.doColorBars),l.dolegend&&u.push(z.doLegend),l.dolayoutstyle&&u.push(z.layoutStyles), l.doticks&&u.push(z.doTicksRelayout),l.domodebar&&u.push(z.doModeBar),l.doCamera&&u.push(z.doCamera));u.push(M.rehover),_.add(e,t,[e,a.undoit,s.undoit,a.traces],t,[e,a.redoit,s.redoit,a.traces]);var f=b.syncOrAsync(u,e);return f&&f.then||(f=Promise.resolve(e)),f.then(function(){return e.emit("plotly_update",{data:a.eventData,layout:s.eventData}),e})},y.animate=function(t,e,r){function n(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=D.getGraphDiv(t),!b.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=M.supplyAnimationDefaults(r);var s=r.transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,u){function c(){if(0!==o._frameQueue.length){for(;o._frameQueue.length;){var e=o._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}function h(e){if(0!==e.length){for(var s=0;s<e.length;s++){var c;c="byname"===e[s].type?M.computeFrame(t,e[s].name):e[s].data;var h=i(s),f=n(s);f.duration=Math.min(f.duration,h.duration);var d={frame:c,name:e[s].name,frameOpts:h,transitionOpts:f};s===e.length-1&&(d.onComplete=a(l,2),d.onInterrupt=u),o._frameQueue.push(d)}"immediate"===r.mode&&(o._lastFrameAt=-(1/0)),o._animationRaf||p()}}function f(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function d(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,M.transition(t,e.frame.data,e.frame.layout,D.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else f()}function p(){t.emit("plotly_animating"),o._lastFrameAt=-(1/0),o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&d()};e()}function m(t){return Array.isArray(s)?y>=s.length?t.transitionOpts=s[y]:t.transitionOpts=s[0]:t.transitionOpts=s,y++,t}var v,g,y=0,x=[],_=void 0===e||null===e,w=Array.isArray(e),A=!_&&!w&&b.isPlainObject(e);if(A)x.push({type:"object",data:m(b.extendFlat({},e))});else if(_||["string","number"].indexOf(typeof e)!==-1)for(v=0;v<o._frames.length;v++)g=o._frames[v],g&&(_||String(g.group)===String(e))&&x.push({type:"byname",name:String(g.name),data:m({name:g.name})});else if(w)for(v=0;v<e.length;v++){var k=e[v];["number","string"].indexOf(typeof k)!==-1?(k=String(k),x.push({type:"byname",name:k,data:m({name:k})})):b.isPlainObject(k)&&x.push({type:"object",data:m(b.extendFlat({},k))})}for(v=0;v<x.length;v++)if(g=x[v],"byname"===g.type&&!o._frameHash[g.data.name])return b.warn('animate failure: frame not found: "'+g.data.name+'"'),void u();["next","immediate"].indexOf(r.mode)!==-1&&c(),"reverse"===r.direction&&x.reverse();var T=t._fullLayout._currentFrame;if(T&&r.fromcurrent){var S=-1;for(v=0;v<x.length;v++)if(g=x[v],"byname"===g.type&&g.name===T){S=v;break}if(S>0&&S<x.length-1){var E=[];for(v=0;v<x.length;v++)g=x[v],("byname"!==x[v].type||v>S)&&E.push(g);x=E}}x.length>0?h(x):(t.emit("plotly_animated"),l())})},y.addFrames=function(t,e,r){t=D.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!b.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var i,a,o,s,l=t._transitionData._frames,u=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var c=l.length+2*e.length,h=[];for(i=e.length-1;i>=0;i--)if(b.isPlainObject(e[i])){var f=(u[e[i].name]||{}).name,d=e[i].name;f&&d&&"number"==typeof d&&u[f]&&(n++,b.warn('addFrames: overwriting frame "'+u[f].name+'" with a frame whose name of type "number" also equates to "'+f+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&b.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h.push({frame:M.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:c+i})}h.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var p=[],m=[],v=l.length;for(i=h.length-1;i>=0;i--){if(a=h[i].frame,"number"==typeof a.name&&b.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(o=0;o<l.length&&(l[o]||{}).name!==a.name;o++);p.push({type:"replace",index:o,value:a}),m.unshift({type:"replace",index:o,value:l[o]})}else s=Math.max(0,Math.min(h[i].index,v)),p.push({type:"insert",index:s,value:a}),m.unshift({type:"delete",index:s}),v++}var g=M.modifyFrames,y=M.modifyFrames,x=[t,m],w=[t,p];return _&&_.add(t,g,x,y,w),M.modifyFrames(t,p)},y.deleteFrames=function(t,e){if(t=D.getGraphDiv(t),!b.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,i=t._transitionData._frames,a=[],o=[];for(e=e.slice(0),e.sort(),r=e.length-1;r>=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=M.modifyFrames,l=M.modifyFrames,u=[t,o],c=[t,a];return _&&_.add(t,s,u,l,c),M.modifyFrames(t,a)},y.purge=function(t){t=D.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return M.cleanPlot([],{},r,e),M.purge(t),x.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/drawing":585,"../components/errorbars":591,"../constants/xmlns_namespaces":651,"../lib":667,"../lib/events":658,"../lib/queue":679,"../lib/svg_text_utils":686,"../plotly":701,"../plots/cartesian/constants":711,"../plots/cartesian/graph_interact":713,"../plots/plots":766,"../plots/polar":769,"../registry":781,"./helpers":691,"./manage_arrays":692,"./subroutines":698,d3:97,"fast-isnumeric":106}],694:[function(t,e,r){"use strict";function n(t,r){try{t._fullLayout._paper.style("background",r)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!1,autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],695:[function(t,e,r){"use strict";function n(t){var e,r;"area"===t?(e={attributes:b},r={}):(e=d.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,w(n,m),w(n,e.attributes),r.attributes&&w(n,r.attributes),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.schema&&r.schema.traces&&r.schema.traces[t]&&Object.keys(r.schema.traces[t]).forEach(function(e){f(n,r.schema.traces[t][e],e)})}),n.type=t;var i={meta:e.meta||{},attributes:s(n)};if(e.layoutAttributes){var a={};w(a,e.layoutAttributes),i.layoutAttributes=s(a)}return i}function i(){var t={};return w(t,v),Object.keys(d.subplotsRegistry).forEach(function(e){var r=d.subplotsRegistry[e];if(r.layoutAttributes)if("cartesian"===r.name)h(t,r,"xaxis"),h(t,r,"yaxis");else{var n="subplot"===r.attr?r.name:r.attr;h(t,r,n)}}),t=c(t),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.layoutAttributes&&(r.schema&&r.schema.layout?Object.keys(r.schema.layout).forEach(function(e){f(t,r.schema.layout[e],e)}):f(t,r.layoutAttributes,r.name))}),{layoutAttributes:s(t)}}function a(t){var e=d.transformsRegistry[t],r=w({},e.attributes);return Object.keys(d.componentsRegistry).forEach(function(e){var n=d.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){f(r,n.schema.transforms[t][e],e)})}),{attributes:s(r)}}function o(){var t={frames:p.extendDeep({},g)};return s(t),t.frames}function s(t){return l(t),u(t),t}function l(t){function e(t){return{valType:"string"}}function n(t,n,i){r.isValObject(t)?"data_array"===t.valType?(t.role="data",i[n+"src"]=e(n)):t.arrayOk===!0&&(i[n+"src"]=e(n)):p.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function u(t){function e(t,e,r){if(t){var n=t[A];n&&(delete t[A],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function c(t){return _(t,{radialaxis:x.radialaxis,angularaxis:x.angularaxis}),_(t,x.layout),t}function h(t,e,r){var n=p.nestedProperty(t,r),i=w({},e.layoutAttributes);i[M]=!0,n.set(i)}function f(t,e,r){var n=p.nestedProperty(t,r);n.set(w(n.get()||{},e))}var d=t("../registry"),p=t("../lib"),m=t("../plots/attributes"),v=t("../plots/layout_attributes"),g=t("../plots/frame_attributes"),y=t("../plots/animation_attributes"),b=t("../plots/polar/area_attributes"),x=t("../plots/polar/axis_attributes"),_=p.extendFlat,w=p.extendDeep,M="_isSubplotObj",A="_isLinkedToArray",k="_arrayAttrRegexps",T="_deprecated",S=[M,A,k,T];r.IS_SUBPLOT_OBJ=M,r.IS_LINKED_TO_ARRAY=A,r.DEPRECATED=T,r.UNDERSCORE_ATTRS=S,r.get=function(){var t={};d.allTypes.concat("area").forEach(function(e){t[e]=n(e)});var e={};return Object.keys(d.transformsRegistry).forEach(function(t){e[t]=a(t)}),{defs:{valObjects:p.valObjects,metaKeys:S.concat(["description","role"])},traces:t,layout:i(),transforms:e,frames:o(),animation:s(y)}},r.crawl=function(t,e,n){var i=n||0;Object.keys(t).forEach(function(n){var a=t[n];S.indexOf(n)===-1&&(e(a,n,t,i),r.isValObject(a)||p.isPlainObject(a)&&r.crawl(a,e,i+1))})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,s){a=a.slice(0,s).concat([r]);var l=e&&("data_array"===e.valType||e.arrayOk===!0);if(l){var u=n(a),c=p.nestedProperty(t,u).get();Array.isArray(c)&&i.push(u)}}function n(t){return t.join(".")}var i=[],a=[];if(r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s<o.length;s++){var l=o[s];a=["transforms["+s+"]"],r.crawl(l._module.attributes,e,1)}return t._fullInput&&(r.crawl(t._fullInput._module.attributes,e),i=p.filterUnique(i)),i}},{"../lib":667,"../plots/animation_attributes":702,"../plots/attributes":704,"../plots/frame_attributes":727,"../plots/layout_attributes":757,"../plots/polar/area_attributes":767,"../plots/polar/axis_attributes":768,"../registry":781}],696:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function i(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&s.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),s.isPlainObject(t.attributes)||s.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&s.log(e+" registered without a *supplyDefaults* method."),o.transformsRegistry[t.name]=t}function a(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),s=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var r=t[e];if(!r)throw new Error("Invalid module was attempted to be registered!");switch(r.moduleType){case"trace":n(r);break;case"transform":i(r);break;case"component":a(r);break;default:throw new Error("Invalid module was attempted to be registered!")}}}},{"../lib":667,"../registry":781}],697:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("../lib");e.exports=function(t){return i.extendFlat(n.defaultConfig,t)}},{"../lib":667,"../plotly":701}],698:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../components/color"),l=t("../components/drawing"),u=t("../components/titles"),c=t("../components/modebar");r.layoutStyles=function(t){return o.syncOrAsync([a.doAutoMargin,r.lsInner],t)},r.lsInner=function(t){var e,i=t._fullLayout,a=i._size,o=n.Axes.list(t);for(e=0;e<o.length;e++)o[e]._linepositions={};i._paperdiv.style({width:i.width+"px",height:i.height+"px"}).selectAll(".main-svg").call(l.setSize,i.width,i.height),t._context.setBackground(t,i.paper_bgcolor);var u=[];return i._paper.selectAll("g.subplot").each(function(e){var r=i._plots[e],o=n.Axes.getFromId(t,e,"x"),c=n.Axes.getFromId(t,e,"y");o.setScale(),c.setScale(),r.bg&&r.bg.call(l.setRect,o._offset-a.p,c._offset-a.p,o._length+2*a.p,c._length+2*a.p).call(s.fill,i.plot_bgcolor),r.clipId="clip"+i._uid+e+"plot";var h=i._defs.selectAll("g.clips").selectAll("#"+r.clipId).data([0]);h.enter().append("clipPath").attr({class:"plotclip",id:r.clipId}).append("rect"),h.selectAll("rect").attr({width:o._length,height:c._length}),r.plot.call(l.setTranslate,o._offset,c._offset),r.plot.call(l.setClipUrl,r.clipId);var f=l.crispRound(t,o.linewidth,1),d=l.crispRound(t,c.linewidth,1),p=a.p+d,m="M"+-p+",",v="h"+(o._length+2*p),g="free"===o.anchor&&u.indexOf(o._id)===-1,y=a.h*(1-(o.position||0))+f/2%1,b=o.anchor===c._id&&(o.mirror||"top"!==o.side)||"all"===o.mirror||"allticks"===o.mirror||o.mirrors&&o.mirrors[c._id+"bottom"],x=c._length+a.p+f/2,_=o.anchor===c._id&&(o.mirror||"top"===o.side)||"all"===o.mirror||"allticks"===o.mirror||o.mirrors&&o.mirrors[c._id+"top"],w=-a.p-f/2,M=a.p,A=b?0:f,k=_?0:f,T=","+(-M-k)+"v"+(c._length+2*M+k+A),S="free"===c.anchor&&u.indexOf(c._id)===-1,E=a.w*(c.position||0)+d/2%1,L=c.anchor===o._id&&(c.mirror||"right"!==c.side)||"all"===c.mirror||"allticks"===c.mirror||c.mirrors&&c.mirrors[o._id+"left"],C=-a.p-d/2,D=c.anchor===o._id&&(c.mirror||"right"===c.side)||"all"===c.mirror||"allticks"===c.mirror||c.mirrors&&c.mirrors[o._id+"right"],z=o._length+a.p+d/2;o._linepositions[e]=[b?x:void 0,_?w:void 0,g?y:void 0],o.anchor===c._id?o._linepositions[e][3]="top"===o.side?w:x:g&&(o._linepositions[e][3]=y),c._linepositions[e]=[L?C:void 0,D?z:void 0,S?E:void 0],c.anchor===o._id?c._linepositions[e][3]="right"===c.side?z:C:S&&(c._linepositions[e][3]=E);var I="translate("+o._offset+","+c._offset+")",P=I,O=I;g&&(P="translate("+o._offset+","+a.t+")",w+=c._offset-a.t,x+=c._offset-a.t),S&&(O="translate("+a.l+","+c._offset+")",C+=o._offset-a.l,z+=o._offset-a.l),r.xlines.attr("transform",P).attr("d",(b?m+x+v:"")+(_?m+w+v:"")+(g?m+y+v:"")||"M0,0").style("stroke-width",f+"px").call(s.stroke,o.showline?o.linecolor:"rgba(0,0,0,0)"),r.ylines.attr("transform",O).attr("d",(L?"M"+C+T:"")+(D?"M"+z+T:"")+(S?"M"+E+T:"")||"M0,0").attr("stroke-width",d+"px").call(s.stroke,c.showline?c.linecolor:"rgba(0,0,0,0)"),r.xaxislayer.attr("transform",P),r.yaxislayer.attr("transform",O),r.gridlayer.attr("transform",I),r.zerolinelayer.attr("transform",I),r.draglayer.attr("transform",I),g&&u.push(o._id),S&&u.push(c._id)}),n.Axes.makeClipPaths(t),r.drawMainTitle(t),c.manage(t),t._promises.length&&Promise.all(t._promises)},r.drawMainTitle=function(t){var e=t._fullLayout;u.draw(t,"gtitle",{propContainer:e,propName:"title",dfltName:"Plot",attributes:{x:e.width/2,y:e._size.t/2,"text-anchor":"middle"}})},r.doTraceStyle=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e],n=((r[0]||{}).trace||{})._module||{},o=n.arraysToCalcdata;o&&o(r,r[0].trace)}return a.style(t),i.getComponentMethod("legend","draw")(t),a.previousPromises(t)},r.doColorBars=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e][0];if((r.t||{}).cb){var n=r.trace,o=r.t.cb;i.traceIs(n,"contour")&&o.line({width:n.contours.showlines!==!1?n.line.width:0,dash:n.line.dash,color:"line"===n.contours.coloring?o._opts.line.color:n.line.color}),i.traceIs(n,"markerColorscale")?o.options(n.marker.colorbar)():o.options(n.colorbar)()}}return a.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,n.plot(t,"",e)},r.doLegend=function(t){return i.getComponentMethod("legend","draw")(t),a.previousPromises(t)},r.doTicksRelayout=function(t){return n.Axes.doTicks(t,"redraw"),r.drawMainTitle(t),a.previousPromises(t)},r.doModeBar=function(t){var e,r,i=t._fullLayout;for(c.manage(t),n.Fx.init(t),e=a.getSubplotIds(i,"gl3d"),r=0;r<e.length;r++){var o=i[e[r]]._scene;o.updateFx(i.dragmode,i.hovermode)}return a.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=a.getSubplotIds(e,"gl3d"),n=0;n<r.length;n++){var i=e[r[n]],o=i._scene;o.setCamera(i.camera)}}},{"../components/color":562,"../components/drawing":585,"../components/modebar":609,"../components/titles":638,"../lib":667,"../plotly":701,"../plots/plots":766,"../registry":781}],699:[function(t,e,r){"use strict";function n(t,e){var r=new Promise(function(r,n){function h(){var t=s.getDelay(p._fullLayout);return new Promise(function(r,n){setTimeout(function(){var t=u(p),i=document.createElement("canvas");i.id=o.randstr(),c({format:e.format,width:p._fullLayout.width,height:p._fullLayout.height,canvas:i,svg:t,promise:!0}).then(function(t){p&&document.body.removeChild(p),r(t)}).catch(function(t){n(t)})},t)})}e=e||{},e.format=e.format||"png";var f=function(t){return void 0===t||null===t||!!(i(t)&&t>1)};f(e.width)&&f(e.height)||n(new Error("Height and width should be pixel values."));var d=l(t,{format:"png",height:e.height,width:e.width}),p=d.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var m=s.getRedrawFunc(p);a.plot(p,d.data,d.layout,d.config).then(m).then(h).then(function(t){r(t)}).catch(function(t){n(t)})});return r}var i=t("fast-isnumeric"),a=t("../plotly"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/cloneplot"),u=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg");e.exports=n},{"../lib":667,"../plotly":701,"../snapshot/cloneplot":782,"../snapshot/helpers":785,"../snapshot/svgtoimg":787,"../snapshot/tosvg":789,"fast-isnumeric":106}],700:[function(t,e,r){"use strict";function n(t,e,r,i,a,u){u=u||[];for(var c=Object.keys(t),f=0;f<c.length;f++){var d=c[f];if("transforms"!==d){var v=u.slice();v.push(d);var g=t[d],y=e[d],b=l(r,d),x="info_array"===(b||{}).valType,_="colorscale"===(b||{}).valType;if(s(r,d))if(p(g)&&p(y))n(g,y,b,i,a,v);else if(b.items&&!x&&m(g)){var w,M,A=b.items,k=A[Object.keys(A)[0]],T=[];for(w=0;w<y.length;w++){var S=y[w]._index||w;M=v.slice(),M.push(S),p(g[S])&&p(y[w])&&(T.push(S),n(g[S],y[w],k,i,a,M))}for(w=0;w<g.length;w++)M=v.slice(),M.push(w),p(g[w])?T.indexOf(w)===-1&&i.push(o("unused",a,M)):i.push(o("object",a,M,g[w]))}else!p(g)&&p(y)?i.push(o("object",a,v,g)):m(g)||!m(y)||x||_?d in e?h.validate(g,b)||i.push(o("value",a,v,g)):i.push(o("unused",a,v,g)):i.push(o("array",a,v,g));else i.push(o("schema",a,v))}}return i}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r].type,i=t.traces[n].layoutAttributes;i&&h.extendFlat(t.layout.layoutAttributes,i)}return t.layout.layoutAttributes}function a(t){return m(t)?"In data trace "+t[1]+", ":"In "+t+", "}function o(t,e,r,n){r=r||"";var i,a;m(e)?(i=e[0],a=e[1]):(i=e,a=null);var o=c(r),s=v[t](e,o,n);return h.log(s),{code:t,container:i,trace:a,path:r,astr:o,msg:s}}function s(t,e){var r=u(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function l(t,e){var r=u(e);return t[r.keyMinusId]}function u(t){var e=/([2-9]|[1-9][0-9]+)$/,r=t.split(e)[0],n=t.substr(r.length,t.length);return{keyMinusId:r,id:n}}function c(t){if(!m(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}var h=t("../lib"),f=t("../plots/plots"),d=t("./plot_schema"),p=h.isPlainObject,m=Array.isArray;e.exports=function(t,e){var r,a,s=d.get(),l=[],u={};m(t)?(u.data=h.extendDeep([],t),r=t):(u.data=[],r=[],l.push(o("array","data"))),p(e)?(u.layout=h.extendDeep({},e),a=e):(u.layout={},a={},arguments.length>1&&l.push(o("object","layout"))),f.supplyDefaults(u);for(var c=u._fullData,v=r.length,g=0;g<v;g++){var y=r[g],b=["data",g];if(p(y)){var x=c[g],_=x.type,w=s.traces[_].attributes;w.type={valType:"enumerated",values:[_]},x.visible===!1&&y.visible!==!1&&l.push(o("invisible",b)),n(y,x,w,l,b);var M=y.transforms,A=x.transforms;if(M){m(M)||l.push(o("array",b,["transforms"])),b.push("transforms");for(var k=0;k<M.length;k++){var T=["transforms",k],S=M[k].type;if(p(M[k])){var E=s.transforms[S]?s.transforms[S].attributes:{};E.type={valType:"enumerated",values:Object.keys(s.transforms)},n(M[k],A[k],E,l,b,T)}else l.push(o("object",b,T))}}}else l.push(o("object",b))}var L=u._fullLayout,C=i(s,c);return n(a,L,C,l,"layout"),0===l.length?void 0:l};var v={object:function(t,e){var r;return r="layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":a(t)+"key "+e,r+" must be linked to an object container"},array:function(t,e){var r;return r="data"===t?"The data argument":a(t)+"key "+e,r+" must be linked to an array container"},schema:function(t,e){return a(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=p(r)?"container":"key";return a(t)+n+" "+e+" did not get coerced"},invisible:function(t){return"Trace "+t[1]+" got defaulted to be not visible"},value:function(t,e,r){return[a(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}}},{"../lib":667,"../plots/plots":766,"./plot_schema":695}],701:[function(t,e,r){"use strict";r.defaultConfig=t("./plot_api/plot_config"),r.Plots=t("./plots/plots"),r.Axes=t("./plots/cartesian/axes"),r.Fx=t("./plots/cartesian/graph_interact"),r.ModeBar=t("./components/modebar"),t("./plot_api/plot_api")},{"./components/modebar":609,"./plot_api/plot_api":693,"./plot_api/plot_config":694,"./plots/cartesian/axes":706,"./plots/cartesian/graph_interact":713,"./plots/plots":766}],702:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"]}}}},{}],703:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r){var i,a=r.name,o=e[a],s=n.isArray(t[a])?t[a]:[],l=e[a]=[];for(i=0;i<s.length;i++){var u=s[i],c={},h={};n.isPlainObject(u)||(h.itemIsNotPlainObject=!0,u={}),r.handleItemDefaults(u,c,e,r,h),c._input=u,c._index=i,l.push(c)}if(n.isArray(o)){var f=Math.min(o.length,l.length);for(i=0;i<f;i++)n.relinkPrivateKeys(l[i],o[i])}}},{"../lib":667}],704:[function(t,e,r){"use strict";e.exports={type:{valType:"enumerated",values:[],dflt:"scatter"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0},showlegend:{valType:"boolean",dflt:!0},legendgroup:{valType:"string",dflt:""},opacity:{valType:"number",min:0,max:1,dflt:1},name:{valType:"string"},uid:{valType:"string",dflt:""},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],dflt:"all"},stream:{token:{valType:"string",noBlank:!0,strict:!0},maxpoints:{valType:"number",min:0,max:1e4,dflt:500}}}},{}],705:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x"},yaxis:{valType:"subplotid",dflt:"y"}}},{}],706:[function(t,e,r){"use strict";function n(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,u=0,c=0;c<e.length;c++)e[c]%1===0?l++:b(e[c])||u++,a(e[c])&&o++,a(e[c]+r.dtick/2)&&s++;var h=e.length-u;if(l===h&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5,t+r.dtick<n&&(t+=r.dtick));else if(s<.1*h&&(o>.3*h||a(n)||a(i))){var f=r.dtick/2;t+=t+f<n?f:-f}return t}function i(t,e,r,n,i){var a=_.findExactDates(e,i),o=.8;if(a.exactDays>o){var s=Number(r.substr(1));a.exactYears>o&&s%12===0?t=O.tickIncrement(t,"M6","reverse")+1.5*C:a.exactMonths>o?t=O.tickIncrement(t,"M1","reverse")+15.5*C:t-=C/2;var l=O.tickIncrement(t,r);if(l<=n)return l}return t}function a(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=_.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],u=1.0001*o[1]-1e-4*o[0],c=Math.min(s,u),h=Math.max(s,u),f=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;r<n.length;r++)e=d(n[r]),e>c&&e<h&&(void 0===i[r]?a[f]=O.tickText(t,e):a[f]=l(t,e,String(i[r])),f++);return f<n.length&&a.splice(f,n.length-f),a}function o(t,e,r){return e*_.roundUp(t/e,r)}function s(t){var e=t.dtick;if(t._tickexponent=0,b(e)||"string"==typeof e||(e=1),"category"===t.type&&(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),i=n.length;if("M"===String(e).charAt(0))i>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12===0?"y":"m";else if(e>=C&&i<=10||e>=15*C)t._tickround="d";else if(e>=z&&i<=16||e>=D)t._tickround="M";else if(e>=I&&i<=19||e>=z)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(b(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);b(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function l(t,e,r){var n=t.tickfont||t._gd._fullLayout.font;return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function u(t,e,r,n){var i=t._tickround,a=r&&t.hoverformat||t.tickformat;n&&(i=b(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o,s=_.formatDate(e.x,a,i,t.calendar),l=s.indexOf("\n");l!==-1&&(o=s.substr(l+1),s=s.substr(0,l)),n&&("00:00:00"===s||"00:00"===s?(s=o,o=""):8===s.length&&(s=s.replace(/:00$/,""))),o&&(r?"d"===i?s+=", "+o:s=o+(s?", "+s:""):t._inCalcTicks&&o===t._prevDateHead||(s+="
"+o,t._prevDateHead=o)),e.text=s}function c(t,e,r,n,i){var a=t.dtick,o=e.x;if(!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=d(Math.pow(10,o),t,i,n);else if(b(a)||"D"===a.charAt(0)&&_.mod(o+.01,1)<.1)if(["e","E","power"].indexOf(t.exponentformat)!==-1){var s=Math.round(o);0===s?e.text=1:1===s?e.text="10":s>1?e.text="10"+s+"":e.text="10\u2212"+-s+"",e.fontSize*=1.25}else e.text=d(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,_.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(o<0?.5:.25)))}}function h(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function f(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=d(e.x,t,i,n)}function d(t,e,r,n){var i=t<0,a=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,u=e.tickformat,c=e.separatethousands;if(n){var h={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:b(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};s(h),a=(Number(h._tickround)||0)+4,l=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return y.format(u)(t).replace(/-/g,"\u2212");var f=Math.pow(10,-a)/2;if("none"===o&&(l=0),t=Math.abs(t),t<f)t="0",i=!1;else{if(t+=f,l&&(t*=Math.pow(10,-l),a+=l),0===a)t=String(Math.floor(t));else if(a<0){t=String(Math.round(t)),t=t.substr(0,t.length+a);for(var d=a;d<0;d++)t+="0"}else{t=String(t);var p=t.indexOf(".")+1;p&&(t=t.substr(0,p+a).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._gd._fullLayout.separators,c)}if(l&&"hide"!==o){var m;m=l<0?"\u2212"+-l:"power"!==o?"+"+l:String(l),"e"===o||("SI"===o||"B"===o)&&(l>12||l<-15)?t+="e"+m:"E"===o?t+="E"+m:"power"===o?t+="\xd710"+m+"":"B"===o&&9===l?t+="B":"SI"!==o&&"B"!==o||(t+=H[l/3+5])}return i?"\u2212"+t:t}function p(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var a=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)i[n].x.indexOf(o)===-1&&i[n].y.indexOf(s)===-1||a.push(n);if(a.length){var l,u=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],m(u.x,l.x),m(u.y,l.y);m(u.x,[o]),m(u.y,[s])}else i.push({x:[o],y:[s]})}}return i}function m(t,e){for(var r=0;r<e.length;r++)t.indexOf(e[r])===-1&&t.push(e[r])}function v(t,e,r){var n,i,a=[],o=[],s=t.layout;for(n=0;n<e.length;n++)a.push(O.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(O.getFromId(t,r[n]));var l=Object.keys(a[0]),u=["anchor","domain","overlaying","position","side","tickangle"],c=["linear","log"];for(n=0;n<l.length;n++){var h=l[n],f=a[0][h],d=o[0][h],p=!0,m=!1,v=!1;if("_"!==h.charAt(0)&&"function"!=typeof f&&u.indexOf(h)===-1){for(i=1;i<a.length&&p;i++){var y=a[i][h];"type"===h&&c.indexOf(f)!==-1&&c.indexOf(y)!==-1&&f!==y?m=!0:y!==f&&(p=!1)}for(i=1;i<o.length&&p;i++){var b=o[i][h];"type"===h&&c.indexOf(d)!==-1&&c.indexOf(b)!==-1&&d!==b?v=!0:o[i][h]!==d&&(p=!1)}p&&(m&&(s[a[0]._name].type="linear"),v&&(s[o[0]._name].type="linear"),g(s,h,a,o))}}for(n=0;n<t._fullLayout.annotations.length;n++){var x=t._fullLayout.annotations[n];e.indexOf(x.xref)!==-1&&r.indexOf(x.yref)!==-1&&_.swapAttrs(s.annotations[n],["?"])}}function g(t,e,r,n){var i,a=_.nestedProperty,o=a(t[r[0]._name],e).get(),s=a(t[n[0]._name],e).get();for("title"===e&&("Click to enter X axis title"===o&&(o="Click to enter Y axis title"),"Click to enter Y axis title"===s&&(s="Click to enter X axis title")),i=0;i<r.length;i++)a(t,r[i]._name+"."+e).set(s);for(i=0;i<n.length;i++)a(t,n[i]._name+"."+e).set(o)}var y=t("d3"),b=t("fast-isnumeric"),x=t("../../registry"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),M=t("../../components/titles"),A=t("../../components/color"),k=t("../../components/drawing"),T=t("../../constants/numerical"),S=T.FP_SAFE,E=T.ONEAVGYEAR,L=T.ONEAVGMONTH,C=T.ONEDAY,D=T.ONEHOUR,z=T.ONEMIN,I=T.ONESEC,P=T.BADNUM,O=e.exports={};O.layoutAttributes=t("./layout_attributes"),O.supplyLayoutDefaults=t("./layout_defaults"),O.setConvert=t("./set_convert");var R=t("./axis_ids");O.id2name=R.id2name,O.cleanId=R.cleanId,O.list=R.list,O.listIds=R.listIds,O.getFromId=R.getFromId,O.getFromTrace=R.getFromTrace,O.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),s=O.listIds(r,o),l=n+"ref",u={};return i||(i=s[0]||a),a||(a=i),u[l]={valType:"enumerated",values:s.concat(a?[a]:[]),dflt:i},_.coerce(t,e,u,l)},O.coercePosition=function(t,e,r,n,i,a){var o,s;if("paper"===n||"pixel"===n)o=r(i,a);else{var l=O.getFromId(e,n); if(a=l.fraction2r(a),o=r(i,a),"category"===l.type){if("string"==typeof o&&(l._categories||[]).length)return s=l._categories.indexOf(o),void(t[i]=s===-1?a:s)}else if("date"===l.type)return void(t[i]=_.cleanDate(o,P,l.calendar))}t[i]=b(o)?Number(o):a},O.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(O.getFromId(t,r.xaxis)||{}).type,delete(O.getFromId(t,r.yaxis)||{}).type})},O.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},O.minDtick=function(t,e,r,n){["log","category"].indexOf(t.type)===-1&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},O.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e<t._min.length&&n===i;e++)n=Math.min(n,t._min[e].val);for(e=1;e<t._max.length&&n===i;e++)i=Math.max(i,t._max[e].val);var a,o,s,l,u,c,h,f=0,d=!1;if(t.range){var p=_.simpleMap(t.range,t.r2l);d=p[1]<p[0]}for("reversed"===t.autorange&&(d=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(o=t._min[e],a=0;a<t._max.length;a++)s=t._max[a],h=s.val-o.val,c=t._length-o.pad-s.pad,h>0&&c>0&&h/c>f&&(l=o,u=s,f=h/c);if(n===i){var m=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,v)]:[m,v]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),f=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-f*l.pad,u.val+f*u.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),_.simpleMap(r,t.l2r||Number)},O.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=O.getAutoRange(t);var r=t._gd.layout[t._name];r||(t._gd.layout[t._name]=r={}),r!==t&&(r.range=t.range.slice(),r.autorange=t.autorange)}},O.saveRangeInitial=function(t,e){for(var r=O.list(t,"",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial,s=o||!(a.range[0]===a._rangeInitial[0]&&a.range[1]===a._rangeInitial[1]);(o&&a.autorange===!1||e&&s)&&(a._rangeInitial=a.range.slice(),n=!0)}return n},O.expand=function(t,e,r){function n(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function i(r){function n(t){return b(t)&&Math.abs(t)<S}if(u=e[r],b(u)){if(f=w(r)+y,d=M(r)+y,m=u-k(r),v=u+A(r),"log"===t.type&&m<v/10&&(m=v/10),c=t.c2l(m),h=t.c2l(v),x&&(c=Math.min(0,c),h=Math.max(0,h)),n(c)){for(p=!0,s=0;s<t._min.length&&p;s++)l=t._min[s],l.val<=c&&l.pad>=d?p=!1:l.val>=c&&l.pad<=d&&(t._min.splice(s,1),s--);p&&t._min.push({val:c,pad:x&&0===c?0:d})}if(n(h)){for(p=!0,s=0;s<t._max.length&&p;s++)l=t._max[s],l.val>=h&&l.pad>=f?p=!1:l.val<=h&&l.pad<=f&&(t._max.splice(s,1),s--);p&&t._max.push({val:h,pad:x&&0===h?0:f})}}}var a=t.autorange||_.nestedProperty(t,"rangeslider.autorange");if(a&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var o,s,l,u,c,h,f,d,p,m,v,g=e.length,y=r.padded?.05*t._length:0,x=r.tozero&&("linear"===t.type||"-"===t.type),w=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),M=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),A=n(r.vpadplus||r.vpad),k=n(r.vpadminus||r.vpad);for(o=0;o<6;o++)i(o);for(o=g-1;o>5;o--)i(o)}},O.autoBin=function(t,e,r,a,o){var s=_.aggNums(Math.min,null,t),l=_.aggNums(Math.max,null,t);if(o||(o=e.calendar),"category"===e.type)return{start:s-.5,end:l+.5,size:1};var u;if(r)u=(l-s)/r;else{var c=_.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),f=h*_.roundUp(c.minDiff/h,[.9,1.9,4.9,9.9],!0);u=Math.max(f,2*_.stdev(t)/Math.pow(t.length,a?.25:.4)),b(u)||(u=1)}var d;d="log"===e.type?{type:"linear",range:[s,l]}:{type:e.type,range:_.simpleMap([s,l],e.c2r,0,o),calendar:o},O.setConvert(d),O.autoTicks(d,u);var p,m=O.tickIncrement(O.tickFirst(d),d.dtick,"reverse",o);if("number"==typeof d.dtick){m=n(m,t,d,s,l);var v=1+Math.floor((l-m)/d.dtick);p=m+v*d.dtick}else for("M"===d.dtick.charAt(0)&&(m=i(m,t,d.dtick,s,o)),p=m;p<=l;)p=O.tickIncrement(p,d.dtick,!1,o);return{start:e.c2r(m,0,o),end:e.c2r(p,0,o),size:d.dtick}},O.calcTicks=function(t){var e=_.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=_.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),O.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),s(t),"array"===t.tickmode)return a(t);t._tmin=O.tickFirst(t);var i=e[1]<e[0],o=[],l=1.0001*e[1]-1e-4*e[0];"category"===t.type&&(l=i?Math.max(-.5,l):Math.min(t._categories.length-.5,l));for(var u=t._tmin;(i?u>=l:u<=l)&&(o.push(u),!(o.length>1e3));u=O.tickIncrement(u,t.dtick,i,t.calendar));t._tmax=o[o.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var c=new Array(o.length),h=0;h<o.length;h++)c[h]=O.tickText(t,o[h]);return t._inCalcTicks=!1,c};var j=[2,5,10],F=[1,2,3,6,12],N=[1,2,5,10,15,30],B=[1,2,3,7,14],U=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],V=[-.301,0,.301,.699,1];O.autoTicks=function(t,e){var r;if("date"===t.type){t.tick0=_.dateTick0(t.calendar);var n=2*e;n>E?(e/=E,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*o(e,r,j)):n>L?(e/=L,t.dtick="M"+o(e,1,F)):n>C?(t.dtick=o(e,C,B),t.tick0=_.dateTick0(t.calendar,!0)):n>D?t.dtick=o(e,D,F):n>z?t.dtick=o(e,z,N):n>I?t.dtick=o(e,I,N):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=o(e,r,j))}else if("log"===t.type){t.tick0=0;var i=_.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var a=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/a,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+o(e,r,j)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=o(e,r,j));if(0===t.dtick&&(t.dtick=1),!b(t.dtick)&&"string"!=typeof t.dtick){var s=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(s)}},O.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(b(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return _.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?V:U,l=t+.01*i,u=_.roundUp(_.mod(l,1),s,r);return Math.floor(l)+Math.log(y.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(e)},O.tickFirst=function(t){var e=t.r2l||Number,r=_.simpleMap(t.range,e),n=r[1]<r[0],i=n?Math.floor:Math.ceil,a=1.0001*r[0]-1e-4*r[1],o=t.dtick,s=e(t.tick0);if(b(o)){var l=i((a-s)/o)*o+s;return"category"===t.type&&(l=_.constrain(l,0,t._categories.length-1)),l}var u=o.charAt(0),c=Number(o.substr(1));if("M"===u){for(var h,f,d,p=0,m=s;p<10;){if(h=O.tickIncrement(m,o,n,t.calendar),(h-a)*(m-a)<=0)return n?Math.min(m,h):Math.max(m,h);f=(a-(m+h)/2)/(h-m),d=u+(Math.abs(Math.round(f))||1)*c,m=O.tickIncrement(m,d,f<0?!n:n,t.calendar),p++}return _.error("tickFirst did not converge",t),m}if("L"===u)return Math.log(i((Math.pow(10,a)-s)/c)*c+s)/Math.LN10;if("D"===u){var v="D2"===o?V:U,g=_.roundUp(_.mod(a,1),v,n);return Math.floor(a)+Math.log(y.round(Math.pow(10,g),1))/Math.LN10}throw"unrecognized dtick "+String(o)},O.tickText=function(t,e,r){function n(n){var i;return void 0===n||(r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i))}var i,a,o=l(t,e),s="array"===t.tickmode,d=r||s,p="category"===t.type?t.d2l_noadd:t.d2l;if(s&&Array.isArray(t.ticktext)){var m=_.simpleMap(t.range,t.r2l),v=Math.abs(m[1]-m[0])/1e4;for(a=0;a<t.ticktext.length&&!(Math.abs(e-p(t.tickvals[a]))<v);a++);if(a<t.ticktext.length)return o.text=String(t.ticktext[a]),o}return i="none"!==t.exponentformat&&n(t.showexponent)?"hide":"","date"===t.type?u(t,o,r,d):"log"===t.type?c(t,o,r,d,i):"category"===t.type?h(t,o):f(t,o,r,d,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o};var H=["f","p","n","\u03bc","m","","k","M","G","T"];O.subplotMatch=/^x([0-9]*)y([0-9]*)$/,O.getSubplots=function(t,e){function r(t,e){return t.indexOf(e._id)!==-1}var n,i,a,o=[],s=t._fullData||t.data||[];for(n=0;n<s.length;n++){var l=s[n];if(l.visible!==!1&&"legendonly"!==l.visible&&(x.traceIs(l,"cartesian")||x.traceIs(l,"gl2d"))){var u=l.xaxis||"x",c=l.yaxis||"y";a=u+c,o.indexOf(a)===-1&&o.push(a)}}var h=O.list(t,"",!0);for(n=0;n<h.length;n++){var f=h[n],d=f._id.charAt(0),p="free"===f.anchor?"x"===d?"y":"x":f.anchor,m=O.getFromId(t,p),v=!1;for(i=0;i<o.length;i++)if(r(o[i],f)){v=!0;break}"free"===f.anchor&&v||m&&(a="x"===d?f._id+m._id:m._id+f._id,o.indexOf(a)===-1&&o.push(a))}var g=O.subplotMatch,y=[];for(n=0;n<o.length;n++)a=o[n],g.test(a)&&y.push(a);return y.sort(function(t,e){var r=t.match(g),n=e.match(g);return r[1]===n[1]?+(r[2]||1)-(n[2]||1):+(r[1]||0)-(n[1]||0)}),e?O.findSubplotsWithAxis(y,e):y},O.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],i=0;i<t.length;i++){var a=t[i];r.test(a)&&n.push(a)}return n},O.makeClipPaths=function(t){var e,r,n=t._fullLayout,i=n._defs,a={_offset:0,_length:n.width,_id:""},o={_offset:0,_length:n.height,_id:""},s=O.list(t,"x",!0),l=O.list(t,"y",!0),u=[];for(e=0;e<s.length;e++)for(u.push({x:s[e],y:o}),r=0;r<l.length;r++)0===e&&u.push({x:a,y:l[r]}),u.push({x:s[e],y:l[r]});var c=i.selectAll("g.clips").data([0]);c.enter().append("g").classed("clips",!0);var h=c.selectAll(".axesclip").data(u,function(t){return t.x._id+t.y._id});h.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+n._uid+t.x._id+t.y._id}).append("rect"),h.exit().remove(),h.each(function(t){y.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})},O.doTicks=function(t,e,r){function n(t){var e=u.l2p(t.x);return e>1&&e<u._length-1}function i(t,e){var r=t.selectAll("path."+E).data("inside"===u.ticks?V:T,S);e&&u.ticks?(r.enter().append("path").classed(E,1).classed("ticks",1).classed("crisp",1).call(A.stroke,u.tickcolor).style("stroke-width",F+"px").attr("d",e),r.attr("transform",d),r.exit().remove()):r.remove()}function a(r,n){function i(t,e){t.each(function(t){var r=p(e),n=y.select(this),i=n.select(".text-math-group"),a=d(t)+(b(e)&&0!==+e?" rotate("+e+","+h(t)+","+(f(t)-t.fontSize/2)+")":"");if(i.empty()){var o=n.select("text").attr({transform:a,"text-anchor":r});o.empty()||o.selectAll("tspan.line").attr({x:o.attr("x"),y:o.attr("y")})}else{var s=k.bBox(i.node()).width*{end:-.5,start:.5}[r];i.attr("transform",a+(s?"translate("+s+",0)":""))}})}function a(){return L.length&&Promise.all(L)}function s(){if(i(c,u.tickangle),"x"===v&&!b(u.tickangle)&&("log"!==u.type||"D"!==String(u.dtick).charAt(0))){var t=[];for(c.each(function(e){var r=y.select(this),n=r.select(".text-math-group"),i=u.l2p(e.x);n.empty()&&(n=r.select("text"));var a=k.bBox(n.node());t.push({top:0,bottom:10,height:10,left:i-a.width/2,right:i+a.width/2+2,width:a.width+2})}),m=0;m<t.length-1;m++)if(_.bBoxIntersect(t[m],t[m+1])){A=30;break}if(A){var r=Math.abs((T[T.length-1].x-T[0].x)*u._m)/(T.length-1);r<2.5*M&&(A=90),i(c,A)}u._lastangle=A}return o(e),e+" done"}function l(){u._boundingBox=r.node().getBoundingClientRect()}var c=r.selectAll("g."+E).data(T,S);if(!u.showticklabels||!b(n))return c.remove(),void o(e);var h,f,p,g,x;"x"===v?(x="bottom"===B?1:-1,h=function(t){return t.dx+I*x},g=n+(z+D)*x,f=function(t){return t.dy+g+t.fontSize*("bottom"===B?1:-.5)},p=function(t){return b(t)&&0!==t&&180!==t?t*x<0?"end":"start":"middle"}):(x="right"===B?1:-1,f=function(t){return t.dy+t.fontSize/2-I*x},h=function(t){return t.dx+n+(z+D+(90===Math.abs(u.tickangle)?t.fontSize/2:0))*x},p=function(t){return b(t)&&90===Math.abs(t)?"middle":"right"===B?"start":"end"});var M=0,A=0,L=[];c.enter().append("g").classed(E,1).append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(k.setPosition,h(e),f(e)).call(k.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?L.push(t._promises.pop().then(function(){i(r,u.tickangle)})):i(r,u.tickangle)}),c.exit().remove(),c.each(function(t){M=Math.max(M,t.fontSize)}),i(c,u._lastangle||u.tickangle);var C=_.syncOrAsync([a,s,l]);return C&&C.then&&t._promises.push(C),C}function o(e){if(!r){var n,i,a,o,s=R.getFromId(t,e),l=y.select(t).selectAll("g."+e+"tick"),u={selection:l,side:s.side},h=e.charAt(0),f=t._fullLayout._size,d=1.5,p=s.titlefont.size;if(l.size()){var m=k.getTranslate(l.node().parentNode);u.offsetLeft=m.x,u.offsetTop=m.y}"x"===h?(i="free"===s.anchor?{_offset:f.t+(1-(s.position||0))*f.h,_length:0}:R.getFromId(t,s.anchor),a=s._offset+s._length/2,o=i._offset+("top"===s.side?-10-p*(d+(s.showticklabels?1:0)):i._length+10+p*(d+(s.showticklabels?1.5:.5))),s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(o+=(c.height-c.margin.b-c.margin.t)*s.rangeslider.thickness+s._boundingBox.height),u.side||(u.side="bottom")):(i="free"===s.anchor?{_offset:f.l+(s.position||0)*f.w,_length:0}:R.getFromId(t,s.anchor),o=s._offset+s._length/2,a=i._offset+("right"===s.side?i._length+10+p*(d+(s.showticklabels?1:.5)):-10-p*(d+(s.showticklabels?.5:0))),n={rotate:"-90",offset:0},u.side||(u.side="left")),M.draw(t,e+"title",{propContainer:s,propName:s._name+".title",dfltName:h.toUpperCase()+" axis",avoid:u,transform:n,attributes:{x:a,y:o,"text-anchor":"middle"}})}}function s(t,e){return t.visible===!0&&t.xaxis+t.yaxis===e&&(!(!x.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[v])||t.fill&&t.fill.charAt(t.fill.length-1)===v)}function l(e,r,i){var a=e.gridlayer,o=e.zerolinelayer,l=e["hidegrid"+v]?[]:V,c=u._gridpath||"M0,0"+("x"===v?"v":"h")+r._length,h=a.selectAll("path."+L).data(u.showgrid===!1?[]:l,S);if(h.enter().append("path").classed(L,1).classed("crisp",1).attr("d",c).each(function(t){u.zeroline&&("linear"===u.type||"-"===u.type)&&Math.abs(t.x)<u.dtick/100&&y.select(this).remove()}),h.attr("transform",d).call(A.stroke,u.gridcolor||"#ddd").style("stroke-width",P+"px"),h.exit().remove(),o){for(var f=!1,p=0;p<t._fullData.length;p++)if(s(t._fullData[p],i)){f=!0;break}var m=_.simpleMap(u.range,u.r2l),g=m[0]*m[1]<=0&&u.zeroline&&("linear"===u.type||"-"===u.type)&&l.length&&(f||n({x:0})||!u.showline),b=o.selectAll("path."+C).data(g?[{x:0}]:[]);b.enter().append("path").classed(C,1).classed("zl",1).classed("crisp",1).attr("d",c),b.attr("transform",d).call(A.stroke,u.zerolinecolor||A.defaultLine).style("stroke-width",j+"px"),b.exit().remove()}}var u,c=t._fullLayout,h=!1;if("object"==typeof e)u=e,e=u._id,h=!0;else if(u=O.getFromId(t,e),"redraw"===e&&c._paper.selectAll("g.subplot").each(function(t){var e=c._plots[t],r=e.xaxis,n=e.yaxis;e.xaxislayer.selectAll("."+r._id+"tick").remove(),e.yaxislayer.selectAll("."+n._id+"tick").remove(),e.gridlayer.selectAll("path").remove(),e.zerolinelayer.selectAll("path").remove()}),!e||"redraw"===e)return _.syncOrAsync(O.list(t,"",!0).map(function(r){return function(){if(r._id){var n=O.doTicks(t,r._id);return"redraw"===e&&(r._r=r.range.slice(),r._rl=_.simpleMap(r._r,r.r2l)),n}}}));u.tickformat||(["none","e","E","power","SI","B"].indexOf(u.exponentformat)===-1&&(u.exponentformat="e"),["all","first","last","none"].indexOf(u.showexponent)===-1&&(u.showexponent="all")),u.setScale();var f,d,p,m,v=e.charAt(0),g=O.counterLetter(e),T=O.calcTicks(u),S=function(t){return[t.text,t.x,u.mirror].join("_")},E=e+"tick",L=e+"grid",C=e+"zl",D=(u.linewidth||1)/2,z=("outside"===u.ticks?u.ticklen:1)+(u.linewidth||0),I=0,P=k.crispRound(t,u.gridwidth,1),j=k.crispRound(t,u.zerolinewidth,P),F=k.crispRound(t,u.tickwidth,1);if(u._counterangle&&"outside"===u.ticks){var N=u._counterangle*Math.PI/180;z=u.ticklen*Math.cos(N)+(u.linewidth||0),I=u.ticklen*Math.sin(N)}if("x"===v)f=["bottom","top"],d=function(t){return"translate("+u.l2p(t.x)+",0)"},p=function(t,e){if(u._counterangle){var r=u._counterangle*Math.PI/180;return"M0,"+t+"l"+Math.sin(r)*e+","+Math.cos(r)*e}return"M0,"+t+"v"+e};else{if("y"!==v)return void _.warn("Unrecognized doTicks axis:",e);f=["left","right"],d=function(t){return"translate(0,"+u.l2p(t.x)+")"},p=function(t,e){if(u._counterangle){var r=u._counterangle*Math.PI/180;return"M"+t+",0l"+Math.cos(r)*e+","+-Math.sin(r)*e}return"M"+t+",0h"+e}}var B=u.side||f[0],U=[-1,1,B===f[1]?1:-1];"inside"!==u.ticks==("x"===v)&&(U=U.map(function(t){return-t}));var V=T.filter(n);if(h){if(i(u._axislayer,p(u._pos+D*U[2],U[2]*u.ticklen)),u._counteraxis){var H={gridlayer:u._gridlayer,zerolinelayer:u._zerolinelayer};l(H,u._counteraxis)}return a(u._axislayer,u._pos)}var q=O.getSubplots(t,u).map(function(t){var e=c._plots[t];if(c._has("cartesian")){var r=e[v+"axislayer"],n=u._linepositions[t]||[],o=e[g+"axis"],s=o._id===u.anchor,h=[!1,!1,!1],d="";if("allticks"===u.mirror?h=[!0,!0,!1]:s&&("ticks"===u.mirror?h=[!0,!0,!1]:h[f.indexOf(B)]=!0),u.mirrors)for(m=0;m<2;m++){var y=u.mirrors[o._id+f[m]];"ticks"!==y&&"labels"!==y||(h[m]=!0)}return void 0!==n[2]&&(h[2]=!0),h.forEach(function(t,e){var r=n[e],i=U[e];t&&b(r)&&(d+=p(r+D*i,i*u.ticklen))}),i(r,d),l(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return q.length?Promise.all(q):0},O.swap=function(t,e){for(var r=p(t,e),n=0;n<r.length;n++)v(t,r[n].x,r[n].y)}},{"../../components/color":562,"../../components/drawing":585,"../../components/titles":638,"../../constants/numerical":649,"../../lib":667,"../../lib/svg_text_utils":686,"../../registry":781,"./axis_ids":709,"./layout_attributes":715,"./layout_defaults":716,"./set_convert":720,d3:97,"fast-isnumeric":106}],707:[function(t,e,r){"use strict";function n(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(o(t[e]))return!0;return!1}function i(t,e){for(var r,n=0,i=0,a=Math.max(1,(t.length-1)/1e3),l=0;l<t.length;l+=a)r=t[Math.round(l)],s.isDateTime(r,e)&&(n+=1),o(r)&&(i+=1);return n>2*i}function a(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a<t.length;a+=r)e=t[Math.round(a)],s.cleanNumber(e)!==l?n++:"string"==typeof e&&""!==e&&"None"!==e&&i++;return i>2*n}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return i(t,e)?"date":a(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":649,"../../lib":667,"fast-isnumeric":106}],708:[function(t,e,r){"use strict";function n(t,e){if("-"===t.type){var r=t._id,n=r.charAt(0);r.indexOf("scene")!==-1&&(r=n);var s=o(e,r,n);if(s){if("histogram"===s.type&&n==={v:"y",h:"x"}[s.orientation||"v"])return void(t.type="linear");var u=n+"calendar",c=s[u];if(a(s,n)){for(var h,f=i(s),d=[],p=0;p<e.length;p++)h=e[p],l.traceIs(h,"box")&&(h[n+"axis"]||n)===r&&(void 0!==h[f]?d.push(h[f][0]):void 0!==h.name?d.push(h.name):d.push("text"),h[u]!==c&&(c=void 0));t.type=b(d,c)}else t.type=b(s[n]||[s[n+"0"]],c)}}}function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function a(t,e){var r=i(t),n=l.traceIs(t,"box"),a=l.traceIs(t._fullInput||{},"candlestick");return n&&!a&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}function o(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if((i[r+"axis"]||r)===e){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}var s=t("tinycolor2").mix,l=t("../../registry"),u=t("../../lib"),c=t("../../components/color/attributes").lightFraction,h=t("./layout_attributes"),f=t("./tick_value_defaults"),d=t("./tick_mark_defaults"),p=t("./tick_label_defaults"),m=t("./category_order_defaults"),v=t("./set_convert"),g=t("./ordered_categories"),y=t("./axis_ids"),b=t("./axis_autotype");e.exports=function(t,e,r,i){function a(r,n){return u.coerce2(t,e,h,r,n)}var o=i.letter,b=i.font||{},x="Click to enter "+(i.title||o.toUpperCase()+" axis")+" title";i.name&&(e._name=i.name,e._id=y.name2id(i.name));var _=r("type");if("-"===_&&(n(e,i.data),"-"===e.type?e.type="linear":_=t.type=e.type),"date"===_){var w=l.getComponentMethod("calendars","handleDefaults");w(t,e,"calendar",i.calendar)}v(e);var M=r("color"),A=M===t.color?M:b.color;r("title",x),u.coerceFont(r,"titlefont",{family:b.family,size:Math.round(1.2*b.size),color:A});var k=r("autorange",!e.isValidRange(t.range));k&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r,_),p(t,e,r,_,i),d(t,e,r,i),m(t,e,r);var T=a("linecolor",M),S=a("linewidth"),E=r("showline",!!T||!!S);E||(delete e.linecolor,delete e.linewidth),(E||e.ticks)&&r("mirror");var L=a("gridcolor",s(M,i.bgColor,c).toRgbString()),C=a("gridwidth"),D=r("showgrid",i.showGrid||!!L||!!C);D||(delete e.gridcolor,delete e.gridwidth);var z=a("zerolinecolor",M),I=a("zerolinewidth"),P=r("zeroline",i.showGrid||!!z||!!I);return P||(delete e.zerolinecolor,delete e.zerolinewidth),e._initialCategories="category"===_?g(o,e.categoryorder,e.categoryarray,i.data):[],e}},{"../../components/color/attributes":561,"../../lib":667,"../../registry":781,"./axis_autotype":707,"./axis_ids":709,"./category_order_defaults":710,"./layout_attributes":715,"./ordered_categories":717,"./set_convert":720,"./tick_label_defaults":721,"./tick_mark_defaults":722,"./tick_value_defaults":723,tinycolor2:498}],709:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o<n.length;o++){var s=n[o];e&&s.charAt(0)!==e||i.test(s)&&a.push(r+s)}return a.sort()}var i=t._fullLayout;if(!i)return[];var o=n(i,"");if(r)return o;for(var s=a.getSubplotIds(i,"gl3d")||[],l=0;l<s.length;l++){var u=s[l];o=o.concat(n(i[u],u+"."))}return o}var i=t("../../registry"),a=t("../plots"),o=t("../../lib"),s=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(s.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(s.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(s.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,r){return n(t,e,r).map(function(e){return o.nestedProperty(t._fullLayout,e).get()})},r.listIds=function(t,e){return n(t,e,!0).map(r.name2id)},r.getFromId=function(t,e,n){var i=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),i[r.id2name(e)]},r.getFromTrace=function(t,e,n){var a=t._fullLayout,o=null;if(i.traceIs(e,"gl3d")){var s=e.scene;"scene"===s.substr(0,5)&&(o=a[s][n+"axis"])}else o=r.getFromId(t,e[n+"axis"]||n);return o}},{"../../lib":667,"../../registry":781,"../plots":766,"./constants":711}],710:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],711:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:300,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,BENDPX:1.5,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4]}},{}],712:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,s.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,s.format("."+String(r)+"g")(n))}function i(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function a(t){s.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function o(t){var e=["lasso","select"];return e.indexOf(t)!==-1}var s=t("d3"),l=t("tinycolor2"),u=t("../../plotly"),c=t("../../registry"),h=t("../../lib"),f=t("../../lib/svg_text_utils"),d=t("../../components/color"),p=t("../../components/drawing"),m=t("../../lib/setcursor"),v=t("../../components/dragelement"),g=t("./axes"),y=t("./select"),b=t("./constants"),x=!0;e.exports=function(t,e,r,s,_,w,M,A){function k(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function T(){U=[e.xaxis],V=[e.yaxis],H=U[0]._length,q=V[0]._length;for(var t=1;t<B.length;t++){var r=B[t].xaxis,n=B[t].yaxis;U.indexOf(r)===-1&&U.push(r),V.indexOf(n)===-1&&V.push(n)}Q=U.concat(V),K=k(U,A),$=k(V,M),tt=i($+K,N.dragmode),mt=e.xaxis._offset,vt=e.yaxis._offset,it.xa=U,it.ya=V}function S(e,r,n){var i=nt.getBoundingClientRect();at=r-i.left,ot=n-i.top,st={l:at,r:at,w:0,t:ot,b:ot,h:0},lt=t._hmpixcount?t._hmlumcount/t._hmpixcount:l(t._fullLayout.plot_bgcolor).getLuminance(),ut="M0,0H"+H+"V"+q+"H0V0",ct=!1,ht="xy",ft=pt.append("path").attr("class","zoombox").style({fill:lt>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+mt+", "+vt+")").attr("d",ut+"Z"),dt=pt.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+mt+", "+vt+")").attr("d","M0,0Z"),E()}function E(){pt.selectAll(".select-outline").remove()}function L(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(H,e+at)),i=Math.max(0,Math.min(q,r+ot)),a=Math.abs(n-at),o=Math.abs(i-ot),s=Math.floor(Math.min(o,a,G)/2);st.l=Math.min(at,n),st.r=Math.max(at,n),st.t=Math.min(ot,i),st.b=Math.max(ot,i),!$||o<Math.min(Math.max(.6*a,Y),G)?a<Y?(ht="",st.r=st.l,st.t=st.b,dt.attr("d","M0,0Z")):(st.t=0,st.b=q,ht="x",dt.attr("d","M"+(st.l-.5)+","+(ot-G-.5)+"h-3v"+(2*G+1)+"h3ZM"+(st.r+.5)+","+(ot-G-.5)+"h3v"+(2*G+1)+"h-3Z")):!K||a<Math.min(.6*o,G)?(st.l=0,st.r=H,ht="y",dt.attr("d","M"+(at-G-.5)+","+(st.t-.5)+"v-3h"+(2*G+1)+"v3ZM"+(at-G-.5)+","+(st.b+.5)+"v3h"+(2*G+1)+"v-3Z")):(ht="xy",dt.attr("d","M"+(st.l-3.5)+","+(st.t-.5+s)+"h3v"+-s+"h"+s+"v-3h-"+(s+3)+"ZM"+(st.r+3.5)+","+(st.t-.5+s)+"h-3v"+-s+"h"+-s+"v-3h"+(s+3)+"ZM"+(st.r+3.5)+","+(st.b+.5-s)+"h-3v"+s+"h"+-s+"v3h"+(s+3)+"ZM"+(st.l-3.5)+","+(st.b+.5-s)+"h3v"+s+"h"+s+"v3h-"+(s+3)+"Z")),st.w=st.r-st.l,st.h=st.b-st.t,ft.attr("d",ut+"M"+st.l+","+st.t+"v"+st.h+"h"+st.w+"v-"+st.h+"h-"+st.w+"Z"),ct||(ft.transition().style("fill",lt>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),dt.transition().style("opacity",1).duration(200),ct=!0)}function C(t,e,r){var n,i,a,o;for(n=0;n<t.length;n++)i=t[n],i.fixedrange||(a=i._rl[0],o=i._rl[1]-a,i.range=[i.l2r(a+o*e),i.l2r(a+o*r)])}function D(e,r){return Math.min(st.h,st.w)<2*Y?(2===r&&R(),a(t)):("xy"!==ht&&"x"!==ht||C(U,st.l/H,st.r/H),"xy"!==ht&&"y"!==ht||C(V,(q-st.b)/q,(q-st.t)/q),a(t),j(ht),void(x&&t.data&&t._context.showTips&&(h.notifier("Double-click to
zoom back out","long"),x=!1)))}function z(e,r){var i=1===(M+A).length;if(e)j();else if(2!==r||i){if(1===r&&i){var a=M?V[0]:U[0],o="s"===M||"w"===A?0:1,s=a._name+".range["+o+"]",l=n(a,o),c="left",h="middle";if(a.fixedrange)return;M?(h="n"===M?"top":"bottom","right"===a.side&&(c="right")):"e"===A&&(c="right"),t._context.showAxisRangeEntryBoxes&&rt.call(f.makeEditable,null,{immediate:!0,background:N.paper_bgcolor,text:String(l),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:h}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&u.relayout(t,s,r)})}}else R()}function I(e){function r(t,e,r){function n(e){return t.l2r(a+(e-a)*r)}if(!t.fixedrange){var i=h.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(n)}}if(t._context.scrollZoom||N._enablescrollzoom){if(t._transitioningWithDuration)return h.pauseEvent(e);var n=t.querySelector(".plotly");if(T(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(yt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void h.log("Did not find wheel motion attributes: ",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=xt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=gt[0]+gt[2]*l,c=(s.bottom-e.clientY)/s.height,f=gt[1]+gt[3]*(1-c);if(A){for(a=0;a<U.length;a++)r(U[a],l,o);gt[2]*=o,gt[0]=u-gt[2]*l}if(M){for(a=0;a<V.length;a++)r(V[a],c,o);gt[3]*=o,gt[1]=f-gt[3]*(1-c)}return F(gt),O(M,A),yt=setTimeout(function(){gt=[0,0,H,q],j()},bt),h.pauseEvent(e)}}}function P(e,r){function n(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)])}}function i(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function a(t,e,r){for(var n,a,o=1-e,s=0;s<t.length;s++){var l=t[s];if(!l.fixedrange){n=l,a=l._rl[o]+(l._rl[e]-l._rl[o])/i(r/l._length);var u=l.l2r(a);u!==!1&&void 0!==u&&(l.range[e]=u)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[o])}if(!t._transitioningWithDuration){if(T(),"ew"===K||"ns"===$)return K&&n(U,e),$&&n(V,r),F([K?-e:0,$?-r:0,H,q]),void O($,K);"w"===K?e=a(U,0,e):"e"===K?e=a(U,1,-e):K||(e=0),"n"===$?r=a(V,1,r):"s"===$?r=a(V,0,-r):$||(r=0),F(["w"===K?e:0,"n"===$?r:0,H-e,q-r]),O($,K)}}function O(e,r){function n(t){for(a=0;a<t.length;a++)t[a].fixedrange||o.push(t[a]._id)}function i(n,i){for(a=0;a<n.length;a++){var s=n[a];(r&&o.indexOf(s.xref)!==-1||e&&o.indexOf(s.yref)!==-1)&&i(t,a)}}var a,o=[];for(r&&n(U),e&&n(V),a=0;a<o.length;a++)g.doTicks(t,o[a],!0);i(N.annotations||[],c.getComponentMethod("annotations","drawOne")),i(N.shapes||[],c.getComponentMethod("shapes","drawOne")),i(N.images||[],c.getComponentMethod("images","draw"))}function R(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(K?U:[]).concat($?V:[]),o={};if("autosize"===i)for(r=0;r<a.length;r++)e=a[r],e.fixedrange||(o[e._name+".autorange"]=!0);else if("reset"===i)for(r=0;r<a.length;r++)e=a[r],e._rangeInitial?(n=e._rangeInitial.slice(),o[e._name+".range[0]"]=n[0],o[e._name+".range[1]"]=n[1]):o[e._name+".autorange"]=!0;else if("reset+autosize"===i)for(r=0;r<a.length;r++)e=a[r],e.fixedrange||(void 0===e._rangeInitial||e.range[0]===e._rangeInitial[0]&&e.range[1]===e._rangeInitial[1]?o[e._name+".autorange"]=!0:(n=e._rangeInitial.slice(),o[e._name+".range[0]"]=n[0],o[e._name+".range[1]"]=n[1]));t.emit("plotly_doubleclick",null),u.relayout(t,o)}}function j(e){for(var r={},n=0;n<Q.length;n++){var i=Q[n];e&&e.indexOf(i._id.charAt(0))===-1||(i._r[0]!==i.range[0]&&(r[i._name+".range[0]"]=i.range[0]),i._r[1]!==i.range[1]&&(r[i._name+".range[1]"]=i.range[1]),i.range=i._r.slice())}F([0,0,H,q]),u.relayout(t,r)}function F(t){for(var e,r=N._plots,n=Object.keys(r),i=0;i<n.length;i++){var a=r[n[i]],o=a.xaxis,s=a.yaxis,l=A&&!o.fixedrange,u=M&&!s.fixedrange;if(l){var c=!1;for(e=0;e<U.length;e++)if(U[e]._id===o._id){c=!0;break}l=l&&c}if(u){var h=!1;for(e=0;e<V.length;e++)if(V[e]._id===s._id){h=!0;break}u=u&&h}var f=l?o._length/t[2]:1,d=u?s._length/t[3]:1,m=l?t[0]:0,v=u?t[1]:0,g=l?t[0]/t[2]*o._length:0,y=u?t[1]/t[3]*s._length:0,b=o._offset-g,x=s._offset-y;N._defs.selectAll("#"+a.clipId).call(p.setTranslate,m,v).call(p.setScale,1/f,1/d),a.plot.call(p.setTranslate,b,x).call(p.setScale,f,d).select(".scatterlayer").selectAll(".points").selectAll(".point").call(p.setPointGroupScale,1/f,1/d)}}for(var N=t._fullLayout,B=[e].concat(M&&A?e.overlays:[]),U=[e.xaxis],V=[e.yaxis],H=U[0]._length,q=V[0]._length,Y=b.MINDRAG,G=b.MINZOOM,W=M+A==="nsew",X=1;X<B.length;X++){var Z=B[X].xaxis,J=B[X].yaxis;U.indexOf(Z)===-1&&U.push(Z),V.indexOf(J)===-1&&V.push(J)}var Q=U.concat(V),K=k(U,A),$=k(V,M),tt=i($+K,N.dragmode),et=M+A+"drag",rt=e.draglayer.selectAll("."+et).data([0]);rt.enter().append("rect").classed("drag",!0).classed(et,!0).style({ fill:"transparent","stroke-width":0}).attr("data-subplot",e.id),rt.call(p.setRect,r,s,_,w).call(m,tt);var nt=rt.node();if(!$&&!K&&!o(N.dragmode))return nt.onmousedown=null,nt.style.pointerEvents=W?"all":"none",nt;var it={element:nt,gd:t,plotinfo:e,xaxes:U,yaxes:V,doubleclick:R,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;W?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan","lasso"===i?it.minDrag=1:it.minDrag=void 0,"zoom"===i?(it.moveFn=L,it.doneFn=D,S(e,r,n)):"pan"===i?(it.moveFn=P,it.doneFn=z,E()):o(i)&&y(e,r,n,it,i)}};v.init(it);var at,ot,st,lt,ut,ct,ht,ft,dt,pt=t._fullLayout._zoomlayer,mt=e.xaxis._offset,vt=e.yaxis._offset,gt=[0,0,H,q],yt=null,bt=b.REDRAWDELAY,xt=e.mainplot?N._plots[e.mainplot]:e;return M.length*A.length!==1&&(void 0!==nt.onwheel?nt.onwheel=I:void 0!==nt.onmousewheel&&(nt.onmousewheel=I)),nt}},{"../../components/color":562,"../../components/dragelement":583,"../../components/drawing":585,"../../lib":667,"../../lib/setcursor":682,"../../lib/svg_text_utils":686,"../../plotly":701,"../../registry":781,"./axes":706,"./constants":711,"./select":719,d3:97,tinycolor2:498}],713:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=t.length;n>0;n--)r.push(e);return r}function i(t,e){for(var r=[],n=0;n<t.length;n++)r.push(t[n].p2c(e));return r}function a(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}}function o(t,e,r){if("pie"===r)return void t.emit("plotly_hover",{points:[e]});r||(r="xy");var a=Array.isArray(r)?r:[r],o=t._fullLayout,p=o._plots||[],y=p[r];if(y){var x=y.overlays.map(function(t){return t.id});a=a.concat(x)}for(var T=a.length,S=new Array(T),E=new Array(T),L=0;L<T;L++){var C=a[L],D=p[C];if(D)S[L]=A.getFromId(t,D.xaxis._id),E[L]=A.getFromId(t,D.yaxis._id);else{var z=o[C]._subplot;S[L]=z.xaxis,E[L]=z.yaxis}}var I=e.hovermode||o.hovermode;if(["x","y","closest"].indexOf(I)===-1||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return _.unhoverRaw(t,e);var P,O,R,j,F,N,B,U,V,H,q,Y,G,W=[],X=[];if(Array.isArray(e))for(I="array",R=0;R<e.length;R++)F=t.calcdata[e[R].curveNumber||0],"skip"!==F[0].trace.hoverinfo&&X.push(F);else{for(j=0;j<t.calcdata.length;j++)F=t.calcdata[j],N=F[0].trace,"skip"!==N.hoverinfo&&a.indexOf(s(N))!==-1&&X.push(F);var Z,J;if(e.target&&"clientX"in e&&"clientY"in e){if(g.triggerHandler(t,"plotly_beforehover",e)===!1)return;var Q=e.target.getBoundingClientRect();if(Z=e.clientX-Q.left,J=e.clientY-Q.top,Z<0||Z>Q.width||J<0||J>Q.height)return _.unhoverRaw(t,e)}else Z="xpx"in e?e.xpx:S[0]._length/2,J="ypx"in e?e.ypx:E[0]._length/2;if(P="xval"in e?n(a,e.xval):i(S,Z),O="yval"in e?n(a,e.yval):i(E,J),!m(P[0])||!m(O[0]))return v.warn("Fx.hover failed",e,t),_.unhoverRaw(t,e)}var K=1/0;for(j=0;j<X.length;j++)if(F=X[j],F&&F[0]&&F[0].trace&&F[0].trace.visible===!0){if(N=F[0].trace,B=s(N),U=a.indexOf(B),V=I,Y={cd:F,trace:N,xa:S[U],ya:E[U],name:t.data.length>1||N.hoverinfo.indexOf("name")!==-1?N.name:void 0,index:!1,distance:Math.min(K,k.MAXDIST),color:b.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},o[B]&&(Y.subplot=o[B]._subplot),G=W.length,"array"===V){var $=e[j];"pointNumber"in $?(Y.index=$.pointNumber,V="closest"):(V="","xval"in $&&(H=$.xval,V="x"),"yval"in $&&(q=$.yval,V=V?"closest":"y"))}else H=P[U],q=O[U];if(N._module&&N._module.hoverPoints){var tt=N._module.hoverPoints(Y,H,q,V);if(tt)for(var et,rt=0;rt<tt.length;rt++)et=tt[rt],m(et.x0)&&m(et.y0)&&W.push(l(et,I))}else v.log("Unrecognized trace type in hover:",N);"closest"===I&&W.length>G&&(W.splice(0,G),K=W[0].distance)}if(0===W.length)return _.unhoverRaw(t,e);var nt="y"===I&&X.length>1;W.sort(function(t,e){return t.distance-e.distance});var it=b.combine(o.plot_bgcolor||b.background,o.paper_bgcolor),at={hovermode:I,rotateLabels:nt,bgColor:it,container:o._hoverlayer,outerContainer:o._paperdiv},ot=u(W,at);c(W,nt?"xa":"ya"),h(ot,nt);var st=t._hoverdata,lt=[];for(R=0;R<W.length;R++){var ut=W[R],ct={data:ut.trace._input,fullData:ut.trace,curveNumber:ut.trace.index,pointNumber:ut.index};ut.trace._module.eventData?ct=ut.trace._module.eventData(ct,ut):(ct.x=ut.xVal,ct.y=ut.yVal,ct.xaxis=ut.xa,ct.yaxis=ut.ya,void 0!==ut.zLabelVal&&(ct.z=ut.zLabelVal)),lt.push(ct)}if(t._hoverdata=lt,e.target&&e.target.tagName){var ht=M.getComponentMethod("annotations","hasClickToShow")(t,lt);w(d.select(e.target),ht?"pointer":"")}f(t,e,st)&&(st&&t.emit("plotly_unhover",{points:st}),t.emit("plotly_hover",{points:t._hoverdata,xaxes:S,yaxes:E,xvals:P,yvals:O}))}function s(t){return t.subplot||t.xaxis+t.yaxis||t.geo}function l(t,e){t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=v.constrain(t.x0,0,t.xa._length),t.x1=v.constrain(t.x1,0,t.xa._length),t.y0=v.constrain(t.y0,0,t.ya._length),t.y1=v.constrain(t.y1,0,t.ya._length);var r;if(void 0!==t.xLabelVal){r="log"===t.xa.type&&t.xLabelVal<=0;var n=A.tickText(t.xa,t.xa.c2l(r?-t.xLabelVal:t.xLabelVal),"hover");r?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+n.text:t.xLabel=n.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){r="log"===t.ya.type&&t.yLabelVal<=0;var i=A.tickText(t.ya,t.ya.c2l(r?-t.yLabelVal:t.yLabelVal),"hover");r?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+i.text:t.yLabel=i.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var a=A.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+a+" / -"+A.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+a,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var o=A.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+o+" / -"+A.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+o,"y"===e&&(t.distance+=1)}var s=t.trace.hoverinfo;return"all"!==s&&(s=s.split("+"),s.indexOf("x")===-1&&(t.xLabel=void 0),s.indexOf("y")===-1&&(t.yLabel=void 0),s.indexOf("z")===-1&&(t.zLabel=void 0),s.indexOf("text")===-1&&(t.text=void 0),s.indexOf("name")===-1&&(t.name=void 0)),t}function u(t,e){var r,n,i=e.hovermode,a=e.rotateLabels,o=e.bgColor,s=e.container,l=e.outerContainer,u=t[0],c=u.xa,h=u.ya,f="y"===i?"yLabel":"xLabel",m=u[f],v=(String(m)||"").split(" ")[0],g=l.node().getBoundingClientRect(),_=g.top,w=g.width,M=g.height,A=u.distance<=k.MAXDIST&&("x"===i||"y"===i);for(r=0;r<t.length;r++){n=t[r].trace.hoverinfo;var T=n.split("+");if(T.indexOf("all")===-1&&T.indexOf(i)===-1){A=!1;break}}var S=s.selectAll("g.axistext").data(A?[0]:[]);S.enter().append("g").classed("axistext",!0),S.exit().remove(),S.each(function(){var e=d.select(this),r=e.selectAll("path").data([0]),n=e.selectAll("text").data([0]);r.enter().append("path").style({fill:b.defaultLine,"stroke-width":"1px",stroke:b.background}),n.enter().append("text").call(x.font,j,R,b.background).attr("data-notex",1),n.text(m).call(y.convertToTspans).call(x.setPosition,0,0).selectAll("tspan.line").call(x.setPosition,0,0),e.attr("transform","");var a=n.node().getBoundingClientRect();if("x"===i){n.attr("text-anchor","middle").call(x.setPosition,0,"top"===c.side?_-a.bottom-P-O:_-a.top+P+O).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var o="top"===c.side?"-":"";r.attr("d","M0,0L"+P+","+o+P+"H"+(O+a.width/2)+"v"+o+(2*O+a.height)+"H-"+(O+a.width/2)+"V"+o+P+"H-"+P+"Z"),e.attr("transform","translate("+(c._offset+(u.x0+u.x1)/2)+","+(h._offset+("top"===c.side?0:h._length))+")")}else{n.attr("text-anchor","right"===h.side?"start":"end").call(x.setPosition,("right"===h.side?1:-1)*(O+P),_-a.top-a.height/2).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var s="right"===h.side?"":"-";r.attr("d","M0,0L"+s+P+","+P+"V"+(O+a.height/2)+"h"+s+(2*O+a.width)+"V-"+(O+a.height/2)+"H"+s+P+"V-"+P+"Z"),e.attr("transform","translate("+(c._offset+("right"===h.side?c._length:0))+","+(h._offset+(u.y0+u.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[f]||"").split(" ")[0]===v})});var E=s.selectAll("g.hovertext").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")});return E.enter().append("g").classed("hovertext",!0).each(function(){var t=d.select(this);t.append("rect").call(b.fill,b.addOpacity(o,.8)),t.append("text").classed("name",!0).call(x.font,j,R),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(x.font,j,R)}),E.exit().remove(),E.each(function(t){var e=d.select(this).attr("transform",""),r="",n="",s=b.opacity(t.color)?t.color:b.defaultLine,l=b.combine(s,o),u=p(l).getBrightness()>128?"#000":b.background;void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&void 0===t.zLabelVal&&(r=y.plainText(t.name||""),r.length>15&&(r=r.substr(0,12)+"...")),void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"
"),n+=(n?"z: ":"")+t.zLabel):A&&t[i+"Label"]===m?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"
":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var c=e.select("text.nums").style("fill",u).call(x.setPosition,0,0).text(n).attr("data-notex",1).call(y.convertToTspans);c.selectAll("tspan.line").call(x.setPosition,0,0);var h=e.select("text.name"),f=0;r&&r!==n?(h.style("fill",l).text(r).call(x.setPosition,0,0).attr("data-notex",1).call(y.convertToTspans),h.selectAll("tspan.line").call(x.setPosition,0,0),f=h.node().getBoundingClientRect().width+2*O):(h.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:u});var v,g,k=c.node().getBoundingClientRect(),T=t.xa._offset+(t.x0+t.x1)/2,S=t.ya._offset+(t.y0+t.y1)/2,E=Math.abs(t.x1-t.x0),C=Math.abs(t.y1-t.y0),D=k.width+P+O+f;t.ty0=_-k.top,t.bx=k.width+2*O,t.by=k.height+2*O,t.anchor="start",t.txwidth=k.width,t.tx2width=f,t.offset=0,a?(t.pos=T,v=S+C/2+D<=M,g=S-C/2-D>=0,"top"!==t.idealAlign&&v||!g?v?(S+=C/2,t.anchor="start"):t.anchor="middle":(S-=C/2,t.anchor="end")):(t.pos=S,v=T+E/2+D<=w,g=T-E/2-D>=0,"left"!==t.idealAlign&&v||!g?v?(T+=E/2,t.anchor="start"):t.anchor="middle":(T-=E/2,t.anchor="end")),c.attr("text-anchor",t.anchor),f&&h.attr("text-anchor",t.anchor),e.attr("transform","translate("+T+","+S+")"+(a?"rotate("+L+")":""))}),E}function c(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;o<t.length;o++)l=t[o],l.pos+l.dp+l.size>e.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o<t.length&&!(u<=0);o++)if(l=t[o],l.pos<e.pmin+1)for(l.del=!0,u--,a=2*l.size,s=t.length-1;s>=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var n,i,a,o,s,l,u,c=0,h=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?D:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o<h.length-1;){var f=h[o],d=h[o+1],p=f[f.length-1],m=d[0];if(i=p.pos+p.dp+p.size-m.pos-m.dp+m.size,i>.01&&p.pmin===m.pmin&&p.pmax===m.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(f.push.apply(f,d),h.splice(o+1,1),u=0,s=f.length-1;s>=0;s--)u+=f[s].dp;for(a=u/f.length,s=f.length-1;s>=0;s--)f[s].dp-=a;n=!1}else o++}h.forEach(r)}for(o=h.length-1;o>=0;o--){var v=h[o];for(s=v.length-1;s>=0;s--){var g=v[s],y=t[g.i];y.offset=g.dp,y.del=g.del}}}function h(t,e){t.each(function(t){var r=d.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(P+O),s=o+a*(t.txwidth+O),l=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-I,l=t.offset*z),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*P+l)+","+(P+u)+"v"+(t.by/2-P)+"h"+n*t.bx+"v-"+t.by+"H"+(n*P+l)+"V"+(u-P)+"Z"),i.call(x.setPosition,o+l,u+t.ty0-t.by/2+O).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(x.setPosition,s+a*O+l,u+t.ty0-t.by/2+O),r.select("rect").call(x.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function f(t,e,r){if(!e.target)return!1;if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}var d=t("d3"),p=t("tinycolor2"),m=t("fast-isnumeric"),v=t("../../lib"),g=t("../../lib/events"),y=t("../../lib/svg_text_utils"),b=t("../../components/color"),x=t("../../components/drawing"),_=t("../../components/dragelement"),w=t("../../lib/override_cursor"),M=t("../../registry"),A=t("./axes"),k=t("./constants"),T=t("./dragbox"),S=t("../layout_attributes"),E=e.exports={};E.unhover=_.unhover,E.supplyLayoutDefaults=function(t,e,r){function n(r,n){return v.coerce(t,e,S,r,n)}n("dragmode");var i;if(e._has("cartesian")){var a=e._isHoriz=E.isHoriz(r);i=a?"y":"x"}else i="closest";n("hovermode",i)},E.isHoriz=function(t){for(var e=!0,r=0;r<t.length;r++){var n=t[r];if("h"!==n.orientation){e=!1;break}}return e},E.init=function(t){var e=t._fullLayout;if(e._has("cartesian")&&!t._context.staticPlot){var r=Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),i=r.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1});r.forEach(function(r){var n=e._plots[r];if(e._has("cartesian")){var i=n.xaxis,a=n.yaxis,o=(i._linepositions[r]||[])[3],s=(a._linepositions[r]||[])[3],l=k.DRAGGERSIZE;if(m(o)&&"top"===i.side&&(o-=l),m(s)&&"right"!==a.side&&(s-=l),!n.mainplot){var u=T(t,n,0,0,i._length,a._length,"ns","ew");u.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&E.hover(t,e,r)},E.hover(t,e,r),t._fullLayout._lasthover=u,t._fullLayout._hoversubplot=r},u.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,_.unhover(t,e))},u.onclick=function(e){E.click(t,e)},t._context.showAxisDragHandles&&(T(t,n,-l,-l,l,l,"n","w"),T(t,n,i._length,-l,l,l,"n","e"),T(t,n,-l,a._length,l,l,"s","w"),T(t,n,i._length,a._length,l,l,"s","e"))}t._context.showAxisDragHandles&&(m(o)&&("free"===i.anchor&&(o-=e._size.h*(1-a.domain[1])),T(t,n,.1*i._length,o,.8*i._length,l,"","ew"),T(t,n,0,o,.1*i._length,l,"","w"),T(t,n,.9*i._length,o,.1*i._length,l,"","e")),m(s)&&("free"===a.anchor&&(s-=e._size.w*i.domain[0]),T(t,n,s,.1*a._length,l,.8*a._length,"ns",""),T(t,n,s,.9*a._length,l,.1*a._length,"s",""),T(t,n,s,0,l,.1*a._length,"n","")))}});var n=e._hoverlayer.node();n.onmousemove=function(r){r.target=e._lasthover,E.hover(t,r,e._hoversubplot)},n.onclick=function(r){r.target=e._lasthover,E.click(t,r)},n.onmousedown=function(t){e._lasthover.onmousedown(t)}}};var L=k.YANGLE,C=Math.PI*L/180,D=1/Math.sin(C),z=Math.cos(C),I=Math.sin(C),P=k.HOVERARROWSIZE,O=k.HOVERTEXTPAD,R=k.HOVERFONTSIZE,j=k.HOVERFONT;E.hover=function(t,e,r){return"string"==typeof t&&(t=document.getElementById(t)),void 0===t._lastHoverTime&&(t._lastHoverTime=0),void 0!==t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),Date.now()>t._lastHoverTime+k.HOVERMINTIME?(o(t,e,r),void(t._lastHoverTime=Date.now())):void(t._hoverTimer=setTimeout(function(){o(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},k.HOVERMINTIME))},E.getDistanceFunction=function(t,e,r,n){return"closest"===t?n||a(e,r):"x"===t?e:r},E.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var i=e(t[n]);i<=r.distance&&(r.index=n,r.distance=i)}return r},E.loneHover=function(t,e){var r={color:t.color||b.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=d.select(e.container),i=e.outerContainer?d.select(e.outerContainer):n,a={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||b.background,container:n,outerContainer:i},o=u([r],a);return h(o,a.rotateLabels),o.node()},E.loneUnhover=function(t){var e=v.isD3Selection(t)?t:d.select(t);e.selectAll("g.hovertext").remove()},E.click=function(t,e){function r(){t.emit("plotly_click",{points:t._hoverdata})}var n=M.getComponentMethod("annotations","onClick")(t,t._hoverdata);t._hoverdata&&e&&e.target&&(n&&n.then?n.then(r):r(),e.stopImmediatePropagation&&e.stopImmediatePropagation())},E.inbox=function(t,e){return t*e<0||0===t?k.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"../../components/color":562,"../../components/dragelement":583,"../../components/drawing":585,"../../lib":667,"../../lib/events":658,"../../lib/override_cursor":676,"../../lib/svg_text_utils":686,"../../registry":781,"../layout_attributes":757,"./axes":706,"./constants":711,"./dragbox":712,d3:97,"fast-isnumeric":106,tinycolor2:498}],714:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._fullLayout,o=a._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;s<o.length;s++){var l=o[s];if("cartesian"===l.basePlotModule.name){for(var u=[],c=0;c<r.length;c++){var h=r[c],f=h[0].trace;f._module===l&&f.visible===!0&&u.push(h)}l.plot(t,e,u,n,i)}}}function i(t){for(var e=t._fullLayout,r=Object.keys(e._plots),n=[],i=[],a=0;a<r.length;a++){var o=r[a],s=e._plots[o],l=s.xaxis,u=s.yaxis,c=h.getFromId(t,l.overlaying)||l;c!==l&&c.overlaying&&(c=l,l.overlaying=!1);var f=h.getFromId(t,u.overlaying)||u;f!==u&&f.overlaying&&(f=u,u.overlaying=!1);var d=c._id+f._id;d!==o&&r.indexOf(d)!==-1?(s.mainplot=d,s.mainplotinfo=e._plots[d],i.push(o),l.domain=c.domain.slice(),u.domain=f.domain.slice()):n.push(o)}return n=n.concat(i)}function a(t){function e(t){s(t,"g","imagelayer"),s(t,"g","maplayer"),s(t,"g","barlayer"),s(t,"g","boxlayer"),s(t,"g","scatterlayer")}var r=t.plotgroup,n=t.id;if(t.mainplot){var i=t.mainplotinfo;t.gridlayer=s(i.overgrid,"g",n),t.zerolinelayer=s(i.overzero,"g",n),t.plot=s(i.overplot,"g",n),t.xlines=s(i.overlines,"path",n),t.ylines=s(i.overlines,"path",n),t.xaxislayer=s(i.overaxes,"g",n),t.yaxislayer=s(i.overaxes,"g",n)}else{t.bg=s(r,"rect","bg"),t.bg.style("stroke-width",0);var a=s(r,"g","layer-subplot");t.shapelayer=s(a,"g","shapelayer"),t.imagelayer=s(a,"g","imagelayer"),t.gridlayer=s(r,"g","gridlayer"),t.overgrid=s(r,"g","overgrid"),t.zerolinelayer=s(r,"g","zerolinelayer"),t.overzero=s(r,"g","overzero"),t.plot=s(r,"g","plot"),t.overplot=s(r,"g","overplot"),t.xlines=s(r,"path","xlines"),t.ylines=s(r,"path","ylines"),t.overlines=s(r,"g","overlines"),t.xaxislayer=s(r,"g","xaxislayer"),t.yaxislayer=s(r,"g","yaxislayer"),t.overaxes=s(r,"g","overaxes")}t.plot.call(e),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function o(t,e){t&&t.each(function(t){var r=l.select(this),n="clip"+e._uid+t+"plot";r.remove(),e._draggers.selectAll("g."+t).remove(),e._defs.select("#"+n).remove()})}function s(t,e,r){var n=t.selectAll("."+r).data([0]);return n.enter().append(e).classed(r,!0),n}var l=t("d3"),u=t("../../lib"),c=t("../plots"),h=t("./axes"),f=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=f.idRegex,r.attrRegex=f.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.transitionAxes=t("./transition_axes"),r.plot=function(t,e,r,i){var a,o=t._fullLayout,s=c.getSubplotIds(o,"cartesian"),l=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<l.length;a++)e.push(a);for(a=0;a<s.length;a++){for(var u,h=s[a],f=o._plots[h],d=[],p=0;p<l.length;p++){var m=l[p],v=m[0].trace;v.xaxis+v.yaxis===h&&(e.indexOf(v.index)!==-1&&(u&&u[0].trace.xaxis+u[0].trace.yaxis===h&&["tonextx","tonexty","tonext"].indexOf(v.fill)!==-1&&d.indexOf(u)===-1&&d.push(u),d.push(m)),u=m)}n(t,f,d,r,i)}},r.clean=function(t,e,r,n){var i,a,s,l=n._modules||[],u=e._modules||[];for(s=0;s<l.length;s++)if("scatter"===l[s].name){i=!0;break}for(s=0;s<u.length;s++)if("scatter"===u[s].name){a=!0;break}if(i&&!a){var c=n._plots,f=Object.keys(c||{});for(s=0;s<f.length;s++){var d=c[f[s]];d.plot&&d.plot.select("g.scatterlayer").selectAll("g.trace").remove()}}var p=n._has&&n._has("cartesian"),m=e._has&&e._has("cartesian");if(p&&!m){var v=n._cartesianlayer.selectAll(".subplot"),g=h.listIds({_fullLayout:n});for(v.call(o,n),n._defs.selectAll(".axesclip").remove(),s=0;s<g.length;s++)n._infolayer.select("."+g[s]+"title").remove()}},r.drawFramework=function(t){var e=t._fullLayout,r=i(t),n=e._cartesianlayer.selectAll(".subplot").data(r,u.identity);n.enter().append("g").attr("class",function(t){return"subplot "+t}),n.order(),n.exit().call(o,e),n.each(function(t){var r=e._plots[t];if(r.plotgroup=l.select(this),r.overlays=[],a(r),r.mainplot){var n=e._plots[r.mainplot];n.overlays.push(r)}r.draglayer=s(e._draggers,"g",t)})},r.rangePlot=function(t,e,r){a(e),n(t,e,r),c.style(t)}},{"../../lib":667,"../plots":766,"./attributes":705,"./axes":706,"./constants":711,"./layout_attributes":715,"./transition_axes":724,d3:97}],715:[function(t,e,r){"use strict";var n=t("../font_attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=t("./constants");e.exports={color:{valType:"color",dflt:i.defaultLine},title:{valType:"string"},titlefont:a({},n,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},fixedrange:{valType:"boolean",dflt:!1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"any"},dtick:{valType:"any"},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:i.defaultLine},showticklabels:{valType:"boolean",dflt:!0},tickfont:a({},n,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},separatethousands:{valType:"boolean",dflt:!1},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:i.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:i.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:i.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",o.idRegex.x.toString(),o.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",o.idRegex.x.toString(),o.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace"},categoryarray:{valType:"data_array"},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":561,"../../lib/extend":659,"../font_attributes":726,"./constants":711}],716:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("../layout_attributes"),s=t("./constants"),l=t("./layout_attributes"),u=t("./axis_defaults"),c=t("./position_defaults"),h=t("./axis_ids");e.exports=function(t,e,r){function f(t,e){var r=Number(t.substr(5)||1),n=Number(e.substr(5)||1);return r-n}function d(t,e){return i.coerce(P,O,l,t,e)}var p,m=Object.keys(t),v=[],g=[],y=[],b=[],x={},_={};for(p=0;p<r.length;p++){var w,M,A=r[p];if(n.traceIs(A,"cartesian"))w=v,M=g;else{if(!n.traceIs(A,"gl2d"))continue;w=y,M=b}var k=h.id2name(A.xaxis),T=h.id2name(A.yaxis);if(k&&w.indexOf(k)===-1&&w.push(k),T&&M.indexOf(T)===-1&&M.push(T),n.traceIs(A,"2dMap")&&(x[k]=!0,x[T]=!0),n.traceIs(A,"oriented")){var S="h"===A.orientation?T:k;_[S]=!0}}var E=e._has("gl3d")||e._has("geo");if(!E)for(p=0;p<m.length;p++){var L=m[p];y.indexOf(L)===-1&&v.indexOf(L)===-1&&s.xAxisMatch.test(L)?v.push(L):b.indexOf(L)===-1&&g.indexOf(L)===-1&&s.yAxisMatch.test(L)&&g.push(L)}v.length&&g.length&&i.pushUnique(e._basePlotModules,n.subplotsRegistry.cartesian);var C=v.concat(y).sort(f),D=g.concat(b).sort(f),z=C.concat(D),I=a.background;C.length&&D.length&&(I=i.coerce(t,e,o,"plot_bgcolor"));var P,O,R=a.combine(I,e.paper_bgcolor);z.forEach(function(n){var i=n.charAt(0);P=t[n]||{},O={};var a={letter:i,font:e.font,outerTicks:x[n],showGrid:!_[n],name:n,data:r,bgColor:R,calendar:e.calendar};u(P,O,d,a,e);var o={letter:i,counterAxes:{x:D,y:C}[i].map(h.name2id),overlayableAxes:{x:C,y:D}[i].filter(function(e){return e!==n&&!(t[e]||{}).overlaying}).map(h.name2id)};c(P,O,d,o),e[n]=O,t[n]||"-"===P.type||(t[n]={type:P.type})});var j=n.getComponentMethod("rangeslider","handleDefaults"),F=n.getComponentMethod("rangeselector","handleDefaults");C.forEach(function(r){P=t[r],O=e[r],j(t,e,r),"date"===O.type&&F(P,O,e,D,O.calendar),d("fixedrange")}),D.forEach(function(r){P=t[r],O=e[r];var n=e[h.id2name(O.anchor)],i=n&&n.rangeslider&&n.rangeslider.visible;d("fixedrange",i)})}},{"../../components/color":562,"../../lib":667,"../../registry":781,"../layout_attributes":757,"./axis_defaults":708,"./axis_ids":709,"./constants":711,"./layout_attributes":715,"./position_defaults":718}],717:[function(t,e,r){"use strict";function n(t,e,r){var n,a,o,s,l,u=[],c=r.map(function(e){return e[t]}),h=i.bisector(e).left;for(n=0;n<c.length;n++)for(o=c[n],a=0;a<o.length;a++)s=o[a],null!==s&&void 0!==s&&(l=h(u,s),l<u.length&&u[l]===s||u.splice(l,0,s));return u}var i=t("d3");e.exports=function(t,e,r,a){switch(e){case"array":return Array.isArray(r)?r.slice():[];case"category ascending":return n(t,i.ascending,a);case"category descending":return n(t,i.descending,a);case"trace":return[];default:return[]}}},{d3:97}],718:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t,e,r,a){var o=a.counterAxes||[],s=a.overlayableAxes||[],l=a.letter,u=i.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(o),dflt:n(t.position)?"free":o[0]||"free"}},"anchor");"free"===u&&r("position"),i.coerce(t,e,{side:{valType:"enumerated",values:"x"===l?["bottom","top"]:["left","right"],dflt:"x"===l?"bottom":"left"}},"side");var c=!1;if(s.length&&(c=i.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(s),dflt:!1}},"overlaying")),!c){var h=r("domain");h[0]>h[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":667,"fast-isnumeric":106}],719:[function(t,e,r){"use strict";function n(t){return t._id}var i=t("../../lib/polygon"),a=t("../../components/color"),o=t("./axes"),s=t("./constants"),l=i.filter,u=i.tester,c=s.MINSELECT;e.exports=function(t,e,r,i,h){function f(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function d(t,e){return t-e}var p,m=i.gd._fullLayout._zoomlayer,v=i.element.getBoundingClientRect(),g=i.plotinfo.xaxis._offset,y=i.plotinfo.yaxis._offset,b=e-v.left,x=r-v.top,_=b,w=x,M="M"+b+","+x,A=i.xaxes[0]._length,k=i.yaxes[0]._length,T=i.xaxes.map(n),S=i.yaxes.map(n),E=i.xaxes.concat(i.yaxes);"lasso"===h&&(p=l(b,x,s.BENDPX));var L=m.selectAll("path.select-outline").data([1,2]);L.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+g+", "+y+")").attr("d",M+"Z");var C,D,z,I,P,O=m.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1}).attr("transform","translate("+g+", "+y+")").attr("d","M0,0Z"),R=[],j=i.gd,F=[];for(C=0;C<j.calcdata.length;C++)if(D=j.calcdata[C],z=D[0].trace,z._module&&z._module.selectPoints)if(i.subplot){if(z.subplot!==i.subplot)continue;R.push({selectPoints:z._module.selectPoints,cd:D,xaxis:i.xaxes[0],yaxis:i.yaxes[0]})}else{if(T.indexOf(z.xaxis)===-1)continue;if(S.indexOf(z.yaxis)===-1)continue;R.push({selectPoints:z._module.selectPoints,cd:D,xaxis:o.getFromId(j,z.xaxis),yaxis:o.getFromId(j,z.yaxis)})}i.moveFn=function(t,e){var r,n;_=Math.max(0,Math.min(A,t+b)),w=Math.max(0,Math.min(k,e+x));var a=Math.abs(_-b),o=Math.abs(w-x);for("select"===h?(o<Math.min(.6*a,c)?(r=u([[b,0],[b,k],[_,k],[_,0]]),O.attr("d","M"+r.xmin+","+(x-c)+"h-4v"+2*c+"h4ZM"+(r.xmax-1)+","+(x-c)+"h4v"+2*c+"h-4Z")):a<Math.min(.6*o,c)?(r=u([[0,x],[0,w],[A,w],[A,x]]),O.attr("d","M"+(b-c)+","+r.ymin+"v-4h"+2*c+"v4ZM"+(b-c)+","+(r.ymax-1)+"v4h"+2*c+"v-4Z")):(r=u([[b,x],[b,w],[_,w],[_,x]]),O.attr("d","M0,0Z")),L.attr("d","M"+r.xmin+","+r.ymin+"H"+(r.xmax-1)+"V"+(r.ymax-1)+"H"+r.xmin+"Z")):"lasso"===h&&(p.addPt([_,w]),r=u(p.filtered),L.attr("d","M"+p.filtered.join("L")+"Z")),F=[],C=0;C<R.length;C++)I=R[C],[].push.apply(F,I.selectPoints(I,r));if(P={points:F},"select"===h){var s,l=P.range={};for(C=0;C<E.length;C++)n=E[C],s=n._id.charAt(0),l[n._id]=[n.p2d(r[s+"min"]),n.p2d(r[s+"max"])].sort(d)}else{var m=P.lassoPoints={};for(C=0;C<E.length;C++)n=E[C],m[n._id]=p.filtered.map(f(n))}i.gd.emit("plotly_selecting",P)},i.doneFn=function(t,e){if(O.remove(),t||2!==e)i.gd.emit("plotly_selected",P);else{for(L.remove(),C=0;C<R.length;C++)I=R[C],I.selectPoints(I,!1);j.emit("plotly_deselect",null)}}}},{"../../components/color":562,"../../lib/polygon":677,"./axes":706,"./constants":711}],720:[function(t,e,r){"use strict";function n(t){return Math.pow(10,t)}function i(t){return o(t)?(t=Number(t),t<-f||t>f?d:o(t)?Number(t):d):d}var a=t("d3"),o=t("fast-isnumeric"),s=t("../../lib"),l=s.cleanNumber,u=s.ms2DateTime,c=s.dateTime2ms,h=t("../../constants/numerical"),f=h.FP_SAFE,d=h.BADNUM,p=t("./constants"),m=t("./axis_ids");e.exports=function(t){function e(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*_*Math.abs(n-i))}return d}function r(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!o(e))return d;i=c(new Date(+e))}return i}function h(e,r,n){return u(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function g(e){if(null!==e&&void 0!==e){var r=t._categories.indexOf(e);return r===-1?(t._categories.push(e),t._categories.length-1):r}return d}function y(e){var r=t._categories.indexOf(e);return r!==-1?r:"number"==typeof e?e:void 0}function b(e){return o(e)?a.round(t._b+t._m*e,2):d}function x(e){return(e-t._b)/t._m}var _=10;t.c2l="log"===t.type?e:i,t.l2c="log"===t.type?n:i,t.l2p=b,t.p2l=x,t.c2p="log"===t.type?function(t,r){return b(e(t,r))}:b,t.p2c="log"===t.type?function(t){return n(x(t))}:x,["linear","-"].indexOf(t.type)!==-1?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=i,t.d2p=t.r2p=function(t){return b(l(t))},t.p2d=t.p2r=x):"log"===t.type?(t.d2r=t.d2l=function(t,r){return e(l(t),r)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=i,t.c2r=e,t.l2d=n,t.d2p=function(e,r){return b(t.d2r(e,r))},t.p2d=function(t){return n(x(t))},t.r2p=function(t){return b(l(t))},t.p2r=x):"date"===t.type?(t.d2r=t.r2d=s.identity,t.d2c=t.r2c=t.d2l=t.r2l=r,t.c2d=t.c2r=t.l2d=t.l2r=h,t.d2p=t.r2p=function(t,e,n){ return b(r(t,0,n))},t.p2d=t.p2r=function(t,e,r){return h(x(t),e,r)}):"category"===t.type&&(t.d2r=t.d2c=t.d2l=g,t.r2d=t.c2d=t.l2d=v,t.d2l_noadd=y,t.r2l=t.l2r=t.r2c=t.c2r=i,t.d2p=function(t){return b(y(t))},t.p2d=function(t){return v(x(t))},t.r2p=b,t.p2r=x),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,i=s.nestedProperty(t,e).get(),a=(t._id||"x").charAt(0);if(n="date"===t.type?s.dfltRange(t.calendar):"y"===a?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!i||2!==i.length)return void s.nestedProperty(t,e).set(n);for("date"===t.type&&(i[0]=s.cleanDate(i[0],d,t.calendar),i[1]=s.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!s.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var l=s.constrain(t.r2l(i[0]),s.MIN_MS+1e3,s.MAX_MS-1e3);i[0]=t.l2r(l-1e3),i[1]=t.l2r(l+1e3);break}}else{if(!o(i[r])){if(!o(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-f?i[r]=-f:i[r]>f&&(i[r]=f),i[0]===i[1]){var u=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=u,i[1]+=u}}},t.setScale=function(e){var r=t._gd._fullLayout._size,n=t._id.charAt(0);if(t._categories||(t._categories=[]),t.overlaying){var i=m.getFromId(t._gd,t.overlaying);t.domain=i.domain}var a=e&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var l=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o);if("y"===n?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw s.notifier("Something went wrong with axis scaling","long"),t._gd._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a<n.length;a++)i[a]=t.d2c(n[a],0,o);else{var s=r+"0"in e?t.d2c(e[r+"0"],0,o):0,l=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],i=new Array(n.length),a=0;a<n.length;a++)i[a]=s+a*l}return i},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&o(t.r2l(e[0]))&&o(t.r2l(e[1]))},t._min=[],t._max=[],delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":649,"../../lib":667,"./axis_ids":709,"./constants":711,d3:97,"fast-isnumeric":106}],721:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var i=t("../../lib");e.exports=function(t,e,r,a,o){var s=n(t),l=r("tickprefix");l&&r("showtickprefix",s);var u=r("ticksuffix");u&&r("showticksuffix",s);var c=r("showticklabels");if(c){var h=o.font||{},f=e.color===t.color?e.color:h.color;if(i.coerceFont(r,"tickfont",{family:h.family,size:h.size,color:f}),r("tickangle"),"category"!==a){var d=r("tickformat");d||"date"===a||(r("showexponent",s),r("exponentformat"),r("separatethousands"))}}"category"===a||o.noHover||r("hoverformat")}},{"../../lib":667}],722:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a){var o=n.coerce2(t,e,i,"ticklen"),s=n.coerce2(t,e,i,"tickwidth"),l=n.coerce2(t,e,i,"tickcolor",e.color),u=r("ticks",a.outerTicks||o||s||l?"outside":"");u||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":667,"./layout_attributes":715}],723:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=r("tickmode",s);if("auto"===l)r("nticks");else if("linear"===l){var u="date"===o?a:1,c=r("dtick",u);if(n(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var h=c.charAt(0),f=c.substr(1);f=n(f)?Number(f):0,(f<=0||!("date"===o&&"M"===h&&f===Math.round(f)||"log"===o&&"L"===h||"log"===o&&"D"===h&&(1===f||2===f)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var m=r("tickvals");void 0===m?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":649,"../../lib":667,"fast-isnumeric":106}],724:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=/((x|y)([2-9]|[1-9][0-9]+)?)axis$/;e.exports=function(t,e,r,u){function c(t){var e,r,n,i,a,o={};for(e in t)if(r=e.split("."),n=r[0].match(l)){var s=n[1],u=s+"axis";if(i=y[u],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=u,a.length=i._length,b.push(s),o[s]=a}return o}function h(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(s.indexOf(l)===-1){var u=l.xaxis._id,c=l.yaxis._id,h=l.xaxis.range,f=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[u]?r[u].to:h,a=r[c]?r[c].to:f,h[0]===i[0]&&h[1]===i[1]&&f[0]===a[0]&&f[1]===a[1]||e.indexOf(u)===-1&&e.indexOf(c)===-1||s.push(l)}}return s}function f(e,r){function n(e,r){for(i=0;i<e.length;i++){var n=e[i];o.indexOf(n.xref)===-1&&o.indexOf(n.yref)===-1||r(t,i)}}var i,o=[];for(o=[e._id,r._id],i=0;i<o.length;i++)s.doTicks(t,o[i],!0);n(y.annotations||[],a.getComponentMethod("annotations","drawOne")),n(y.shapes||[],a.getComponentMethod("shapes","drawOne")),n(y.images||[],a.getComponentMethod("images","draw"))}function d(t){var e=t.xaxis,r=t.yaxis;y._defs.selectAll("#"+t.clipId).call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1,1)}function p(e,r){var n,i,a,s=x[e.xaxis._id],l=x[e.yaxis._id],u=[];if(s){n=t._fullLayout[s.axisName],i=n._r,a=s.to,u[0]=(i[0]*(1-r)+r*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var c=i[1]-i[0],h=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[2]=e.xaxis._length*(1-r+r*h/c)}else u[0]=0,u[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],i=n._r,a=l.to,u[1]=(i[1]*(1-r)+r*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[3]=e.yaxis._length*(1-r+r*p/d)}else u[1]=0,u[3]=e.yaxis._length;f(e.xaxis,e.yaxis);var m=e.xaxis,v=e.yaxis,g=!!s,b=!!l,_=g?m._length/u[2]:1,w=b?v._length/u[3]:1,M=g?u[0]:0,A=b?u[1]:0,k=g?u[0]/u[2]*m._length:0,T=b?u[1]/u[3]*v._length:0,S=m._offset-k,E=v._offset-T;y._defs.selectAll("#"+e.clipId).call(o.setTranslate,M,A).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,S,E).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w)}function m(){for(var e={},r=0;r<_.length;r++){var n=t._fullLayout[x[_[r]].axisName],a=x[_[r]].to;e[n._name+".range[0]"]=a[0],e[n._name+".range[1]"]=a[1],n.range=a.slice()}return M&&M(),i.relayout(t,e).then(function(){for(var t=0;t<w.length;t++)d(w[t])})}function v(){for(var e={},r=0;r<_.length;r++){var n=t._fullLayout[_[r]+"axis"];e[n._name+".range[0]"]=n.range[0],e[n._name+".range[1]"]=n.range[1],n.range=n._r.slice()}return i.relayout(t,e).then(function(){for(var t=0;t<w.length;t++)d(w[t])})}function g(){k=Date.now();for(var t=Math.min(1,(k-A)/r.duration),e=S(t),n=0;n<w.length;n++)p(w[n],e);k-A>r.duration?(m(),T=window.cancelAnimationFrame(g)):T=window.requestAnimationFrame(g)}var y=t._fullLayout,b=[],x=c(e),_=Object.keys(x),w=h(y,_,x);if(!w.length)return!1;var M;u&&(M=u());var A,k,T,S=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(T),T=null,v()}),A=Date.now(),T=window.requestAnimationFrame(g),Promise.resolve()}},{"../../components/drawing":585,"../../plotly":701,"../../registry":781,"./axes":706,d3:97}],725:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a,o=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return i=u.nestedProperty(n,e.prop).get(),a=r[e.type]=r[e.type]||{},a.hasOwnProperty(e.prop)&&a[e.prop]!==i&&(o=!0),a[e.prop]=i,{changed:o,value:i}}function i(t,e){return Array.isArray(e[0])&&1===e[0].length&&["string","number"].indexOf(typeof e[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}function a(t,e){var r=[],n=e[0],i={};if("string"==typeof n)i[n]=e[1];else{if(!u.isPlainObject(n))return r;i=n}return s(i,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function o(t,e){var r,n,i,a,o=[];if(n=e[0],i=e[1],r=e[2],a={},"string"==typeof n)a[n]=i;else{if(!u.isPlainObject(n))return o;a=n,void 0===r&&(r=i)}return void 0===r&&(r=null),s(a,function(e,n,i){var a;if(Array.isArray(i)){var s=Math.min(i.length,t.data.length);r&&(s=Math.min(s,r.length)),a=[];for(var l=0;l<s;l++)a[l]=r?r[l]:l}else a=r?r.slice(0):null;if(null===a)Array.isArray(i)&&(i=i[0]);else if(Array.isArray(a)){if(!Array.isArray(i)){var u=i;i=[];for(var c=0;c<a.length;c++)i[c]=u}i.length=Math.min(a.length,i.length)}o.push({type:"data",prop:e,traces:a,value:i})},"",0),o}function s(t,e,r,n){Object.keys(t).forEach(function(i){var a=t[i];if("_"!==i[0]){var o=r+(n>0?".":"")+i;u.isPlainObject(a)?s(a,e,o,n+1):e(o,i,a)}})}var l=t("../plotly"),u=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h<c.length;h++)t._internalOn(c[h],o.check);o.remove=function(){for(var e=0;e<c.length;e++)t._removeInternalListener(c[e],o.check)}}else u.warn("Unable to automatically bind plot updates to API command"),o.lookupTable={},o.remove=function(){};return o.disable=function(){s=!1},o.enable=function(){s=!0},e&&(e._commandObserver=o),o},r.hasSimpleAPICommandBindings=function(t,e,n){var i,a,o=e.length;for(i=0;i<o;i++){var s,l=e[i],u=l.method,c=l.args;if(Array.isArray(c)||(c=[]),!u)return!1;var h=r.computeAPICommandBindings(t,u,c);if(1!==h.length)return!1;if(a){if(s=h[0],s.type!==a.type)return!1;if(s.prop!==a.prop)return!1;if(Array.isArray(a.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var f=0;f<a.traces.length;f++)if(a.traces[f]!==s.traces[f])return!1}else if(s.prop!==a.prop)return!1}else a=h[0],Array.isArray(a.traces)&&a.traces.sort();s=h[0];var d=s.value;if(Array.isArray(d)){if(1!==d.length)return!1;d=d[0]}n&&(n[d]=i)}return a},r.executeAPICommand=function(t,e,r){var n=l[e],i=[t];Array.isArray(r)||(r=[]);for(var a=0;a<r.length;a++)i.push(r[a]);return n.apply(null,i).catch(function(t){return u.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)})},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=o(t,r);break;case"relayout":n=a(t,r);break;case"update":n=o(t,[r[0],r[2]]).concat(a(t,[r[1]]));break;case"animate":n=i(t,r);break;default:n=[]}return n}},{"../lib":667,"../plotly":701}],726:[function(t,e,r){"use strict";e.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],727:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],728:[function(t,e,r){"use strict";var n=e.exports={};n.projNames={equirectangular:"equirectangular",mercator:"mercator",orthographic:"orthographic","natural earth":"naturalEarth",kavrayskiy7:"kavrayskiy7",miller:"miller",robinson:"robinson",eckert4:"eckert4","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant","conic equal area":"conicEqualArea","conic conformal":"conicConformal","conic equidistant":"conicEquidistant",gnomonic:"gnomonic",stereographic:"stereographic",mollweide:"mollweide",hammer:"hammer","transverse mercator":"transverseMercator","albers usa":"albersUsa","winkel tripel":"winkel3",aitoff:"aitoff",sinusoidal:"sinusoidal"},n.axesNames=["lonaxis","lataxis"],n.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},n.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},n.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,80],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},n.clipPad=.001,n.precision=.1,n.landColor="#F0DC82",n.waterColor="#3399FF",n.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},n.sphereSVG={type:"Sphere"},n.fillLayers=["ocean","land","lakes"],n.lineLayers=["subunits","countries","coastlines","rivers","frame"],n.baseLayers=["ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame"],n.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"},n.baseLayersOverChoropleth=["rivers","lakes"]},{}],729:[function(t,e,r){"use strict";function n(t){this.id=t.id,this.graphDiv=t.graphDiv,this.container=t.container,this.topojsonURL=t.topojsonURL,this.topojsonName=null,this.topojson=null,this.projectionType=null,this.projection=null,this.clipAngle=null,this.setScale=null,this.path=null,this.zoom=null,this.zoomReset=null,this.makeFramework(),this.traceHash={}}function i(t,e,r){return u.geo.graticule().extent([[t[0],e[0]],[t[1],e[1]]]).step(r)}function a(t,e,r){var n=b.layerNameToAdjective[e];t.select("."+e).selectAll("path").attr("stroke","none").call(c.fill,r[n+"color"])}function o(t,e,r){var n=b.layerNameToAdjective[e];t.select("."+e).selectAll("path").attr("fill","none").call(c.stroke,r[n+"color"]).call(h.dashLine,"",r[n+"width"])}function s(t,e,r){t.select("."+e+"graticule").selectAll("path").attr("fill","none").call(c.stroke,r[e].gridcolor).call(h.dashLine,"",r[e].gridwidth)}function l(t){var e={type:"linear",showexponent:"all",exponentformat:d.layoutAttributes.exponentformat.dflt,_gd:{_fullLayout:t}};return d.setConvert(e),e}var u=t("d3"),c=t("../../components/color"),h=t("../../components/drawing"),f=t("../plots"),d=t("../cartesian/axes"),p=t("../cartesian/graph_interact"),m=t("./projections"),v=t("./set_scale"),g=t("./zoom"),y=t("./zoom_reset"),b=t("./constants"),x=t("../../lib/topojson_utils"),_=t("topojson-client").feature;m(u),e.exports=n;var w=n.prototype;w.plot=function(t,e,r){var n,i,a=this,o=e[a.id],s=e._size;a.projection=null,a.setScale=v(o,s),a.makeProjection(o),a.makePath(),a.adjustLayout(o,s),a.zoom=g(a,o),a.zoomReset=y(a,o),a.mockAxis=l(e),a.framework.call(a.zoom).on("dblclick.zoom",a.zoomReset),a.framework.on("mousemove",function(){var t=u.mouse(this),e=a.projection.invert(t);if(e&&!isNaN(e[0])&&!isNaN(e[1])){var r={target:!0,xpx:t[0],ypx:t[1]};a.xaxis.c2p=function(){return t[0]},a.xaxis.p2c=function(){return e[0]},a.yaxis.c2p=function(){return t[1]},a.yaxis.p2c=function(){return e[1]},p.hover(a.graphDiv,r,a.id)}}),a.framework.on("mouseout",function(){p.loneUnhover(e._toppaper)}),a.framework.on("click",function(){p.click(a.graphDiv,{target:!0})}),n=x.getTopojsonName(o),null===a.topojson||n!==a.topojsonName?(a.topojsonName=n,void 0!==PlotlyGeoAssets.topojson[a.topojsonName]?(a.topojson=PlotlyGeoAssets.topojson[a.topojsonName],a.onceTopojsonIsLoaded(t,o)):(i=x.getTopojsonPath(a.topojsonURL,a.topojsonName),r.push(new Promise(function(e,r){u.json(i,function(n,s){return n?void r(404===n.status?new Error(["plotly.js could not find topojson file at",i,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",i].join(" "))):(a.topojson=s,PlotlyGeoAssets.topojson[a.topojsonName]=s,a.onceTopojsonIsLoaded(t,o),void e())})})))):a.onceTopojsonIsLoaded(t,o)},w.onceTopojsonIsLoaded=function(t,e){this.drawLayout(e),f.generalUpdatePerTraceModule(this,t,e),this.render()},w.makeProjection=function(t){var e,r=t.projection,n=r.type,i=null===this.projection||n!==this.projectionType;i?(this.projectionType=n,e=this.projection=u.geo[b.projNames[n]]()):e=this.projection,e.translate(r._translate0).precision(b.precision),t._isAlbersUsa||e.rotate(r._rotate).center(r._center),t._clipAngle?(this.clipAngle=t._clipAngle,e.clipAngle(t._clipAngle-b.clipPad)):this.clipAngle=null,r.parallels&&e.parallels(r.parallels),i&&this.setScale(e),e.translate(r._translate).scale(r._scale)},w.makePath=function(){this.path=u.geo.path().projection(this.projection)},w.makeFramework=function(){var t=this.graphDiv._fullLayout,e="clip"+t._uid+this.id,r=t._defs.selectAll("g.clips").data([0]);r.enter().append("g").classed("clips",!0);var n=this.clipDef=r.selectAll("#"+e).data([0]);n.enter().append("clipPath").attr("id",e).append("rect");var i=this.framework=u.select(this.container).append("g");i.attr("class","geo "+this.id).style("pointer-events","all").call(h.setClipUrl,e),i.append("g").attr("class","bglayer").append("rect"),i.append("g").attr("class","baselayer"),i.append("g").attr("class","choroplethlayer"),i.append("g").attr("class","baselayeroverchoropleth"),i.append("g").attr("class","scattergeolayer"),i.on("dblclick.zoom",null),this.xaxis={_id:"x"},this.yaxis={_id:"y"}},w.adjustLayout=function(t,e){var r=t.domain,n=e.l+e.w*r.x[0]+t._marginX,i=e.t+e.h*(1-r.y[1])+t._marginY;h.setTranslate(this.framework,n,i);var a={x:0,y:0,width:t._width,height:t._height};this.clipDef.select("rect").attr(a),this.framework.select(".bglayer").select("rect").attr(a).call(c.fill,t.bgcolor),this.xaxis._offset=n,this.xaxis._length=t._width,this.yaxis._offset=i,this.yaxis._length=t._height},w.drawTopo=function(t,e,r){if(r["show"+e]===!0){var n=this.topojson,i="frame"===e?b.sphereSVG:_(n,n.objects[e]);t.append("g").datum(i).attr("class",e).append("path").attr("class","basepath")}},w.drawGraticule=function(t,e,r){var n=r[e];if(n.showgrid===!0){var a=b.scopeDefaults[r.scope],o=a.lonaxisRange,s=a.lataxisRange,l="lonaxis"===e?[n.dtick]:[0,n.dtick],u=i(o,s,l);t.append("g").datum(u).attr("class",e+"graticule").append("path").attr("class","graticulepath")}},w.drawLayout=function(t){var e,r=this.framework.select("g.baselayer"),n=b.baseLayers,i=b.axesNames;r.selectAll("*").remove();for(var a=0;a<n.length;a++)e=n[a],i.indexOf(e)!==-1?this.drawGraticule(r,e,t):this.drawTopo(r,e,t);this.styleLayout(t)},w.styleLayer=function(t,e,r){var n=b.fillLayers,i=b.lineLayers;n.indexOf(e)!==-1?a(t,e,r):i.indexOf(e)!==-1&&o(t,e,r)},w.styleLayout=function(t){for(var e,r=this.framework.select("g.baselayer"),n=b.baseLayers,i=b.axesNames,a=0;a<n.length;a++)e=n[a],i.indexOf(e)!==-1?s(r,e,t):this.styleLayer(r,e,t)},w.isLonLatOverEdges=function(t){var e=this.clipAngle;if(null===e)return!1;var r=this.projection.rotate(),n=u.geo.distance(t,[-r[0],-r[1]]),i=e*Math.PI/180;return n>i},w.render=function(){function t(t){var e=r.projection(t.lonlat);return e?"translate("+e[0]+","+e[1]+")":null}function e(t){return r.isLonLatOverEdges(t.lonlat)?"0":"1.0"}var r=this,n=r.framework,i=n.select("g.choroplethlayer"),a=n.select("g.scattergeolayer"),o=r.path;n.selectAll("path.basepath").attr("d",o),n.selectAll("path.graticulepath").attr("d",o),i.selectAll("path.choroplethlocation").attr("d",o),i.selectAll("path.basepath").attr("d",o),a.selectAll("path.js-line").attr("d",o),null!==r.clipAngle?(a.selectAll("path.point").style("opacity",e).attr("transform",t),a.selectAll("text").style("opacity",e).attr("transform",t)):(a.selectAll("path.point").attr("transform",t),a.selectAll("text").attr("transform",t))}},{"../../components/color":562,"../../components/drawing":585,"../../lib/topojson_utils":688,"../cartesian/axes":706,"../cartesian/graph_interact":713,"../plots":766,"./constants":728,"./projections":736,"./set_scale":737,"./zoom":738,"./zoom_reset":739,d3:97,"topojson-client":500}],730:[function(t,e,r){"use strict";var n=t("./geo"),i=t("../../plots/plots");r.name="geo",r.attr="geo",r.idRoot="geo",r.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=i.getSubplotIds(e,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var o=0;o<a.length;o++){var s=a[o],l=i.getSubplotCalcData(r,"geo",s),u=e[s]._subplot;u||(u=new n({id:s,graphDiv:t,container:e._geolayer.node(),topojsonURL:t._context.topojsonURL}),e[s]._subplot=u),u.plot(l,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,"geo"),o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!e[s]&&l&&(l.framework.remove(),l.clipDef.remove())}}},{"../../plots/plots":766,"./geo":729,"./layout/attributes":731,"./layout/defaults":734,"./layout/layout_attributes":735}],731:[function(t,e,r){"use strict";e.exports={geo:{valType:"subplotid",dflt:"geo"}}},{}],732:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes");e.exports={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}}},{"../../../components/color/attributes":561}],733:[function(t,e,r){"use strict";var n=t("../../../lib"),i=t("../constants"),a=t("./axis_attributes");e.exports=function(t,e){function r(t,e){return n.coerce(s,l,a,t,e)}function o(t){var r,n,a,o,s,l,u=e.scope;return"world"===u?(r=e.projection,n=r.type,a=r.rotation,s=i[t+"Span"],l=void 0!==s[n]?s[n]/2:s["*"]/2,o="lonaxis"===t?a.lon:a.lat,[o-l,o+l]):i.scopeDefaults[u][t+"Range"]}for(var s,l,u=i.axesNames,c=0;c<u.length;c++){var h=u[c];s=t[h]||{},l={};var f=o(h),d=r("range",f);n.noneOrAll(s.range,l.range,[0,1]),r("tick0",d[0]),r("dtick","lonaxis"===h?30:10);var p=r("showgrid");p&&(r("gridcolor"),r("gridwidth")),e[h]=l,e[h]._fullRange=f}}},{"../../../lib":667,"../constants":728,"./axis_attributes":732}],734:[function(t,e,r){"use strict";function n(t,e,r){var n,i=r("scope"),o="world"!==i,l=a.scopeDefaults[i],u=r("resolution"),c=r("projection.type",l.projType),h="albers usa"===c,f=c.indexOf("conic")!==-1;if(f){var d=l.projParallels||[0,60];r("projection.parallels",d)}if(h)e.scope="usa";else{var p=l.projRotate||[0,0,0];r("projection.rotation.lon",p[0]),r("projection.rotation.lat",p[1]),r("projection.rotation.roll",p[2]),n=r("showcoastlines",!o),n&&(r("coastlinecolor"),r("coastlinewidth")),n=r("showocean"),n&&r("oceancolor")}r("projection.scale"),n=r("showland"),n&&r("landcolor"),n=r("showlakes"),n&&r("lakecolor"),n=r("showrivers"),n&&(r("rivercolor"),r("riverwidth")),n=r("showcountries",o&&"usa"!==i),n&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===u)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),o||(n=r("showframe",!0),n&&(r("framecolor"),r("framewidth"))),r("bgcolor"),s(t,e),e._isHighRes=50===u,e._clipAngle=a.lonaxisSpan[c]/2,e._isAlbersUsa=h,e._isConic=f,e._isScoped=o;var m=e.projection.rotation||{};e.projection._rotate=[-m.lon||0,-m.lat||0,m.roll||0]}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=t("./axis_defaults");e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":773,"../constants":728,"./axis_defaults":733,"./layout_attributes":735}],735:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../constants"),a=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,max:10,dflt:1}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:a,lataxis:a}},{"../../../components/color/attributes":561,"../constants":728,"./axis_attributes":732}],736:[function(t,e,r){"use strict";function n(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!E.hasOwnProperty(e.type))return null;var i=E[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++r<e;)n+=t[r-1][1]*t[r][0]-t[r-1][0]*t[r][1];return n<=0}function a(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;a<o;s=a++){var l=t[a],u=l[0],c=l[1],h=t[s],f=h[0],d=h[1];c>n^d>n&&r<(f-u)*(n-c)/(d-c)+u&&(i=!i)}return i}function o(t){return t?t/Math.sin(t):1}function s(t){return t>1?z:t<-1?-z:Math.asin(t)}function l(t){return t>1?0:t<-1?D:Math.acos(t)}function u(t,e){var r=(2+z)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>L;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(D*(4+D))*t*(1+Math.cos(e)),2*Math.sqrt(D/(4+D))*Math.sin(e)]}function c(t,e){function r(r,n){var i=j(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?j:e===1/0?f:(r.invert=function(r,n){var i=j.invert(r/t,n);return i[0]*=e,i},r)}function h(){var t=2,e=R(c),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function f(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function d(t,e){return[3*t/(2*D)*Math.sqrt(D*D/3-e*e),e]}function p(t,e){return[t,1.25*Math.log(Math.tan(D/4+.4*e))]}function m(t){return function(e){var r,n=t*Math.sin(e),i=30;do e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e));while(Math.abs(r)>L&&--i>0);return e/2}}function v(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=m(r);return n.invert=function(n,i){var a=s(i/e);return[n/(t*Math.cos(a)),s((2*a+Math.sin(2*a))/r)]},n}function g(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),e*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}function y(t,e){var r,n=Math.min(18,36*Math.abs(e)/D),i=Math.floor(n),a=n-i,o=(r=N[i])[0],s=r[1],l=(r=N[++i])[0],u=r[1],c=(r=N[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?z:-z)*(u+a*(h-s)/2+a*a*(h-2*u+s)/2)]}function b(t,e){return[t*Math.cos(e),e]}function x(t,e){var r=Math.cos(e),n=o(l(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function _(t,e){var r=x(t,e);return[(r[0]+t/z)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&w.hasOwnProperty(t.type)?w[t.type]:r)(t,n)};var w={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},M=[],A=[],k={point:function(t,e){M.push([t,e])},result:function(){var t=M.length?M.length<2?{type:"Point",coordinates:M[0]}:{type:"MultiPoint",coordinates:M}:null;return M=[],t}},T={lineStart:n,point:function(t,e){M.push([t,e])},lineEnd:function(){M.length&&(A.push(M),M=[])},result:function(){var t=A.length?A.length<2?{type:"LineString",coordinates:A[0]}:{type:"MultiLineString",coordinates:A}:null;return A=[],t}},S={polygonStart:n,lineStart:n,point:function(t,e){M.push([t,e])},lineEnd:function(){var t=M.length;if(t){do M.push(M[0].slice());while(++t<4);A.push(M),M=[]}},polygonEnd:n,result:function(){if(!A.length)return null;var t=[],e=[];return A.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){if(a(t[0],r))return t.push(e),!0})||t.push([e])}),A=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},E={Point:k,MultiPoint:k,LineString:T,MultiLineString:T,Polygon:S,MultiPolygon:S,Sphere:S},L=1e-6,C=L*L,D=Math.PI,z=D/2,I=(Math.sqrt(D),D/180),P=180/D,O=t.geo.projection,R=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=l[+(r<0)],a=0,o=i.length-1;a<o&&t>i[a][2][0];++a);var s=e(t-i[a][1][0],r);return s[0]+=e(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function n(){s=l.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function i(){for(var e=1e-6,r=[],n=0,i=l[0].length;n<i;++n){var o=l[0][n],s=180*o[0][0]/D,u=180*o[0][1]/D,c=180*o[1][1]/D,h=180*o[2][0]/D,f=180*o[2][1]/D;r.push(a([[s+e,u+e],[s+e,c-e],[h-e,c-e],[h-e,f+e]],30))}for(var n=l[1].length-1;n>=0;--n){var o=l[1][n],s=180*o[0][0]/D,u=180*o[0][1]/D,c=180*o[1][1]/D,h=180*o[2][0]/D,f=180*o[2][1]/D;r.push(a([[h-e,f-e],[h-e,c+e],[s+e,c+e],[s+e,u-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a<o;){r=t[a],n=(r[0]-s[0])/e,i=(r[1]-s[1])/e;for(var u=0;u<e;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function o(t,e){return Math.abs(t[0]-e[0])<L&&Math.abs(t[1]-e[1])<L}var s,l=[[[[-D,0],[0,z],[D,0]]],[[[-D,0],[0,-z],[D,0]]]];e.invert&&(r.invert=function(t,n){for(var i=s[+(n<0)],a=l[+(n<0)],u=0,c=i.length;u<c;++u){var h=i[u];if(h[0][0]<=t&&t<h[1][0]&&h[0][1]<=n&&n<h[1][1]){var f=e.invert(t-e(a[u][1][0],0)[0],n);return f[0]+=a[u][1][0],o(r(f[0],f[1]),[t,n])?f:null}}});var u=t.geo.projection(r),c=u.stream;return u.stream=function(e){var r=u.rotate(),n=c(e),a=(u.rotate([0,0]),c(e));return u.rotate(r),n.sphere=function(){t.geo.stream(i(),a)},n}, u.lobes=function(t){return arguments.length?(l=t.map(function(t){return t.map(function(t){return[[t[0][0]*D/180,t[0][1]*D/180],[t[1][0]*D/180,t[1][1]*D/180],[t[2][0]*D/180,t[2][1]*D/180]]})}),n(),u):l.map(function(t){return t.map(function(t){return[[180*t[0][0]/D,180*t[0][1]/D],[180*t[1][0]/D,180*t[1][1]/D],[180*t[2][0]/D,180*t[2][1]/D]]})})},u},u.invert=function(t,e){var r=.5*e*Math.sqrt((4+D)/D),n=s(r),i=Math.cos(n);return[t/(2/Math.sqrt(D*(4+D))*(1+i)),s((n+r*(i+2))/(2+z))]},(t.geo.eckert4=function(){return O(u)}).raw=u;var j=t.geo.azimuthalEqualArea.raw;f.invert=function(t,e){var r=2*s(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=h).raw=c,d.invert=function(t,e){return[2/3*D*t/Math.sqrt(D*D/3-e*e),e]},(t.geo.kavrayskiy7=function(){return O(d)}).raw=d,p.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*D]},(t.geo.miller=function(){return O(p)}).raw=p;var F=(m(D),v(Math.SQRT2/z,Math.SQRT2,D));(t.geo.mollweide=function(){return O(F)}).raw=F,g.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(-.044475+.028874*a-.005916*o)))-e)/(1.007226+a*(.045255+o*(-.311325+.259866*a-.005916*11*o)))}while(Math.abs(r)>L&&--i>0);return[t/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]},(t.geo.naturalEarth=function(){return O(g)}).raw=g;var N=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];N.forEach(function(t){t[1]*=1.0144}),y.invert=function(t,e){var r=e/z,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=N[a][1],s=N[a+1][1],l=N[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,h=2*(Math.abs(r)-s)/u,f=c/u,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=N[a][1],s=N[a+1][1],l=N[Math.min(19,a+2)][1],n-=(p=(e>=0?z:-z)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*P;while(Math.abs(p)>C&&--m>0);break}}while(--a>=0);var v=N[a][0],g=N[a+1][0],y=N[Math.min(19,a+2)][0];return[t/(g+d*(y-v)/2+d*d*(y-2*g+v)/2),n*I]},(t.geo.robinson=function(){return O(y)}).raw=y,b.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return O(b)}).raw=b,x.invert=function(t,e){if(!(t*t+4*e*e>D*D+L)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),u=Math.cos(r/2),c=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),d=c*c,p=h*h,m=s*s,v=1-p*u*u,g=v?l(h*u)*Math.sqrt(a=1/v):a=0,y=2*g*h*s-t,b=g*c-e,x=a*(p*m+g*h*u*d),_=a*(.5*o*f-2*g*c*s),w=.25*a*(f*s-g*c*p*o),M=a*(d*u+g*m*h),A=_*w-M*x;if(!A)break;var k=(b*_-y*M)/A,T=(y*w-b*x)/A;r-=k,n-=T}while((Math.abs(k)>L||Math.abs(T)>L)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return O(x)}).raw=x,_.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),u=Math.sin(2*n),c=s*s,h=o*o,f=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,v=1-h*d*d,g=v?l(o*d)*Math.sqrt(a=1/v):a=0,y=.5*(2*g*o*p+r/z)-t,b=.5*(g*s+n)-e,x=.5*a*(h*m+g*o*d*c)+.5/z,_=a*(f*u/4-g*s*p),w=.125*a*(u*p-g*s*h*f),M=.5*a*(c*d+g*m*o)+.5,A=_*w-M*x,k=(b*_-y*M)/A,T=(y*w-b*x)/A;r-=k,n-=T}while((Math.abs(k)>L||Math.abs(T)>L)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return O(_)}).raw=_}e.exports=n},{}],737:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,o=t.lataxis,l=t.domain,u=t.framewidth||0,c=e.w*(l.x[1]-l.x[0]),h=e.h*(l.y[1]-l.y[0]),f=n.range[0]+s,d=n.range[1]-s,p=o.range[0]+s,m=o.range[1]-s,v=n._fullRange[0]+s,g=n._fullRange[1]-s,y=o._fullRange[0]+s,b=o._fullRange[1]-s;r._translate0=[e.l+c/2,e.t+h/2];var x=d-f,_=m-p,w=[f+x/2,p+_/2],M=r._rotate;r._center=[w[0]+M[0],w[1]+M[1]];var A=function(e){function n(t){return Math.min(_*c/(t[1][0]-t[0][0]),_*h/(t[1][1]-t[0][1]))}var o,s,l,x,_=e.scale(),w=r._translate0,M=i(f,p,d,m),A=i(v,y,g,b);l=a(e,M),o=n(l),x=a(e,A),r._fullScale=n(x),e.scale(o),l=a(e,M),s=[w[0]-l[0][0]+u,w[1]-l[0][1]+u],r._translate=s,e.translate(s),l=a(e,M),t._isAlbersUsa||e.clipExtent(l),o=r.scale*o,r._scale=o,t._width=Math.round(l[1][0])+u,t._height=Math.round(l[1][1])+u,t._marginX=(c-Math.round(l[1][0]))/2,t._marginY=(h-Math.round(l[1][1]))/2};return A}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function a(t,e){return o.geo.path().projection(t).bounds(e)}var o=t("d3"),s=t("./constants").clipPad;e.exports=n},{"./constants":728,d3:97}],738:[function(t,e,r){"use strict";function n(t,e){var r;return(r=e._isScoped?a:e._clipAngle?s:o)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function a(t,e){function r(){_.select(this).style(A)}function n(){o.scale(_.event.scale).translate(_.event.translate),t.render()}function a(){_.select(this).style(k)}var o=t.projection,s=i(o,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",a),s}function o(t,e){function r(t){return v.invert(t)}function n(t){var e=v(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function a(){_.select(this).style(A),l=_.mouse(this),u=v.rotate(),c=v.translate(),h=u,f=r(l)}function o(){return d=_.mouse(this),n(l)?(g.scale(v.scale()),void g.translate(v.translate())):(v.scale(_.event.scale),v.translate([c[0],_.event.translate[1]]),f?r(d)&&(m=r(d),p=[h[0]+(m[0]-f[0]),u[1],u[2]],v.rotate(p),h=p):(l=d,f=r(l)),void t.render())}function s(){_.select(this).style(k)}var l,u,c,h,f,d,p,m,v=t.projection,g=i(v,e),y=2;return g.on("zoomstart",a).on("zoom",o).on("zoomend",s),g}function s(t,e){function r(t){g++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function a(t){--g||t({type:"zoomend"})}var o,s=t.projection,d={r:s.rotate(),k:s.scale()},p=i(s,e),m=x(p,"zoomstart","zoom","zoomend"),g=0,y=p.on;return p.on("zoomstart",function(){_.select(this).style(A);var t=_.mouse(this),e=s.rotate(),i=e,a=s.translate(),g=u(e);o=l(s,t),y.call(p,"zoom",function(){var r=_.mouse(this);if(s.scale(d.k=_.event.scale),o){if(l(s,r)){s.rotate(e).translate(a);var u=l(s,r),p=h(o,u),y=v(c(g,p)),b=d.r=f(y,o,i);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=i),s.rotate(b),i=b}}else t=r,o=l(s,t);n(m.of(this,arguments))}),r(m.of(this,arguments))}).on("zoomend",function(){_.select(this).style(k),y.call(p,"zoom",null),a(m.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(p,m,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&g(r)}function u(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[a*s*u+i*o*l,i*s*u-a*o*l,a*o*u+i*s*l,a*s*l-i*o*u]}function c(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}function h(t,e){if(t&&e){var r=b(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function f(t,e,r){var n=m(e,2,t[0]);n=m(n,1,t[1]),n=m(n,0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,o)*M,p=Math.sqrt(o*o+s*s);Math.abs(c)>p?(a=(c>0?90:-90)-f,i=0):(a=Math.asin(c/p)*M-f,i=Math.sqrt(p*p-c*c));var v=180-a-2*f,g=(Math.atan2(h,u)-Math.atan2(l,i))*M,y=(Math.atan2(h,u)-Math.atan2(l,-i))*M,b=d(r[0],r[1],a,g),x=d(r[0],r[1],v,y);return b<=x?[a,g,r[2]]:[v,y,r[2]]}function d(t,e,r,n){var i=p(r-t),a=p(n-e);return Math.sqrt(i*i+a*a)}function p(t){return(t%360+540)%360-180}function m(t,e,r){var n=r*w,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function v(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*M,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*M,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*M]}function g(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=0,i=t.length;n<i;++n)r+=t[n]*e[n];return r}function b(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 x(t){for(var e=0,r=arguments.length,n=[];++e<r;)n.push(arguments[e]);var i=_.dispatch.apply(null,n);return i.of=function(e,r){return function(n){var a;try{a=n.sourceEvent=_.event,n.target=t,_.event=n,i[n.type].apply(e,r)}finally{_.event=a}}},i}var _=t("d3"),w=Math.PI/180,M=180/Math.PI,A={cursor:"pointer"},k={cursor:"auto"};e.exports=n},{d3:97}],739:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.projection,n=t.zoom,i=function(){t.makeProjection(e),t.makePath(),n.scale(r.scale()),n.translate(r.translate()),t.render()};return i}},{}],740:[function(t,e,r){"use strict";function n(t,e){this.element=t,this.plot=e,this.mouseListener=null,this.wheelListener=null,this.lastInputTime=Date.now(),this.lastPos=[0,0],this.boxEnabled=!1,this.boxStart=[0,0],this.boxEnd=[0,0]}function i(t){function e(){t.xaxis.autorange=!1,t.yaxis.autorange=!1}var r=t.mouseContainer,i=t.glplot,s=new n(r,i);return s.mouseListener=a(r,function(r,n,a){function o(e,r,n){var i=Math.min(r,n),a=Math.max(r,n);i!==a?(l[e]=i,l[e+2]=a,s.dataBox=l,t.setRanges(l)):(t.selectBox.selectBox=[0,0,1,1],t.glplot.setDirty())}var l=t.calcDataBox(),u=i.viewBox,c=s.lastPos[0],h=s.lastPos[1];switch(n*=i.pixelRatio,a*=i.pixelRatio,a=u[3]-u[1]-a,t.fullLayout.dragmode){case"zoom":if(r){var f=n/(u[2]-u[0])*(l[2]-l[0])+l[0],d=a/(u[3]-u[1])*(l[3]-l[1])+l[1];s.boxEnabled||(s.boxStart[0]=f,s.boxStart[1]=d),s.boxEnd[0]=f,s.boxEnd[1]=d,s.boxEnabled=!0}else s.boxEnabled&&(o(0,s.boxStart[0],s.boxEnd[0]),o(1,s.boxStart[1],s.boxEnd[1]),e(),s.boxEnabled=!1,t.relayoutCallback());break;case"pan":if(s.boxEnabled=!1,r){var p=(c-n)*(l[2]-l[0])/(i.viewBox[2]-i.viewBox[0]),m=(h-a)*(l[3]-l[1])/(i.viewBox[3]-i.viewBox[1]);l[0]+=p,l[2]+=p,l[1]+=m,l[3]+=m,t.setRanges(l),s.panning=!0,s.lastInputTime=Date.now(),e(),t.cameraChanged(),t.handleAnnotations()}else s.panning&&(s.panning=!1,t.relayoutCallback())}s.lastPos[0]=n,s.lastPos[1]=a}),s.wheelListener=o(r,function(r,n){var a=t.calcDataBox(),o=i.viewBox,l=s.lastPos[0],u=s.lastPos[1];switch(t.fullLayout.dragmode){case"zoom":break;case"pan":var c=Math.exp(.1*n/(o[3]-o[1])),h=l/(o[2]-o[0])*(a[2]-a[0])+a[0],f=u/(o[3]-o[1])*(a[3]-a[1])+a[1];a[0]=(a[0]-h)*c+h,a[2]=(a[2]-h)*c+h,a[1]=(a[1]-f)*c+f,a[3]=(a[3]-f)*c+f,t.setRanges(a),s.lastInputTime=Date.now(),e(),t.cameraChanged(),t.handleAnnotations(),t.relayoutCallback()}return!0}),s}var a=t("mouse-change"),o=t("mouse-wheel");e.exports=i},{"mouse-change":419,"mouse-wheel":422}],741:[function(t,e,r){"use strict";function n(t){this.scene=t,this.gl=t.gl,this.pixelRatio=t.pixelRatio,this.screenBox=[0,0,1,1],this.viewBox=[0,0,1,1],this.dataBox=[-1,-1,1,1],this.borderLineEnable=[!1,!1,!1,!1],this.borderLineWidth=[1,1,1,1],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.ticks=[[],[]],this.tickEnable=[!0,!0,!1,!1],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,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.labels=["x","y"],this.labelEnable=[!0,!0,!1,!1],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelPad=[15,15,15,15],this.labelSize=[12,12],this.labelFont=["sans-serif","sans-serif"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.title="",this.titleEnable=!0,this.titleCenter=[0,0,0,0],this.titleAngle=0,this.titleColor=[0,0,0,1],this.titleFont="sans-serif",this.titleSize=18,this.gridLineEnable=[!0,!0],this.gridLineColor=[[0,0,0,.5],[0,0,0,.5]],this.gridLineWidth=[1,1],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[1,1],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.static=this.scene.staticPlot}function i(t){return new n(t)}var a=t("../plots"),o=t("../cartesian/axes"),s=t("../../lib/html2unicode"),l=t("../../lib/str2rgbarray"),u=n.prototype,c=["xaxis","yaxis"];u.merge=function(t){this.titleEnable=!1,this.backgroundColor=l(t.plot_bgcolor);var e,r,n,i,a,o,u,h,f,d,p;for(d=0;d<2;++d){for(e=c[d],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?"":r.title,p=0;p<=2;p+=2)this.labelEnable[d+p]=!1,this.labels[d+p]=s(n),this.labelColor[d+p]=l(r.titlefont.color),this.labelFont[d+p]=r.titlefont.family,this.labelSize[d+p]=r.titlefont.size,this.labelPad[d+p]=this.getLabelPad(e,r),this.tickEnable[d+p]=!1,this.tickColor[d+p]=l((r.tickfont||{}).color),this.tickAngle[d+p]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[d+p]=this.getTickPad(r),this.tickMarkLength[d+p]=0,this.tickMarkWidth[d+p]=r.tickwidth||0,this.tickMarkColor[d+p]=l(r.tickcolor),this.borderLineEnable[d+p]=!1,this.borderLineColor[d+p]=l(r.linecolor),this.borderLineWidth[d+p]=r.linewidth||0;u=this.hasSharedAxis(r),a=this.hasAxisInDfltPos(e,r)&&!u,o=this.hasAxisInAltrPos(e,r)&&!u,i=r.mirror||!1,h=u?String(i).indexOf("all")!==-1:!!i,f=u?"allticks"===i:String(i).indexOf("ticks")!==-1,a?this.labelEnable[d]=!0:o&&(this.labelEnable[d+2]=!0),a?this.tickEnable[d]=r.showticklabels:o&&(this.tickEnable[d+2]=r.showticklabels),(a||h)&&(this.borderLineEnable[d]=r.showline),(o||h)&&(this.borderLineEnable[d+2]=r.showline),(a||f)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(o||f)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=l(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=l(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},u.hasSharedAxis=function(t){var e=this.scene,r=a.getSubplotIds(e.fullLayout,"gl2d"),n=o.findSubplotsWithAxis(r,t);return 0!==n.indexOf(e.id)},u.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},u.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},u.getLabelPad=function(t,e){var r=1.5,n=e.titlefont.size,i=e.showticklabels;return"xaxis"===t?"top"===e.side?-10+n*(r+(i?1:0)):-10+n*(r+(i?.5:0)):"yaxis"===t?"right"===e.side?10+n*(r+(i?1:.5)):10+n*(r+(i?.5:0)):void 0},u.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},u.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":665,"../../lib/str2rgbarray":685,"../cartesian/axes":706,"../plots":766}],742:[function(t,e,r){"use strict";var n=t("./scene2d"),i=t("../plots"),a=t("../../constants/xmlns_namespaces");r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},r.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},r.attributes=t("../cartesian/attributes"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=i.getSubplotIds(e,"gl2d"),o=0;o<a.length;o++){var s=a[o],l=e._plots[s],u=i.getSubplotData(r,"gl2d",s),c=l._scene2d;void 0===c&&(c=new n({id:s,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),l._scene2d=c),c.plot(u,t.calcdata,e,t.layout)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,"gl2d"),o=0;o<a.length;o++){var s=a[o],l=n._plots[s];if(l._scene2d){var u=i.getSubplotData(t,"gl2d",s);0===u.length&&(l._scene2d.destroy(),delete n._plots[s])}}},r.toSVG=function(t){for(var e=t._fullLayout,r=i.getSubplotIds(e,"gl2d"),n=0;n<r.length;n++){var o=e._plots[r[n]],s=o._scene2d,l=s.toImage("png"),u=e._glimages.append("svg:image");u.attr({xmlns:a.svg,"xlink:href":l,x:0,y:0,width:"100%",height:"100%",preserveAspectRatio:"none"}),s.destroy()}}},{"../../constants/xmlns_namespaces":651,"../cartesian/attributes":705,"../plots":766,"./scene2d":743}],743:[function(t,e,r){"use strict";function n(t,e){this.container=t.container,this.graphDiv=t.graphDiv,this.pixelRatio=t.plotGlPixelRatio||window.devicePixelRatio,this.id=t.id,this.staticPlot=!!t.staticPlot,this.fullData=null,this.updateRefs(e),this.makeFramework(),this.glplotOptions=p(this),this.glplotOptions.merge(e),this.glplot=c(this.glplotOptions),this.camera=m(this),this.traces={},this._inputs={},this.spikes=h(this.glplot),this.selectBox=f(this.glplot,{innerFill:!1,outerFill:!0}),this.lastButtonState=0,this.pickResult=null,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw()}function i(t,e){for(var r=0;r<2;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var a=0;a<n.length;++a)if(n[a].x!==i[a].x)return!0}return!1}var a,o,s=t("../../registry"),l=t("../../plots/cartesian/axes"),u=t("../../plots/cartesian/graph_interact"),c=t("gl-plot2d"),h=t("gl-spikes2d"),f=t("gl-select-box"),d=t("webgl-context"),p=t("./convert"),m=t("./camera"),v=t("../../lib/html2unicode"),g=t("../../lib/show_no_webgl_msg"),y=["xaxis","yaxis"];e.exports=n;var b=n.prototype;b.makeFramework=function(){if(this.staticPlot){if(!o&&(a=document.createElement("canvas"),o=d({canvas:a,preserveDrawingBuffer:!1,premultipliedAlpha:!0,antialias:!0}),!o))throw new Error("Error creating static canvas/context for image server");this.canvas=a,this.gl=o}else{var t=document.createElement("canvas"),e=d({canvas:t,premultipliedAlpha:!0});e||g(this),this.canvas=t,this.gl=e}var r=this.canvas;r.style.width="100%",r.style.height="100%",r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style["pointer-events"]="none",this.updateSize(r),r.className+="user-select-none";var n=this.svgContainer=document.createElementNS("http://www.w3.org/2000/svg","svg");n.style.position="absolute",n.style.top=n.style.left="0px",n.style.width=n.style.height="100%",n.style["z-index"]=20,n.style["pointer-events"]="none";var i=this.mouseContainer=document.createElement("div");i.style.position="absolute";var s=this.container;s.appendChild(r),s.appendChild(n),s.appendChild(i)},b.toImage=function(t){t||(t="png"),this.stopped=!0,this.staticPlot&&this.container.appendChild(a),this.updateSize(this.canvas),this.glplot.setDirty(),this.glplot.draw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,s=n-1;o<s;++o,--s)for(var l=0;l<r;++l)for(var u=0;u<4;++u){var c=i[4*(r*o+l)+u];i[4*(r*o+l)+u]=i[4*(r*s+l)+u],i[4*(r*s+l)+u]=c}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case"jpeg":p=h.toDataURL("image/jpeg");break;case"webp":p=h.toDataURL("image/webp");break;default:p=h.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(a),p},b.updateSize=function(t){t||(t=this.canvas);var e=this.pixelRatio,r=this.fullLayout,n=r.width,i=r.height,a=0|Math.ceil(e*n),o=0|Math.ceil(e*i);return t.width===a&&t.height===o||(t.width=a,t.height=o),this.redraw&&this.redraw(),t},b.computeTickMarks=function(){this.xaxis.setScale(),this.yaxis.setScale(),this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[l.calcTicks(this.xaxis),l.calcTicks(this.yaxis)],e=0;e<2;++e)for(var r=0;r<t[e].length;++r)t[e][r].text=v(t[e][r].text+"");return t},b.updateRefs=function(t){this.fullLayout=t;var e=l.subplotMatch,r="xaxis"+this.id.match(e)[1],n="yaxis"+this.id.match(e)[2];this.xaxis=this.fullLayout[r],this.yaxis=this.fullLayout[n]},b.relayoutCallback=function(){var t=this.graphDiv,e=this.xaxis,r=this.yaxis,n=t.layout;n.xaxis.autorange=e.autorange,n.xaxis.range=e.range.slice(0),n.yaxis.autorange=r.autorange,n.yaxis.range=r.range.slice(0);var i={lastInputTime:this.camera.lastInputTime};i[e._name]=e.range.slice(0),i[r._name]=r.range.slice(0),t.emit("plotly_relayout",i)},b.cameraChanged=function(){var t=this.camera;this.glplot.setDataBox(this.calcDataBox());var e=this.computeTickMarks(),r=this.glplotOptions.ticks;i(e,r)&&(this.glplotOptions.ticks=e,this.glplotOptions.dataBox=t.dataBox,this.glplot.update(this.glplotOptions),this.handleAnnotations())},b.handleAnnotations=function(){for(var t=this.graphDiv,e=this.fullLayout.annotations,r=0;r<e.length;r++){var n=e[r];n.xref===this.xaxis._id&&n.yref===this.yaxis._id&&s.getComponentMethod("annotations","drawOne")(t,r)}},b.destroy=function(){var t=this.traces;t&&Object.keys(t).map(function(e){t[e].dispose(),delete t[e]}),this.glplot.dispose(),this.staticPlot||this.container.removeChild(this.canvas),this.container.removeChild(this.svgContainer),this.container.removeChild(this.mouseContainer),this.fullData=null,this._inputs=null,this.glplot=null,this.stopped=!0},b.plot=function(t,e,r){var n=this.glplot;this.updateRefs(r),this.updateTraces(t,e);var i=r.width,a=r.height;this.updateSize(this.canvas);var o=this.glplotOptions;o.merge(r),o.screenBox=[0,0,i,a];var s=r._size,u=this.xaxis.domain,c=this.yaxis.domain;o.viewBox=[s.l+u[0]*s.w,s.b+c[0]*s.h,i-s.r-(1-u[1])*s.w,a-s.t-(1-c[1])*s.h],this.mouseContainer.style.width=s.w*(u[1]-u[0])+"px",this.mouseContainer.style.height=s.h*(c[1]-c[0])+"px",this.mouseContainer.height=s.h*(c[1]-c[0]),this.mouseContainer.style.left=s.l+u[0]*s.w+"px",this.mouseContainer.style.top=s.t+(1-c[1])*s.h+"px";var h=this.bounds;h[0]=h[1]=1/0,h[2]=h[3]=-(1/0);var f,d,p=Object.keys(this.traces);for(d=0;d<p.length;++d)for(var m=this.traces[p[d]],v=0;v<2;++v)h[v]=Math.min(h[v],m.bounds[v]),h[v+2]=Math.max(h[v+2],m.bounds[v+2]);for(d=0;d<2;++d)h[d]>h[d+2]&&(h[d]=-1,h[d+2]=1),f=this[y[d]],f._length=o.viewBox[d+2]-o.viewBox[d],l.doAutoRange(f),f.setScale();o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},b.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},b.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},b.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;r<a.length;r++){var o=a[r],s=this.traces[o];for(n=0;n<t.length;n++)if(i=t[n],i.uid===o&&i.type===s.type)continue t;s.dispose(),delete this.traces[o]}for(r=0;r<t.length;r++){i=t[r],this._inputs[i.uid]=r;var l=e[r],u=this.traces[i.uid];u?u.update(i,l):(u=i._module.plot(this,i,l),this.traces[i.uid]=u)}},b.emitPointAction=function(t,e){var r=this._inputs[t.trace.uid];this.graphDiv.emit(e,{points:[{x:t.traceCoord[0],y:t.traceCoord[1],curveNumber:r,pointNumber:t.pointIndex,data:this.fullData[r]._input,fullData:this.fullData,xaxis:this.xaxis,yaxis:this.yaxis}]})},b.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var t=this.glplot,e=this.camera,r=e.mouseListener,n=1===this.lastButtonState&&0===r.buttons,i=this.fullLayout;this.lastButtonState=r.buttons,this.cameraChanged();var a=r.x*t.pixelRatio,o=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===i.dragmode)this.selectBox.enabled=!0,this.selectBox.selectBox=[Math.min(e.boxStart[0],e.boxEnd[0]),Math.min(e.boxStart[1],e.boxEnd[1]),Math.max(e.boxStart[0],e.boxEnd[0]),Math.max(e.boxStart[1],e.boxEnd[1])],t.setDirty();else{this.selectBox.enabled=!1;var s=i._size,l=this.xaxis.domain,c=this.yaxis.domain,h=t.pick(a/t.pixelRatio+s.l+l[0]*s.w,o/t.pixelRatio-(s.t+(1-c[1])*s.h)),f=h&&h.object._trace.handlePick(h);if(f&&n&&this.emitPointAction(f,"plotly_click"),h&&"skip"!==h.object._trace.hoverinfo&&i.hovermode){if(f&&(!this.lastPickResult||this.lastPickResult.traceUid!==f.trace.uid||this.lastPickResult.dataCoord[0]!==f.dataCoord[0]||this.lastPickResult.dataCoord[1]!==f.dataCoord[1])){var d=f;this.lastPickResult={traceUid:f.trace?f.trace.uid:null,dataCoord:f.dataCoord.slice()},this.spikes.update({center:h.dataCoord}),d.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(h.dataCoord[0]-t.dataBox[0])/(t.dataBox[2]-t.dataBox[0])+t.viewBox[0])/t.pixelRatio,(this.canvas.height-(t.viewBox[3]-t.viewBox[1])*(h.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio],this.emitPointAction(f,"plotly_hover");var p=d.hoverinfo;if("all"!==p){var m=p.split("+");m.indexOf("x")===-1&&(d.traceCoord[0]=void 0),m.indexOf("y")===-1&&(d.traceCoord[1]=void 0),m.indexOf("z")===-1&&(d.traceCoord[2]=void 0),m.indexOf("text")===-1&&(d.textLabel=void 0),m.indexOf("name")===-1&&(d.name=void 0)}u.loneHover({x:d.screenCoord[0],y:d.screenCoord[1],xLabel:this.hoverFormatter("xaxis",d.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",d.traceCoord[1]),zLabel:d.traceCoord[2],text:d.textLabel,name:d.name,color:d.color},{container:this.svgContainer})}}else!h&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,this.graphDiv.emit("plotly_unhover"),u.loneUnhover(this.svgContainer))}t.draw()}},b.hoverFormatter=function(t,e){if(void 0!==e){var r=this[t];return l.tickText(r,r.c2l(e),"hover").text}}},{"../../lib/html2unicode":665,"../../lib/show_no_webgl_msg":683,"../../plots/cartesian/axes":706,"../../plots/cartesian/graph_interact":713,"../../registry":781,"./camera":740,"./convert":741,"gl-plot2d":192,"gl-select-box":223,"gl-spikes2d":232,"webgl-context":527}],744:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,h=t.clientHeight,f={keyBindingMode:"rotate",view:n,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:n.modes,tick:function(){var e=i(),r=this.delay,a=e-2*r;n.idle(e-r),n.recalcMatrix(a),n.flush(e-(100+2*r));for(var o=!0,s=n.computedMatrix,f=0;f<16;++f)o=o&&l[f]===s[f],l[f]=s[f];var d=t.clientWidth===c&&t.clientHeight===h;return c=t.clientWidth,h=t.clientHeight,o?!d:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(f,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),a=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var o=i();n._active.lookAt(o,r,a,e),n._active.lookAt(o+500,r,a,[0,0,1]),n._active.flush(o)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s=f.keyBindingMode;if(s!==!1){var l="rotate"===s,c="pan"===s,h="zoom"===s,m=!!o.control,v=!!o.alt,g=!!o.shift,y=!!(1&e),b=!!(2&e),x=!!(4&e),_=1/t.clientHeight,w=_*(r-d),M=_*(a-p),A=f.flipX?1:-1,k=f.flipY?1:-1,T=i(),S=Math.PI*f.rotateSpeed;if((l&&y&&!m&&!v&&!g||y&&!m&&!v&&g)&&n.rotate(T,A*S*w,-k*S*M,0),(c&&y&&!m&&!v&&!g||b||y&&m&&!v&&!g)&&n.pan(T,-f.translateSpeed*w*u,f.translateSpeed*M*u,0),h&&y&&!m&&!v&&!g||x||y&&!m&&v&&!g){var E=-f.zoomSpeed*M/window.innerHeight*(T-n.lastT())*100;n.pan(T,0,0,u*(Math.exp(E)-1))}return d=r,p=a,!0}}),s(t,function(t,e){if(f.keyBindingMode!==!1){var r=f.flipX?1:-1,a=f.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))n.rotate(o,0,0,-t*r*Math.PI*f.rotateSpeed/window.innerWidth);else{var s=-f.zoomSpeed*a*e/window.innerHeight*(o-n.lastT())/100;n.pan(o,0,0,u*(Math.exp(s)-1))}}},!0),f}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":30,"mouse-change":419,"mouse-wheel":422,"right-now":468}],745:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r<3;++r){var n=l[r];e[n]._gd=t}}var i=t("./scene"),a=t("../plots"),o=t("../../lib"),s=t("../../constants/xmlns_namespaces"),l=["xaxis","yaxis","zaxis"];r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,s=a.getSubplotIds(e,"gl3d"),l=0;l<s.length;l++){var u=s[l],c=a.getSubplotData(r,"gl3d",u),h=e[u],f=h._scene;f||(n(t,h),f=new i({id:u,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),h._scene=f),f.cameraInitial||(f.cameraInitial=o.extendDeep({},h.camera)),f.plot(c,e,t.layout)}},r.clean=function(t,e,r,n){for(var i=a.getSubplotIds(n,"gl3d"),o=0;o<i.length;o++){var s=i[o];!e[s]&&n[s]._scene&&n[s]._scene.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=a.getSubplotIds(e,"gl3d"),n=e._size,i=0;i<r.length;i++){var o=e[r[i]],l=o.domain,u=o._scene,c=u.toImage("png"),h=e._glimages.append("svg:image");h.attr({xmlns:s.svg,"xlink:href":c,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),u.destroy()}},r.cleanId=function(t){if(t.match(/^scene[0-9]*$/)){var e=t.substr(5);return"1"===e&&(e=""),"scene"+e}},r.setConvert=t("./set_convert")},{"../../constants/xmlns_namespaces":651,"../../lib":667,"../plots":766,"./layout/attributes":746,"./layout/defaults":750,"./layout/layout_attributes":751,"./scene":755,"./set_convert":756}],746:[function(t,e,r){"use strict";e.exports={scene:{valType:"subplotid",dflt:"scene"}}},{}],747:[function(t,e,r){"use strict";var n=t("../../../components/color"),i=t("../../cartesian/layout_attributes"),a=t("../../../lib/extend").extendFlat;e.exports={showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:n.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:i.color,categoryorder:i.categoryorder,categoryarray:i.categoryarray,title:i.title,titlefont:i.titlefont,type:i.type,autorange:i.autorange,rangemode:i.rangemode,range:i.range,tickmode:i.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,mirror:i.mirror,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,tickfont:i.tickfont,tickangle:i.tickangle,tickprefix:i.tickprefix,showtickprefix:i.showtickprefix,ticksuffix:i.ticksuffix,showticksuffix:i.showticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,separatethousands:i.separatethousands,tickformat:i.tickformat,hoverformat:i.hoverformat,showline:i.showline,linecolor:i.linecolor,linewidth:i.linewidth,showgrid:i.showgrid,gridcolor:a({},i.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:i.gridwidth,zeroline:i.zeroline,zerolinecolor:i.zerolinecolor,zerolinewidth:i.zerolinewidth}},{"../../../components/color":562,"../../../lib/extend":659,"../../cartesian/layout_attributes":715}],748:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../../lib"),a=t("./axis_attributes"),o=t("../../cartesian/axis_defaults"),s=["xaxis","yaxis","zaxis"],l=13600/187;e.exports=function(t,e,r){ function u(t,e){return i.coerce(c,h,a,t,e)}for(var c,h,f=0;f<s.length;f++){var d=s[f];c=t[d]||{},h={_id:d[0]+r.scene,_name:d},e[d]=h=o(c,h,u,{font:r.font,letter:d[0],data:r.data,showGrid:!0,bgColor:r.bgColor,calendar:r.calendar}),u("gridcolor",n(h.color,r.bgColor,l).toRgbString()),u("title",d[0]),h.setScale=i.noop,u("showspikes")&&(u("spikesides"),u("spikethickness"),u("spikecolor",h.color)),u("showaxeslabels"),u("showbackground")&&u("backgroundcolor")}}},{"../../../lib":667,"../../cartesian/axis_defaults":708,"./axis_attributes":747,tinycolor2:498}],749:[function(t,e,r){"use strict";function n(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],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=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],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=[30,30,30],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=[10,10,10],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=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=l(this.tickPad),this._defaultLabelPad=l(this.labelPad),this._defaultLineTickLength=l(this.lineTickLength)}function i(t){var e=new n;return e.merge(t),e}var a=t("arraytools"),o=t("../../../lib/html2unicode"),s=t("../../../lib/str2rgbarray"),l=a.copy1D,u=["xaxis","yaxis","zaxis"],c=n.prototype;c.merge=function(t){for(var e=this,r=0;r<3;++r){var n=t[u[r]];e.labels[r]=o(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=s(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=s(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=s(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth),"log"===n.type?e.zeroEnable[r]=!1:"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=s(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=s(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:Math.PI*-n.tickangle/180),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=s(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?["ticks","all","allticks"].indexOf(n.mirror)!==-1?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=s(n.backgroundcolor)):e.backgroundEnable[r]=!1}},e.exports=i},{"../../../lib/html2unicode":665,"../../../lib/str2rgbarray":685,arraytools:36}],750:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=r("bgcolor"),o=a.combine(i,n.paper_bgcolor),u=Object.keys(s.camera),c=0;c<u.length;c++)r("camera."+u[c]+".x"),r("camera."+u[c]+".y"),r("camera."+u[c]+".z");var h=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),f=h?"manual":"auto",d=r("aspectmode",f);h||(t.aspectratio=e.aspectratio={x:1,y:1,z:1},"manual"===d&&(e.aspectmode="auto")),l(t,e,{font:n.font,scene:n.id,data:n.fullData,bgColor:o,calendar:n.calendar}),r("dragmode",n.getDfltFromLayout("dragmode")),r("hovermode",n.getDfltFromLayout("hovermode"))}var i=t("../../../lib"),a=t("../../../components/color"),o=t("../../subplot_defaults"),s=t("./layout_attributes"),l=t("./axis_defaults");e.exports=function(t,e,r){function a(e){if(!l){var r=i.validate(t[e],s[e]);return r?t[e]:void 0}}var l=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:s,handleDefaults:n,font:e.font,fullData:r,getDfltFromLayout:a,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":562,"../../../lib":667,"../../subplot_defaults":773,"./axis_defaults":748,"./layout_attributes":751}],751:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t},y:{valType:"number",dflt:e},z:{valType:"number",dflt:r}}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{})},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto"},aspectratio:{x:{valType:"number",min:0},y:{valType:"number",min:0},z:{valType:"number",min:0}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest"},_deprecated:{cameraposition:{valType:"info_array"}}}},{"../../../lib/extend":659,"./axis_attributes":747}],752:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/str2rgbarray"),o=["xaxis","yaxis","zaxis"],s=n.prototype;s.merge=function(t){for(var e=0;e<3;++e){var r=t[o[e]];this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness}},e.exports=i},{"../../../lib/str2rgbarray":685}],753:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;a<n.length;++a)i[a]=n[a].x;e[r]=i}return e}function i(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,i=t.fullSceneLayout,c=[[],[],[]],h=0;h<3;++h){var f=i[l[h]];if(f._length=(r[h].hi-r[h].lo)*r[h].pixelsPerDataUnit/t.dataScale[h],Math.abs(f._length)===1/0)c[h]=[];else{f.range[0]=r[h].lo/t.dataScale[h],f.range[1]=r[h].hi/t.dataScale[h],f._m=1/(t.dataScale[h]*r[h].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var d=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var p=f.nticks||o.constrain(f._length/40,4,9);a.autoTicks(f,Math.abs(f.range[1]-f.range[0])/p)}for(var m=a.calcTicks(f),v=0;v<m.length;++v)m[v].x=m[v].x*t.dataScale[h],m[v].text=s(m[v].text);c[h]=m,f.tickmode=d}}e.ticks=c;for(var h=0;h<3;++h){u[h]=.5*(t.glplot.bounds[0][h]+t.glplot.bounds[1][h]);for(var v=0;v<2;++v)e.bounds[v][h]=t.glplot.bounds[v][h]}t.contourLevels=n(c)}e.exports=i;var a=t("../../cartesian/axes"),o=t("../../../lib"),s=t("../../../lib/html2unicode"),l=["xaxis","yaxis","zaxis"],u=[0,0,0]},{"../../../lib":667,"../../../lib/html2unicode":665,"../../cartesian/axes":706}],754:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=t[4*r+n]*e[r];return i}function i(t,e){var r=n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])));return r}e.exports=i},{}],755:[function(t,e,r){"use strict";function n(t){function e(e,r){var n=t.fullSceneLayout[e];return m.tickText(n,n.d2l(r),"hover").text}var r,n=t.svgContainer,i=t.container.getBoundingClientRect(),a=i.width,o=i.height;n.setAttributeNS(null,"viewBox","0 0 "+a+" "+o),n.setAttributeNS(null,"width",a),n.setAttributeNS(null,"height",o),A(t),t.glplot.axes.update(t.axesOptions);for(var s=Object.keys(t.traces),l=null,u=t.glplot.selection,c=0;c<s.length;++c)r=t.traces[s[c]],"skip"!==r.data.hoverinfo&&r.handlePick(u)&&(l=r),r.setContourLevels&&r.setContourLevels();var h;if(null!==l){var f=x(t.glplot.cameraParams,u.dataCoordinate);r=l.data;var d=r.hoverinfo,p=e("xaxis",u.traceCoordinate[0]),g=e("yaxis",u.traceCoordinate[1]),y=e("zaxis",u.traceCoordinate[2]);if("all"!==d){var b=d.split("+");b.indexOf("x")===-1&&(p=void 0),b.indexOf("y")===-1&&(g=void 0),b.indexOf("z")===-1&&(y=void 0),b.indexOf("text")===-1&&(u.textLabel=void 0),b.indexOf("name")===-1&&(l.name=void 0)}t.fullSceneLayout.hovermode&&v.loneHover({x:(.5+.5*f[0]/f[3])*a,y:(.5-.5*f[1]/f[3])*o,xLabel:p,yLabel:g,zLabel:y,text:u.textLabel,name:l.name,color:l.color},{container:n});var _={points:[{x:p,y:g,z:y,data:r._input,fullData:r,curveNumber:r.index,pointNumber:u.data.index}]};u.buttons&&u.distance<5?t.graphDiv.emit("plotly_click",_):t.graphDiv.emit("plotly_hover",_),h=_}else v.loneUnhover(n),t.graphDiv.emit("plotly_unhover",h)}function i(t,e,r,i){var a={canvas:r,gl:i,container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1};if(t.staticMode){if(!h&&(c=document.createElement("canvas"),h=d({canvas:c,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!h))throw new Error("error creating static canvas/context for image server");a.pixelRatio=t.pixelRatio,a.gl=h,a.canvas=c}try{t.glplot=f(a)}catch(e){y(t)}var o=function(t){if(t.fullSceneLayout.dragmode!==!1){var e={};e[t.id]=u(t.camera),t.saveCamera(t.graphDiv.layout),t.graphDiv.emit("plotly_relayout",e)}};if(t.glplot.canvas.addEventListener("mouseup",o.bind(null,t)),t.glplot.canvas.addEventListener("wheel",o.bind(null,t)),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",function(t){p.warn("Lost WebGL context."),t.preventDefault()}),!t.camera){var s=t.fullSceneLayout.camera;t.camera=b(t.container,{center:[s.center.x,s.center.y,s.center.z],eye:[s.eye.x,s.eye.y,s.eye.z],up:[s.up.x,s.up.y,s.up.z],zoomMin:.1,zoomMax:100,mode:"orbit"})}return t.glplot.camera=t.camera,t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=n.bind(null,t),t.traces={},!0}function a(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.position="absolute",a.style.top=a.style.left="0px",a.style.width=a.style.height="100%",a.style["z-index"]=20,a.style["pointer-events"]="none",r.appendChild(a),this.svgContainer=a,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=w(e[this.id]),this.spikeOptions=M(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],!i(this,e)}function o(t,e,r,n,i){for(var a,o=0;o<e.length;++o)if(Array.isArray(e[o]))for(var s=0;s<e[o].length;++s)a=t.d2l(e[o][s],0,i),!isNaN(a)&&isFinite(a)&&(n[0][r]=Math.min(n[0][r],a),n[1][r]=Math.max(n[1][r],a));else a=t.d2l(e[o],0,i),!isNaN(a)&&isFinite(a)&&(n[0][r]=Math.min(n[0][r],a),n[1][r]=Math.max(n[1][r],a))}function s(t,e,r){var n=t.fullSceneLayout;o(n.xaxis,e.x,0,r,e.xcalendar),o(n.yaxis,e.y,1,r,e.ycalendar),o(n.zaxis,e.z,2,r,e.zcalendar)}function l(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}function u(t){return{up:{x:t.up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]}}}var c,h,f=t("gl-plot3d"),d=t("webgl-context"),p=t("../../lib"),m=t("../../plots/cartesian/axes"),v=t("../../plots/cartesian/graph_interact"),g=t("../../lib/str2rgbarray"),y=t("../../lib/show_no_webgl_msg"),b=t("./camera"),x=t("./project"),_=t("./set_convert"),w=t("./layout/convert"),M=t("./layout/spikes"),A=t("./layout/tick_marks"),k=a.prototype;k.recoverContext=function(){function t(){return r.isContextLost()?void requestAnimationFrame(t):i(e,e.fullLayout,n,r)?void e.plot.apply(e,e.plotArgs):void p.error("Catastrophic and unrecoverable WebGL error. Context lost.")}var e=this,r=this.glplot.gl,n=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame(t)};var T=["xaxis","yaxis","zaxis"];k.plot=function(t,e,r){if(this.plotArgs=[t,e,r],!this.glplot.contextLost){var n,i,a,o,l,u,c=e[this.id],h=r[this.id];for(c.bgcolor?this.glplot.clearColor=g(c.bgcolor):this.glplot.clearColor=[0,0,0,0],this.glplot.snapToData=!0,this.fullSceneLayout=c,this.glplotLayout=c,this.axesOptions.merge(c),this.spikeOptions.merge(c),this.setCamera(c.camera),this.updateFx(c.dragmode,c.hovermode),this.glplot.update({}),a=0;a<3;++a)l=c[T[a]],_(l);t?Array.isArray(t)||(t=[t]):t=[];var f=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(a=0;a<t.length;++a)n=t[a],n.visible===!0&&s(this,n,f);var d=[1,1,1];for(o=0;o<3;++o)f[0][o]>f[1][o]?d[o]=1:f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]);for(this.dataScale=d,a=0;a<t.length;++a)n=t[a],n.visible===!0&&(i=this.traces[n.uid],i?i.update(n):(i=n._module.plot(this,n),this.traces[n.uid]=i),i.name=n.name);var p=Object.keys(this.traces);t:for(a=0;a<p.length;++a){for(o=0;o<t.length;++o)if(t[o].uid===p[a]&&t[o].visible===!0)continue t;i=this.traces[p[a]],i.dispose(),delete this.traces[p[a]]}var m=[[0,0,0],[0,0,0]],v=[],y={};for(a=0;a<3;++a){if(l=c[T[a]],u=l.type,u in y?(y[u].acc*=d[a],y[u].count+=1):y[u]={acc:d[a],count:1},l.autorange){for(m[0][a]=1/0,m[1][a]=-(1/0),o=0;o<this.glplot.objects.length;++o){var b=this.glplot.objects[o].bounds;m[0][a]=Math.min(m[0][a],b[0][a]/d[a]),m[1][a]=Math.max(m[1][a],b[1][a]/d[a])}if("rangemode"in l&&"tozero"===l.rangemode&&(m[0][a]=Math.min(m[0][a],0),m[1][a]=Math.max(m[1][a],0)),m[0][a]>m[1][a])m[0][a]=-1,m[1][a]=1;else{var x=m[1][a]-m[0][a];m[0][a]-=x/32,m[1][a]+=x/32}}else{var w=c[T[a]].range;m[0][a]=w[0],m[1][a]=w[1]}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var M=[1,1,1];for(a=0;a<3;++a){l=c[T[a]],u=l.type;var A=y[u];M[a]=Math.pow(A.acc,1/A.count)/d[a]}var k,S=4;if("auto"===c.aspectmode)k=Math.max.apply(null,M)/Math.min.apply(null,M)<=S?M:[1,1,1];else if("cube"===c.aspectmode)k=[1,1,1];else if("data"===c.aspectmode)k=M;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var E=c.aspectratio;k=[E.x,E.y,E.z]}c.aspectratio.x=h.aspectratio.x=k[0],c.aspectratio.y=h.aspectratio.y=k[1],c.aspectratio.z=h.aspectratio.z=k[2],this.glplot.aspect=k;var L=c.domain||null,C=e._size||null;if(L&&C){var D=this.container.style;D.position="absolute",D.left=C.l+L.x[0]*C.w+"px",D.top=C.t+(1-L.y[1])*C.h+"px",D.width=C.w*(L.x[1]-L.x[0])+"px",D.height=C.h*(L.y[1]-L.y[0])+"px"}this.glplot.redraw()}},k.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},k.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},k.setCamera=function(t){this.glplot.camera.lookAt.apply(this,l(t))},k.saveCamera=function(t){function e(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var r=this.getCamera(),n=p.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},k.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},k.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a<o;++a,--o)for(var s=0;s<r;++s)for(var l=0;l<4;++l){var u=i[4*(r*a+s)+l];i[4*(r*a+s)+l]=i[4*(r*o+s)+l],i[4*(r*o+s)+l]=u}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case"jpeg":p=h.toDataURL("image/jpeg");break;case"webp":p=h.toDataURL("image/webp");break;default:p=h.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(c),p},e.exports=a},{"../../lib":667,"../../lib/show_no_webgl_msg":683,"../../lib/str2rgbarray":685,"../../plots/cartesian/axes":706,"../../plots/cartesian/graph_interact":713,"./camera":744,"./layout/convert":749,"./layout/spikes":752,"./layout/tick_marks":753,"./project":754,"./set_convert":756,"gl-plot3d":194,"webgl-context":527}],756:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../cartesian/axes");e.exports=function(t){i.setConvert(t),t.setScale=n.noop}},{"../../lib":667,"../cartesian/axes":706}],757:[function(t,e,r){"use strict";var n=t("../lib"),i=n.extendFlat,a=t("./font_attributes"),o=t("../components/color/attributes");e.exports={font:{family:i({},a.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:i({},a.size,{dflt:12}),color:i({},a.color,{dflt:o.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:i({},a,{}),autosize:{valType:"boolean",dflt:!1},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:o.background},plot_bgcolor:{valType:"color",dflt:o.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}}},{"../components/color/attributes":561,"../lib":667,"./font_attributes":726}],758:[function(t,e,r){"use strict";e.exports={styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",controlContainerClassName:"mapboxgl-control-container",noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),mapOnErrorMsg:"Mapbox error."}},{}],759:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],a=r[1],o=Array.isArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}var h;return h=u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",{anchor:h,offset:c}}},{"../../lib":667}],760:[function(t,e,r){"use strict";function n(t,e){var r=t._fullLayout,n=t._context;if(""===n.mapboxAccessToken)return"";for(var i=n.mapboxAccessToken,a=0;a<e.length;a++){var o=r[e[a]];if(o.accesstoken){i=o.accesstoken;break}}if(!i)throw new Error(l.noAccessTokenErrorMsg);return i}var i=t("mapbox-gl"),a=t("../plots"),o=t("../../constants/xmlns_namespaces"),s=t("./mapbox"),l=t("./constants");r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=/^mapbox([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^mapbox([2-9]|[1-9][0-9]+)?$/,r.attributes={subplot:{valType:"subplotid",dflt:"mapbox"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=a.getSubplotIds(e,"mapbox"),l=n(t,o);i.accessToken=l;for(var u=0;u<o.length;u++){var c=o[u],h=a.getSubplotCalcData(r,"mapbox",c),f=e[c],d=f._subplot;f.accesstoken=l,d||(d=s({gd:t,container:e._glcontainer.node(),id:c,fullLayout:e,staticPlot:t._context.staticPlot}),e[c]._subplot=d),d.plot(h,e,t._promises)}},r.clean=function(t,e,r,n){for(var i=a.getSubplotIds(n,"mapbox"),o=0;o<i.length;o++){var s=i[o];!e[s]&&n[s]._subplot&&n[s]._subplot.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=a.getSubplotIds(e,"mapbox"),n=e._size,i=0;i<r.length;i++){var s=e[r[i]],l=s.domain,u=s._subplot,c=u.toImage("png"),h=e._glimages.append("svg:image");h.attr({xmlns:o.svg,"xlink:href":c,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),u.destroy()}}},{"../../constants/xmlns_namespaces":651,"../plots":766,"./constants":758,"./layout_attributes":762,"./layout_defaults":763,"./mapbox":764,"mapbox-gl":310}],761:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=t.uid+"-layer"+e,this.idSource=this.uid+"-source",this.idLayer=this.uid+"-layer",this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}function i(t){var e=t.source;return s.isPlainObject(e)||"string"==typeof e&&e.length>0}function a(t){var e={},r={};switch(t.type){case"circle":s.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=l(n.textposition,n.iconsize);s.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}function o(t){var e,r=t.sourcetype,n=t.source,i={type:r},a="string"==typeof n;return"geojson"===r?e="data":"vector"===r&&(e=a?"url":"tiles"),i[e]=n,i}var s=t("../../lib"),l=t("./convert_text_opts"),u=n.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=o(t);e.addSource(this.idSource,r)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var r={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",r)}},u.updateStyle=function(t){var e=a(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":667,"./convert_text_opts":759}],762:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition;e.exports={_arrayAttrRegexps:[/^mapbox([2-9]|[1-9][0-9]+)?\.layers/],domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:n.extendDeep({},a,{family:{dflt:"Open Sans Regular, Arial Unicode MS Regular"}}),textposition:n.extendFlat({},o,{arrayOk:!1})}}}},{"../../components/color":562,"../../lib":667,"../../traces/scatter/attributes":911,"../font_attributes":726}],763:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(t,e),e._input=t}function i(t,e){function r(t,e){return a.coerce(n,i,s.layers,t,e)}for(var n,i,o=t.layers||[],l=e.layers=[],u=0;u<o.length;u++)if(n=o[u],i={},a.isPlainObject(n)){var c=r("sourcetype");r("source"),"vector"===c&&r("sourcelayer");var h=r("type");r("below"),r("color"),r("opacity"),"circle"===h&&r("circle.radius"),"line"===h&&r("line.width"),"fill"===h&&r("fill.outlinecolor"),"symbol"===h&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),a.coerceFont(r,"symbol.textfont"),r("symbol.textposition")),i._index=u,l.push(i)}}var a=t("../../lib"),o=t("../subplot_defaults"),s=t("./layout_attributes");e.exports=function(t,e,r){o(t,e,r,{type:"mapbox",attributes:s,handleDefaults:n,partition:"y"})}},{"../../lib":667,"../subplot_defaults":773,"./layout_attributes":762}],764:[function(t,e,r){"use strict";function n(t){this.id=t.id,this.gd=t.gd,this.container=t.container,this.isStatic=t.staticPlot;var e=t.fullLayout;this.uid=e._uid+"-"+this.id,this.opts=e[this.id],this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(e),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[]}function i(t){var e=h.style.values,r=h.style.dflt,n={};return u.isPlainObject(t)?(n.id=t.id,n.style=t):"string"==typeof t?(n.id=t,n.style=e.indexOf(t)!==-1?a(t):t):(n.id=r,n.style=a(r)),n}function a(t){return c.styleUrlPrefix+t+"-"+c.styleUrlSuffix}function o(t){return[t.lon,t.lat]}var s=t("mapbox-gl"),l=t("../cartesian/graph_interact"),u=t("../../lib"),c=t("./constants"),h=t("./layout_attributes"),f=t("./layers"),d=n.prototype;e.exports=function(t){var e=new n(t);return e},d.plot=function(t,e,r){var n=this,i=n.opts=e[this.id];n.map&&i.accesstoken!==n.accessToken&&(n.map.remove(),n.map=null,n.styleObj=null,n.traceHash=[],n.layerList={});var a;a=n.map?new Promise(function(r,i){n.updateMap(t,e,r,i)}):new Promise(function(r,i){n.createMap(t,e,r,i)}),r.push(a)},d.createMap=function(t,e,r,n){function a(){l.loneUnhover(e._toppaper)}var h=this,f=h.gd,d=h.opts,p=h.styleObj=i(d.style);h.accessToken=d.accesstoken;var m=h.map=new s.Map({container:h.div,style:p.style,center:o(d.center),zoom:d.zoom,bearing:d.bearing,pitch:d.pitch,interactive:!h.isStatic,preserveDrawingBuffer:h.isStatic}),v=c.controlContainerClassName,g=h.div.getElementsByClassName(v)[0];h.div.removeChild(g),h.rejectOnError(n),m.once("load",function(){h.updateData(t),h.updateLayout(e),h.resolveOnRender(r)}),m.on("moveend",function(t){if(h.map){var e=h.getView();if(d._input.center=d.center=e.center,d._input.zoom=d.zoom=e.zoom,d._input.bearing=d.bearing=e.bearing,d._input.pitch=d.pitch=e.pitch,t.originalEvent){var r={};r[h.id]=u.extendFlat({},e),f.emit("plotly_relayout",r)}}}),m.on("mousemove",function(t){var e=h.div.getBoundingClientRect();t.clientX=t.point.x+e.left,t.clientY=t.point.y+e.top,t.target.getBoundingClientRect=function(){return e},h.xaxis.p2c=function(){return t.lngLat.lng},h.yaxis.p2c=function(){return t.lngLat.lat},l.hover(f,t,h.id)}),m.on("click",function(){l.click(f,{target:!0})}),m.on("dragstart",a),m.on("zoomstart",a)},d.updateMap=function(t,e,r,n){var a=this,o=a.map;a.rejectOnError(n);var s=i(a.opts.style);a.styleObj.id!==s.id?(a.styleObj=s,o.setStyle(s.style),o.style.once("load",function(){a.traceHash={},a.updateData(t),a.updateLayout(e),a.resolveOnRender(r)})):(a.updateData(t),a.updateLayout(e),a.resolveOnRender(r))},d.updateData=function(t){var e,r,n,i,a=this.traceHash;for(n=0;n<t.length;n++){var o=t[n];r=o[0].trace,e=a[r.uid],e?e.update(o):r._module&&(a[r.uid]=r._module.plot(this,o))}var s=Object.keys(a);t:for(n=0;n<s.length;n++){var l=s[n];for(i=0;i<t.length;i++)if(r=t[i][0].trace,l===r.uid)continue t;e=a[l],e.dispose(),delete a[l]}},d.updateLayout=function(t){var e=this.map,r=this.opts;e.setCenter(o(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch),this.updateLayers(),this.updateFramework(t),this.map.resize()},d.resolveOnRender=function(t){var e=this.map;e.on("render",function r(){e.loaded()&&(e.off("render",r),t())})},d.rejectOnError=function(t){function e(){t(new Error(c.mapOnErrorMsg))}var r=this.map;r.once("error",e),r.once("style.error",e),r.once("source.error",e),r.once("tile.error",e),r.once("layer.error",e)},d.createFramework=function(t){var e=this,r=e.div=document.createElement("div");r.id=e.uid,r.style.position="absolute",e.container.appendChild(r),e.xaxis={_id:"x",c2p:function(t){return e.project(t).x}},e.yaxis={_id:"y",c2p:function(t){return e.project(t).y}},e.updateFramework(t)},d.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},d.updateLayers=function(){var t,e=this.opts,r=e.layers,n=this.layerList;if(r.length!==n.length){for(t=0;t<n.length;t++)n[t].dispose();for(n=this.layerList=[],t=0;t<r.length;t++)n.push(f(this,t,r[t]))}else for(t=0;t<r.length;t++)n[t].update(r[t])},d.destroy=function(){this.map&&(this.map.remove(),this.map=null),this.container.removeChild(this.div)},d.toImage=function(){return this.map.getCanvas().toDataURL()},d.initSource=function(t){var e={type:"geojson",data:{type:"Feature",geometry:{type:"Point",coordinates:[]}}};return this.map.addSource(t,e)},d.setSourceData=function(t,e){this.map.getSource(t).setData(e)},d.setOptions=function(t,e,r){for(var n=this.map,i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];n[e](t,o,r[o])}},d.project=function(t){return this.map.project(new s.LngLat(t[0],t[1]))},d.getView=function(){var t=this.map,e=t.getCenter(),r={lon:e.lng,lat:e.lat};return{center:r,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch()}}},{"../../lib":667,"../cartesian/graph_interact":713,"./constants":758,"./layers":761,"./layout_attributes":762,"mapbox-gl":310}],765:[function(t,e,r){"use strict";e.exports={t:{valType:"number",dflt:0},r:{valType:"number",dflt:0},b:{valType:"number",dflt:0},l:{valType:"number",dflt:0}}},{}],766:[function(t,e,r){"use strict";function n(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){d.sendDataToCloud(t); });else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}function i(t,e,r){var n=r._globalTransforms||[];if(Array.isArray(t.transforms)||0!==n.length)for(var i=t.transforms||[],a=n.concat(i),o=e.transforms=[],s=0;s<a.length;s++){var l,u=a[s],c=u.type,f=y[c];f||h.warn("Unrecognized transform type "+c+"."),f&&f.supplyDefaults?(l=f.supplyDefaults(u,e,r,t),l.type=c,l._module=f,h.pushUnique(r._transformModules,f)):l=h.extendFlat({},u),o.push(l)}}function a(t,e,r,n){for(var i=t.transforms,a=[t],o=0;o<i.length;o++){var s=i[o],l=y[s.type];l&&l.transform&&(a=l.transform(a,{transform:s,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return a}function o(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}var s=t("d3"),l=t("fast-isnumeric"),u=t("../plotly"),c=t("../registry"),h=t("../lib"),f=t("../components/color"),d=e.exports={},p=t("./animation_attributes"),m=t("./frame_attributes"),v=h.relinkPrivateKeys;h.extendFlat(d,c),d.attributes=t("./attributes"),d.attributes.type.values=d.allTypes,d.fontAttrs=t("./font_attributes"),d.layoutAttributes=t("./layout_attributes"),d.fontWeight="normal";var g=d.subplotsRegistry,y=d.transformsRegistry,b=t("../components/errorbars"),x=t("./command");d.executeAPICommand=x.executeAPICommand,d.computeAPICommandBindings=x.computeAPICommandBindings,d.manageCommandObserver=x.manageCommandObserver,d.hasSimpleAPICommandBindings=x.hasSimpleAPICommandBindings,d.findSubplotIds=function(t,e){var r=[];if(!d.subplotsRegistry[e])return r;for(var n=d.subplotsRegistry[e].attr,i=0;i<t.length;i++){var a=t[i];d.traceIs(a,e)&&r.indexOf(a[n])===-1&&r.push(a[n])}return r},d.getSubplotIds=function(t,e){var r=d.subplotsRegistry[e];if(!r)return[];if(!("cartesian"!==e||t._has&&t._has("cartesian")))return[];if(!("gl2d"!==e||t._has&&t._has("gl2d")))return[];if("cartesian"===e||"gl2d"===e)return Object.keys(t._plots||{});for(var n=r.idRegex,i=Object.keys(t),a=[],o=0;o<i.length;o++){var s=i[o];n.test(s)&&a.push(s)}var l=r.idRoot.length;return a.sort(function(t,e){var r=+(t.substr(l)||1),n=+(e.substr(l)||1);return r-n}),a},d.getSubplotData=function(t,e,r){if(!d.subplotsRegistry[e])return[];for(var n,i=d.subplotsRegistry[e].attr,a=[],o=0;o<t.length;o++)if(n=t[o],"gl2d"===e&&d.traceIs(n,"gl2d")){var s=u.Axes.subplotMatch,l="x"+r.match(s)[1],c="y"+r.match(s)[2];n[i[0]]===l&&n[i[1]]===c&&a.push(n)}else n[i]===r&&a.push(n);return a},d.getSubplotCalcData=function(t,e,r){if(!d.subplotsRegistry[e])return[];for(var n=d.subplotsRegistry[e].attr,i=[],a=0;a<t.length;a++){var o=t[a],s=o[0].trace;s[n]===r&&i.push(o)}return i},d.redrawText=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){c.getComponentMethod("annotations","draw")(t),c.getComponentMethod("legend","draw")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(d.previousPromises(t))},300)})},d.resize=function(t){return new Promise(function(e,r){t&&"none"!==s.select(t).style("display")||r(new Error("Resize must be passed a plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(t.layout.width&&t.layout.height)return void e(t);delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,u.relayout(t,{autosize:!0}).then(function(){t.changed=r,e(t)})},100)})},d.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},d.addLinks=function(t){var e=t._fullLayout,r=e._paper.selectAll("text.js-plot-link-container").data([0]);r.enter().append("text").classed("js-plot-link-container",!0).style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:f.defaultLine,"pointer-events":"all"}).each(function(){var t=s.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)});var i=r.node(),a={y:e._paper.attr("height")-9};document.body.contains(i)&&i.getComputedTextLength()>=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),l.text(o.text()&&u.text()?" - ":"")},d.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=s.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=n.append("input").attr({type:"text",name:"data"});return i.node().value=d.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},d.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},a=t._fullData||[],o=t._fullData=[],s=t.data||[];if(t._transitionData||d.createTransitionData(t),r._initialAutoSizeIsDone){var l=r.width,c=r.height;d.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=l),i.height||(n.height=c)}else{d.supplyLayoutGlobalDefaults(i,n);var h=!i.width||!i.height,f=n.autosize,p=t._context&&t._context.autosizable,m=h&&(f||p);m?d.plotAutoSize(t,i,n):h&&d.sanitizeMargins(t),!f&&h&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._globalTransforms=(t._context||{}).globalTransforms,d.supplyDataDefaults(s,o,i,n),n._has=d._hasPlotType.bind(n);var g=n._modules;for(e=0;e<g.length;e++){var y=g[e];y.cleanData&&y.cleanData(o)}if(a.length===s.length)for(e=0;e<o.length;e++)v(o[e],a[e]);d.supplyLayoutModuleDefaults(i,n,o,t._transitionData),n._hasCartesian=n._has("cartesian"),n._hasGeo=n._has("geo"),n._hasGL3D=n._has("gl3d"),n._hasGL2D=n._has("gl2d"),n._hasTernary=n._has("ternary"),n._hasPie=n._has("pie"),d.cleanPlot(o,n,a,r),d.linkSubplots(o,n,a,r),v(n,r),d.doAutoMargin(t);var b=u.Axes.list(t);for(e=0;e<b.length;e++){var x=b[e];x._gd=t,x.setScale()}if((t.calcdata||[]).length===o.length)for(e=0;e<o.length;e++){var _=o[e];(t.calcdata[e][0]||{}).trace=_}},d.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},d._hasPlotType=function(t){for(var e=this._basePlotModules||[],r=0;r<e.length;r++){var n=e[r];if(n.name===t)return!0}return!1},d.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i<o.length;i++){var s=o[i];s.clean&&s.clean(t,e,r,n)}var l=!!n._paper,u=!!n._infolayer;t:for(i=0;i<r.length;i++){var c=r[i],h=c.uid;for(a=0;a<t.length;a++){var f=t[a];if(h===f.uid)continue t}l&&n._paper.selectAll(".hm"+h+",.contour"+h+",#clip"+h+",.trace"+h).remove(),u&&n._infolayer.selectAll(".cb"+h).remove()}},d.linkSubplots=function(t,e,r,n){for(var i=n._plots||{},a=e._plots={},o={_fullData:t,_fullLayout:e},s=u.Axes.getSubplots(o),l=0;l<s.length;l++){var c,h=s[l],f=i[h];f?(c=a[h]=f,c._scene2d&&c._scene2d.updateRefs(e)):(c=a[h]={},c.id=h),c.xaxis=u.Axes.getFromId(o,h,"x"),c.yaxis=u.Axes.getFromId(o,h,"y")}},d.supplyDataDefaults=function(t,e,r,n){function i(t){e.push(t);var r=t._module;r&&(h.pushUnique(o,r),h.pushUnique(s,t._module.basePlotModule),l++)}var o=n._modules=[],s=n._basePlotModules=[],l=0;n._transformModules=[];for(var u=0;u<t.length;u++){var c=t[u],f=d.supplyTraceDefaults(c,l,n,u);if(f.index=u,f._input=c,f._expandedIndex=l,f.transforms&&f.transforms.length)for(var p=a(f,e,r,n),m=0;m<p.length;m++){var v=p[m],g=d.supplyTraceDefaults(v,l,n,u);v.uid=g.uid=f.uid+m,g.index=u,g._input=c,g._fullInput=f,g._expandedIndex=l,g._expandedInput=v,i(g)}else f._fullInput=f,f._expandedInput=f,i(f)}},d.supplyAnimationDefaults=function(t){function e(e,r){return h.coerce(t||{},n,p,e,r)}t=t||{};var r,n={};if(e("mode"),e("direction"),e("fromcurrent"),Array.isArray(t.frame))for(n.frame=[],r=0;r<t.frame.length;r++)n.frame[r]=d.supplyAnimationFrameDefaults(t.frame[r]||{});else n.frame=d.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(n.transition=[],r=0;r<t.transition.length;r++)n.transition[r]=d.supplyAnimationTransitionDefaults(t.transition[r]||{});else n.transition=d.supplyAnimationTransitionDefaults(t.transition||{});return n},d.supplyAnimationFrameDefaults=function(t){function e(e,n){return h.coerce(t||{},r,p.frame,e,n)}var r={};return e("duration"),e("redraw"),r},d.supplyAnimationTransitionDefaults=function(t){function e(e,n){return h.coerce(t||{},r,p.transition,e,n)}var r={};return e("duration"),e("easing"),r},d.supplyFrameDefaults=function(t){function e(e,n){return h.coerce(t,r,m,e,n)}var r={};return e("group"),e("name"),e("traces"),e("baseframe"),e("data"),e("layout"),r},d.supplyTraceDefaults=function(t,e,r,n){function a(e,r){return h.coerce(t,s,d.attributes,e,r)}function o(e,r){if(d.traceIs(s,e))return h.coerce(t,s,d.subplotsRegistry[e].attributes,r)}var s={},l=f.defaults[e%f.defaults.length],u=a("visible");a("type"),a("uid"),a("name","trace "+n);for(var c=Object.keys(g),p=0;p<c.length;p++){var m=c[p];if(["cartesian","gl2d"].indexOf(m)===-1){var v=g[m].attr;v&&o(m,v)}}if(u){var y=d.getModule(s);s._module=y,a("hoverinfo",1===r._dataLength?"x+y+z+text":void 0),y&&y.supplyDefaults(t,s,l,r),d.traceIs(s,"noOpacity")||a("opacity"),o("cartesian","xaxis"),o("cartesian","yaxis"),o("gl2d","xaxis"),o("gl2d","yaxis"),d.traceIs(s,"showLegend")&&(a("showlegend"),a("legendgroup")),i(t,s,r)}return s},d.supplyLayoutGlobalDefaults=function(t,e){function r(r,n){return h.coerce(t,e,d.layoutAttributes,r,n)}var n=h.coerceFont(r,"font");r("title"),h.coerceFont(r,"titlefont",{family:n.family,size:Math.round(1.4*n.size),color:n.color}),r("autosize",!(t.width&&t.height)),r("width"),r("height"),r("margin.l"),r("margin.r"),r("margin.t"),r("margin.b"),r("margin.pad"),r("margin.autoexpand"),t.width&&t.height&&d.sanitizeMargins(e),r("paper_bgcolor"),r("separators"),r("hidesources"),r("smith");var i=c.getComponentMethod("calendars","handleDefaults");i(t,e,"calendar")},d.plotAutoSize=function(t,e,r){var n,i,a=t._context||{},s=a.frameMargins,u=h.isPlotDiv(t);if(u&&t.emit("plotly_autosize"),a.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else if(l(s)&&s>0){var c=o(t._boundingBoxMargins),f=c.left+c.right,p=c.bottom+c.top,m=1-2*s,v=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(m*(v.width-f)),i=Math.round(m*(v.height-p))}else{var g=u?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var y=d.layoutAttributes.width.min,b=d.layoutAttributes.height.min;n<y&&(n=y),i<b&&(i=b);var x=!e.width&&Math.abs(r.width-n)>1,_=!e.height&&Math.abs(r.height-i)>1;(_||x)&&(x&&(r.width=n),_&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),d.sanitizeMargins(r)},d.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a;u.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(i=0;i<o.length;i++)a=o[i],"cartesian"!==a.name&&a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r);var s=e._modules;for(i=0;i<s.length;i++)a=s[i],a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r);var l=e._transformModules;for(i=0;i<l.length;i++)a=l[i],a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r,n);u.Fx.supplyLayoutDefaults(t,e,r);var h=Object.keys(c.componentsRegistry);for(i=0;i<h.length;i++)a=c.componentsRegistry[h[i]],a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r)},d.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&e._glcontainer.remove(),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._tester,delete t._testref,delete t._promises,delete t._redrawTimer,delete t._replotting,delete t.firstscatter,delete t.hmlumcount,delete t.hmpixcount,delete t.numboxes,delete t._hoverTimer,delete t._lastHoverTime,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,t.removeAllListeners&&t.removeAllListeners()},d.style=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++){var n=e[r];n.style&&n.style(t)}},d.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,i=t.margin,a=r-(i.l+i.r),o=n-(i.t+i.b);a<0&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),o<0&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},d.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=void 0===r.pad?12:r.pad;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];t._replotting||d.doAutoMargin(t)}},d.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),c=e._pushmargin;if(e.margin.autoexpand!==!1){c.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:s}};for(var h=Object.keys(c),f=0;f<h.length;f++)for(var d=h[f],p=c[d].l||{},m=c[d].b||{},v=p.val,g=p.size,y=m.val,b=m.size,x=0;x<h.length;x++){var _=h[x];if(l(g)&&c[_].r){var w=c[_].r.val,M=c[_].r.size;if(w>v){var A=(g*w+(M-e.width)*v)/(w-v),k=(M*(1-v)+(g-e.width)*(1-w))/(w-v);A>=0&&k>=0&&A+k>i+a&&(i=A,a=k)}}if(l(b)&&c[_].t){var T=c[_].t.val,S=c[_].t.size;if(T>y){var E=(b*T+(S-e.height)*y)/(T-y),L=(S*(1-y)+(b-e.height)*(1-T))/(T-y);E>=0&&L>=0&&E+L>s+o&&(s=E,o=L)}}}}if(r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!t._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return u.plot(t)},d.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(h.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&["_","["].indexOf(e.charAt(0))===-1){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0&&!h.isPlainObject(t.stream))continue}else if("keepall"!==r&&(n=t[e+"src"],"string"==typeof n&&n.indexOf(":")>0))continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):h.isJSDate(t)?h.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&d.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=a(l)),"object"===n?u:JSON.stringify(u)},d.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch(n=e[r],n.type){case"replace":i=n.value;var s=(a[n.index]||{}).name,l=i.name;a[n.index]=o[l]=i,l!==s&&(delete o[s],o[l]=i);break;case"insert":i=n.value,o[i.name]=i,a.splice(n.index,0,i);break;case"delete":i=a[n.index],delete o[i.name],a.splice(n.index,1)}return Promise.resolve()},d.computeFrame=function(t,e){var r,n,i,a,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var s=o[e.toString()];if(!s)return!1;for(var l=[s],u=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&u.indexOf(s.name)===-1;)l.push(s),u.push(s.name);for(var c={};s=l.pop();)if(s.layout&&(c.layout=d.extendLayout(c.layout,s.layout)),s.data){if(c.data||(c.data=[]),n=s.traces,!n)for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(c.traces||(c.traces=[]),r=0;r<s.data.length;r++)i=n[r],void 0!==i&&null!==i&&(a=c.traces.indexOf(i),a===-1&&(a=c.data.length,c.traces[a]=i),c.data[a]=d.extendTrace(c.data[a],s.data[r]))}return c},d.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var i=r[n];i&&i.name&&(e[i.name]=i)}},d.extendObjectWithContainers=function(t,e,r){var n,i,a,o,s,l,u,c,f=h.extendDeepNoArrays({},e||{}),p=h.expandObjectPaths(f),m={};if(r&&r.length)for(a=0;a<r.length;a++)n=h.nestedProperty(p,r[a]),i=n.get(),void 0===i?h.nestedProperty(m,r[a]).set(null):(n.set(null),h.nestedProperty(m,r[a]).set(i));if(t=h.extendDeepNoArrays(t||{},p),r&&r.length)for(a=0;a<r.length;a++)if(s=h.nestedProperty(m,r[a]),u=s.get()){for(l=h.nestedProperty(t,r[a]),c=l.get(),Array.isArray(c)||(c=[],l.set(c)),o=0;o<u.length;o++){var v=u[o];null===v?c[o]=null:c[o]=d.extendObjectWithContainers(c[o],v)}l.set(c)}return t},d.dataArrayContainers=["transforms"],d.layoutArrayContainers=c.layoutArrayContainers,d.extendTrace=function(t,e){return d.extendObjectWithContainers(t,e,d.dataArrayContainers)},d.extendLayout=function(t,e){return d.extendObjectWithContainers(t,e,d.layoutArrayContainers)},d.transition=function(t,e,r,n,i,a){function o(){var n;for(n=0;n<y.length;n++){var i=y[n],a=t._fullData[i],o=a._module;o&&(o.animatable&&x.push(i),t.data[y[n]]=d.extendTrace(t.data[y[n]],e[n]))}var s=h.expandObjectPaths(h.extendDeepNoArrays({},r)),l=/^[xy]axis[0-9]*$/;for(var u in s)l.test(u)&&delete s[u].range;return d.extendLayout(t.layout,s),d.supplyDefaults(t),d.doCalcdata(t),b.calc(t),Promise.resolve()}function s(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}function l(t){if(t)for(;t.length;)t.shift()}function c(){return t.emit("plotly_transitioning",[]),new Promise(function(e){function n(){return l++,function(){c++,_||c!==l||f(e)}}t._transitioning=!0,a.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){_=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,c=0,d=t._fullLayout._basePlotModules,p=!1;if(r)for(s=0;s<d.length;s++)if(d[s].transitionAxes){var m=h.expandObjectPaths(r);p=d[s].transitionAxes(t,m,a,n)||p}for(p?(o=h.extendFlat({},a),o.duration=0):o=a,s=0;s<d.length;s++)d[s].plot(t,x,o,n);setTimeout(n())})}function f(e){if(t._transitionData)return l(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(i.redraw)return u.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)}function p(){if(t._transitionData)return t._transitioning=!1,s(t._transitionData._interruptCallbacks)}var m,v,g=Array.isArray(e)?e.length:0,y=n.slice(0,g),x=[],_=!1;for(m=0;m<y.length;m++){v=y[m];var w=t._fullData[v],M=w._module;if(M&&!M.animatable){var A={};for(var k in e[m])A[k]=[e[m][k]]}}var T=[d.previousPromises,p,o,d.rehover,c],S=h.syncOrAsync(T,t);return S&&S.then||(S=Promise.resolve()),S.then(function(){return t})},d.doCalcdata=function(t,e){var r,n,i,a,o=u.Axes.list(t),s=t._fullData,l=t._fullLayout,h=!1,f=new Array(s.length),d=(t.calcdata||[]).slice(0);for(t.calcdata=f,t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,l._piecolormap={},l._piedefaultcolorcount=0,i=0;i<o.length;i++)o[i]._categories=o[i]._initialCategories.slice(),"category"===o[i].type&&(h=!0);for(i=0;i<s.length;i++)Array.isArray(e)&&e.indexOf(i)===-1&&(f[i]=d[i]);var p=!1;for(i=0;i<s.length;i++)if(r=s[i],r.visible===!0&&r.transforms)for(n=r._module,n&&n.calc&&n.calc(t,r),a=0;a<r.transforms.length;a++){var m=r.transforms[a];n=y[m.type],n&&n.calcTransform&&(p=!0,n.calcTransform(t,r,m))}if(p)for(i=0;i<o.length;i++)o[i]._min=[],o[i]._max=[],o[i]._categories=[];for(i=0;i<s.length;i++){var v=[];r=s[i],r.visible===!0&&(n=r._module,n&&n.calc&&(v=n.calc(t,r))),Array.isArray(v)&&v[0]||(v=[{x:!1,y:!1,placeholder:!0}]),v[0].t||(v[0].t={}),v[0].trace=r,f[i]=v}if(h){var g=["annotations","shapes","images"];for(i=0;i<g.length;i++)c.getComponentMethod(g[i],"supplyLayoutDefaults")(t.layout,l,s)}},d.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},d.generalUpdatePerTraceModule=function(t,e,r){function n(t){for(var e=[],r=0;r<t.length;r++){var n=t[r],i=n[0].trace;i.visible===!0&&e.push(n)}return e}var i,a=t.traceHash,o={};for(i=0;i<e.length;i++){var s=e[i],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}var u=Object.keys(a),c=Object.keys(o);for(i=0;i<u.length;i++){var h=u[i];if(c.indexOf(h)===-1){var f=a[h][0],d=f[0].trace;d.visible=!1,o[h]=[f]}}for(c=Object.keys(o),i=0;i<c.length;i++){var p=o[c[i]],m=p[0][0].trace._module;m.plot(t,n(p),r)}t.traceHash=o}},{"../components/color":562,"../components/errorbars":591,"../lib":667,"../plotly":701,"../registry":781,"./animation_attributes":702,"./attributes":704,"./command":725,"./font_attributes":726,"./frame_attributes":727,"./layout_attributes":757,d3:97,"fast-isnumeric":106}],767:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":911}],768:[function(t,e,r){"use strict";function n(t,e){var r={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return a({},e,r)}var i=t("../cartesian/layout_attributes"),a=t("../../lib/extend").extendFlat,o=a({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:o,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:o}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":659,"../cartesian/layout_attributes":715}],769:[function(t,e,r){"use strict";var n=e.exports=t("./micropolar");n.manager=t("./micropolar_manager")},{"./micropolar":770,"./micropolar_manager":771}],770:[function(t,e,r){var n=t("d3"),i=t("../../lib"),a=i.extendDeepAll,o=e.exports={version:"0.2.2"};o.Axis=function(){function t(t){r=t||r;var u=l.data,h=l.layout;return("string"==typeof r||r.nodeName)&&(r=n.select(r)),r.datum(u).each(function(t,r){function l(t,e){return s(t)%360+h.orientation}var u=t.slice();c={data:o.util.cloneJson(u),layout:o.util.cloneJson(h)};var f=0;u.forEach(function(t,e){t.color||(t.color=h.defaultColorRange[f],f=(f+1)%h.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize});var d=u.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||r===!0}),p=!1,m=d.map(function(t,e){return p=p||"undefined"!=typeof t.groupId,t});if(p){var v=n.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(m),g=[],y=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],g.push(r),r=o.util.sumArrays(t.r,r)}),t.values});d=n.merge(y)}d.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var b=Math.min(h.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2;b=Math.max(10,b);var x,_=[h.margin.left+b,h.margin.top+b];if(p){var w=n.max(o.util.sumArrays(o.util.arrayLast(d).r[0],o.util.arrayLast(g)));x=[0,w]}else x=n.extent(o.util.flattenArray(d.map(function(t,e){return t.r})));h.radialAxis.domain!=o.DATAEXTENT&&(x[0]=0),i=n.scale.linear().domain(h.radialAxis.domain!=o.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:x).range([0,b]),c.layout.radialAxis.domain=i.domain();var M,A=o.util.flattenArray(d.map(function(t,e){return t.t})),k="string"==typeof A[0];k&&(A=o.util.deduplicate(A),M=A.slice(),A=n.range(A.length),d=d.map(function(t,e){var r=t;return t.t=[A],p&&(r.yStack=t.yStack),r}));var T=d.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===d.length,S=null===h.needsEndSpacing?k||!T:h.needsEndSpacing,E=h.angularAxis.domain&&h.angularAxis.domain!=o.DATAEXTENT&&!k&&h.angularAxis.domain[0]>=0,L=E?h.angularAxis.domain:n.extent(A),C=Math.abs(A[1]-A[0]);T&&!k&&(C=0);var D=L.slice();S&&k&&(D[1]+=C);var z=h.angularAxis.ticksCount||4;z>8&&(z=z/(z/8)+z%8),h.angularAxis.ticksStep&&(z=(D[1]-D[0])/z);var I=h.angularAxis.ticksStep||(D[1]-D[0])/(z*(h.minorTicks+1));M&&(I=Math.max(Math.round(I),1)),D[2]||(D[2]=I);var P=n.range.apply(this,D);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(D.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=S?C:0,e=n.select(this).select("svg.chart-root"),"undefined"==typeof e||e.empty()){var O="<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>",R=(new DOMParser).parseFromString(O,"application/xml"),j=this.appendChild(this.ownerDocument.importNode(R.documentElement,!0));e=n.select(j)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var F,N=e.select(".chart-group"),B={fill:"none",stroke:h.tickColor},U={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){F=e.select(".legend-group").attr({transform:"translate("+[b,h.margin.top]+")"}).style({display:"block"});var V=d.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:F,elements:V,reverseOrder:h.legend.reverseOrder})})();var H=F.node().getBBox();b=Math.min(h.width-H.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,b=Math.max(10,b),_=[h.margin.left+b,h.margin.top+b],i.range([0,b]),c.layout.radialAxis.domain=i.domain(),F.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),N.attr("transform","translate("+_+")").style({cursor:"crosshair"});var q=[(h.width-(h.margin.left+h.margin.right+2*b+(H?H.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*b))/2];if(q[0]=Math.max(0,q[0]),q[1]=Math.max(0,q[1]),e.select(".outer-group").attr("transform","translate("+q+")"),h.title){var Y=e.select("g.title-group text").style(U).text(h.title),G=Y.node().getBBox();Y.attr({x:_[0]-G.width/2,y:_[1]-b-20})}var W=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var X=W.selectAll("circle.grid-circle").data(i.ticks(5));X.enter().append("circle").attr({class:"grid-circle"}).style(B),X.attr("r",i),X.exit().remove()}W.select("circle.outside-circle").attr({r:b}).style(B);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var J=n.svg.axis().scale(i).ticks(5).tickSize(5);W.call(J).attr({transform:"rotate("+h.radialAxis.orientation+")"}),W.selectAll(".domain").style(B),W.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(U).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,U["font-size"]]+")":"translate("+[0,U["font-size"]]+")"}}),W.selectAll("g>line").style({stroke:"black"})}var Q=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),K=Q.enter().append("g").classed("angular-tick",!0);Q.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Q.exit().remove(),K.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(B),K.selectAll(".minor").style({stroke:h.minorTickColor}),Q.select("line.grid-line").attr({x1:h.tickLength?b-h.tickLength:0,x2:b}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(U);var $=Q.select("text.axis-text").attr({x:b+h.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=b+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":M?M[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(U);h.angularAxis.rewriteTicks&&$.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var tt=n.max(N.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[b+tt,h.margin.top]+")"});var et=e.select("g.geometry-group").selectAll("g").size()>0,rt=e.select("g.geometry-group").selectAll("g.geometry").data(d);if(rt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),rt.exit().remove(),d[0]||et){var nt=[];d.forEach(function(t,e){var r={};r.radialScale=i,r.angularScale=s,r.container=rt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,nt.push({data:t,geometryConfig:r})});var it=n.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(nt),at=[];it.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(o[r].defaultConfig(),t)});o[r]().config(n)()})}var ot,st,lt=e.select(".guides-group"),ut=e.select(".tooltips-group"),ct=o.tooltipPanel().config({container:ut,fontSize:8})(),ht=o.tooltipPanel().config({container:ut,fontSize:8})(),ft=o.tooltipPanel().config({container:ut,hasTick:!0})();if(!k){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});N.on("mousemove.angular-guide",function(t,e){ var r=o.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;ot=s.invert(n);var i=o.util.convertToCartesian(b+12,r+180);ct.text(o.util.round(ot)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});N.on("mousemove.radial-guide",function(t,e){var r=o.util.getMousePos(Z).radius;pt.attr({r:r}).style({opacity:.5}),st=i.invert(o.util.getMousePos(Z).radius);var n=o.util.convertToCartesian(r,h.radialAxis.orientation);ht.text(o.util.round(st)).move([n[0]+_[0],n[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ft.hide(),ct.hide(),ht.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var i=n.select(this),a=i.style("fill"),s="black",l=i.style("opacity")||1;if(i.attr({"data-opacity":l}),"none"!=a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(t[0]),r:o.util.round(t[1])};k&&(u.t=M[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),d=[h.left+h.width/2-q[0]-f.left,h.top+h.height/2-q[1]-f.top];ft.config({color:s}).text(c),ft.move(d)}else a=i.style("stroke"),i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){return 0==n.event.which&&void(n.select(this).attr("data-fill")&&ft.show())}).on("mouseout.tooltip",function(t,e){ft.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),f}var e,r,i,s,l={data:[],layout:{}},u={},c={},h=n.dispatch("hover"),f={};return f.render=function(e){return t(e),this},f.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)}),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},f.getLiveConfig=function(){return c},f.getinputConfig=function(){return u},f.radialScale=function(t){return i},f.angularScale=function(t){return s},f.svg=function(){return e},n.rebind(f,h,"on"),f},o.Axis.defaultConfig=function(t,e){var r={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return r},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6,i=n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180,i=t(n);return[e,i]});return i},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return r===-2},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180,n=t*Math.cos(r),i=t*Math.sin(r);return[n,i]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i<a;i++)e=t[i],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var a=e.reduce(function(t,e){if("undefined"!=typeof t)return t[e]},t);"undefined"!=typeof a&&(e.reduce(function(t,r,n){if("undefined"!=typeof t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},o.PolyChart=function(){function t(){var t=r[0].geometryConfig,e=t.container;"string"==typeof e&&(e=n.select(e)),e.datum(r).each(function(e,r){function i(e,r){var n=t.radialScale(e[1]),i=(t.angularScale(e[0])+t.orientation)*Math.PI/180;return{r:n,t:i}}function a(t){var e=t.r*Math.cos(t.t),r=t.r*Math.sin(t.t);return{x:e,y:r}}var o=!!e[0].data.yStack,l=e.map(function(t,e){return o?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],h={};h.bar=function(r,i,a){var o=e[a].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[s+l,-c/2],[s+l,c/2],[l,c/2],[l,-c/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+u(e[0]))+")"}})},h.dot=function(t,r,o){var s=t[2]?[t[0],t[1]+t[2]]:t,l=n.svg.symbol().size(e[o].data.dotSize).type(e[o].data.dotType)(t,r);n.select(this).attr({class:"mark dot",d:l,transform:function(t,e){var r=a(i(s));return"translate("+[r.x,r.y]+")"}})};var f=n.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});h.line=function(r,i,a){var o=r[2]?l[a].map(function(t,e){return[t[0],t[1]+t[2]]}):l[a];if(n.select(this).each(h.dot).style({opacity:function(t,r){return+e[a].data.dotVisible},fill:v.stroke(r,i,a)}).attr({class:"mark dot"}),!(i>0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:f(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,i,a)},"stroke-width":function(t,e){return v["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,i,a)},opacity:function(t,e){return v.opacity(r,i,a)},display:function(t,e){return v.display(r,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:m,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var v={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return s[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return"undefined"==typeof e[n].data.visible||e[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(l);g.enter().append("g").attr({class:"layer"});var y=g.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(h[t.geometryType]),y.exit().remove(),g.exit().remove()})}var e,r=[o.PolyChart.defaultConfig()],i=n.dispatch("hover"),s={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,e){r[e]||(r[e]={}),a(r[e],o.PolyChart.defaultConfig()),a(r[e],t)}),this):r},t.getColorScale=function(){return e},n.rebind(t,i,"on"),t},o.PolyChart.defaultConfig=function(){var t={data:{name:"geom1",t:1,2,3,4,r:1,2,3,4,dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}};return t},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"bar"}};return t},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){var t={geometryConfig:{geometryType:"arc"}};return t},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"dot",dotType:"circle"}};return t},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){var t={geometryConfig:{geometryType:"line"}};return t},o.Legend=function(){function t(){var r=e.legendConfig,i=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||"undefined"==typeof r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,h=c?r.height:u*o.length,f=s.classed("legend-group",!0),d=f.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:h+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var m=n.range(o.length),v=n.scale[c?"linear":"ordinal"]().domain(m).range(l),g=n.scale[c?"linear":"ordinal"]().domain(m)[c?"range":"rangePoints"]([0,h]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":n.svg.symbolTypes.indexOf(t)!=-1?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(c){var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,g(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return v(e)}}),x.exit().remove()}var _=n.svg.axis().scale(g).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){var r={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return r},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){t=i.container.selectAll("g."+s).data([0]);var n=t.enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),u};return u.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",h=a||"";e.style({fill:c,"font-size":i.fontSize+"px"}).text(h);var f=i.padding,d=e.node().getBBox(),p={fill:i.color,stroke:s,"stroke-width":"2px"},m=d.width+2*f+l,v=d.height+2*f;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[i.hasTick?0:l,0],[l,v/4],[l,v/2],[m,v/2],[m,-v/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-v/2+2*f]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return a(i,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t),i=[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]];return i.forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);n!=-1&&(r.data[e].groupId=n)})}if(t.layout){var s=a({},t.layout),l=[[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]];if(l.forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var u=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],h={};n.entries(s.margin).forEach(function(t,e){h[c[u.indexOf(t.key)]]=t.value}),s.margin=h}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../lib":667,d3:97}],771:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){function e(e,i){return i&&(h=i),n.select(n.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),c=o.adapter.plotly().convert(r),a.config(c).render(h),t.data=r.data,t.layout=r.layout,u.fillLayout(t),r}var r,i,a,c,h,f=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":562,"../../lib":667,"./micropolar":770,"./undo_manager":772,d3:97}],772:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return n!==-1},hasRedo:function(){return n<r.length-1},getCommands:function(){return r},getPreviousCommand:function(){return r[n-1]},getIndex:function(){return n}}}},{}],773:[function(t,e,r){"use strict";var n=t("../lib"),i=t("./plots");e.exports=function(t,e,r,a){function o(t,e){return n.coerce(s,l,c,t,e)}for(var s,l,u=a.type,c=a.attributes,h=a.handleDefaults,f=a.partition||"x",d=i.findSubplotIds(r,u),p=d.length,m=0;m<p;m++){var v=d[m];s=t[v]?t[v]:t[v]={},e[v]=l={},o("domain."+f,[m/p,(m+1)/p]),o("domain."+{x:"y",y:"x"}[f]),a.id=v,h(s,l,o,a)}}},{"../lib":667,"./plots":766}],774:[function(t,e,r){"use strict";var n=t("./ternary"),i=t("../../plots/plots");r.name="ternary",r.attr="subplot",r.idRoot="ternary",r.idRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t.calcdata,a=i.getSubplotIds(e,"ternary"),o=0;o<a.length;o++){var s=a[o],l=i.getSubplotCalcData(r,"ternary",s),u=e[s]._subplot;u||(u=new n({id:s,graphDiv:t,container:e._ternarylayer.node()},e),e[s]._subplot=u),u.plot(l,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,"ternary"),o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!e[s]&&l&&(l.plotContainer.remove(),l.clipDef.remove())}}},{"../../plots/plots":766,"./layout/attributes":775,"./layout/defaults":778,"./layout/layout_attributes":779,"./ternary":780}],775:[function(t,e,r){"use strict";e.exports={subplot:{valType:"subplotid",dflt:"ternary"}}},{}],776:[function(t,e,r){"use strict";var n=t("../../cartesian/layout_attributes"),i=t("../../../lib/extend").extendFlat;e.exports={title:n.title,titlefont:n.titlefont,color:n.color,tickmode:n.tickmode,nticks:i({},n.nticks,{dflt:6,min:1}),tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,separatethousands:n.separatethousands,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,hoverformat:n.hoverformat,showline:i({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:i({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,min:{valType:"number",dflt:0,min:0}}},{"../../../lib/extend":659,"../../cartesian/layout_attributes":715}],777:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../../lib"),a=t("./axis_attributes"),o=t("../../cartesian/tick_label_defaults"),s=t("../../cartesian/tick_mark_defaults"),l=t("../../cartesian/tick_value_defaults");e.exports=function(t,e,r){function u(r,n){return i.coerce(t,e,a,r,n)}e.type="linear";var c=u("color"),h=c===t.color?c:r.font.color,f=e._name,d=f.charAt(0).toUpperCase(),p="Component "+d,m=u("title",p);e._hovertitle=m===p?m:d,i.coerceFont(u,"titlefont",{family:r.font.family,size:Math.round(1.2*r.font.size),color:h}),u("min"),l(t,e,u,"linear"),o(t,e,u,"linear",{noHover:!1}),s(t,e,u,{outerTicks:!0});var v=u("showticklabels");v&&(i.coerceFont(u,"tickfont",{family:r.font.family,size:r.font.size,color:h}),u("tickangle"),u("tickformat")),u("hoverformat");var g=u("showline");g&&(u("linecolor",c),u("linewidth"));var y=u("showgrid");y&&(u("gridcolor",n(c,r.bgColor,60).toRgbString()),u("gridwidth"))}},{"../../../lib":667,"../../cartesian/tick_label_defaults":721,"../../cartesian/tick_mark_defaults":722,"../../cartesian/tick_value_defaults":723,"./axis_attributes":776,tinycolor2:498}],778:[function(t,e,r){"use strict";function n(t,e,r,n){var a=r("bgcolor"),o=r("sum");n.bgColor=i.combine(a,n.paper_bgcolor);for(var u,c,h,f=0;f<l.length;f++)u=l[f],c=t[u]||{},h=e[u]={_name:u},s(c,h,n);var d=e.aaxis,p=e.baxis,m=e.caxis;d.min+p.min+m.min>=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":562,"../../subplot_defaults":773,"./axis_defaults":777,"./layout_attributes":779}],779:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i}},{"../../../components/color/attributes":561,"./axis_attributes":776}],780:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),u=t("../../components/color"),c=t("../../components/drawing"),h=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,d=t("../plots"),p=t("../cartesian/axes"),m=t("../../components/dragelement"),v=t("../../components/titles"),g=t("../cartesian/select"),y=t("../cartesian/constants"),b=t("../cartesian/graph_interact");e.exports=n;var x=n.prototype;x.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},x.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r.adjustLayout(n,i),d.generalUpdatePerTraceModule(r,t,n),r.layers.plotbg.select("path").call(u.fill,n.bgcolor)},x.makeFramework=function(){var t=this,e=t.defs.selectAll("g.clips").data([0]);e.enter().append("g").classed("clips",!0);var r="clip"+t.layoutId+t.id;t.clipDef=e.selectAll("#"+r).data([0]),t.clipDef.enter().append("clipPath").attr("id",r).append("path").attr("d","M0,0Z"),t.plotContainer=t.container.selectAll("g."+t.id).data([0]),t.plotContainer.enter().append("g").classed(t.id,!0),t.layers={};var n=["draglayer","plotbg","backplot","grids","frontplot","zoom","aaxis","baxis","caxis","axlines"],i=t.plotContainer.selectAll("g.toplevel").data(n);i.enter().append("g").attr("class",function(t){return"toplevel "+t}).each(function(e){var r=a.select(this);t.layers[e]=r,"frontplot"===e?r.append("g").classed("scatterlayer",!0):"backplot"===e?r.append("g").classed("maplayer",!0):"plotbg"===e?r.append("path").attr("d","M0,0Z"):"axlines"===e&&r.selectAll("path").data(["aline","bline","cline"]).enter().append("path").each(function(t){a.select(this).classed(t,!0)})});var o=t.plotContainer.select(".grids").selectAll("g.grid").data(["agrid","bgrid","cgrid"]);o.enter().append("g").attr("class",function(t){return"grid "+t}).each(function(e){t.layers[e]=a.select(this)}),t.plotContainer.selectAll(".backplot,.frontplot,.grids").call(c.setClipUrl,r),t.graphDiv._context.staticPlot||t.initInteractions()};var _=Math.sqrt(4/3);x.adjustLayout=function(t,e){var r,n,i,a,o,s,l=this,c=t.domain,d=(c.x[0]+c.x[1])/2,p=(c.y[0]+c.y[1])/2,m=c.x[1]-c.x[0],v=c.y[1]-c.y[0],g=m*e.w,y=v*e.h,b=t.sum,x=t.aaxis.min,w=t.baxis.min,M=t.caxis.min;g>_*y?(a=y,i=a*_):(i=g,a=i/_),o=m*i/g,s=v*a/y,r=e.l+e.w*d-i/2,n=e.t+e.h*(1-p)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=b,l.xaxis={type:"linear",range:[x+2*M-b,b-x-2*w],domain:[d-o/2,d+o/2],_id:"x",_gd:l.graphDiv},h(l.xaxis),l.xaxis.setScale(),l.yaxis={type:"linear",range:[x,b-w-M],domain:[p-s/2,p+s/2],_id:"y",_gd:l.graphDiv},h(l.yaxis),l.yaxis.setScale();var A=l.yaxis.domain[0],k=l.aaxis=f({},t.aaxis,{range:[x,b-w-M],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(k);var T=l.baxis=f({},t.baxis,{range:[b-x-M,w],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_gd:l.graphDiv,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(T),k._counteraxis=T;var S=l.caxis=f({},t.caxis,{range:[b-x-w,M],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_gd:l.graphDiv,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(S);var E="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",E),l.layers.plotbg.select("path").attr("d",E);var L="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer,.zoom").attr("transform",L);var C="translate("+r+","+(n+a)+")";l.layers.baxis.attr("transform",C),l.layers.bgrid.attr("transform",C);var D="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",D),l.layers.agrid.attr("transform",D);var z="translate("+(r+i/2)+","+n+")rotate(-30)";l.layers.caxis.attr("transform",z),l.layers.cgrid.attr("transform",z),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1);var I=l.layers.axlines;I.select(".aline").attr("d",k.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,k.linecolor||"#000").style("stroke-width",(k.linewidth||0)+"px"),I.select(".bline").attr("d",T.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),I.select(".cline").attr("d",S.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px")},x.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.aaxis,a=e.baxis,o=e.caxis;if(p.doTicks(r,i,!0),p.doTicks(r,a,!0),p.doTicks(r,o,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0));v.draw(r,"a"+n,{propContainer:i,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,"text-anchor":"middle"}});var l=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;v.draw(r,"b"+n,{propContainer:a,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-l,y:e.y0+e.h+.83*a.titlefont.size+l,"text-anchor":"middle"}}),v.draw(r,"c"+n,{propContainer:o,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*o.titlefont.size+l,"text-anchor":"middle"}})}};var w=y.MINZOOM/2+.87,M="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",A="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",k="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",S=!0;x.initInteractions=function(){function t(t,e,r){var n=j.getBoundingClientRect();x=e-n.left,w=r-n.top,E={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=E,L=R.aaxis.range[1]-E.a,D=o(R.graphDiv._fullLayout[R.id].bgcolor).getLuminance(),z="M0,"+R.h+"L"+R.w/2+", 0L"+R.w+","+R.h+"Z",I=!1,P=N.append("path").attr("class","zoombox").style({fill:D>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",z),O=N.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}function e(t,e){return 1-e/R.h}function r(t,e){return 1-(t+(R.h-e)/Math.sqrt(3))/R.w}function n(t,e){return(t-(R.h-e)/Math.sqrt(3))/R.w}function a(t,i){var a=x+t,o=w+i,s=Math.max(0,Math.min(1,e(x,w),e(a,o))),l=Math.max(0,Math.min(1,r(x,w),r(a,o))),u=Math.max(0,Math.min(1,n(x,w),n(a,o))),c=(s/2+u)*R.w,h=(1-s/2-l)*R.w,f=(c+h)/2,d=h-c,p=(1-s)*R.h,m=p-d/_;d<y.MINZOOM?(C=E,P.attr("d",z),O.attr("d","M0,0Z")):(C={a:E.a+s*L,b:E.b+l*L,c:E.c+u*L},P.attr("d",z+"M"+c+","+p+"H"+h+"L"+f+","+m+"L"+c+","+p+"Z"), O.attr("d","M"+x+","+w+T+"M"+c+","+p+M+"M"+h+","+p+A+"M"+f+","+m+k)),I||(P.transition().style("fill",D>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),O.transition().style("opacity",1).duration(200),I=!0)}function c(t,e){if(C===E)return 2===e&&v(),i(F);i(F);var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(F,r),S&&F.data&&F._context.showTips&&(l.notifier("Double-click to
zoom back out","long"),S=!1)}function h(){E={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=E}function f(t,e){var r=t/R.xaxis._m,n=e/R.yaxis._m;C={a:E.a-n,b:E.b+(r+n)/2,c:E.c-(r-n)/2};var i=[C.a,C.b,C.c].sort(),a={a:i.indexOf(C.a),b:i.indexOf(C.b),c:i.indexOf(C.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),C={a:i[a.a],b:i[a.b],c:i[a.c]},e=(E.a-C.a)*R.yaxis._m,t=(E.c-C.c-E.b+C.b)*R.xaxis._m);var o="translate("+(R.x0+t)+","+(R.y0+e)+")";R.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o),R.aaxis.range=[C.a,R.sum-C.b-C.c],R.baxis.range=[R.sum-C.a-C.c,C.b],R.caxis.range=[R.sum-C.a-C.b,C.c],R.drawAxes(!1),R.plotContainer.selectAll(".crisp").classed("crisp",!1)}function d(t,e){if(t){var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(F,r)}else 2===e&&v()}function p(){R.plotContainer.selectAll(".select-outline").remove()}function v(){var t={};t[R.id+".aaxis.min"]=0,t[R.id+".baxis.min"]=0,t[R.id+".caxis.min"]=0,F.emit("plotly_doubleclick",null),s.relayout(F,t)}var x,w,E,L,C,D,z,I,P,O,R=this,j=R.layers.plotbg.select("path").node(),F=R.graphDiv,N=R.layers.zoom,B={element:j,gd:F,plotinfo:{plot:N},doubleclick:v,subplot:R.id,prepFn:function(e,r,n){B.xaxes=[R.xaxis],B.yaxes=[R.yaxis];var i=F._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),"lasso"===i?B.minDrag=1:B.minDrag=void 0,"zoom"===i?(B.moveFn=a,B.doneFn=c,t(e,r,n)):"pan"===i?(B.moveFn=f,B.doneFn=d,h(),p()):"select"!==i&&"lasso"!==i||g(e,r,n,B,i)}};j.onmousemove=function(t){b.hover(F,t,R.id),F._fullLayout._lasthover=j,F._fullLayout._hoversubplot=R.id},j.onmouseout=function(t){F._dragging||m.unhover(F,t)},j.onclick=function(t){b.click(F,t)},m.init(B)}},{"../../components/color":562,"../../components/dragelement":583,"../../components/drawing":585,"../../components/titles":638,"../../lib":667,"../../lib/extend":659,"../../plotly":701,"../cartesian/axes":706,"../cartesian/constants":711,"../cartesian/graph_interact":713,"../cartesian/select":719,"../cartesian/set_convert":720,"../plots":766,d3:97,tinycolor2:498}],781:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)s(r.layoutArrayRegexes,e[n])}}function i(t){return"object"==typeof t&&(t=t.type),t}var a=t("./lib/loggers"),o=t("./lib/noop"),s=t("./lib/push_unique"),l=t("./plots/attributes");r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.register=function(t,e,n,i){if(r.modules[e])return void a.log("Type "+e+" already registered");for(var o={},s=0;s<n.length;s++)o[n[s]]=!0,r.allCategories[n[s]]=!0;r.modules[e]={_module:t,categories:o},i&&Object.keys(i).length&&(r.modules[e].meta=i),r.allTypes.push(e)},r.registerSubplot=function(t){var e=t.name;return r.subplotsRegistry[e]?void a.log("Plot type "+e+" already registered."):(n(t),void(r.subplotsRegistry[e]=t))},r.registerComponent=function(t){var e=t.name;r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&s(r.layoutArrayContainers,e),n(t))},r.getModule=function(t){if(void 0!==t.r)return a.warn("Tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",t),!1;var e=r.modules[i(t)];return!!e&&e._module},r.traceIs=function(t,e){if(t=i(t),"various"===t)return!1;var n=r.modules[t];return n||(t&&"area"!==t&&a.log("Unrecognized trace type "+t+"."),n=r.modules[l.type.dflt]),!!n.categories[e]},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n?n[e]||o:o}},{"./lib/loggers":670,"./lib/noop":674,"./lib/push_unique":678,"./plots/attributes":704}],782:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function i(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,u=t.layout,c=l([],a),h=l({},u,n(e.tileClass));if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var f=Object.keys(h);for(r=0;r<f.length;r++)i(f[r])&&(h[f[r]].title="");for(r=0;r<c.length;r++){var d=c[r];d.showscale=!1,d.marker&&(d.marker.showscale=!1),"pie"===d.type&&(d.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)h.annotations.push(e.annotations[r]);var p=o.getSubplotIds(h,"gl3d");if(p.length){var m={};for("thumbnail"===e.tileClass&&(m={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<p.length;r++){var v=h[p[r]];v.xaxis||(v.xaxis={}),v.yaxis||(v.yaxis={}),v.zaxis||(v.zaxis={}),s(v.xaxis,m),s(v.yaxis,m),s(v.zaxis,m),v._scene=null}}var g=document.createElement("div");e.tileClass&&(g.className=e.tileClass);var y={gd:g,td:g,layout:h,data:c,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1}};return"transparent"!==e.setBackground&&(y.config.setBackground=e.setBackground||"opaque"),y.gd.defaultLayout=n(e.tileClass),y}},{"../lib":667,"../plots/plots":766}],783:[function(t,e,r){"use strict";function n(t,e){return e=e||{},e.format=e.format||"png",new Promise(function(r,n){t._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),a.isIE()&&"svg"!==e.format&&n(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),t._snapshotInProgress=!0;var s=i(t,e),l=e.filename||t.fn||"newplot";l+="."+e.format,s.then(function(e){return t._snapshotInProgress=!1,o(e,l)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})}var i=t("../plot_api/to_image"),a=t("../lib"),o=t("./filesaver");e.exports=n},{"../lib":667,"../plot_api/to_image":699,"./filesaver":784}],784:[function(t,e,r){"use strict";var n=function(t,e){var r=document.createElement("a"),n="download"in r,i=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),a=new Promise(function(a,o){"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&o(new Error("IE < 10 unsupported")),i&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),a(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),a(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob&&(navigator.msSaveBlob(new Blob([t]),e),a(e)),o(new Error("download error"))});return a};e.exports=n},{}],785:[function(t,e,r){"use strict";r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d"))?500:0},r.getRedrawFunc=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}},{}],786:[function(t,e,r){"use strict";var n=t("./helpers"),i={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=i},{"./cloneplot":782,"./download":783,"./helpers":785,"./svgtoimg":787,"./toimage":788,"./tosvg":789}],787:[function(t,e,r){"use strict";function n(t){var e=t.emitter||new a,r=new Promise(function(n,a){var o=window.Image,s=t.svg,l=t.format||"png";if(i.isIE()&&(s=s.replace(/"/gi,"'"),s=s.replace(/(\('#)(.*)('\))/gi,'("$2")'),s=s.replace(/(\\')/gi,'"'),"svg"!==l)){var u=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return a(u),t.promise?r:e.emit("error",u)}var c=t.canvas,h=c.getContext("2d"),f=new o,d="data:image/svg+xml,"+encodeURIComponent(s);c.height=t.height||150,c.width=t.width||300,f.onload=function(){var r;switch("svg"!==l&&h.drawImage(f,0,0),l){case"jpeg":r=c.toDataURL("image/jpeg");break;case"png":r=c.toDataURL("image/png");break;case"webp":r=c.toDataURL("image/webp");break;case"svg":r=d;break;default:if(a(new Error("Image format is not jpeg, png or svg")),!t.promise)return e.emit("error","Image format is not jpeg, png or svg")}n(r),t.promise||e.emit("success",r)},f.onerror=function(r){if(a(r),!t.promise)return e.emit("error",r)},f.src=d});return t.promise?r:e}var i=t("../lib"),a=t("events").EventEmitter;e.exports=n},{"../lib":667,events:104}],788:[function(t,e,r){"use strict";function n(t,e){function r(){var t=s.getDelay(f._fullLayout);setTimeout(function(){var t=u(f),r=document.createElement("canvas");r.id=o.randstr(),n=c({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:r,emitter:n,svg:t}),n.clean=function(){f&&document.body.removeChild(f)}},t)}var n=new i,h=l(t,{format:"png"}),f=h.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=s.getRedrawFunc(f);return a.plot(f,h.data,h.layout,h.config).then(d).then(r).catch(function(t){n.emit("error",t)}),n}var i=t("events").EventEmitter,a=t("../plotly"),o=t("../lib"),s=t("./helpers"),l=t("./cloneplot"),u=t("./tosvg"),c=t("./svgtoimg");e.exports=n},{"../lib":667,"../plotly":701,"./cloneplot":782,"./helpers":785,"./svgtoimg":787,"./tosvg":789,events:104}],789:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib/svg_text_utils"),a=t("../components/drawing"),o=t("../components/color"),s=t("../constants/xmlns_namespaces");e.exports=function(t,e){var r,l=t._fullLayout,u=l._paper,c=l._toppaper;u.insert("rect",":first-child").call(a.setRect,0,0,l.width,l.height).call(o.fill,l.paper_bgcolor);var h=l._basePlotModules||[];for(r=0;r<h.length;r++){var f=h[r];f.toSVG&&f.toSVG(t)}if(c){var d=c.node().childNodes,p=Array.prototype.slice.call(d);for(r=0;r<p.length;r++){var m=p[r];m.childNodes.length&&u.node().appendChild(m)}}l._draggers&&l._draggers.remove(),u.node().style.background="",u.selectAll("text").attr("data-unformatted",null).each(function(){var t=n.select(this);if("hidden"===t.style("visibility"))return void t.remove();t.style("visibility","visible");var e=t.style("font-family");e&&e.indexOf('"')!==-1&&t.style("font-family",e.replace(/"/g,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||u.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),u.node().setAttributeNS(s.xmlns,"xmlns",s.svg),u.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink);var v=(new window.XMLSerializer).serializeToString(u.node());return v=i.html_entity_decode(v),v=i.xml_entity_encode(v),v=v.replace(/("TOBESTRIPPED)|(TOBESTRIPPED")/g,"'")}},{"../components/color":562,"../components/drawing":585,"../constants/xmlns_namespaces":651,"../lib/svg_text_utils":686,d3:97}],790:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){n(e.text,t,"tx");var r=e.marker;if(r){n(r.opacity,t,"mo"),n(r.color,t,"mc");var i=r.line;i&&(n(i.color,t,"mlc"),n(i.width,t,"mlw"))}}},{"../../lib":667}],791:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),a=t("../../components/errorbars/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../plots/font_attributes"),l=t("../../lib/extend").extendFlat,u=t("../../lib/extend").extendDeep,c=u({},s);c.family.arrayOk=!0,c.size.arrayOk=!0,c.color.arrayOk=!0;var h=n.marker,f=h.line,d=l({},f.width,{dflt:0}),p=l({},{width:d},i("marker.line")),m=l({},{line:p},i("marker"),{showscale:h.showscale,colorbar:o});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0},textfont:l({},c,{}),insidetextfont:l({},c,{}),outsidetextfont:l({},c,{}),orientation:{valType:"enumerated",values:["v","h"]},base:{valType:"any",dflt:null,arrayOk:!0},offset:{valType:"number",dflt:null,arrayOk:!0},width:{valType:"number",dflt:null,min:0,arrayOk:!0},marker:m,r:n.r,t:n.t,error_y:a,error_x:a,_deprecated:{bardir:{valType:"enumerated",values:["v","h"]}}}},{"../../components/colorbar/attributes":563,"../../components/colorscale/color_attributes":569,"../../components/errorbars/attributes":587,"../../lib/extend":659,"../../plots/font_attributes":726,"../scatter/attributes":911}],792:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/calc"),s=t("./arrays_to_calcdata");e.exports=function(t,e){var r,l,u,c,h,f=i.getFromId(t,e.xaxis||"x"),d=i.getFromId(t,e.yaxis||"y"),p=e.orientation||(e.x&&!e.y?"h":"v");"h"===p?(r=f,u=f.makeCalcdata(e,"x"),l=d.makeCalcdata(e,"y"),h=e.xcalendar):(r=d,u=d.makeCalcdata(e,"y"),l=f.makeCalcdata(e,"x"),h=e.ycalendar);var m=Math.min(l.length,u.length),v=[];for(c=0;c<m;c++)n(l[c])&&v.push({p:l[c]});var g,y=e.base;if(Array.isArray(y)){for(c=0;c<Math.min(y.length,v.length);c++)g=r.d2c(y[c],0,h),v[c].b=n(g)?g:0;for(;c<v.length;c++)v[c].b=0}else for(g=r.d2c(y,0,h),g=n(g)?g:0,c=0;c<v.length;c++)v[c].b=g;for(c=0;c<v.length;c++)n(u[c])&&(v[c].s=u[c]);return a(e,"marker")&&o(e,e.marker.color,"marker","c"),a(e,"marker.line")&&o(e,e.marker.line.color,"marker.line","c"),s(v,e),v}},{"../../components/colorscale/calc":568,"../../components/colorscale/has_colorscale":575,"../../plots/cartesian/axes":706,"./arrays_to_calcdata":790,"fast-isnumeric":106}],793:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../scatter/xy_defaults"),o=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}var h=n.coerceFont,f=a(t,e,u,c);if(!f)return void(e.visible=!1);c("orientation",e.x&&!e.y?"h":"v"),c("base"),c("offset"),c("width"),c("text");var d=c("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,v=p||"outside"===d;if(m||v){var g=h(c,"textfont",u.font);m&&h(c,"insidetextfont",g),v&&h(c,"outsidetextfont",g)}o(t,e,c,r,u),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":562,"../../components/errorbars/defaults":590,"../../lib":667,"../bar/style_defaults":802,"../scatter/xy_defaults":933,"./attributes":791}],794:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../components/errorbars"),a=t("../../components/color");e.exports=function(t,e,r,o){var s,l=t.cd,u=l[0].trace,c=l[0].t,h=t.xa,f=t.ya,d="closest"===o?c.barwidth/2:c.bargroupwidth/2;s="closest"!==o?function(t){return t.p}:"h"===u.orientation?function(t){return t.y}:function(t){return t.x};var p,m;"h"===u.orientation?(p=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},m=function(t){var e=s(t)-r;return n.inbox(e-d,e+d)}):(m=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},p=function(t){var r=s(t)-e;return n.inbox(r-d,r+d)});var v=n.getDistanceFunction(o,p,m);if(n.getClosest(l,v,t),t.index!==!1){var g=l[t.index],y=g.mcc||u.marker.color,b=g.mlcc||u.marker.line.color,x=g.mlw||u.marker.line.width;a.opacity(y)?t.color=y:a.opacity(b)&&x&&(t.color=b);var _=u.base?g.b+g.s:g.s;return"h"===u.orientation?(t.x0=t.x1=h.c2p(g.x,!0),t.xLabelVal=_,t.y0=f.c2p(s(g)-d,!0),t.y1=f.c2p(s(g)+d,!0),t.yLabelVal=g.p):(t.y0=t.y1=f.c2p(g.y,!0),t.yLabelVal=_,t.x0=h.c2p(s(g)-d,!0),t.x1=h.c2p(s(g)+d,!0),t.xLabelVal=g.p),g.tx&&(t.text=g.tx),i.hoverInfo(g,u,t),[t]}}},{"../../components/color":562,"../../components/errorbars":591,"../../plots/cartesian/graph_interact":713}],795:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":714,"../scatter/colorbar":914,"./arrays_to_calcdata":790,"./attributes":791,"./calc":792,"./defaults":793,"./hover":794,"./layout_attributes":796,"./layout_defaults":797,"./plot":798,"./set_positions":799,"./style":801}],796:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],797:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,u=!1,c=!1,h={},f=0;f<r.length;f++){var d=r[f];if(n.traceIs(d,"bar")){if(l=!0,"overlay"!==t.barmode&&"stack"!==t.barmode){var p=d.xaxis+d.yaxis;h[p]&&(c=!0),h[p]=!0}if(d.visible&&"histogram"===d.type){var m=i.getFromId({_fullLayout:e},d["v"===d.orientation?"xaxis":"yaxis"]);"category"!==m.type&&(u=!0)}}}if(l){var v=s("barmode");"overlay"!==v&&s("barnorm"),s("bargap",u&&!c?0:.2),s("bargroupgap")}}},{"../../lib":667,"../../plots/cartesian/axes":706,"../../registry":781,"./layout_attributes":796}],798:[function(t,e,r){"use strict";function n(t,e,r,n,o,f,d,p){function m(t,e,r){var n=t.append("text").attr("data-notex",1).text(e).attr({class:"bartext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(A.font,r);return n.call(w.convertToTspans),n.selectAll("tspan.line").attr({x:0,y:0}),n}var v=r[0].trace,g=v.orientation,y=s(v,n);if(y){var b=l(v,n);if("none"!==b){var x,_,M,k,T=u(v,n,t._fullLayout.font),S=c(v,n,T),E=h(v,n,T),L=t._fullLayout.barmode,C="stack"===L,D="relative"===L,I=C||D,P=r[n],O=!I||P._outmost,R=Math.abs(f-o)-2*z,j=Math.abs(p-d)-2*z;if("outside"===b&&(O||(b="inside")),"auto"===b)if(O){x=m(e,y,S),_=A.bBox(x.node()),M=_.width,k=_.height;var F=M>0&&k>0,N=M<=R&&k<=j,B=M<=j&&k<=R,U="h"===g?R>=M*(j/k):j>=k*(R/M);F&&(N||B||U)?b="inside":(b="outside",x.remove(),x=null)}else b="inside";if(!x&&(x=m(e,y,"outside"===b?E:S),_=A.bBox(x.node()),M=_.width,k=_.height,M<=0||k<=0))return void x.remove();var V;V="outside"===b?a(o,f,d,p,_,g):i(o,f,d,p,_,g),x.attr("transform",V)}}}function i(t,e,r,n,i,a){var s,l,u,c,h,f=i.width,d=i.height,p=(i.left+i.right)/2,m=(i.top+i.bottom)/2,v=Math.abs(e-t),g=Math.abs(n-r);v>2*z&&g>2*z?(h=z,v-=2*h,g-=2*h):h=0;var y,b;return f<=v&&d<=g?(y=!1,b=1):f<=g&&d<=v?(y=!0,b=1):f<d==v<g?(y=!1,b=Math.min(v/f,g/d)):(y=!0,b=Math.min(g/f,v/d)),y&&(y=90),y?(s=b*d,l=b*f):(s=b*f,l=b*d),"h"===a?e<t?(u=e+h+s/2,c=(r+n)/2):(u=e-h-s/2,c=(r+n)/2):n>r?(u=(t+e)/2,c=n-h-l/2):(u=(t+e)/2,c=n+h+l/2),o(p,m,u,c,b,y)}function a(t,e,r,n,i,a){var s,l="h"===a?Math.abs(n-r):Math.abs(e-t);l>2*z&&(s=z,l-=2*s);var u,c,h,f,d=!1,p="h"===a?Math.min(1,l/i.height):Math.min(1,l/i.width),m=(i.left+i.right)/2,v=(i.top+i.bottom)/2;return d?(u=p*i.height,c=p*i.width):(u=p*i.width,c=p*i.height),"h"===a?e<t?(h=e-s-u/2,f=(r+n)/2):(h=e+s+u/2,f=(r+n)/2):n>r?(h=(t+e)/2,f=n+s+c/2):(h=(t+e)/2,f=n-s-c/2),o(m,v,h,f,p,d)}function o(t,e,r,n,i,a){var o,s,l;i<1?o="scale("+i+") ":(i=1,o=""),s=a?"rotate("+a+" "+t+" "+e+") ":"";var u=r-i*t,c=n-i*e;return l="translate("+u+" "+c+")",l+o+s}function s(t,e){var r=d(t.text,e);return p(S,r)}function l(t,e){var r=d(t.textposition,e);return m(E,r)}function u(t,e,r){return f(L,t.textfont,e,r)}function c(t,e,r){return f(C,t.insidetextfont,e,r)}function h(t,e,r){return f(D,t.outsidetextfont,e,r)}function f(t,e,r,n){e=e||{};var i=d(e.family,r),a=d(e.size,r),o=d(e.color,r);return{family:p(t.family,i,n.family),size:v(t.size,a,n.size),color:g(t.color,o,n.color)}}function d(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function p(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if("number"==typeof e&&!t.strict)return String(e);return void 0!==r?r:t.dflt}function m(t,e,r){return t.coerceNumber&&(e=+e),t.values.indexOf(e)!==-1?e:void 0!==r?r:t.dflt}function v(t,e,r){if(b(e)){e=+e;var n=t.min,i=t.max,a=void 0!==n&&e<n||void 0!==i&&e>i;if(!a)return e}return void 0!==r?r:t.dflt}function g(t,e,r){return x(e).isValid()?e:void 0!==r?r:t.dflt}var y=t("d3"),b=t("fast-isnumeric"),x=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),M=t("../../components/color"),A=t("../../components/drawing"),k=t("../../components/errorbars"),T=t("./attributes"),S=T.text,E=T.textposition,L=T.textfont,C=T.insidetextfont,D=T.outsidetextfont,z=3;e.exports=function(t,e,r){var i=e.xaxis,a=e.yaxis,o=t._fullLayout,s=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);s.enter().append("g").attr("class","trace bars"),s.append("g").attr("class","points").each(function(e){var r=e[0].t,s=e[0].trace,l=r.poffset,u=Array.isArray(l),c=r.barwidth,h=Array.isArray(c);y.select(this).selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,f){function d(t){return 0===o.bargap&&0===o.bargroupgap?y.round(Math.round(t)-S,2):t}function p(t,e){return Math.abs(t-e)>=2?d(t):t>e?Math.ceil(t):Math.floor(t)}var m,v,g,x,_=r.p+(u?l[f]:l),w=_+(h?c[f]:c),A=r.b,k=A+r.s;if("h"===s.orientation?(g=a.c2p(_,!0),x=a.c2p(w,!0),m=i.c2p(A,!0),v=i.c2p(k,!0)):(m=i.c2p(_,!0),v=i.c2p(w,!0),g=a.c2p(A,!0),x=a.c2p(k,!0)),!(b(m)&&b(v)&&b(g)&&b(x)&&m!==v&&g!==x))return void y.select(this).remove();var T=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,S=y.round(T/2%1,2);if(!t._context.staticPlot){var E=M.opacity(r.mc||s.marker.color),L=E<1||T>.01?d:p;m=L(m,v),v=L(v,m),g=L(g,x),x=L(x,g)}var C=y.select(this);C.append("path").attr("d","M"+m+","+g+"V"+x+"H"+v+"V"+g+"Z"),n(t,C,e,f,m,v,g,x)})}),s.call(k.plot,e)}},{"../../components/color":562,"../../components/drawing":585,"../../components/errorbars":591,"../../lib":667,"../../lib/svg_text_utils":686,"./attributes":791,d3:97,"fast-isnumeric":106,tinycolor2:498}],799:[function(t,e,r){"use strict";function n(t,e,r,n){if(n.length){var s,l,u,c,h,f=t._fullLayout.barmode,d="overlay"===f,p="group"===f;if(d)i(t,e,r,n);else if(p){for(s=[],l=[],u=0;u<n.length;u++)c=n[u],h=c[0].trace,void 0===h.offset?l.push(c):s.push(c);l.length&&a(t,e,r,l),s.length&&i(t,e,r,s)}else{for(s=[],l=[],u=0;u<n.length;u++)c=n[u],h=c[0].trace,void 0===h.base?l.push(c):s.push(c);l.length&&o(t,e,r,l),s.length&&i(t,e,r,s)}}}function i(t,e,r,n){for(var i=t._fullLayout.barnorm,a=!1,o=!i,l=0;l<n.length;l++){var u=n[l],c=new x([u],a,o);s(t,e,c),i?(p(t,r,c),m(t,r,c)):f(t,r,c)}}function a(t,e,r,n){var i=t._fullLayout,a=i.barnorm,o=!1,s=!a,u=new x(n,o,s);l(t,e,u),a?(p(t,r,u),m(t,r,u)):f(t,r,u)}function o(t,e,r,n){var i=t._fullLayout,a=i.barmode,o="stack"===a,l="relative"===a,u=t._fullLayout.barnorm,c=l,h=!(u||o||l),f=new x(n,c,h);s(t,e,f),d(t,r,f);for(var p=0;p<n.length;p++)for(var v=n[p],y=0;y<v.length;y++){var b=v[y];if(g(b.s)){var _=b.b+b.s===f.get(b.p,b.s);_&&(b._outmost=!0)}}u&&m(t,r,f)}function s(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.bargap,f=s.bargroupgap,d=r.minDiff,p=r.traces,m=d*(1-l),v=m,g=v*(1-f),y=-g/2;for(n=0;n<p.length;n++)i=p[n],a=i[0],o=a.t,o.barwidth=g,o.poffset=y,o.bargroupwidth=m;r.binWidth=p[0][0].t.barwidth/100,u(r),c(t,e,r),h(t,e,r)}function l(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.bargap,f=s.bargroupgap,d=r.positions,p=r.distinctPositions,m=r.minDiff,v=r.traces,g=d.length!==p.length,y=v.length,b=m*(1-l),x=g?b/y:b,_=x*(1-f);for(n=0;n<y;n++){i=v[n],a=i[0];var w=g?((2*n+1-y)*x-_)/2:-_/2;o=a.t,o.barwidth=_,o.poffset=w,o.bargroupwidth=b}r.binWidth=v[0][0].t.barwidth/100,u(r),c(t,e,r),h(t,e,r,g)}function u(t){var e,r,n,i,a,o,s=t.traces;for(e=0;e<s.length;e++){r=s[e],n=r[0],i=n.trace,o=n.t;var l,u=i.offset,c=o.poffset;if(Array.isArray(u)){for(l=u.slice(0,r.length),a=0;a<l.length;a++)g(l[a])||(l[a]=c);for(a=l.length;a<r.length;a++)l.push(c);o.poffset=l}else void 0!==u&&(o.poffset=u);var h=i.width,f=o.barwidth;if(Array.isArray(h)){var d=h.slice(0,r.length);for(a=0;a<d.length;a++)g(d[a])||(d[a]=f);for(a=d.length;a<r.length;a++)d.push(f);if(o.barwidth=d,void 0===u){for(l=[],a=0;a<r.length;a++)l.push(c+(f-d[a])/2);o.poffset=l}}else void 0!==h&&(o.barwidth=h,void 0===u&&(o.poffset=c+(f-h)/2))}}function c(t,e,r){for(var n=r.traces,i=v(e),a=0;a<n.length;a++)for(var o=n[a],s=o[0].t,l=s.poffset,u=Array.isArray(l),c=s.barwidth,h=Array.isArray(c),f=0;f<o.length;f++){var d=o[f];d[i]=d.p+(u?l[f]:l)+(h?c[f]:c)/2}}function h(t,e,r,n){var i=r.traces,a=r.distinctPositions,o=a[0],s=r.minDiff,l=s/2;b.minDtick(e,s,o,n);for(var u=Math.min.apply(Math,a)-l,c=Math.max.apply(Math,a)+l,h=0;h<i.length;h++){var f=i[h],d=f[0],p=d.trace;if(void 0!==p.width||void 0!==p.offset)for(var m=d.t,v=m.poffset,g=m.barwidth,y=Array.isArray(v),x=Array.isArray(g),_=0;_<f.length;_++){var w=f[_],M=y?v[_]:v,A=x?g[_]:g,k=w.p,T=k+M,S=T+A;u=Math.min(u,T),c=Math.max(c,S)}}b.expand(e,[u,c],{padded:!1})}function f(t,e,r){for(var n=r.traces,i=v(e),a=e.l2c(e.c2l(0)),o=a,s=0;s<n.length;s++)for(var l=n[s],u=0;u<l.length;u++){var c=l[u],h=c.b,f=h+c.s;c[i]=f,g(e.c2l(f))&&(a=Math.max(a,f),o=Math.min(o,f)),g(e.c2l(h))&&(a=Math.max(a,h),o=Math.min(o,h))}b.expand(e,[o,a],{tozero:!0,padded:!0})}function d(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.barnorm,u=v(e),c=r.traces,h=e.l2c(e.c2l(0)),f=h;for(n=0;n<c.length;n++)for(i=c[n],a=0;a<i.length;a++)if(o=i[a],g(o.s)){var d=r.put(o.p,o.b+o.s),p=d+o.b+o.s;o.b=d,o[u]=p,l||(g(e.c2l(p))&&(h=Math.max(h,p),f=Math.min(f,p)),g(e.c2l(d))&&(h=Math.max(h,d),f=Math.min(f,d)))}l||b.expand(e,[f,h],{tozero:!0,padded:!0})}function p(t,e,r){for(var n=r.traces,i=0;i<n.length;i++)for(var a=n[i],o=0;o<a.length;o++){var s=a[o];g(s.s)&&r.put(s.p,s.b+s.s)}}function m(t,e,r){for(var n=r.traces,i=v(e),a="fraction"===t._fullLayout.barnorm?1:100,o=a/1e9,s=0,l="stack"===t._fullLayout.barmode?a:0,u=!1,c=0;c<n.length;c++)for(var h=n[c],f=0;f<h.length;f++){var d=h[f];if(g(d.s)){var p=Math.abs(a/r.get(d.p,d.s));d.b*=p,d.s*=p;var m=d.b,y=m+d.s;d[i]=y,g(e.c2l(y))&&(y<s-o&&(u=!0,s=y),y>l+o&&(u=!0,l=y)),g(e.c2l(m))&&(m<s-o&&(u=!0,s=m),m>l+o&&(u=!0,l=m))}}b.expand(e,[s,l],{tozero:!0,padded:u})}function v(t){return t._id.charAt(0)}var g=t("fast-isnumeric"),y=t("../../registry"),b=t("../../plots/cartesian/axes"),x=t("./sieve.js");e.exports=function(t,e){var r,i=e.xaxis,a=e.yaxis,o=t._fullData,s=t.calcdata,l=[],u=[];for(r=0;r<o.length;r++){var c=o[r];c.visible===!0&&y.traceIs(c,"bar")&&c.xaxis===i._id&&c.yaxis===a._id&&!s[r][0].placeholder&&("h"===c.orientation?l.push(s[r]):u.push(s[r]))}n(t,i,a,u),n(t,a,i,l)}},{"../../plots/cartesian/axes":706,"../../registry":781,"./sieve.js":800,"fast-isnumeric":106}],800:[function(t,e,r){"use strict";function n(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var n=[],a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];n.push(l.p)}this.positions=n;var u=i.distinctVals(this.positions);this.distinctPositions=u.vals,this.minDiff=u.minDiff,this.binWidth=this.minDiff,this.bins={}}e.exports=n;var i=t("../../lib");n.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},n.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},n.prototype.getLabel=function(t,e){var r=e<0&&this.separateNegativeValues?"v":"^",n=this.dontMergeOverlappingData?t:Math.round(t/this.binWidth);return r+n}},{"../../lib":667}],801:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../../components/drawing"),o=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.bars"),r=e.size(),s=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===s.barmode&&r>1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,o=r.line,s=a.tryColorscale(r,""),l=a.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,a,u=(t.mlw+1||o.width+1)-1,c=n.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,c.style("stroke-width",u+"px").call(i.fill,e),u&&(a="mlc"in t?t.mlcc=l(t.mlc):Array.isArray(o.color)?i.defaultLine:o.color,c.call(i.stroke,a))})}),e.call(o.style)}},{"../../components/color":562,"../../components/drawing":585,"../../components/errorbars":591,d3:97}],802:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":562,"../../components/colorscale/defaults":571,"../../components/colorscale/has_colorscale":575}],803:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},xcalendar:n.xcalendar,ycalendar:n.ycalendar,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:a({},o.symbol,{arrayOk:!1}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1}),size:a({},o.size,{arrayOk:!1}),color:a({},o.color,{arrayOk:!1}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:a({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":561,"../../lib/extend":659,"../scatter/attributes":911}],804:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes");e.exports=function(t,e){function r(t,e,r,a,o){var s;return r in e?p=a.makeCalcdata(e,r):(s=r+"0"in e?e[r+"0"]:"name"in e&&("category"===a.type||n(e.name)&&["linear","log"].indexOf(a.type)!==-1||i.isDateTime(e.name)&&"date"===a.type)?e.name:t.numboxes,s=a.d2c(s,0,e[r+"calendar"]),p=o.map(function(){return s})),p}function o(t,e,r,a,o){var s,l,u,c,h=a.length,f=e.length,d=[],p=[];for(s=0;s<h;++s)l=a[s],t[s]={pos:l},p[s]=l-o,d[s]=[];for(p.push(a[h-1]+o),s=0;s<f;++s)c=e[s],n(c)&&(u=i.findBin(r[s],p),u>=0&&u<f&&d[u].push(c));return d}function s(t,e){var r,n,a,o;for(o=0;o<e.length;++o)r=e[o].sort(i.sorterAsc),n=r.length,a=t[o],a.val=r,a.min=r[0],a.max=r[n-1],a.mean=i.mean(r,n),a.sd=i.stdev(r,n,a.mean),a.q1=i.interp(r,.25),a.med=i.interp(r,.5),a.q3=i.interp(r,.75),a.lf=Math.min(a.q1,r[Math.min(i.findBin(2.5*a.q1-1.5*a.q3,r,!0)+1,n-1)]),a.uf=Math.max(a.q3,r[Math.max(i.findBin(2.5*a.q3-1.5*a.q1,r),0)]),a.lo=4*a.q1-3*a.q3,a.uo=4*a.q3-3*a.q1}var l,u,c,h,f,d,p,m,v,g=a.getFromId(t,e.xaxis||"x"),y=a.getFromId(t,e.yaxis||"y"),b=e.orientation,x=[];"h"===b?(l=g,u="x", f=y,d="y"):(l=y,u="y",f=g,d="x"),c=l.makeCalcdata(e,u),a.expand(l,c,{padded:!0}),p=r(t,e,d,f,c);var _=i.distinctVals(p);return m=_.vals,v=_.minDiff/2,h=o(x,c,p,m,v),s(x,h),x=x.filter(function(t){return t.val&&t.val.length}),x.length?(x[0].t={boxnum:t.numboxes,dPos:v},t.numboxes++,x):[{t:{emptybox:!0}}]}},{"../../lib":667,"../../plots/cartesian/axes":706,"fast-isnumeric":106}],805:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../components/color"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}var u,c=l("y"),h=l("x");if(c&&c.length)u="v",h||l("x0");else{if(!h||!h.length)return void(e.visible=!1);u="h",l("y0")}var f=i.getComponentMethod("calendars","handleTraceDefaults");f(t,e,["x","y"],s),l("orientation",u),l("line.color",(t.marker||{}).color||r),l("line.width",2),l("fillcolor",a.addOpacity(e.line.color,.5)),l("whiskerwidth"),l("boxmean");var d=n.coerce2(t,e,o,"marker.outliercolor"),p=l("marker.line.outliercolor"),m=d||p?l("boxpoints","suspectedoutliers"):l("boxpoints");m&&(l("jitter","all"===m?.3:0),l("pointpos","all"===m?-1.5:0),l("marker.symbol"),l("marker.opacity"),l("marker.size"),l("marker.color",e.line.color),l("marker.line.color"),l("marker.line.width"),"suspectedoutliers"===m&&(l("marker.line.outliercolor",e.marker.color),l("marker.line.outlierwidth")))}},{"../../components/color":562,"../../lib":667,"../../registry":781,"./attributes":803}],806:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../plots/cartesian/graph_interact"),a=t("../../lib"),o=t("../../components/color");e.exports=function(t,e,r,s){var l,u,c,h,f,d,p,m,v,g=t.cd,y=g[0].trace,b=g[0].t,x=t.xa,_=t.ya,w=[];if(h="closest"===s?2.5*b.bdPos:b.bdPos,"h"===y.orientation?(l=function(t){return i.inbox(t.min-e,t.max-e)},u=function(t){var e=t.pos+b.bPos-r;return i.inbox(e-h,e+h)},f="y",d=_,m="x",v=x):(l=function(t){var r=t.pos+b.bPos-e;return i.inbox(r-h,r+h)},u=function(t){return i.inbox(t.min-r,t.max-r)},f="x",d=x,m="y",v=_),c=i.getDistanceFunction(s,l,u),i.getClosest(g,c,t),t.index!==!1){var M=g[t.index],A=y.line.color,k=(y.marker||{}).color;o.opacity(A)&&y.line.width?t.color=A:o.opacity(k)&&y.boxpoints?t.color=k:t.color=y.fillcolor,t[f+"0"]=d.c2p(M.pos+b.bPos-b.bdPos,!0),t[f+"1"]=d.c2p(M.pos+b.bPos+b.bdPos,!0),n.tickText(d,d.c2l(M.pos),"hover").text,t[f+"LabelVal"]=M.pos;var T,S,E={},L=["med","min","q1","q3","max"];y.boxmean&&L.push("mean"),y.boxpoints&&[].push.apply(L,["lf","uf"]);for(var C=0;C<L.length;C++)T=L[C],T in M&&!(M[T]in E)&&(E[M[T]]=!0,p=v.c2p(M[T],!0),S=a.extendFlat({},t),S[m+"0"]=S[m+"1"]=p,S[m+"LabelVal"]=M[T],S.attr=T,"mean"===T&&"sd"in M&&"sd"===y.boxmean&&(S[m+"err"]=M.sd),t.name="",w.push(S));return w}}},{"../../components/color":562,"../../lib":667,"../../plots/cartesian/axes":706,"../../plots/cartesian/graph_interact":713}],807:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="box",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","oriented","box","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":714,"./attributes":803,"./calc":804,"./defaults":805,"./hover":806,"./layout_attributes":808,"./layout_defaults":809,"./plot":810,"./set_positions":811,"./style":812}],808:[function(t,e,r){"use strict";e.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay"},boxgap:{valType:"number",min:0,max:1,dflt:.3},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3}}},{}],809:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function o(r,n){return i.coerce(t,e,a,r,n)}for(var s,l=0;l<r.length;l++)if(n.traceIs(r[l],"box")){s=!0;break}s&&(o("boxmode"),o("boxgap"),o("boxgroupgap"))}},{"../../lib":667,"../../registry":781,"./layout_attributes":808}],810:[function(t,e,r){"use strict";function n(){l=2e9}function i(){var t=l;return l=(69069*l+1)%4294967296,Math.abs(l-t)<429496729?i():l/4294967296}var a=t("d3"),o=t("../../lib"),s=t("../../components/drawing"),l=2e9,u=5,c=.01;e.exports=function(t,e,r){var l,h,f=t._fullLayout,d=e.xaxis,p=e.yaxis,m=e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes");m.each(function(e){var r=e[0].t,m=e[0].trace,v="group"===f.boxmode&&t.numboxes>1,g=r.dPos*(1-f.boxgap)*(1-f.boxgroupgap)/(v?t.numboxes:1),y=v?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-f.boxgap):0,b=g*m.whiskerwidth;return m.visible!==!0||r.emptybox?void a.select(this).remove():("h"===m.orientation?(l=p,h=d):(l=d,h=p),r.bPos=y,r.bdPos=g,n(),a.select(this).selectAll("path.box").data(o.identity).enter().append("path").attr("class","box").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-g,!0),n=l.c2p(t.pos+y+g,!0),i=l.c2p(t.pos+y-b,!0),s=l.c2p(t.pos+y+b,!0),u=h.c2p(t.q1,!0),c=h.c2p(t.q3,!0),f=o.constrain(h.c2p(t.med,!0),Math.min(u,c)+1,Math.max(u,c)-1),d=h.c2p(m.boxpoints===!1?t.min:t.lf,!0),p=h.c2p(m.boxpoints===!1?t.max:t.uf,!0);"h"===m.orientation?a.select(this).attr("d","M"+f+","+r+"V"+n+"M"+u+","+r+"V"+n+"H"+c+"V"+r+"ZM"+u+","+e+"H"+d+"M"+c+","+e+"H"+p+(0===m.whiskerwidth?"":"M"+d+","+i+"V"+s+"M"+p+","+i+"V"+s)):a.select(this).attr("d","M"+r+","+f+"H"+n+"M"+r+","+u+"H"+n+"V"+c+"H"+r+"ZM"+e+","+u+"V"+d+"M"+e+","+c+"V"+p+(0===m.whiskerwidth?"":"M"+i+","+d+"H"+s+"M"+i+","+p+"H"+s))}),m.boxpoints&&a.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=m}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,a,s,l,h,f="all"===m.boxpoints?t.val:t.val.filter(function(e){return e<t.lf||e>t.uf}),d=Math.max((t.max-t.min)/10,t.q3-t.q1),p=1e-9*d,v=d*c,b=[],x=0;if(m.jitter){if(0===d)for(x=1,b=new Array(f.length),e=0;e<f.length;e++)b[e]=1;else for(e=0;e<f.length;e++)r=Math.max(0,e-u),a=f[r],n=Math.min(f.length-1,e+u),s=f[n],"all"!==m.boxpoints&&(f[e]<t.lf?s=Math.min(s,t.lf):a=Math.max(a,t.uf)),l=Math.sqrt(v*(n-r)/(s-a+p))||0,l=o.constrain(Math.abs(l),0,1),b.push(l),x=Math.max(l,x);h=2*m.jitter/x}return f.map(function(e,r){var n,a=m.pointpos;return m.jitter&&(a+=h*b[r]*(i()-.5)),n="h"===m.orientation?{y:t.pos+a*g+y,x:e}:{x:t.pos+a*g+y,y:e},"suspectedoutliers"===m.boxpoints&&e<t.uo&&e>t.lo&&(n.so=!0),n})}).enter().append("path").call(s.translatePoints,d,p),void(m.boxmean&&a.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=l.c2p(t.pos+y,!0),r=l.c2p(t.pos+y-g,!0),n=l.c2p(t.pos+y+g,!0),i=h.c2p(t.mean,!0),o=h.c2p(t.mean-t.sd,!0),s=h.c2p(t.mean+t.sd,!0);"h"===m.orientation?a.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==m.boxmean?"":"m0,0L"+o+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):a.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==m.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+i+"L"+e+","+s+"Z"))})))})}},{"../../components/drawing":585,"../../lib":667,d3:97}],811:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib");e.exports=function(t,e){var r,o,s,l,u=t._fullLayout,c=e.xaxis,h=e.yaxis,f=["v","h"];for(o=0;o<f.length;++o){var d,p,m,v=f[o],g=[],y=[],b=0,x=0;for(r="h"===v?h:c,s=0;s<t.calcdata.length;++s)d=t.calcdata[s],p=d[0].t,m=d[0].trace,m.visible===!0&&n.traceIs(m,"box")&&!p.emptybox&&m.orientation===v&&m.xaxis===c._id&&m.yaxis===h._id&&(g.push(s),m.boxpoints!==!1&&(b=Math.max(b,m.jitter-m.pointpos-1),x=Math.max(x,m.jitter+m.pointpos-1)));for(s=0;s<g.length;s++)for(d=t.calcdata[g[s]],l=0;l<d.length;l++)y.push(d[l].pos);if(y.length){var _=a.distinctVals(y),w=_.minDiff/2;for(y.length===_.vals.length&&(t.numboxes=1),i.minDtick(r,_.minDiff,_.vals[0],!0),o=0;o<g.length;o++){var M=g[o];t.calcdata[M][0].t.dPos=w}var A=(1-u.boxgap)*(1-u.boxgroupgap)*w/t.numboxes;i.expand(r,_.vals,{vpadminus:w+b*A,vpadplus:w+x*A})}}}},{"../../lib":667,"../../plots/cartesian/axes":706,"../../registry":781}],812:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../../components/drawing");e.exports=function(t){var e=n.select(t).selectAll("g.trace.boxes");e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){var e=t[0].trace,r=e.line.width;n.select(this).selectAll("path.box").style("stroke-width",r+"px").call(i.stroke,e.line.color).call(i.fill,e.fillcolor),n.select(this).selectAll("path.mean").style({"stroke-width":r,"stroke-dasharray":2*r+"px,"+r+"px"}).call(i.stroke,e.line.color),n.select(this).selectAll("g.points path").call(a.pointStyle,e)})}},{"../../components/color":562,"../../components/drawing":585,d3:97}],813:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../ohlc/attributes"),a=t("../box/attributes"),o={name:i.increasing.name,showlegend:i.increasing.showlegend,line:{color:n.extendFlat({},a.line.color),width:n.extendFlat({},a.line.width)},fillcolor:n.extendFlat({},a.fillcolor)};e.exports={x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n.extendFlat({},a.line.width,{})},increasing:n.extendDeep({},o,{line:{color:{dflt:i.increasing.line.color.dflt}}}),decreasing:n.extendDeep({},o,{line:{color:{dflt:i.decreasing.line.color.dflt}}}),text:i.text,whiskerwidth:n.extendFlat({},a.whiskerwidth,{dflt:0})}},{"../../lib":667,"../box/attributes":803,"../ohlc/attributes":878}],814:[function(t,e,r){"use strict";function n(t,e,r,n){o(t,e,r,n),r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".fillcolor")}var i=t("../../lib"),a=t("../ohlc/ohlc_defaults"),o=t("../ohlc/direction_defaults"),s=t("../ohlc/helpers"),l=t("./attributes");e.exports=function(t,e,r,o){function u(r,n){return i.coerce(t,e,l,r,n)}s.pushDummyTransformOpts(t,e);var c=a(t,e,u,o);return 0===c?void(e.visible=!1):(u("line.width"),n(t,e,u,"increasing"),n(t,e,u,"decreasing"),u("text"),void u("whiskerwidth"))}},{"../../lib":667,"../ohlc/direction_defaults":880,"../ohlc/helpers":881,"../ohlc/ohlc_defaults":883,"./attributes":813}],815:[function(t,e,r){"use strict";var n=t("../../plot_api/register");e.exports={moduleType:"trace",name:"candlestick",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","showLegend","candlestick"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults")},n(t("../box")),n(t("./transform"))},{"../../plot_api/register":696,"../../plots/cartesian":714,"../box":807,"./attributes":813,"./defaults":814,"./transform":816}],816:[function(t,e,r){"use strict";function n(t,e,r){var n={type:"box",boxpoints:!1,visible:t.visible,hoverinfo:t.hoverinfo,opacity:t.opacity,xaxis:t.xaxis,yaxis:t.yaxis,transforms:a.makeTransform(t,e,r)},o=t[r];return o&&i.extendFlat(n,{x:t.x||[0],xcalendar:t.xcalendar,y:[].concat(t.low).concat(t.high),whiskerwidth:t.whiskerwidth,text:t.text,name:o.name,showlegend:o.showlegend,line:o.line,fillcolor:o.fillcolor}),n}var i=t("../../lib"),a=t("../ohlc/helpers");r.moduleType="transform",r.name="candlestick",r.attributes={},r.supplyDefaults=function(t,e,r,n){return a.clearEphemeralTransformOpts(n),a.copyOHLC(t,e),t},r.transform=function(t,e){for(var r=[],i=0;i<t.length;i++){var o=t[i];"candlestick"===o.type?r.push(n(o,e,"increasing"),n(o,e,"decreasing")):r.push(o)}return a.addRangeSlider(r,e.layout),r},r.calcTransform=function(t,e,r){for(var n=r.direction,i=a.getFilterFn(n),o=e.open,s=e.high,l=e.low,u=e.close,c=o.length,h=[],f=[],d=e._fullInput.x?function(t){var r=e.x[t];h.push(r,r,r,r,r,r)}:function(t){h.push(t,t,t,t,t,t)},p=function(t,e,r,n){f.push(r,t,n,n,n,e)},m=0;m<c;m++)i(o[m],u[m])&&(d(m),p(o[m],s[m],l[m],u[m]));e.x=h,e.y=f}},{"../../lib":667,"../ohlc/helpers":881}],817:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker.line;e.exports=s({},{locations:{valType:"data_array"},locationmode:n.locationmode,z:{valType:"data_array"},text:{valType:"data_array"},marker:{line:{color:l.color,width:s({},l.width,{dflt:1})}},hoverinfo:s({},o.hoverinfo,{flags:["location","z","text","name"]})},i,{colorbar:a})},{"../../components/colorbar/attributes":563,"../../components/colorscale/attributes":567,"../../lib/extend":659,"../../plots/attributes":704,"../scattergeo/attributes":940}],818:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){n(e,e.z,"","z")}},{"../../components/colorscale/calc":568}],819:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l,u=s("locations");if(u&&(l=u.length),!u||!l)return void(e.visible=!1);var c=s("z");return Array.isArray(c)?(c.length>l&&(e.z=c.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,o,s,{prefix:"",cLetter:"z"}),void s("hoverinfo",1===o._dataLength?"location+z+text":void 0)):void(e.visible=!1)}},{"../../components/colorscale/defaults":571,"../../lib":667,"./attributes":817}],820:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],821:[function(t,e,r){"use strict";function n(t,e,r,n){function o(t){return i.tickText(n,n.c2l(t),"hover").text}var s=e.hoverinfo,l="all"===s?a.hoverinfo.flags:s.split("+"),u=l.indexOf("name")!==-1,c=l.indexOf("location")!==-1,h=l.indexOf("z")!==-1,f=l.indexOf("text")!==-1,d=!u&&c,p=[];d?t.nameOverride=r.id:(u&&(t.nameOverride=e.name),c&&p.push(r.id)),h&&p.push(o(r.z)),f&&p.push(r.tx),t.extraText=p.join("
")}var i=t("../../plots/cartesian/axes"),a=t("./attributes");e.exports=function(t){var e=t.cd,r=e[0].trace,i=t.subplot,a=i.choroplethHoverPt;if(a){var o=i.projection(a.properties.ct);return t.x0=t.x1=o[0],t.y0=t.y1=o[1],t.index=a.index,t.location=a.id,t.z=a.z,n(t,r,a,i.mockAxis),[t]}}},{"../../plots/cartesian/axes":706,"./attributes":817}],822:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":730,"../heatmap/colorbar":841,"./attributes":817,"./calc":818,"./defaults":819,"./event_data":820,"./hover":821,"./plot":823}],823:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],i=t.locations,a=i.length,o=u(t,e),s=(t.marker||{}).line||{},l=0;l<a;l++)r=c(t.locationmode,i[l],o),r&&(r.z=t.z[l],void 0!==t.text&&(r.tx=t.text[l]),h(s.color,r,"mlc",l),h(s.width,r,"mlw",l),r.index=l,n.push(r));return n.length>0&&(n[0].trace=t),n}function i(t){t.framework.selectAll("g.trace.choropleth").each(function(t){var e=t[0].trace,r=a.select(this),n=e.marker||{},i=n.line||{},u=l.makeColorScaleFunc(l.extractScale(e.colorscale,e.zmin,e.zmax));r.selectAll("path.choroplethlocation").each(function(t){a.select(this).attr("fill",function(t){return u(t.z)}).call(o.stroke,t.mlc||i.color).call(s.dashLine,"",t.mlw||i.width||0)})})}var a=t("d3"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("../../components/colorscale"),u=t("../../lib/topojson_utils").getTopojsonFeatures,c=t("../../lib/geo_location_utils").locationToFeature,h=t("../../lib/array_to_calc_item"),f=t("../../plots/geo/constants");e.exports=function(t,e,r){function o(t){return t[0].trace.uid}var s,l=t.framework,u=l.select("g.choroplethlayer"),c=l.select("g.baselayer"),h=l.select("g.baselayeroverchoropleth"),d=f.baseLayersOverChoropleth,p=u.selectAll("g.trace.choropleth").data(e,o);p.enter().append("g").attr("class","trace choropleth"),p.exit().remove(),p.each(function(e){var r=e[0].trace,i=n(r,t.topojson),o=a.select(this).selectAll("path.choroplethlocation").data(i);o.enter().append("path").classed("choroplethlocation",!0).on("mouseover",function(e){t.choroplethHoverPt=e}).on("mouseout",function(){t.choroplethHoverPt=null}),o.exit().remove()}),h.selectAll("*").remove();for(var m=0;m<d.length;m++)s=d[m],c.select("g."+s).remove(),t.drawTopo(h,s,r),t.styleLayer(h,s,r);i(t)}},{"../../components/color":562,"../../components/colorscale":576,"../../components/drawing":585,"../../lib/array_to_calc_item":654,"../../lib/geo_location_utils":662,"../../lib/topojson_utils":688,"../../plots/geo/constants":728,d3:97}],824:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=i.line;e.exports=s({},{z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,connectgaps:n.connectgaps,autocontour:{valType:"boolean",dflt:!0},ncontours:{valType:"integer",dflt:15,min:1},contours:{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"number",dflt:null,min:0},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill"},showlines:{valType:"boolean",dflt:!0}},line:{color:s({},l.color,{}),width:l.width,dash:l.dash,smoothing:s({},l.smoothing,{})}},a,{autocolorscale:s({},a.autocolorscale,{dflt:!1})},{colorbar:o})},{"../../components/colorbar/attributes":563,"../../components/colorscale/attributes":567,"../../lib/extend":659,"../heatmap/attributes":838,"../scatter/attributes":911}],825:[function(t,e,r){"use strict";function n(t,e,r){var n={type:"linear",range:[t,e]};return i.autoTicks(n,(e-t)/(r||15)),n}var i=t("../../plots/cartesian/axes"),a=t("../../lib").extendFlat,o=t("../heatmap/calc");e.exports=function(t,e){var r=o(t,e),s=e.contours;if(e.autocontour!==!1){var l=n(e.zmin,e.zmax,e.ncontours);s.size=l.dtick,s.start=i.tickFirst(l),l.range.reverse(),s.end=i.tickFirst(l),s.start===e.zmin&&(s.start+=s.size),s.end===e.zmax&&(s.end-=s.size),s.start>s.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var u=s.start,c=s.end,h=e._input.contours;if(u>c&&(s.start=h.start=c,c=s.end=h.end=u,u=s.start),!(s.size>0)){var f;f=u===c?1:n(u,c,e.ncontours).dtick,h.size=s.size=f}}return r}},{"../../lib":667,"../../plots/cartesian/axes":706,"../heatmap/calc":839}],826:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),r.showscale===!1)return void n.autoMargin(t,s);var l=i(t,s);e[0].t.cb=l;var u=r.contours,c=r.line,h=u.size||1,f=u.coloring,d=a(r,{isColorbar:!0});"heatmap"===f&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===f||"heatmap"===f?d:"").line({color:"lines"===f?d:c.color,width:u.showlines!==!1?c.width:0,dash:c.dash}).levels({start:u.start,end:o(u),size:h}).options(r.colorbar)()}},{"../../components/colorbar/draw":565,"../../plots/plots":766,"./end_plus":829,"./make_color_map":833}],827:[function(t,e,r){"use strict";e.exports.BOTTOMSTART=[1,9,13,104,713],e.exports.TOPSTART=[4,6,7,104,713],e.exports.LEFTSTART=[8,12,14,208,1114],e.exports.RIGHTSTART=[2,3,11,208,1114],e.exports.NEWDELTA=[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],e.exports.CHOOSESADDLE={104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},e.exports.SADDLEREMAINDER={1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11}},{}],828:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("../contour/style_defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}var c=a(t,e,u,l);if(!c)return void(e.visible=!1);u("text"),u("connectgaps",i(e));var h,f=n.coerce2(t,e,s,"contours.start"),d=n.coerce2(t,e,s,"contours.end"),p=f===!1||d===!1,m=u("contours.size");h=p?e.autocontour=!0:u("autocontour",!1),!h&&m||u("ncontours"),o(t,e,u,l)}},{"../../lib":667,"../contour/style_defaults":837,"../heatmap/has_columns":845,"../heatmap/xyz_defaults":853,"./attributes":824}],829:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],830:[function(t,e,r){"use strict";function n(t,e){return Math.abs(t[0]-e[0])<.01&&Math.abs(t[1]-e[1])<.01}function i(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function a(t,e,r){function a(t){return m[t%m.length]}var c,h=e.join(","),f=h,d=t.crossings[f],p=o(d,r,e),m=[s(t,e,[-p[0],-p[1]])],v=p.join(","),g=t.z.length,y=t.z[0].length;for(c=0;c<1e4;c++){if(d>20?(d=u.CHOOSESADDLE[d][(p[0]||p[1])<0?0:1],t.crossings[f]=u.SADDLEREMAINDER[d]):delete t.crossings[f],p=u.NEWDELTA[d],!p){l.log("Found bad marching index:",d,e,t.level);break}m.push(s(t,e,p)),e[0]+=p[0],e[1]+=p[1],n(m[m.length-1],m[m.length-2])&&m.pop(),f=e.join(",");var b=p[0]&&(e[0]<0||e[0]>y-2)||p[1]&&(e[1]<0||e[1]>g-2),x=f===h&&p.join(",")===v;if(x||r&&b)break;d=t.crossings[f]}1e4===c&&l.log("Infinite loop in contour?");var _,w,M,A,k,T,S,E=n(m[0],m[m.length-1]),L=0,C=.2*t.smoothing,D=[],z=0;for(c=1;c<m.length;c++)S=i(m[c],m[c-1]),L+=S,D.push(S);var I=L/D.length*C;for(c=m.length-2;c>=z;c--)if(_=D[c],_<I){for(M=0,w=c-1;w>=z&&_+D[w]<I;w--)_+=D[w];if(E&&c===m.length-2)for(M=0;M<w&&_+D[M]<I;M++)_+=D[M];k=c-w+M+1,T=Math.floor((c+w+M+2)/2),A=E||c!==m.length-2?E||w!==-1?k%2?a(T):[(a(T)[0]+a(T+1)[0])/2,(a(T)[1]+a(T+1)[1])/2]:m[0]:m[m.length-1],m.splice(w+1,c-w+1,A),c=w+1,M&&(z=M),E&&(c===m.length-2?m[M]=m[m.length-1]:0===c&&(m[m.length-1]=m[0]))}if(m.splice(0,z),!(m.length<2))if(E)m.pop(),t.paths.push(m);else{r||l.log("Unclosed interior contour?",t.level,h,m.join("L"));var P=!1;t.edgepaths.forEach(function(e,r){if(!P&&n(e[0],m[m.length-1])){m.pop(),P=!0;var i=!1;t.edgepaths.forEach(function(e,a){!i&&n(e[e.length-1],m[0])&&(i=!0,m.splice(0,1),t.edgepaths.splice(r,1),a===r?t.paths.push(m.concat(e)):t.edgepaths[a]=t.edgepaths[a].concat(m,e))}),i||(t.edgepaths[r]=m.concat(e))}}),t.edgepaths.forEach(function(e,r){!P&&n(e[e.length-1],m[0])&&(m.splice(0,1),t.edgepaths[r]=e.concat(m),P=!0)}),P||t.edgepaths.push(m)}}function o(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:u.BOTTOMSTART.indexOf(t)!==-1?i=1:u.LEFTSTART.indexOf(t)!==-1?n=1:u.TOPSTART.indexOf(t)!==-1?i=-1:n=-1,[n,i]}function s(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0)]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0)]}var l=t("../../lib"),u=t("./constants");e.exports=function(t){var e,r,n,i,o;for(n=0;n<t.length;n++){for(i=t[n],o=0;o<i.starts.length;o++)r=i.starts[o],a(i,r,"edge");for(e=0;Object.keys(i.crossings).length&&e<1e4;)e++,r=Object.keys(i.crossings)[0].split(",").map(Number),a(i,r);1e4===e&&l.log("Infinite loop in contour?")}}},{"../../lib":667,"./constants":827}],831:[function(t,e,r){"use strict";var n=t("../heatmap/hover");e.exports=function(t,e,r,i){return n(t,e,r,i,!0)}},{"../heatmap/hover":846}],832:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.colorbar=t("./colorbar"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="contour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","contour"],n.meta={},e.exports=n},{"../../plots/cartesian":714,"./attributes":824,"./calc":825,"./colorbar":826,"./defaults":828,"./hover":831,"./plot":835,"./style":836}],833:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/colorscale"),a=t("./end_plus");e.exports=function(t){var e,r,o=t.contours,s=o.start,l=a(o),u=o.size||1,c=Math.floor((l-s)/u)+1,h="lines"===o.coloring?0:1,f=t.colorscale,d=f.length,p=new Array(d),m=new Array(d);if("heatmap"===o.coloring){for(t.zauto&&t.autocontour===!1&&(t.zmin=s-u/2,t.zmax=t.zmin+c*u),r=0;r<d;r++)e=f[r],p[r]=e[0]*(t.zmax-t.zmin)+t.zmin,m[r]=e[1];var v=n.extent([t.zmin,t.zmax,o.start,o.start+u*(c-1)]),g=v[t.zmin<t.zmax?0:1],y=v[t.zmin<t.zmax?1:0];g!==t.zmin&&(p.splice(0,0,g),m.splice(0,0,Range[0])),y!==t.zmax&&(p.push(y),m.push(m[m.length-1]))}else for(r=0;r<d;r++)e=f[r],p[r]=(e[0]*(c+h-1)-h/2)*u+s,m[r]=e[1];return i.makeColorScaleFunc({domain:p,range:m},{noNumericCheck:!0})}},{"../../components/colorscale":576,"./end_plus":829,d3:97}],834:[function(t,e,r){"use strict";function n(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){var n=(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4;return t>n?5===r?713:1114:5===r?104:208}return 15===r?0:r}var i=t("./constants");e.exports=function(t){var e,r,a,o,s,l,u,c,h,f=t[0].z,d=f.length,p=f[0].length,m=2===d||2===p;for(r=0;r<d-1;r++)for(o=[],0===r&&(o=o.concat(i.BOTTOMSTART)),r===d-2&&(o=o.concat(i.TOPSTART)),e=0;e<p-1;e++)for(a=o.slice(),0===e&&(a=a.concat(i.LEFTSTART)),e===p-2&&(a=a.concat(i.RIGHTSTART)),s=e+","+r,l=[[f[r][e],f[r][e+1]],[f[r+1][e],f[r+1][e+1]]],h=0;h<t.length;h++)c=t[h],u=n(c.level,l),u&&(c.crossings[s]=u,a.indexOf(u)!==-1&&(c.starts.push([e,r]),m&&a.indexOf(u,a.indexOf(u)+1)!==-1&&c.starts.push([e,r])))}},{"./constants":827}],835:[function(t,e,r){"use strict";function n(t,e,r){var n=r[0].trace,l=r[0].x,h=r[0].y,f=n.contours,d=n.uid,p=e.xaxis,y=e.yaxis,b=t._fullLayout,x="contour"+d,_=i(f,e,r[0]);if(n.visible!==!0)return b._paper.selectAll("."+x+",.hm"+d).remove(),void b._infolayer.selectAll(".cb"+d).remove();"heatmap"===f.coloring?(n.zauto&&n.autocontour===!1&&(n._input.zmin=n.zmin=f.start-f.size/2,n._input.zmax=n.zmax=n.zmin+_.length*f.size),m(t,e,[r])):b._paper.selectAll(".hm"+d).remove(),v(_),g(_);var w=p.c2p(l[0],!0),M=p.c2p(l[l.length-1],!0),A=y.c2p(h[0],!0),k=y.c2p(h[h.length-1],!0),T=[[w,k],[M,k],[M,A],[w,A]],S=a(e,r,x);o(S,T,f),s(S,_,T,f),u(S,_,f),c(S,e,r[0],T)}function i(t,e,r){for(var n=t.size,i=[],a=y(t),o=t.start;o<a;o+=n)if(i.push({level:o,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y,z:r.z,smoothing:r.trace.line.smoothing}),i.length>1e3){d.warn("Too many contours, clipping at 1000",t);break}return i}function a(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function o(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function s(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var a=i.selectAll("path").data("fill"===n.coloring?e:[]);a.enter().append("path"),a.exit().remove(),a.each(function(t){var e=l(t,r);e?f.select(this).attr("d",e).style("stroke","none"):f.select(this).remove()})}function l(t,e){function r(t){return Math.abs(t[1]-e[0][1])<.01}function n(t){return Math.abs(t[1]-e[2][1])<.01}function i(t){return Math.abs(t[0]-e[0][0])<.01}function a(t){return Math.abs(t[0]-e[2][0])<.01}for(var o,s,l,u,c,h,f=Math.min(t.z[0][0],t.z[0][1]),m=t.edgepaths.length||f<=t.level?"":"M"+e.join("L")+"Z",v=0,g=t.edgepaths.map(function(t,e){return e}),y=!0;g.length;){for(h=p.smoothopen(t.edgepaths[v],t.smoothing),m+=y?h:h.replace(/^M/,"L"),g.splice(g.indexOf(v),1),o=t.edgepaths[v][t.edgepaths[v].length-1],u=-1,l=0;l<4;l++){if(!o){d.log("Missing end?",v,t);break}for(r(o)&&!a(o)?s=e[1]:i(o)?s=e[0]:n(o)?s=e[3]:a(o)&&(s=e[2]),c=0;c<t.edgepaths.length;c++){var b=t.edgepaths[c][0];Math.abs(o[0]-s[0])<.01?Math.abs(o[0]-b[0])<.01&&(b[1]-o[1])*(s[1]-b[1])>=0&&(s=b,u=c):Math.abs(o[1]-s[1])<.01?Math.abs(o[1]-b[1])<.01&&(b[0]-o[0])*(s[0]-b[0])>=0&&(s=b,u=c):d.log("endpt to newendpt is not vert. or horz.",o,s,b)}if(o=s,u>=0)break;m+="L"+s}if(u===t.edgepaths.length){d.log("unclosed perimeter path");break}v=u,y=g.indexOf(v)===-1,y&&(v=g[0],m+="Z")}for(v=0;v<t.paths.length;v++)m+=p.smoothclosed(t.paths[v],t.smoothing);return m}function u(t,e,r){var n=e[0].smoothing,i=t.selectAll("g.contourlevel").data(r.showlines===!1?[]:e);i.enter().append("g").classed("contourlevel",!0),i.exit().remove();var a=i.selectAll("path.openline").data(function(t){return t.edgepaths});a.enter().append("path").classed("openline",!0),a.exit().remove(),a.attr("d",function(t){return p.smoothopen(t,n)}).style("stroke-miterlimit",1);var o=i.selectAll("path.closedline").data(function(t){return t.paths});o.enter().append("path").classed("closedline",!0),o.exit().remove(),o.attr("d",function(t){return p.smoothclosed(t,n)}).style("stroke-miterlimit",1)}function c(t,e,r,n){var i="clip"+r.trace.uid,a=e.plot.selectAll("defs").data([0]);a.enter().append("defs");var o=a.selectAll("#"+i).data(r.trace.connectgaps?[]:[0]);if(o.enter().append("clipPath").attr("id",i),o.exit().remove(),r.trace.connectgaps===!1){var s={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y,z:h(r),smoothing:0};v([s]),g([s]);var u=l(s,n),c=o.selectAll("path").data([0]);c.enter().append("path"),c.attr("d",u)}else i=null;t.call(p.setClipUrl,i),e.plot.selectAll(".hm"+r.trace.uid).call(p.setClipUrl,i)}function h(t){var e,r,n=t.trace._emptypoints,i=[],a=t.z.length,o=t.z[0].length,s=[];for(e=0;e<o;e++)s.push(1);for(e=0;e<a;e++)i.push(s.slice());for(e=0;e<n.length;e++)r=n[e],i[r[0]][r[1]]=0;return t.zmask=i,i}var f=t("d3"),d=t("../../lib"),p=t("../../components/drawing"),m=t("../heatmap/plot"),v=t("./make_crossings"),g=t("./find_all_paths"),y=t("./end_plus");e.exports=function(t,e,r){for(var i=0;i<r.length;i++)n(t,e,r[i])}},{"../../components/drawing":585,"../../lib":667,"../heatmap/plot":851,"./end_plus":829,"./find_all_paths":830,"./make_crossings":834,d3:97}],836:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",function(t){return t.trace.opacity}),e.each(function(t){var e=n.select(this),r=t.trace,a=r.contours,s=r.line,l=a.size||1,u=a.start,c=o(r);e.selectAll("g.contourlevel").each(function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,"lines"===a.coloring?c(t.level):s.color,s.dash)});var h;e.selectAll("g.contourfill path").style("fill",function(t){return void 0===h&&(h=t.level),c(t.level+.5*l)}),void 0===h&&(h=u),e.selectAll("g.contourbg path").style("fill",c(h-.5*l))}),a(t)}},{"../../components/drawing":585,"../heatmap/style":852,"./make_color_map":833,d3:97}],837:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i){var a,o=r("contours.coloring");"fill"===o&&(a=r("contours.showlines")),a!==!1&&("lines"!==o&&r("line.color","#000"),r("line.width",.5),r("line.dash")),r("line.smoothing"),"none"!==(e.contours||{}).coloring&&n(t,e,i,r,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":571}],838:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({},{z:{valType:"data_array"},x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:{valType:"data_array"},transpose:{valType:"boolean",dflt:!1},xtype:{valType:"enumerated",values:["array","scaled"]},ytype:{valType:"enumerated",values:["array","scaled"]},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1},connectgaps:{valType:"boolean",dflt:!1},xgap:{valType:"number",dflt:0,min:0},ygap:{valType:"number",dflt:0,min:0}},i,{autocolorscale:o({},i.autocolorscale,{dflt:!1})},{colorbar:a})},{"../../components/colorbar/attributes":563, "../../components/colorscale/attributes":567,"../../lib/extend":659,"../scatter/attributes":911}],839:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),l=t("./has_columns"),u=t("./convert_column_xyz"),c=t("./max_row_length"),h=t("./clean_2d_array"),f=t("./interp2d"),d=t("./find_empties"),p=t("./make_bound_array");e.exports=function(t,e){function r(t){E=e._input.zsmooth=e.zsmooth=!1,i.notifier("cannot fast-zsmooth: "+t)}var m,v,g,y,b,x,_,w,M=a.getFromId(t,e.xaxis||"x"),A=a.getFromId(t,e.yaxis||"y"),k=n.traceIs(e,"contour"),T=n.traceIs(e,"histogram"),S=n.traceIs(e,"gl2d"),E=k?"best":e.zsmooth;if(M._minDtick=0,A._minDtick=0,T){var L=o(t,e);m=L.x,v=L.x0,g=L.dx,y=L.y,b=L.y0,x=L.dy,_=L.z}else l(e)&&u(e,M,A),m=e.x?M.makeCalcdata(e,"x"):[],y=e.y?A.makeCalcdata(e,"y"):[],v=e.x0||0,g=e.dx||1,b=e.y0||0,x=e.dy||1,_=h(e.z,e.transpose),(k||e.connectgaps)&&(e._emptypoints=d(_),e._interpz=f(_,e._emptypoints,e._interpz));if("fast"===E)if("log"===M.type||"log"===A.type)r("log axis found");else if(!T){if(m.length){var C=(m[m.length-1]-m[0])/(m.length-1),D=Math.abs(C/100);for(w=0;w<m.length-1;w++)if(Math.abs(m[w+1]-m[w]-C)>D){r("x scale is not linear");break}}if(y.length&&"fast"===E){var z=(y[y.length-1]-y[0])/(y.length-1),I=Math.abs(z/100);for(w=0;w<y.length-1;w++)if(Math.abs(y[w+1]-y[w]-z)>I){r("y scale is not linear");break}}}var P=c(_),O="scaled"===e.xtype?"":m,R=p(e,O,v,g,P,M),j="scaled"===e.ytype?"":y,F=p(e,j,b,x,_.length,A);S||(a.expand(M,R),a.expand(A,F));var N={x:R,y:F,z:_,text:e.text};if(s(e,_,"","z"),k&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(B,O,v,g,P,M),N.yfill=p(B,j,b,x,_.length,A)}return[N]}},{"../../components/colorscale/calc":568,"../../lib":667,"../../plots/cartesian/axes":706,"../../registry":781,"../histogram2d/calc":867,"./clean_2d_array":840,"./convert_column_xyz":842,"./find_empties":844,"./has_columns":845,"./interp2d":848,"./make_bound_array":849,"./max_row_length":850}],840:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){function r(t){if(n(t))return+t}var i,a,o,s,l,u;if(e){for(i=0,l=0;l<t.length;l++)i=Math.max(i,t[l].length);if(0===i)return!1;o=function(t){return t.length},s=function(t,e,r){return t[r][e]}}else i=t.length,o=function(t,e){return t[e].length},s=function(t,e,r){return t[e][r]};var c=new Array(i);for(l=0;l<i;l++)for(a=o(t,l),c[l]=new Array(a),u=0;u<a;u++)c[l][u]=r(s(t,l,u));return c}},{"fast-isnumeric":106}],841:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,u=r.zmin,c=r.zmax;if(n(u)||(u=i.aggNums(Math.min,null,r.z)),n(c)||(c=i.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+l).remove(),!r.showscale)return void a.autoMargin(t,l);var h=e[0].t.cb=s(t,l),f=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});h.fillcolor(f).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":565,"../../components/colorscale":576,"../../lib":667,"../../plots/plots":766,"fast-isnumeric":106}],842:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a=t.x.slice(),o=t.y.slice(),s=t.z,l=t.text,u=Math.min(a.length,o.length,s.length),c=void 0!==l&&!Array.isArray(l[0]),h=t.xcalendar,f=t.ycalendar;for(u<a.length&&(a=a.slice(0,u)),u<o.length&&(o=o.slice(0,u)),i=0;i<u;i++)a[i]=e.d2c(a[i],0,h),o[i]=r.d2c(o[i],0,f);var d,p,m,v=n.distinctVals(a),g=v.vals,y=n.distinctVals(o),b=y.vals,x=n.init2dArray(b.length,g.length);for(c&&(m=n.init2dArray(b.length,g.length)),i=0;i<u;i++)d=n.findBin(a[i]+v.minDiff/2,g),p=n.findBin(o[i]+y.minDiff/2,b),x[p][d]=s[i],c&&(m[p][d]=l[i]);t.x=g,t.y=b,t.z=x,c&&(t.text=m)}},{"../../lib":667}],843:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./has_columns"),a=t("./xyz_defaults"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}var c=a(t,e,u,l);if(!c)return void(e.visible=!1);u("text");var h=u("zsmooth");h===!1&&(u("xgap"),u("ygap")),u("connectgaps",i(e)&&e.zsmooth!==!1),o(t,e,l,u,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":571,"../../lib":667,"./attributes":838,"./has_columns":845,"./xyz_defaults":853}],844:[function(t,e,r){"use strict";var n=t("./max_row_length");e.exports=function(t){var e,r,i,a,o,s,l,u,c=[],h={},f=[],d=t[0],p=[],m=[0,0,0],v=n(t);for(r=0;r<t.length;r++)for(e=p,p=d,d=t[r+1]||[],i=0;i<v;i++)void 0===p[i]&&(s=(void 0!==p[i-1]?1:0)+(void 0!==p[i+1]?1:0)+(void 0!==e[i]?1:0)+(void 0!==d[i]?1:0),s?(0===r&&s++,0===i&&s++,r===t.length-1&&s++,i===p.length-1&&s++,s<4&&(hr,i=[r,i,s]),c.push([r,i,s])):f.push([r,i]));for(;f.length;){for(l={},u=!1,o=f.length-1;o>=0;o--)a=f[o],r=a[0],i=a[1],s=((hr-1,i||m)[2]+(hr+1,i||m)[2]+(hr,i-1||m)[2]+(hr,i+1||m)[2])/20,s&&(l[a]=[r,i,s],f.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":850}],845:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],846:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/graph_interact"),i=t("../../lib"),a=t("../../plots/cartesian/constants").MAXDIST;e.exports=function(t,e,r,o,s){if(!(t.distance<a)){var l,u,c,h,f=t.cd[0],d=f.trace,p=t.xa,m=t.ya,v=f.x,g=f.y,y=f.z,b=f.zmask,x=v,_=g;if(t.index!==!1){try{c=Math.round(t.index[1]),h=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(c<0||c>=y[0].length||h<0||h>y.length)return}else{if(n.inbox(e-v[0],e-v[v.length-1])>a||n.inbox(r-g[0],r-g[g.length-1])>a)return;if(s){var w;for(x=[2*v[0]-v[1]],w=1;w<v.length;w++)x.push((v[w]+v[w-1])/2);for(x.push([2*v[v.length-1]-v[v.length-2]]),_=[2*g[0]-g[1]],w=1;w<g.length;w++)_.push((g[w]+g[w-1])/2);_.push([2*g[g.length-1]-g[g.length-2]])}c=Math.max(0,Math.min(x.length-2,i.findBin(e,x))),h=Math.max(0,Math.min(_.length-2,i.findBin(r,_)))}var M=p.c2p(v[c]),A=p.c2p(v[c+1]),k=m.c2p(g[h]),T=m.c2p(g[h+1]);s?(A=M,l=v[c],T=k,u=g[h]):(l=(v[c]+v[c+1])/2,u=(g[h]+g[h+1])/2,d.zsmooth&&(M=A=(M+A)/2,k=T=(k+T)/2));var S=y[h][c];b&&!b[h][c]&&(S=void 0);var E;return Array.isArray(f.text)&&Array.isArray(f.text[h])&&(E=f.text[h][c]),[i.extendFlat(t,{index:[h,c],distance:a+10,x0:M,x1:A,y0:k,y1:T,xLabelVal:l,yLabelVal:u,zLabelVal:S,text:E})]}}},{"../../lib":667,"../../plots/cartesian/constants":711,"../../plots/cartesian/graph_interact":713}],847:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="heatmap",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap"],n.meta={},e.exports=n},{"../../plots/cartesian":714,"./attributes":838,"./calc":839,"./colorbar":841,"./defaults":843,"./hover":846,"./plot":851,"./style":852}],848:[function(t,e,r){"use strict";function n(t){return.5-.25*Math.min(1,.5*t)}function i(t,e,r){var n,i,a,o,l,u,c,h,f,d,p,m,v,g=0;for(o=0;o<e.length;o++){for(n=e[o],i=n[0],a=n[1],p=t[i][a],d=0,f=0,l=0;l<4;l++)u=s[l],c=t[i+u[0]],c&&(h=c[a+u[1]],void 0!==h&&(0===d?m=v=h:(m=Math.min(m,h),v=Math.max(v,h)),f++,d+=h));if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][a]=d/f,void 0===p?f<4&&(g=1):(t[i][a]=(1+r)*t[i][a]-r*p,v>m&&(g=Math.max(g,Math.abs(t[i][a]-p)/(v-m))))}return g}var a=t("../../lib"),o=.01,s=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var s,l,u=1;if(Array.isArray(r))for(s=0;s<e.length;s++)l=e[s],t[l[0]][l[1]]=r[l[0]][l[1]];else i(t,e);for(s=0;s<e.length&&!(e[s][2]<4);s++);for(e=e.slice(s),s=0;s<100&&u>o;s++)u=i(t,e,n(u));return u>o&&a.log("interp2d didn't converge quickly",u),t}},{"../../lib":667}],849:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,u,c=[],h=n.traceIs(t,"contour"),f=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d"),p=Array.isArray(e)&&e.length>1;if(p&&!f&&"category"!==o.type){var m=e.length;if(!(m<=a))return h?e.slice(0,a):e.slice(0,a+1);if(h||d)c=e.slice(0,a);else if(1===a)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],u=1;u<m;u++)c.push(.5*(e[u-1]+e[u]));c.push(1.5*e[m-1]-.5*e[m-2])}if(m<a){var v=c[c.length-1],g=v-c[c.length-2];for(u=m;u<a;u++)v+=g,c.push(v)}}else{l=i||1;var y=t[o._id.charAt(0)+"calendar"];for(s=f||"category"===o.type?o.r2c(r,0,y)||0:Array.isArray(e)&&1===e.length?e[0]:void 0===r?0:o.d2c(r,0,y),u=h||d?0:-.5;u<a;u++)c.push(s+l*u)}return c}},{"../../registry":781}],850:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0,r=0;r<t.length;r++)e=Math.max(e,t[r].length);return e}},{}],851:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){var r=e.length-2,n=o.constrain(o.findBin(t,e),0,r),i=e[n],a=e[n+1],s=o.constrain(n+(t-i)/(a-i)-.5,0,r),l=Math.round(s),u=Math.abs(s-l);return s&&s!==r&&u?{bin0:l,frac:u,bin1:Math.round(l+u/(s-l))}:{bin0:l,bin1:l,frac:0}}function c(t,e,r,n,i,a,o,s,l){var u={x0:e,x1:r,y0:n,y1:i},c=2*t.xgap/3,h=2*t.ygap/3,f=t.xgap/3,d=t.ygap/3;return s===l-1&&(u.y1=i-h),a===o-1&&(u.x0=e+c),0===s&&(u.y0=n+h),0===a&&(u.x1=r-c),a>0&&a<o-1&&(u.x0=e+f,u.x1=r-f),s>0&&s<l-1&&(u.y0=n+d,u.y1=i-d),u}function h(t,e){if(void 0!==t){var r=G(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),it+=e,at+=r[0]*e,ot+=r[1]*e,st+=r[2]*e,r}return[0,0,0,0]}function f(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}function d(t,e,r,n){var i=t[r.bin0];if(void 0===i)return h(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],u=o-i||0,c=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,h(i+r.frac*u+n.frac*(c+r.frac*a))}var p=r[0].trace,m=p.uid,v=e.xaxis,g=e.yaxis,y=t._fullLayout,b="hm"+m;if(y._paper.selectAll(".contour"+m).remove(),p.visible!==!0)return y._paper.selectAll("."+b).remove(),void y._infolayer.selectAll(".cb"+m).remove();var x,_,w,M,A,k,T=r[0].z,S=r[0].x,E=r[0].y,L=a.traceIs(p,"contour"),C=L?"best":p.zsmooth,D=T.length,z=u(T),I=!1,P=!1;for(k=0;void 0===x&&k<S.length-1;)x=v.c2p(S[k]),k++;for(k=S.length-1;void 0===_&&k>0;)_=v.c2p(S[k]),k--;for(_<x&&(w=_,_=x,x=w,I=!0),k=0;void 0===M&&k<E.length-1;)M=g.c2p(E[k]),k++;for(k=E.length-1;void 0===A&&k>0;)A=g.c2p(E[k]),k--;if(A<M&&(w=M,M=A,A=w,P=!0),L&&(S=r[0].xfill,E=r[0].yfill),"fast"!==C){var O="best"===C?0:.5;x=Math.max(-O*v._length,x),_=Math.min((1+O)*v._length,_),M=Math.max(-O*g._length,M),A=Math.min((1+O)*g._length,A)}var R=Math.round(_-x),j=Math.round(A-M),F=R<=0||j<=0,N=e.plot.select(".imagelayer").selectAll("g.hm."+b).data(F?[]:[0]);if(N.enter().append("g").classed("hm",!0).classed(b,!0),N.exit().remove(),!F){var B,U;"fast"===C?(B=z,U=D):(B=R,U=j);var V=document.createElement("canvas");V.width=B,V.height=U;var H,q,Y=V.getContext("2d"),G=s.makeColorScaleFunc(s.extractScale(p.colorscale,p.zmin,p.zmax),{noNumericCheck:!0,returnArray:!0});"fast"===C?(H=I?function(t){return z-1-t}:o.identity,q=P?function(t){return D-1-t}:o.identity):(H=function(t){return o.constrain(Math.round(v.c2p(S[t])-x),0,R)},q=function(t){return o.constrain(Math.round(g.c2p(E[t])-M),0,j)});var W,X,Z,J,Q,K,$,tt=q(0),et=[tt,tt],rt=I?0:1,nt=P?0:1,it=0,at=0,ot=0,st=0;if(C){var lt,ut=0;try{lt=new Uint8Array(R*j*4)}catch(t){lt=new Array(R*j*4)}if("best"===C){var ct,ht,ft,dt=new Array(S.length),pt=new Array(E.length),mt=new Array(R);for(k=0;k<S.length;k++)dt[k]=Math.round(v.c2p(S[k])-x);for(k=0;k<E.length;k++)pt[k]=Math.round(g.c2p(E[k])-M);for(k=0;k<R;k++)mt[k]=n(k,dt);for(Z=0;Z<j;Z++)for(ct=n(Z,pt),ht=T[ct.bin0],ft=T[ct.bin1],k=0;k<R;k++,ut+=4)$=d(ht,ft,mt[k],ct),f(lt,ut,$)}else for(Z=0;Z<D;Z++)for(K=T[Z],et=q(Z),k=0;k<R;k++)$=h(K[k],1),ut=4*(et*R+H(k)),f(lt,ut,$);var vt=Y.createImageData(R,j);try{vt.data.set(lt)}catch(t){var gt=vt.data,yt=gt.length;for(Z=0;Z<yt;Z++)gt[Z]=lt[Z]}Y.putImageData(vt,0,0)}else for(Z=0;Z<D;Z++)if(K=T[Z],et.reverse(),et[nt]=q(Z+1),et[0]!==et[1]&&void 0!==et[0]&&void 0!==et[1])for(J=H(0),X=[J,J],k=0;k<z;k++)X.reverse(),X[rt]=H(k+1),X[0]!==X[1]&&void 0!==X[0]&&void 0!==X[1]&&(Q=K[k],$=h(Q,(X[1]-X[0])*(et[1]-et[0])),Y.fillStyle="rgba("+$.join(",")+")",W=c(p,X[0],X[1],et[0],et[1],k,z,Z,D),Y.fillRect(W.x0,W.y0,W.x1-W.x0,W.y1-W.y0));at=Math.round(at/it),ot=Math.round(ot/it),st=Math.round(st/it);var bt=i("rgb("+at+","+ot+","+st+")");t._hmpixcount=(t._hmpixcount||0)+it,t._hmlumcount=(t._hmlumcount||0)+it*bt.getLuminance();var xt=N.selectAll("image").data(r);xt.enter().append("svg:image").attr({xmlns:l.svg,preserveAspectRatio:"none"}),xt.attr({height:j,width:R,x:x,y:M,"xlink:href":V.toDataURL("image/png")}),xt.exit().remove()}}var i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=t("../../components/colorscale"),l=t("../../constants/xmlns_namespaces"),u=t("./max_row_length");e.exports=function(t,e,r){for(var i=0;i<r.length;i++)n(t,e,r[i])}},{"../../components/colorscale":576,"../../constants/xmlns_namespaces":651,"../../lib":667,"../../registry":781,"./max_row_length":850,tinycolor2:498}],852:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t){n.select(t).selectAll(".hm image").style("opacity",function(t){return t.trace.opacity})}},{d3:97}],853:[function(t,e,r){"use strict";function n(t,e){var r=e(t),n=r?e(t+"type","array"):"scaled";return"scaled"===n&&(e(t+"0"),e("d"+t)),r}function i(t){for(var e,r=!0,n=!1,i=!1,o=0;o<t.length;o++){if(e=t[o],!Array.isArray(e)){r=!1;break}e.length>0&&(n=!0);for(var s=0;s<e.length;s++)if(a(e[s])){i=!0;break}}return r&&n&&i}var a=t("fast-isnumeric"),o=t("../../registry"),s=t("./has_columns");e.exports=function(t,e,r,a){var l,u,c=r("z");if(void 0===c||!c.length)return 0;if(s(t)){if(l=r("x"),u=r("y"),!l||!u)return 0}else{if(l=n("x",r),u=n("y",r),!i(c))return 0;r("transpose")}var h=o.getComponentMethod("calendars","handleTraceDefaults");return h(t,e,["x","y"],a),e.z.length}},{"../../registry":781,"./has_columns":845,"fast-isnumeric":106}],854:[function(t,e,r){"use strict";for(var n=t("../heatmap/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../lib/extend").extendFlat,s=["z","x","x0","dx","y","y0","dy","text","transpose","xtype","ytype"],l={},u=0;u<s.length;u++){var c=s[u];l[c]=n[c]}o(l,i,{autocolorscale:o({},i.autocolorscale,{dflt:!1})},{colorbar:a}),e.exports=l},{"../../components/colorbar/attributes":563,"../../components/colorscale/attributes":567,"../../lib/extend":659,"../heatmap/attributes":838}],855:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="heatmapgl",this.name="",this.hoverinfo="all",this.xData=[],this.yData=[],this.zData=[],this.textLabels=[],this.idToIndex=[],this.bounds=[0,0,0,0],this.options={z:[],x:[],y:[],shape:[0,0],colorLevels:[0],colorValues:[0,0,0,1]},this.heatmap=o(t.glplot,this.options),this.heatmap._trace=this}function i(t){for(var e=t.colorscale,r=t.zmin,n=t.zmax,i=e.length,a=new Array(i),o=new Array(4*i),s=0;s<i;s++){var u=e[s],c=l(u[1]);a[s]=r+u[0]*(n-r);for(var h=0;h<4;h++)o[4*s+h]=c[h]}return{colorLevels:a,colorValues:o}}function a(t,e,r){var i=new n(t,e.uid);return i.update(e,r),i}var o=t("gl-heatmap2d"),s=t("../../plots/cartesian/axes"),l=t("../../lib/str2rgbarray"),u=n.prototype;u.handlePick=function(t){var e=this.options,r=e.shape,n=t.pointId,i=n%r[0],a=Math.floor(n/r[0]),o=n;return{trace:this,dataCoord:t.dataCoord,traceCoord:[e.x[i],e.y[a],e.z[o]],textLabel:this.textLabels[n],name:this.name,pointIndex:[i,a],hoverinfo:this.hoverinfo}},u.update=function(t,e){var r=e[0];this.name=t.name,this.hoverinfo=t.hoverinfo;var n=r.z;this.options.z=[].concat.apply([],n);var a=n[0].length,o=n.length;this.options.shape=[a,o],this.options.x=r.x,this.options.y=r.y;var l=i(t);this.options.colorLevels=l.colorLevels,this.options.colorValues=l.colorValues,this.textLabels=[].concat.apply([],t.text),this.heatmap.update(this.options),s.expand(this.scene.xaxis,r.x),s.expand(this.scene.yaxis,r.y)},u.dispose=function(){this.heatmap.dispose()},e.exports=a},{"../../lib/str2rgbarray":685,"../../plots/cartesian/axes":706,"gl-heatmap2d":139}],856:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("../heatmap/defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("../heatmap/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="heatmapgl",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","2dMap"],n.meta={},e.exports=n},{"../../plots/gl2d":742,"../heatmap/calc":839,"../heatmap/colorbar":841,"../heatmap/defaults":843,"./attributes":854,"./convert":855}],857:[function(t,e,r){"use strict";function n(t){return{start:{valType:"any",dflt:null},end:{valType:"any",dflt:null},size:{valType:"any",dflt:null}}}var i=t("../bar/attributes");e.exports={x:{valType:"data_array"},y:{valType:"data_array"},text:i.text,orientation:i.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:""},cumulative:{enabled:{valType:"boolean",dflt:!1},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include"}},autobinx:{valType:"boolean",dflt:null},nbinsx:{valType:"integer",min:0,dflt:0},xbins:n("x"),autobiny:{valType:"boolean",dflt:null},nbinsy:{valType:"integer",min:0,dflt:0},ybins:n("y"),marker:i.marker,error_y:i.error_y,error_x:i.error_x,_deprecated:{bardir:i._deprecated.bardir}}},{"../bar/attributes":791}],858:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.length,n=0,i=0;i<r;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}},{}],859:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){return r("histnorm"),n.forEach(function(t){r(t+"bins.start"),r(t+"bins.end"),r(t+"bins.size"),r("autobin"+t),r("nbins"+t)}),e}},{}],860:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,i){var a=i[e];return n(a)?(a=Number(a),r[t]+=a,a):0},avg:function(t,e,r,i,a){var o=i[e];return n(o)&&(o=Number(o),r[t]+=o,a[t]++),0},min:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]>a){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]<a){var o=a-r[t];return r[t]=a,o}}return 0}}},{"fast-isnumeric":106}],861:[function(t,e,r){"use strict";function n(t,e,r){function n(e){s=t[e],t[e]/=2}function i(e){o=t[e],t[e]=s+o/2,s+=o}var a,o,s;if("half"===r)if("increasing"===e)for(n(0),a=1;a<t.length;a++)i(a);else for(n(t.length-1),a=t.length-2;a>=0;a--)i(a);else if("increasing"===e){for(a=1;a<t.length;a++)t[a]+=t[a-1];"exclude"===r&&(t.unshift(0),t.pop())}else{for(a=t.length-2;a>=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}var i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/cartesian/axes"),s=t("./bin_functions"),l=t("./norm_functions"),u=t("./average"),c=t("./clean_bins");e.exports=function(t,e){if(e.visible===!0){var r,h=[],f=[],d=o.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),p="h"===e.orientation?"y":"x",m={x:"y",y:"x"}[p],v=e[p+"calendar"],g=e.cumulative;c(e,d,p);var y,b=d.makeCalcdata(e,p),x=p+"bins";e["autobin"+p]===!1&&x in e?y=e[x]:(y=o.autoBin(b,d,e["nbins"+p],!1,v),g.enabled&&"include"!==g.currentbin&&("decreasing"===g.direction?y.start=d.c2r(d.r2c(y.start)-y.size):y.end=d.c2r(d.r2c(y.end)+y.size)),e._input[x]=e[x]=y);var _,w,M,A="string"==typeof y.size,k=A?[]:y,T=[],S=[],E=0,L=e.histnorm,C=e.histfunc,D=L.indexOf("density")!==-1;g.enabled&&D&&(L=L.replace(/ ?density$/,""),D=!1);var z,I="max"===C||"min"===C,P=I?null:0,O=s.count,R=l[L],j=!1,F=function(t){return d.r2c(t,0,v)};for(Array.isArray(e[m])&&"count"!==C&&(z=e[m],j="avg"===C,O=s[C]),r=F(y.start),w=F(y.end)+(r-o.tickIncrement(r,y.size,!1,v))/1e6;r<w&&h.length<5e3;)_=o.tickIncrement(r,y.size,!1,v),h.push((r+_)/2),f.push(P),A&&k.push(r),D&&T.push(1/(_-r)),j&&S.push(0),r=_;A||"date"!==d.type||(k={start:F(k.start),end:F(k.end),size:k.size});var N=f.length;for(r=0;r<b.length;r++)M=a.findBin(b[r],k),M>=0&&M<N&&(E+=O(M,r,f,z,S));j&&(E=u(f,S)),R&&R(f,E,T),g.enabled&&n(f,g.direction,g.currentbin);var B=Math.min(h.length,f.length),U=[],V=0,H=B-1;for(r=0;r<B;r++)if(f[r]){V=r;break}for(r=B-1;r>V;r--)if(f[r]){H=r;break}for(r=V;r<=H;r++)i(h[r])&&i(f[r])&&U.push({p:h[r],s:f[r],b:0});return U}}},{"../../lib":667,"../../plots/cartesian/axes":706,"./average":858,"./bin_functions":860,"./clean_bins":862,"./norm_functions":865,"fast-isnumeric":106}],862:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",u=t[l];u||(u=t[l]={});var c="date"===a?function(t){return t||0===t?i(t,s,u.calendar):null}:function(t){return n(t)?Number(t):null};u.start=c(u.start),u.end=c(u.end);var h="date"===a?o:1,f=u.size;if(n(f))u.size=f>0?Number(f):h;else if("string"!=typeof f)u.size=h;else{var d=f.charAt(0),p=f.substr(1);p=n(p)?Number(p):0,(p<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(u.size=h)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((u.start||0===u.start)&&(u.end||0===u.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":649,"../../lib":667,"fast-isnumeric":106}],863:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function h(r,n){return i.coerce(t,e,u,r,n)}var f=h("x"),d=h("y"),p=h("cumulative.enabled");p&&(h("cumulative.direction"),h("cumulative.currentbin")),h("text");var m=h("orientation",d&&!f?"h":"v"),v=e["v"===m?"x":"y"];if(!v||!v.length)return void(e.visible=!1);var g=n.getComponentMethod("calendars","handleTraceDefaults");g(t,e,["x","y"],c);var y=e["h"===m?"x":"y"];y&&h("histfunc");var b="h"===m?["y"]:["x"];o(t,e,h,b),s(t,e,h,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":562,"../../components/errorbars/defaults":590,"../../lib":667,"../../registry":781,"../bar/style_defaults":802,"./attributes":857,"./bin_defaults":859}],864:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("../bar/hover"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":714,"../bar/hover":794,"../bar/layout_attributes":796,"../bar/layout_defaults":797,"../bar/plot":798,"../bar/set_positions":799,"../bar/style":801,"../scatter/colorbar":914,"./attributes":857,"./calc":861,"./defaults":863}],865:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;i<r;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;n<r;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;a<i;a++)t[a]*=r[a]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;a<i;a++)t[a]*=r[a]/e}}},{}],866:[function(t,e,r){"use strict";var n=t("../histogram/attributes"),i=t("../heatmap/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({},{x:n.x,y:n.y,z:{valType:"data_array"},marker:{color:{valType:"data_array"}},histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth},a,{autocolorscale:s({},a.autocolorscale,{dflt:!1})},{colorbar:o})},{"../../components/colorbar/attributes":563,"../../components/colorscale/attributes":567,"../../lib/extend":659,"../heatmap/attributes":838,"../histogram/attributes":857}],867:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../histogram/bin_functions"),o=t("../histogram/norm_functions"),s=t("../histogram/average"),l=t("../histogram/clean_bins");e.exports=function(t,e){var r,u,c,h,f,d,p=i.getFromId(t,e.xaxis||"x"),m=e.x?p.makeCalcdata(e,"x"):[],v=i.getFromId(t,e.yaxis||"y"),g=e.y?v.makeCalcdata(e,"y"):[],y=e.xcalendar,b=e.ycalendar,x=function(t){return p.r2c(t,0,y)},_=function(t){return v.r2c(t,0,b)},w=function(t){return p.c2r(t,0,y)},M=function(t){return v.c2r(t,0,b)};l(e,p,"x"),l(e,v,"y");var A=Math.min(m.length,g.length);m.length>A&&m.splice(A,m.length-A),g.length>A&&g.splice(A,g.length-A),!e.autobinx&&"xbins"in e||(e.xbins=i.autoBin(m,p,e.nbinsx,"2d",y),"histogram2dcontour"===e.type&&(e.xbins.start=w(i.tickIncrement(x(e.xbins.start),e.xbins.size,!0,y)),e.xbins.end=w(i.tickIncrement(x(e.xbins.end),e.xbins.size,!1,y))),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=i.autoBin(g,v,e.nbinsy,"2d",b),"histogram2dcontour"===e.type&&(e.ybins.start=M(i.tickIncrement(_(e.ybins.start),e.ybins.size,!0,b)),e.ybins.end=M(i.tickIncrement(_(e.ybins.end),e.ybins.size,!1,b))),e._input.ybins=e.ybins),f=[];var k,T,S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,D=L?[]:e.xbins,z=C?[]:e.ybins,I=0,P=[],O=e.histnorm,R=e.histfunc,j=O.indexOf("density")!==-1,F="max"===R||"min"===R,N=F?null:0,B=a.count,U=o[O],V=!1,H=[],q=[],Y="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Y&&"count"!==R&&(V="avg"===R,B=a[R]);var G=e.xbins,W=x(G.start),X=x(G.end)+(W-i.tickIncrement(W,G.size,!1,y))/1e6;for(d=W;d<X;d=i.tickIncrement(d,G.size,!1,y))S.push(N),L&&D.push(d),V&&E.push(0);L&&D.push(d);var Z=S.length;r=e.xbins.start;var J=x(r);for(u=(d-J)/Z,r=w(J+u/2),G=e.ybins,W=_(G.start),X=_(G.end)+(W-i.tickIncrement(W,G.size,!1,b))/1e6,d=W;d<X;d=i.tickIncrement(d,G.size,!1,b))f.push(S.concat()),C&&z.push(d),V&&P.push(E.concat());C&&z.push(d);var Q=f.length;c=e.ybins.start;var K=_(c);for(h=(d-K)/Q,c=M(K+h/2),j&&(H=S.map(function(t,e){return L?1/(D[e+1]-D[e]):1/u}),q=f.map(function(t,e){return C?1/(z[e+1]-z[e]):1/h})),L||"date"!==p.type||(D={start:x(D.start),end:x(D.end),size:D.size}),C||"date"!==v.type||(z={start:_(z.start),end:_(z.end),size:z.size}),d=0;d<A;d++)k=n.findBin(m[d],D),T=n.findBin(g[d],z),k>=0&&k<Z&&T>=0&&T<Q&&(I+=B(k,d,f[T],Y,P[T]));if(V)for(T=0;T<Q;T++)I+=s(f[T],P[T]);if(U)for(T=0;T<Q;T++)U(f[T],I,H,q[T]);return{x:m,x0:r,dx:u,y:g,y0:c,dy:h,z:f}}},{"../../lib":667,"../../plots/cartesian/axes":706,"../histogram/average":858,"../histogram/bin_functions":860,"../histogram/clean_bins":862,"../histogram/norm_functions":865}],868:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./sample_defaults"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,l,s);var u=l("zsmooth");u===!1&&(l("xgap"),l("ygap")),a(t,e,s,l,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":571,"../../lib":667,"./attributes":866,"./sample_defaults":870}],869:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../heatmap/calc"),n.plot=t("../heatmap/plot"),n.colorbar=t("../heatmap/colorbar"),n.style=t("../heatmap/style"),n.hoverPoints=t("../heatmap/hover"),n.moduleType="trace",n.name="histogram2d",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":714,"../heatmap/calc":839,"../heatmap/colorbar":841,"../heatmap/hover":846,"../heatmap/plot":851,"../heatmap/style":852,"./attributes":866,"./defaults":868}],870:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../histogram/bin_defaults");e.exports=function(t,e,r,a){var o=r("x"),s=r("y");if(!(o&&o.length&&s&&s.length))return void(e.visible=!1);var l=n.getComponentMethod("calendars","handleTraceDefaults");l(t,e,["x","y"],a);var u=r("z")||r("marker.color");u&&r("histfunc");var c=["x","y"];i(t,e,r,c)}},{"../../registry":781,"../histogram/bin_defaults":859}],871:[function(t,e,r){"use strict";var n=t("../histogram2d/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({},{x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:i.line},a,{colorbar:o})},{"../../components/colorbar/attributes":563,"../../components/colorscale/attributes":567,"../../lib/extend":659,"../contour/attributes":824,"../histogram2d/attributes":866}],872:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../histogram2d/sample_defaults"),a=t("../contour/style_defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,l,s);var u=n.coerce2(t,e,o,"contours.start"),c=n.coerce2(t,e,o,"contours.end"),h=l("autocontour",!(u&&c));l(h?"ncontours":"contours.size"),a(t,e,l,s)}},{"../../lib":667,"../contour/style_defaults":837,"../histogram2d/sample_defaults":870,"./attributes":871}],873:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../contour/calc"),n.plot=t("../contour/plot"),n.style=t("../contour/style"),n.colorbar=t("../contour/colorbar"),n.hoverPoints=t("../contour/hover"),n.moduleType="trace",n.name="histogram2dcontour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","contour","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":714,"../contour/calc":825,"../contour/colorbar":826,"../contour/hover":831,"../contour/plot":835,"../contour/style":836,"./attributes":871,"./defaults":872}],874:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../components/colorbar/attributes"),a=t("../surface/attributes"),o=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:o({},a.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:o({},a.contours.x.show,{}),color:o({},a.contours.x.color),width:o({},a.contours.x.width)},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,colorbar:i,lightposition:{x:o({},a.lightposition.x,{dflt:1e5}),y:o({},a.lightposition.y,{dflt:1e5}),z:o({},a.lightposition.z,{dflt:0})},lighting:o({},{vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6}},a.lighting)}},{"../../components/colorbar/attributes":563,"../../components/colorscale/attributes":567,"../../lib/extend":659,"../surface/attributes":967}],875:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){ var e=t[0],r=u(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function a(t){return t.map(d)}function o(t,e,r){for(var n=new Array(t.length),i=0;i<t.length;++i)n[i]=[t[i],e[i],r[i]];return n}function s(t,e){var r=t.glplot.gl,i=l({gl:r}),a=new n(t,i,e.uid);return a.update(e),t.glplot.add(i),a}var l=t("gl-mesh3d"),u=t("tinycolor2"),c=t("delaunay-triangulate"),h=t("alpha-shape"),f=t("convex-hull"),d=t("../../lib/str2rgbarray"),p=n.prototype;p.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},p.update=function(t){function e(t,e,r,n){return e.map(function(e){return t.d2l(e,0,n)*r})}var r=this.scene,n=r.fullSceneLayout;this.data=t;var s,l=o(e(n.xaxis,t.x,r.dataScale[0],t.xcalendar),e(n.yaxis,t.y,r.dataScale[1],t.ycalendar),e(n.zaxis,t.z,r.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k)s=o(t.i,t.j,t.k);else if(0===t.alphahull)s=f(l);else if(t.alphahull>0)s=h(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolors[0],p.vertexColors=a(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=a(t.facecolor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":685,"alpha-shape":35,"convex-hull":86,"delaunay-triangulate":98,"gl-mesh3d":178,tinycolor2:498}],876:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorbar/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function u(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u(["x","y","z"]),h=u(["i","j","k"]);if(!c)return void(e.visible=!1);h&&h.forEach(function(t){for(var e=0;e<t.length;++e)t[e]|=0});var f=n.getComponentMethod("calendars","handleTraceDefaults");f(t,e,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","contour.show","contour.color","contour.width","colorscale","reversescale","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(t){l(t)}),"intensity"in t?(l("intensity"),l("showscale",!0)):(e.showscale=!1,"vertexcolor"in t?l("vertexcolor"):"facecolor"in t?l("facecolor"):l("color",r)),e.reversescale&&(e.colorscale=e.colorscale.map(function(t){return[1-t[0],t[1]]}).reverse()),e.showscale&&a(t,e,s)}},{"../../components/colorbar/defaults":564,"../../lib":667,"../../registry":781,"./attributes":874}],877:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.plot=t("./convert"),n.moduleType="trace",n.name="mesh3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d"],n.meta={},e.exports=n},{"../../plots/gl3d":745,"../heatmap/colorbar":841,"./attributes":874,"./convert":875,"./defaults":876}],878:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/attributes"),a="#3D9970",o="#FF4136",s=i.line,l={name:{valType:"string"},showlegend:{valType:"boolean",dflt:!0},line:{color:n.extendFlat({},s.color),width:n.extendFlat({},s.width),dash:n.extendFlat({},s.dash)}};e.exports={x:{valType:"data_array"},open:{valType:"data_array",dflt:[]},high:{valType:"data_array",dflt:[]},low:{valType:"data_array",dflt:[]},close:{valType:"data_array",dflt:[]},line:{width:n.extendFlat({},s.width,{}),dash:n.extendFlat({},s.dash,{})},increasing:n.extendDeep({},l,{line:{color:{dflt:a}}}),decreasing:n.extendDeep({},l,{line:{color:{dflt:o}}}),text:{valType:"string",dflt:"",arrayOk:!0},tickwidth:{valType:"number",min:0,max:.5,dflt:.3}}},{"../../lib":667,"../scatter/attributes":911}],879:[function(t,e,r){"use strict";function n(t,e,r,n){o(t,e,r,n),r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".line.dash",e.line.dash)}var i=t("../../lib"),a=t("./ohlc_defaults"),o=t("./direction_defaults"),s=t("./attributes"),l=t("./helpers");e.exports=function(t,e,r,o){function u(r,n){return i.coerce(t,e,s,r,n)}l.pushDummyTransformOpts(t,e);var c=a(t,e,u,o);return 0===c?void(e.visible=!1):(u("line.width"),u("line.dash"),n(t,e,u,"increasing"),n(t,e,u,"decreasing"),u("text"),void u("tickwidth"))}},{"../../lib":667,"./attributes":878,"./direction_defaults":880,"./helpers":881,"./ohlc_defaults":883}],880:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){r(n+".showlegend"),t.showlegend===!1&&(e[n].showlegend=!1);var i=e.name+" - "+n;r(n+".name",i)}},{}],881:[function(t,e,r){"use strict";var n=t("../../lib");r.pushDummyTransformOpts=function(t,e){var r={type:e.type,_ephemeral:!0};Array.isArray(t.transforms)?t.transforms.push(r):t.transforms=[r]},r.clearEphemeralTransformOpts=function(t){var e=t.transforms;if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]._ephemeral&&e.splice(r,1);0===e.length&&delete t.transforms}},r.copyOHLC=function(t,e){t.open&&(e.open=t.open),t.high&&(e.high=t.high),t.low&&(e.low=t.low),t.close&&(e.close=t.close)},r.makeTransform=function(t,e,r){var i=n.extendFlat([],t.transforms);return i[e.transformIndex]={type:t.type,direction:r,open:t.open,high:t.high,low:t.low,close:t.close},i},r.getFilterFn=function(t){switch(t){case"increasing":return function(t,e){return t<=e};case"decreasing":return function(t,e){return t>e}}},r.addRangeSlider=function(t,e){for(var r=!1,n=0;n<t.length;n++)if(t[n].visible===!0){r=!0;break}r&&(e.xaxis||(e.xaxis={}),e.xaxis.rangeslider||(e.xaxis.rangeslider={}))}},{"../../lib":667}],882:[function(t,e,r){"use strict";var n=t("../../plot_api/register");e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults")},n(t("../scatter")),n(t("./transform"))},{"../../plot_api/register":696,"../../plots/cartesian":714,"../scatter":921,"./attributes":878,"./defaults":879,"./transform":884}],883:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i){var a,o=r("x"),s=r("open"),l=r("high"),u=r("low"),c=r("close"),h=n.getComponentMethod("calendars","handleTraceDefaults");return h(t,e,["x"],i),a=Math.min(s.length,l.length,u.length,c.length),o&&(a=Math.min(a,o.length),a<o.length&&(e.x=o.slice(0,a))),a<s.length&&(e.open=s.slice(0,a)),a<l.length&&(e.high=l.slice(0,a)),a<u.length&&(e.low=u.slice(0,a)),a<c.length&&(e.close=c.slice(0,a)),a}},{"../../registry":781}],884:[function(t,e,r){"use strict";function n(t,e,r){var n={type:"scatter",mode:"lines",connectgaps:!1,visible:t.visible,opacity:t.opacity,xaxis:t.xaxis,yaxis:t.yaxis,hoverinfo:i(t),transforms:s.makeTransform(t,e,r)},a=t[r];return a&&o.extendFlat(n,{x:t.x||[0],xcalendar:t.xcalendar,y:[].concat(t.low).concat(t.high),text:t.text,name:a.name,showlegend:a.showlegend,line:a.line}),n}function i(t){var e=t.hoverinfo;if("all"===e)return"x+text+name";var r=e.split("+"),n=r.indexOf("y"),i=r.indexOf("text");return n!==-1&&(r.splice(n,1),i===-1&&r.push("text")),r.join("+")}function a(t,e,r){var n=r._fullInput,i=n.tickwidth,a=n._minDiff;if(!a){var s=t._fullData,l=[];a=1/0;var u;for(u=0;u<s.length;u++){var c=s[u]._fullInput;if("ohlc"===c.type&&c.visible===!0&&c.xaxis===e._id&&(l.push(c),c.x&&c.x.length>1)){var h=o.simpleMap(c.x,e.d2c,0,r.xcalendar),f=o.distinctVals(h).minDiff;a=Math.min(a,f)}}for(a===1/0&&(a=1),u=0;u<l.length;u++)l[u]._minDiff=a}return a*i}var o=t("../../lib"),s=t("./helpers"),l=t("../../plots/cartesian/axes"),u=t("../../plots/cartesian/axis_ids");r.moduleType="transform",r.name="ohlc",r.attributes={},r.supplyDefaults=function(t,e,r,n){return s.clearEphemeralTransformOpts(n),s.copyOHLC(t,e),t},r.transform=function(t,e){for(var r=[],i=0;i<t.length;i++){var a=t[i];"ohlc"===a.type?r.push(n(a,e,"increasing"),n(a,e,"decreasing")):r.push(a)}return s.addRangeSlider(r,e.layout),r},r.calcTransform=function(t,e,r){var n,i=r.direction,o=s.getFilterFn(i),c=u.getFromTrace(t,e,"x"),h=u.getFromTrace(t,e,"y"),f=a(t,c,e),d=e.open,p=e.high,m=e.low,v=e.close,g=e.text,y=d.length,b=[],x=[],_=[];n=e._fullInput.x?function(t){var r=e.x[t],n=e.xcalendar,i=c.d2c(r,0,n);b.push(c.c2d(i-f,0,n),r,r,r,r,c.c2d(i+f,0,n),null)}:function(t){b.push(t-f,t,t,t,t,t+f,null)};for(var w=function(t,e,r,n){x.push(t,t,e,r,n,n,null)},M=function(t,e){return l.tickText(t,t.c2l(e),"hover").text},A=e._fullInput.hoverinfo,k=A.split("+"),T="all"===A,S=T||k.indexOf("y")!==-1,E=T||k.indexOf("text")!==-1,L=Array.isArray(g)?function(t){return g[t]||""}:function(){return g},C=function(t,e,r,n,i){var a=[];S&&(a.push("Open: "+M(h,e)),a.push("High: "+M(h,r)),a.push("Low: "+M(h,n)),a.push("Close: "+M(h,i))),E&&a.push(L(t));var o=a.join("
");_.push(o,o,o,o,o,o,null)},D=0;D<y;D++)o(d[D],v[D])&&(n(D),w(d[D],p[D],m[D],v[D]),C(D,d[D],p[D],m[D],v[D]));e.x=b,e.y=x,e.text=_}},{"../../lib":667,"../../plots/cartesian/axes":706,"../../plots/cartesian/axis_ids":709,"./helpers":881}],885:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/colorbar/attributes"),a=t("../../components/colorscale/scales"),o=t("../../plots/cartesian/layout_attributes"),s=t("../../lib/extend").extendDeep,l=t("../../lib/extend").extendFlat;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},dimensions:{_isLinkedToArray:"dimension",label:{valType:"string"},tickvals:o.tickvals,ticktext:o.ticktext,tickformat:{valType:"string",dflt:"3s"},visible:{valType:"boolean",dflt:!0},range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},constraintrange:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},values:{valType:"data_array",dflt:[]}},line:l({},s({},n("line"),{colorscale:s({},n("line").colorscale,{dflt:a.Viridis}),autocolorscale:s({},n("line").autocolorscale,{dflt:!1})}),{showscale:{valType:"boolean",dflt:!1},colorbar:i})}},{"../../components/colorbar/attributes":563,"../../components/colorscale/color_attributes":569,"../../components/colorscale/scales":580,"../../lib/extend":659,"../../plots/cartesian/layout_attributes":715}],886:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("./plot"),o=t("../../constants/xmlns_namespaces"),s=t("./constants");r.name="parcoords",r.attr="type",r.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"parcoords","parcoords");e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){function e(e){var n=this,i=n.toDataURL("image/png"),a=r.append("svg:image"),l=t._fullLayout._size,u=t._fullData[e.model.key].domain;a.attr({xmlns:o.svg,"xlink:href":i,x:l.l+l.w*u.x[0]-s.overdrag,y:l.t+l.h*(1-u.y[1]),width:(u.x[1]-u.x[0])*l.w+2*s.overdrag,height:(u.y[1]-u.y[0])*l.h,preserveAspectRatio:"none"})}var r=t._fullLayout._glimages,i=n.selectAll(".svg-container"),a=i.filter(function(t,e){return e===i.size()-1}).selectAll(".parcoords-lines.context, .parcoords-lines.focus");r.selectAll("*").remove(),a.each(e),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":651,"../../plots/plots":766,"./constants":889,"./plot":894,d3:97}],887:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("../../lib");e.exports=function(t,e){var r=!!e.line.colorscale&&a.isArray(e.line.color),o=r?e.line.color:Array.apply(0,Array(e.dimensions.reduce(function(t,e){return Math.max(t,e.values.length)},0))).map(function(){return.5}),s=r?e.line.colorscale:[[0,e.line.color],[1,e.line.color]];return e.line.color=o,e.line.colorscale=s,n(e,"line")&&i(e,e.line.color,"line","c"),[{}]}},{"../../components/colorscale/calc":568,"../../components/colorscale/has_colorscale":575,"../../lib":667}],888:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.line,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":565,"../../components/colorscale":576,"../../lib":667,"../../plots/plots":766,"fast-isnumeric":106}],889:[function(t,e,r){"use strict";e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,scatter:!1,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,capturewidth:10,fillcolor:"magenta",fillopacity:1,strokecolor:"white",strokeopacity:1,strokewidth:1,handleheight:16,handleopacity:1,handleoverlap:0}}},{}],890:[function(t,e,r){"use strict";function n(t,e,r,n,i){i("line.color",r),i("line.colorscale"),s(t,"line")?l(t,e,n,i,{prefix:"line.",cLetter:"c"}):i("line.color",r)}function i(t,e){function r(t,e){return a.coerce(n,i,o.dimensions,t,e)}var n,i,s,l=t.dimensions||[],c=e.dimensions=[],h=1/0;for(l.length>u&&(a.log("parcoords traces support up to "+u+" dimensions at the moment"),l.splice(u)),s=0;s<l.length;s++)if(n=l[s],i={},a.isPlainObject(n)){var f=r("values"),d=r("visible",f.length>0);d&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),h=Math.min(h,i.values.length)),i._index=s,c.push(i)}if(isFinite(h))for(s=0;s<c.length;s++)i=c[s],i.visible&&i.values.length>h&&(i.values=i.values.slice(0,h));return c}var a=t("../../lib"),o=t("./attributes"),s=t("../../components/colorscale/has_colorscale"),l=t("../../components/colorscale/defaults"),u=t("./constants").maxDimensionCount;e.exports=function(t,e,r,s){function l(r,n){return a.coerce(t,e,o,r,n)}var u=i(t,e);n(t,e,r,s,l),l("domain.x"),l("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1)}},{"../../components/colorscale/defaults":571,"../../components/colorscale/has_colorscale":575,"../../lib":667,"./attributes":885,"./constants":889}],891:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl"],n.meta={},e.exports=n},{"./attributes":885,"./base_plot":886,"./calc":887,"./colorbar":888,"./defaults":890,"./plot":894}],892:[function(t,e,r){"use strict";function n(t){t.read({x:0,y:0,width:1,height:1,data:M})}function i(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function a(t,e,r,a,o,s){function l(n){var c;c=Math.min(a,o-n*a),s.offset=x*n*a,s.count=x*c,0===n&&(window.cancelAnimationFrame(r.currentRafs[u]),delete r.currentRafs[u],i(t,s.scissorX,s.scissorY,s.scissorWidth,s.viewBoxSize[1])),r.clearOnly||(e(s),(n+1)*a+c<o&&(r.currentRafs[u]=window.requestAnimationFrame(function(){l(n+1)})),r.drawCompleted=!1)}var u=s.key;r.drawCompleted||(n(t),r.drawCompleted=!0),l(0)}function o(t){return Math.max(y,Math.min(1-y,t))}function s(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?w:a).concat(r))}return n}function l(t,e){return(t>>>8*e)%256/255}function u(t,e,r,n){for(var i=[],a=0;a<t;a++)for(var s=0;s<b;s++)i.push(s<e?r[s].paddedUnitValues[a]:s===b-1?o(n[a]):s>=b-4?l(a,b-2-s):.5);return i}function c(t,e,r){var n,i,a,o=[];for(i=0;i<t;i++)for(a=0;a<x;a++)for(n=0;n<_;n++)o.push(e[i*b+r*_+n]),r*_+n===b-1&&a%2===0&&(o[o.length-1]*=-1);return o}function h(t,e){var r=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],n=r.map(function(r){return c(t,e,r)}),i={};return n.forEach(function(t,e){i["p"+e.toString(16)]=t}),i}function f(t,e,r){return t+e<=r}var d=t("regl"),p=t("./constants").verticalPadding,m="precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n \n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // visible coloring\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n",v="precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n \n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // pick coloring\n fragColor = vec4(pf.rgb, 1.0);\n}\n",g="precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n",y=1e-6,b=64,x=2,_=4,w=[119,119,119],M=new Uint8Array(4),A=new Uint8Array(4);e.exports=function(t,e,r,n,i,o,l,c,y,b){function x(t){N[0]=t[0],N[1]=t[1]}function _(t,e,i,a,o,s,l,u,h,d,m){var v,g,y,b,x=[t,e],_=p/s,w=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})}),M=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})});for(v=0;v<2;v++)for(b=x[v],g=0;g<4;g++)for(y=0;y<16;y++){var A=y+16*g;w[v][g][y]=y+16*g===b?1:0,M[v][g][y]=(!c&&f(y,16*g,I)?T[0===A?0:1+(A-1)%(T.length-1)].filter[v]:v)+(2*v-1)*_}return{key:l,resolution:[r,n],viewBoxPosition:[i+z,a],viewBoxSize:[o,s],i:t,ii:e,dim1A:w[0][0],dim1B:w[0][1],dim1C:w[0][2],dim1D:w[0][3],dim2A:w[1][0],dim2B:w[1][1],dim2C:w[1][2],dim2D:w[1][3],loA:M[0][0],loB:M[0][1],loC:M[0][2],loD:M[0][3],hiA:M[1][0],hiB:M[1][1],hiC:M[1][2],hiD:M[1][3],colorClamp:N,scatter:u||0,scissorX:h===d?0:i+z,scissorWidth:(h===m?r-i+z:o+.5)+(h===d?i+z:0),scissorY:a,scissorHeight:s}}function w(t,r,n){var i,o,s,l=1/0,u=-(1/0);for(i=0;i<I;i++)t[i].dim2.canvasX>u&&(u=t[i].dim2.canvasX,s=i),t[i].dim1.canvasX<l&&(l=t[i].dim1.canvasX,o=i);for(i=0;i<I;i++){var c=t[i],h=c.dim1,f=h.crossfilterDimensionIndex,d=c.canvasX,p=c.canvasY,m=c.dim2,v=m.crossfilterDimensionIndex,g=c.panelSizeX,y=c.panelSizeY,x=d+g;if(r||!B[f]||B[f][0]!==d||B[f][1]!==x){B[f]=[d,x];var w=_(f,v,d,p,g,y,h.crossfilterDimensionIndex,b||h.scatter?1:0,i,o,s);k.clearOnly=n,a(R,F,k,r?e.blockLineCount:E,E,w)}}}function M(t,e){return R.read({x:t,y:e,width:1,height:1,data:A}),A}var k={currentRafs:{},drawCompleted:!0,clearOnly:!1},T=i.slice(),S=T.length,E=T[0]?T[0].values.length:0,L=c,C=y?e.color.map(function(t,r){return r/e.color.length}):e.color,D=Math.max(1/255,Math.pow(1/C.length,1/3)),z=e.canvasOverdrag,I=o.length,P=u(E,S,T,C),O=h(E,P),R=d({canvas:t,attributes:{preserveDrawingBuffer:!0,antialias:!y}}),j=R.texture({shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest",data:s(l,c,Math.round(255*(c?D:1)))}),F=R({profile:!1,blend:{enable:L,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!L,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:R.prop("scissorX"),y:R.prop("scissorY"),width:R.prop("scissorWidth"),height:R.prop("scissorHeight")}},dither:!1,vert:y?v:m,frag:g,primitive:"lines",lineWidth:1,attributes:O,uniforms:{resolution:R.prop("resolution"),viewBoxPosition:R.prop("viewBoxPosition"),viewBoxSize:R.prop("viewBoxSize"),dim1A:R.prop("dim1A"),dim2A:R.prop("dim2A"),dim1B:R.prop("dim1B"),dim2B:R.prop("dim2B"),dim1C:R.prop("dim1C"),dim2C:R.prop("dim2C"),dim1D:R.prop("dim1D"),dim2D:R.prop("dim2D"),loA:R.prop("loA"),hiA:R.prop("hiA"),loB:R.prop("loB"),hiB:R.prop("hiB"),loC:R.prop("loC"),hiC:R.prop("hiC"),loD:R.prop("loD"),hiD:R.prop("hiD"),palette:j,colorClamp:R.prop("colorClamp"),scatter:R.prop("scatter")},offset:R.prop("offset"),count:R.prop("count")}),N=[0,1],B=[];return{setColorDomain:x,render:w,readPixel:M,destroy:R.destroy}}},{"./constants":889,regl:465}],893:[function(t,e,r){"use strict";function n(t){return t.key}function i(t){return[t]}function a(t){return!("visible"in t)||t.visible}function o(t){var e=t.range?t.range[0]:_.min(t.values),r=t.range?t.range[1]:_.max(t.values);return!isNaN(e)&&isFinite(e)||(e=0),!isNaN(r)&&isFinite(r)||(r=0),e===r&&(void 0===e?(e=0,r=1):0===e?(e-=1,r+=1):(e*=.9,r*=1.1)),[e,r]}function s(t,e){var r,n,i,a,o;for(r=0,n=t.range(),i=1/0,a=n[0],o;r<n.length;r++){if((o=Math.abs(n[r]-e))>i)return a;i=o,a=n[r]}return n[n.length-1]}function l(t,e,r){var n=o(r);return r.tickvals?_.scale.ordinal().domain(r.tickvals).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):_.scale.linear().domain(n).range([t-e,e])}function u(t,e){return _.scale.linear().range([t-e,e])}function c(t){return _.scale.linear().domain(o(t))}function h(t){var e=o(t);return t.tickvals&&_.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}function f(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}),n=r.map(function(t){return _.rgb(t)}),i=function(t){return function(e){return e[t]}},a="rgb".split("").map(function(t){return _.scale.linear().clamp(!0).domain(e).range(n.map(i(t)))});return function(t){return a.map(function(e){return e(t)})}}function d(t){return t[0]}function p(t,e,r){var n=d(e).trace,i=n.line,o=n.domain,s=n.dimensions,l=t.width,u=x.extendDeep({},i,{color:i.color.map(c({values:i.color,range:[i.cmin,i.cmax]})),blockLineCount:b.blockLineCount,canvasOverdrag:b.overdrag*b.canvasPixelRatio}),h=l*(o.x[1]-o.x[0]),p=t.height*(o.y[1]-o.y[0]),m=t.margin||{l:80,r:80,t:100,b:80},v=h,g=p;return{key:r,colCount:s.filter(a).length,dimensions:s,tickDistance:b.tickDistance,unitToColor:f(i.colorscale),lines:u,translateX:o.x[0]*l,translateY:t.height-o.y[1]*t.height,pad:m,canvasWidth:v*b.canvasPixelRatio+2*u.canvasOverdrag,canvasHeight:g*b.canvasPixelRatio,width:v,height:g,canvasPixelRatio:b.canvasPixelRatio}}function m(t){var e=t.width,r=t.height,n=t.dimensions,i=t.canvasPixelRatio,o=function(r){return e*r/Math.max(1,t.colCount-1)},s=b.verticalPadding/(r*i),f=1-2*s,d=function(t){return s+f*t},p={key:t.key,xScale:o,model:t},m={};return p.dimensions=n.filter(a).map(function(e,n){var a=c(e),s=m[e.label];m[e.label]=(s?0:s)+1;var f=e.label+(s?"__"+s:"");return{key:f,label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:b.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(d),xScale:o,x:o(n),canvasX:o(n)*i,unitScale:u(r,b.verticalPadding),domainScale:l(r,b.verticalPadding,e),ordinalScale:h(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function v(t){return b.layers.map(function(e){return{key:e,context:"contextLineLayer"===e,pick:"pickLineLayer"===e,viewModel:t,model:t.model}})}function g(t){t.classed("axisExtentText",!0).attr("text-anchor","middle").style("font-weight",100).style("font-size","10px").style("cursor","default").style("user-select","none")}var y=t("./lines"),b=t("./constants"),x=t("../../lib"),_=t("d3");e.exports=function(t,e,r,a,o){function l(t){var e=t.selectAll("defs").data(i,n);e.enter().append("defs");var r=e.selectAll("#filterBarPattern").data(i,n);r.enter().append("pattern").attr("id","filterBarPattern").attr("patternUnits","userSpaceOnUse"),r.attr("x",-b.bar.width).attr("width",b.bar.capturewidth).attr("height",function(t){return t.model.height});var a=r.selectAll("rect").data(i,n);a.enter().append("rect").attr("shape-rendering","crispEdges"),a.attr("height",function(t){return t.model.height}).attr("width",b.bar.width).attr("x",b.bar.width/2).attr("fill",b.bar.fillcolor).attr("fill-opacity",b.bar.fillopacity).attr("stroke",b.bar.strokecolor).attr("stroke-opacity",b.bar.strokeopacity).attr("stroke-width",b.bar.strokewidth)}function u(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function c(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=1,o=0;o<a;o++)for(var s=0;s<i;s++){var l=r[s+o*i]||(r[s+o*i]={}),u=n[s],c=n[s+1];l.dim1=u,l.dim2=c,l.canvasX=u.canvasX,l.panelSizeX=c.canvasX-u.canvasX,l.panelSizeY=e.model.canvasHeight/a,l.y=o*l.panelSizeY,l.canvasY=e.model.canvasHeight-l.y-l.panelSizeY}}function h(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=i,o=0;o<i;o++)for(var s=0;s<i;s++){var l=r[s+o*i]||(r[s+o*i]={}),u=n[s],c=n[s+1];l.dim1=n[o+1],l.dim2=c,l.canvasX=u.canvasX,l.panelSizeX=c.canvasX-u.canvasX,l.panelSizeY=e.model.canvasHeight/a,l.y=o*l.panelSizeY,l.canvasY=e.model.canvasHeight-l.y-l.panelSizeY}}function f(t,e){return(b.scatter?h:c)(t,e)}function x(t){return t.ordinal?function(){return""}:_.format(t.tickFormat)}function w(){G=!0,k=!0}function M(t){T=!1;var e=t.parent,r=t.brush.extent(),n=e.dimensions,i=n[t.xIndex].filter,a=G&&r[0]===r[1];a&&(t.brush.clear(),_.select(this).select("rect.extent").attr("y",-100));var o=a?[0,1]:r.slice();if(o[0]!==i[0]||o[1]!==i[1]){n[t.xIndex].filter=o,e.focusLineLayer&&e.focusLineLayer.render(e.panels,!0);var s=u(e);!W&&s?(e.contextLineLayer&&e.contextLineLayer.render(e.panels,!0),W=!0):W&&!s&&(e.contextLineLayer&&e.contextLineLayer.render(e.panels,!0,!0),W=!1)}G=!1}function A(t){var e=t.parent,r=t.brush.extent(),n=r[0]===r[1],i=e.dimensions,a=i[t.xIndex].filter;if(!n&&t.ordinal&&(a[0]=s(t.ordinalScale,a[0]),a[1]=s(t.ordinalScale,a[1]),a[0]===a[1]&&(a[0]=Math.max(0,a[0]-.05),a[1]=Math.min(1,a[1]+.05)),_.select(this).transition().duration(150).call(t.brush.extent(a)),e.focusLineLayer.render(e.panels,!0)),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),T=!0,k="ending",o&&o.filterChanged){var l=t.domainToUnitScale.invert,u=a.map(l);o.filterChanged(e.key,t.visibleIndex,u)}}var k=!1,T=!0,S=r.filter(function(t){return d(t).trace.visible}).map(p.bind(0,a)).map(m),E=t.selectAll(".parcoords-line-layers").data(S,n);E.exit().remove(),E.enter().insert("div","."+e.attr("class").split(" ").join(" .")).classed("parcoords-line-layers",!0).style("box-sizing","content-box"),E.style("transform",function(t){return"translate("+(t.model.translateX-b.overdrag)+"px,"+t.model.translateY+"px)"});var L=E.selectAll(".parcoords-lines").data(v,n),C={renderers:[],dimensions:[]},D=null;L.enter().append("canvas").attr("class",function(t){return"parcoords-lines "+(t.context?"context":t.pick?"pick":"focus")}).style("box-sizing","content-box").style("float","left").style("clear","both").style("left",0).style("overflow","visible").style("position",function(t,e){return"absolute"}).filter(function(t){return t.pick}).on("mousemove",function(t){if(T&&t.lineLayer&&o&&o.hover){var e=_.event,r=this.width,n=this.height,i=_.mouse(this),a=i[0],s=i[1];if(a<0||s<0||a>=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),u=0!==l[3],c=u?l[2]+256*(l[1]+256*l[0]):null,h={ x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:c};c!==D&&(u?o.hover(h):o.unhover&&o.unhover(h),D=c)}}),L.style("margin",function(t){var e=t.model.pad;return e.t+"px "+e.r+"px "+e.b+"px "+e.l+"px"}).attr("width",function(t){return t.model.canvasWidth}).attr("height",function(t){return t.model.canvasHeight}).style("width",function(t){return t.model.width+2*b.overdrag+"px"}).style("height",function(t){return t.model.height+"px"}).style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var z=e.selectAll(".parcoords").data(S,n);z.exit().remove(),z.enter().append("g").classed("parcoords",!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(l),z.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var I=z.selectAll(".parcoordsControlView").data(i,n);I.enter().append("g").classed("parcoordsControlView",!0).style("box-sizing","content-box"),I.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var P=I.selectAll(".yAxis").data(function(t){return t.dimensions},n);P.enter().append("g").classed("yAxis",!0).each(function(t){C.dimensions.push(t)}),I.each(function(t){f(P,t)}),L.each(function(t){t.lineLayer=y(this,t.model.lines,t.model.canvasWidth,t.model.canvasHeight,t.viewModel.dimensions,t.viewModel.panels,t.model.unitToColor,t.context,t.pick,b.scatter),t.viewModel[t.key]=t.lineLayer,C.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),P.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),P.call(_.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;T=!1,k||(t.x=Math.max(-b.overdrag,Math.min(t.model.width+b.overdrag,_.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,P.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),f(P,e),P.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),_.select(this).attr("transform","translate("+t.x+", 0)"),P.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!u(e)),e.focusLineLayer.render&&e.focusLineLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;return k?void("ending"===k&&(k=!1)):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,f(P,e),_.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!u(e)),e.focusLineLayer&&e.focusLineLayer.render(e.panels),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),T=!0,void(o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex}))))})),P.exit().remove();var O=P.selectAll(".axisOverlays").data(i,n);O.enter().append("g").classed("axisOverlays",!0),O.selectAll(".axis").remove();var R=O.selectAll(".axis").data(i,n);R.enter().append("g").classed("axis",!0),R.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain(),i=t.ticktext;_.select(this).call(_.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n.map(function(t,e){return i&&i[e]||t}):null).tickFormat(t.ordinal?function(t){return t}:null).scale(r))}),R.selectAll(".domain, .tick").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),R.selectAll("text").style("font-weight",100).style("font-size","10px").style("fill","black").style("fill-opacity",1).style("stroke","none").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=O.selectAll(".axisHeading").data(i,n);j.enter().append("g").classed("axisHeading",!0);var F=j.selectAll(".axisTitle").data(i,n);F.enter().append("text").classed("axisTitle",!0).attr("text-anchor","middle").style("font-family","sans-serif").style("font-size","10px").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),F.attr("transform","translate(0,"+-b.axisTitleOffset+")").text(function(t){return t.label});var N=O.selectAll(".axisExtent").data(i,n);N.enter().append("g").classed("axisExtent",!0);var B=N.selectAll(".axisExtentTop").data(i,n);B.enter().append("g").classed("axisExtentTop",!0),B.attr("transform","translate(0,"+-b.axisExtentOffset+")");var U=B.selectAll(".axisExtentTopText").data(i,n);U.enter().append("text").classed("axisExtentTopText",!0).attr("alignment-baseline","after-edge").call(g),U.text(function(t){return x(t)(t.domainScale.domain().slice(-1)[0])});var V=N.selectAll(".axisExtentBottom").data(i,n);V.enter().append("g").classed("axisExtentBottom",!0),V.attr("transform",function(t){return"translate(0,"+(t.model.height+b.axisExtentOffset)+")"});var H=V.selectAll(".axisExtentBottomText").data(i,n);H.enter().append("text").classed("axisExtentBottomText",!0).attr("alignment-baseline","before-edge").call(g),H.text(function(t){return x(t)(t.domainScale.domain()[0])});var q=O.selectAll(".axisBrush").data(i,n),Y=q.enter().append("g").classed("axisBrush",!0);q.each(function(t){t.brush||(t.brush=_.svg.brush().y(t.unitScale).on("brushstart",w).on("brush",M).on("brushend",A),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),_.select(this).call(t.brush))}),Y.selectAll("rect").attr("x",-b.bar.capturewidth/2).attr("width",b.bar.capturewidth),Y.selectAll("rect.extent").attr("fill","url(#filterBarPattern)").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),Y.selectAll(".resize rect").attr("height",b.bar.handleheight).attr("opacity",0).style("visibility","visible"),Y.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",b.bar.handleoverlap-b.bar.handleheight),Y.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",b.bar.handleoverlap);var G=!1,W=!1;return C}},{"../../lib":667,"./constants":889,"./lines":892,d3:97}],894:[function(t,e,r){"use strict";var n=t("./parcoords");e.exports=function(t,e){var r=t._fullLayout,i=r._paper,a=r._paperdiv,o={},s={},l=r._size;e.forEach(function(e,r){o[r]=t.data[r].dimensions,s[r]=t.data[r].dimensions.slice()});var u=function(e,r,n){var i=s[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},c=function(e){t.emit("plotly_hover",e)},h=function(e){t.emit("plotly_unhover",e)},f=function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return i===-1&&(i+=e.length),i}function a(t){return function(e,n){var a=i(r,t,e),o=i(r,t,n);return a-o}}var l=a(s[e].filter(n));o[e].sort(l),s[e].filter(function(t){return!n(t)}).sort(function(t){return s[e].indexOf(t)}).forEach(function(t){o[e].splice(o[e].indexOf(t),1),o[e].splice(s[e].indexOf(t),0,t)}),t.emit("plotly_restyle")};n(a,i,e,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},{filterChanged:u,hover:c,unhover:h,axesMoved:f})}},{"./parcoords":893}],895:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:o({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:o({},i,{}),insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":561,"../../lib/extend":659,"../../plots/attributes":704,"../../plots/font_attributes":726}],896:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a._module===e&&a.visible===!0&&r.push(i)}return r}var i=t("../../registry");r.name="pie",r.plot=function(t){var e=i.getModule("pie"),r=n(t.calcdata,e);r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var i=n._has&&n._has("pie"),a=e._has&&e._has("pie");i&&!a&&n._pielayer.selectAll("g.trace").remove()}},{"../../registry":781}],897:[function(t,e,r){"use strict";function n(t){if(!l){var e=o.defaults;l=e.slice();var r;for(r=0;r<e.length;r++)l.push(a(e[r]).lighten(20).toHexString());for(r=0;r<o.defaults.length;r++)l.push(a(e[r]).darken(20).toHexString())}return l[t%l.length]}var i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../components/color"),s=t("./helpers");e.exports=function(t,e){var r,l,u,c,h,f,d=e.values,p=e.labels,m=[],v=t._fullLayout,g=v._piecolormap,y={},b=!1,x=0,_=v.hiddenlabels||[];if(e.dlabel)for(p=new Array(d.length),r=0;r<d.length;r++)p[r]=String(e.label0+r*e.dlabel);for(r=0;r<d.length;r++)l=d[r],i(l)&&(l=+l,l<0||(u=p[r],void 0!==u&&""!==u||(u=r),u=String(u),void 0===y[u]&&(y[u]=!0,c=a(e.marker.colors[r]),c.isValid()?(c=o.addOpacity(c,c.getAlpha()),g[u]||(g[u]=c)):g[u]?c=g[u]:(c=!1,b=!0),h=_.indexOf(u)!==-1,h||(x+=l),m.push({v:l,label:u,color:c,i:r,hidden:h}))));if(e.sort&&m.sort(function(t,e){return e.v-t.v}),b)for(r=0;r<m.length;r++)f=m[r],f.color===!1&&(g[f.label]=f.color=n(v._piedefaultcolorcount),v._piedefaultcolorcount++);if(m[0]&&(m[0].vTotal=x),e.textinfo&&"none"!==e.textinfo){var w,M=e.textinfo.indexOf("label")!==-1,A=e.textinfo.indexOf("text")!==-1,k=e.textinfo.indexOf("value")!==-1,T=e.textinfo.indexOf("percent")!==-1,S=v.separators;for(r=0;r<m.length;r++)f=m[r],w=M?[f.label]:[],A&&e.text[f.i]&&w.push(e.text[f.i]),k&&w.push(s.formatPieValue(f.v,S)),T&&w.push(s.formatPiePercent(f.v/x,S)),f.text=w.join("
")}return m};var l},{"../../components/color":562,"./helpers":899,"fast-isnumeric":106,tinycolor2:498}],898:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values");if(!Array.isArray(l)||!l.length)return void(e.visible=!1);var u=o("labels");Array.isArray(u)||(o("label0"),o("dlabel"));var c=o("marker.line.width");c&&o("marker.line.color");var h=o("marker.colors");Array.isArray(h)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),d=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hoverinfo",1===a._dataLength?"label+text+value+percent":void 0),d&&"none"!==d){var p=o("textposition"),m=Array.isArray(p)||"auto"===p,v=m||"inside"===p,g=m||"outside"===p;if(v||g){var y=s(o,"textfont",a.font);v&&s(o,"insidetextfont",y),g&&s(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":667,"./attributes":895}],899:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":667}],900:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":895,"./base_plot":896,"./calc":897,"./defaults":898,"./layout_attributes":901,"./layout_defaults":902,"./plot":903,"./style":904,"./style_one":905}],901:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],902:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("hiddenlabels")}},{"../../lib":667,"./layout_attributes":901}],903:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=i(e,r),u={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=a+1/(2*Math.tan(o)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(a*a+s/2)+a)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),v={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},g=v.scale>f.scale?v:f;return u.scale<1&&g.scale>u.scale?g:u}function i(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function a(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,f,d,m=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),v=o?t.yLabelMin:t.yLabelMax,g=o?t.yLabelMax:t.yLabelMin,y=t.cyFinal+u(t.px0[1],t.px1[1]),b=m-v;if(b*h>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(i=0;i<p.length;i++)a=p[i],a===t||(e.pull[t.i]||0)>=e.pull[a.i]||((t.pxmid[1]-a.pxmid[1])*h>0?(s=a.cyFinal+u(a.px0[1],a.px1[1]),b=s-v-t.labelExtraY,b*h>0&&(t.labelExtraY+=b)):(g+t.labelExtraY-y)*h>0&&(n=3*c*Math.abs(i-p.indexOf(t)),f=a.cxFinal+l(a.px0[0],a.px1[0]),d=f+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX,d*c>0&&(t.labelExtraX+=d)))}var a,o,s,l,u,c,h,f,d,p,m,v,g;for(o=0;o<2;o++)for(s=o?r:n,u=o?Math.max:Math.min,h=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[o][a],f.sort(s),d=t[1-o][a],p=d.concat(f),v=[],m=0;m<f.length;m++)void 0!==f[m].yLabelMid&&v.push(f[m]);for(g=!1,m=0;o&&m<d.length;m++)if(void 0!==d[m].yLabelMid){g=d[m];break}for(m=0;m<v.length;m++){var y=m&&v[m-1];g&&!m&&(y=g),i(v[m],y)}}}function s(t,e){var r,n,i,a,o,s,l,c,h,f,d=[];for(i=0;i<t.length;i++){if(o=t[i][0],s=o.trace,r=e.w*(s.domain.x[1]-s.domain.x[0]),n=e.h*(s.domain.y[1]-s.domain.y[0]),l=s.tiltaxis*Math.PI/180,c=s.pull,Array.isArray(c))for(c=0,a=0;a<s.pull.length;a++)s.pull[a]>c&&(c=s.pull[a]);o.r=Math.min(r/u(s.tilt,Math.sin(l),s.depth),n/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&d.indexOf(s.scalegroup)===-1&&d.push(s.scalegroup)}for(a=0;a<d.length;a++){for(f=1/0,h=d[a],i=0;i<t.length;i++)o=t[i][0],o.trace.scalegroup===h&&(f=Math.min(f,o.r*o.r/o.vTotal));for(i=0;i<t.length;i++)o=t[i][0],o.trace.scalegroup===h&&(o.r=Math.sqrt(f*o.vTotal))}}function l(t){function e(t){var e=h.r*Math.sin(t),r=-h.r*Math.cos(t);return d?[e*(1-s*n*n)+r*o*s,e*o*s+r*(1-s*i*i),Math.sin(a)*(r*i-e*n)]:[e,r]}var r,n,i,a,o,s,l,u,c,h=t[0],f=h.trace,d=f.tilt,p=f.rotation*Math.PI/180,m=2*Math.PI/h.vTotal,v="px0",g="px1";if("counterclockwise"===f.direction){for(l=0;l<t.length&&t[l].hidden;l++);if(l===t.length)return;p+=m*t[l].v,m*=-1,v="px1",g="px0"}for(d&&(a=d*Math.PI/180,r=f.tiltaxis*Math.PI/180,o=Math.sin(r)*Math.cos(r),s=1-Math.cos(a),n=Math.sin(r),i=Math.cos(r)),c=e(p),l=0;l<t.length;l++)u=t[l],u.hidden||(u[v]=c,p+=m*u.v/2,u.pxmid=e(p),u.midangle=p,p+=m*u.v/2,c=e(p),u[g]=c,u.largeArc=u.v>h.vTotal/2?1:0)}function u(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var c=t("d3"),h=t("../../plots/cartesian/graph_interact"),f=t("../../components/color"),d=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),m=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var u=r._pielayer.selectAll("g.trace").data(e);u.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],v=u.trace,g=0,y=(v.depth||0)*u.r*Math.sin(g)/2,b=v.tiltaxis||0,x=b*Math.PI/180,_=[y*Math.sin(x),y*Math.cos(x)],w=u.r*Math.cos(g),M=s.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);M.enter().append("g").attr("class",function(t){return t+" part"}),M.exit().remove(),M.order(),l(e),s.selectAll(".top").each(function(){var s=c.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],g=!1;s.each(function(o){function s(e){var n=t._fullLayout,a=t._fullData[v.index],s=a.hoverinfo;if("all"===s&&(s="label+text+value+percent+name"),!t._dragging&&n.hovermode!==!1&&"none"!==s&&"skip"!==s&&s){var l=i(o,u),c=M+o.pxmid[0]*(1-l),f=A+o.pxmid[1]*(1-l),d=r.separators,p=[];s.indexOf("label")!==-1&&p.push(o.label),a.text&&a.text[o.i]&&s.indexOf("text")!==-1&&p.push(a.text[o.i]),s.indexOf("value")!==-1&&p.push(m.formatPieValue(o.v,d)),s.indexOf("percent")!==-1&&p.push(m.formatPiePercent(o.v/u.vTotal,d)),h.loneHover({x0:c-l*u.r,x1:c+l*u.r,y:f,text:p.join("
"),name:s.indexOf("name")!==-1?a.name:void 0,color:o.color,idealAlign:o.pxmid[0]<0?"left":"right"},{container:n._hoverlayer.node(),outerContainer:n._paper.node()}),h.hover(t,e,"pie"),S=!0}}function f(e){t.emit("plotly_unhover",{points:[e]}),S&&(h.loneUnhover(r._hoverlayer.node()),S=!1)}function y(){t._hoverdata=[o],t._hoverdata.trace=e.trace,h.click(t,{target:!0})}function x(t,e,r,n){return"a"+n*u.r+","+n*w+" "+b+" "+o.largeArc+(r?" 1 ":" 0 ")+n*(e[0]-t[0])+","+n*(e[1]-t[1])}if(o.hidden)return void c.select(this).selectAll("path,g").remove();l[o.pxmid[1]<0?0:1][o.pxmid[0]<0?0:1].push(o);var M=u.cx+_[0],A=u.cy+_[1],k=c.select(this),T=k.selectAll("path.surface").data([o]),S=!1;if(T.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),k.select("path.textline").remove(),k.on("mouseover",s).on("mouseout",f).on("click",y),v.pull){var E=+(Array.isArray(v.pull)?v.pull[o.i]:v.pull)||0;E>0&&(M+=E*o.pxmid[0],A+=E*o.pxmid[1])}o.cxFinal=M,o.cyFinal=A;var L=v.hole;if(o.v===u.vTotal){var C="M"+(M+o.px0[0])+","+(A+o.px0[1])+x(o.px0,o.pxmid,!0,1)+x(o.pxmid,o.px0,!0,1)+"Z";L?T.attr("d","M"+(M+L*o.px0[0])+","+(A+L*o.px0[1])+x(o.px0,o.pxmid,!1,L)+x(o.pxmid,o.px0,!1,L)+"Z"+C):T.attr("d",C)}else{var D=x(o.px0,o.px1,!0,1);if(L){var z=1-L;T.attr("d","M"+(M+L*o.px1[0])+","+(A+L*o.px1[1])+x(o.px1,o.px0,!1,L)+"l"+z*o.px0[0]+","+z*o.px0[1]+D+"Z")}else T.attr("d","M"+M+","+A+"l"+o.px0[0]+","+o.px0[1]+D+"Z")}var I=Array.isArray(v.textposition)?v.textposition[o.i]:v.textposition,P=k.selectAll("g.slicetext").data(o.text&&"none"!==I?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var t=c.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(o.text).attr({class:"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(d.font,"outside"===I?v.outsidetextfont:v.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var e,r=d.bBox(t.node());"outside"===I?e=a(r,o):(e=n(r,o,u),"auto"===I&&e.scale<1&&(t.call(d.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(t.attr({"data-bb":""}),r=d.bBox(t.node())),e=a(r,o)));var i=M+o.pxmid[0]*e.rCenter+(e.x||0),s=A+o.pxmid[1]*e.rCenter+(e.y||0);e.outside&&(o.yLabelMin=s-r.height/2,o.yLabelMid=s,o.yLabelMax=s+r.height/2,o.labelExtraX=0,o.labelExtraY=0,g=!0),t.attr("transform","translate("+i+","+s+")"+(e.scale<1?"scale("+e.scale+")":"")+(e.rotate?"rotate("+e.rotate+")":"")+"translate("+-(r.left+r.right)/2+","+-(r.top+r.bottom)/2+")")})}),g&&o(l,v),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],i=t.cyFinal+t.pxmid[1],a="M"+n+","+i,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);a+=Math.abs(s)>Math.abs(l)?"l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):"l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+o}else a+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(f.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:a,fill:"none"})}})})}),setTimeout(function(){u.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":562,"../../components/drawing":585,"../../lib/svg_text_utils":686,"../../plots/cartesian/graph_interact":713,"./helpers":899,d3:97}],904:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll(".top path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":905,d3:97}],905:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var a=r.marker.line.width||0;Array.isArray(a)&&(a=a[e.i]||0),t.style({"stroke-width":a,fill:e.color}).call(n.stroke,i)}},{"../../components/color":562}],906:[function(t,e,r){"use strict";var n=t("../scattergl/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array"},indices:{valType:"data_array"},xbounds:{valType:"data_array"},ybounds:{valType:"data_array"},text:n.text,marker:{color:{valType:"color",arrayOk:!1},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1},blend:{valType:"boolean",dflt:null},sizemin:{valType:"number",min:.1,max:2,dflt:.5},sizemax:{valType:"number",min:.1,dflt:20},border:{color:{valType:"color",arrayOk:!1},arearatio:{valType:"number",min:0,max:1,dflt:0}}}}},{"../scattergl/attributes":947}],907:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=a(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}function i(t,e){var r=new n(t,e.uid);return r.update(e),r}var a=t("gl-pointcloud2d"),o=t("../../lib/str2rgbarray"),s=t("../scatter/get_trace_color"),l=["xaxis","yaxis"],u=n.prototype;u.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},u.update=function(t){this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.updateFast(t),this.color=s(t,{})},u.updateFast=function(t){var e,r,n,i,a,s,l=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,c=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,d=this.bounds;if(c){if(n=c,e=c.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;s<e;s++)i=n[2*s],a=n[2*s+1],i<d[0]&&(d[0]=i),i>d[2]&&(d[2]=i),a<d[1]&&(d[1]=a),a>d[3]&&(d[3]=a);if(f)r=f;else for(r=new Int32Array(e),s=0;s<e;s++)r[s]=s}else for(e=l.length,n=new Float32Array(2*e),r=new Int32Array(e),s=0;s<e;s++)i=l[s],a=u[s],r[s]=s,n[2*s]=i,n[2*s+1]=a,i<d[0]&&(d[0]=i),i>d[2]&&(d[2]=i),a<d[1]&&(d[1]=a),a>d[3]&&(d[3]=a);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=o(t.marker.color),m=o(t.marker.border.color),v=t.opacity*t.marker.opacity;p[3]*=v,this.pointcloudOptions.color=p;var g=t.marker.blend;if(null===g){var y=100;g=l.length<y||u.length<y}this.pointcloudOptions.blend=g,m[3]*=v,this.pointcloudOptions.borderColor=m;var b=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=b,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,x/2)},u.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)r=this.scene[l[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},u.dispose=function(){this.pointcloud.dispose()},e.exports=i},{"../../lib/str2rgbarray":685,"../scatter/get_trace_color":919,"gl-pointcloud2d":203}],908:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":667,"./attributes":906}],909:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":742,"../scatter3d/calc":935,"./attributes":906,"./convert":907,"./defaults":908}],910:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){n.mergeArray(e.text,t,"tx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var r=e.marker;if(r){n.mergeArray(r.size,t,"ms"),n.mergeArray(r.opacity,t,"mo"),n.mergeArray(r.symbol,t,"mx"),n.mergeArray(r.color,t,"mc");var i=r.line;r.line&&(n.mergeArray(i.color,t,"mlc"),n.mergeArray(i.width,t,"mlw"))}}},{"../../lib":667}],911:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/errorbars/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../components/drawing"),s=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},customdata:{valType:"data_array"},dy:{valType:"number",dflt:1},ids:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"},simplify:{valType:"boolean",dflt:!0}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:s({},{symbol:{valType:"enumerated",values:o.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},colorbar:a,line:s({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line"))},n("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},error_y:i,error_x:i}},{"../../components/colorbar/attributes":563,"../../components/colorscale/color_attributes":569,"../../components/drawing":585,"../../components/errorbars/attributes":587,"../../lib/extend":659,"./constants":916}],912:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("./subtypes"),o=t("./colorscale_calc"),s=t("./arrays_to_calcdata");e.exports=function(t,e){var r,l,u,c=i.getFromId(t,e.xaxis||"x"),h=i.getFromId(t,e.yaxis||"y"),f=c.makeCalcdata(e,"x"),d=h.makeCalcdata(e,"y"),p=Math.min(f.length,d.length);c._minDtick=0,h._minDtick=0,f.length>p&&f.splice(p,f.length-p),d.length>p&&d.splice(p,d.length-p);var m={padded:!0},v={padded:!0};if(a.hasMarkers(e)){if(r=e.marker,l=r.size,Array.isArray(l)){var g={type:"linear"};i.setConvert(g),l=g.makeCalcdata(e.marker,"size"),l.length>p&&l.splice(p,l.length-p)}var y,b=1.6*(e.marker.sizeref||1);y="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},m.ppad=v.ppad=Array.isArray(l)?l.map(y):y(l)}o(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||f[0]===f[p-1]&&d[0]===d[p-1]?e.error_y.visible||["tonexty","tozeroy"].indexOf(e.fill)===-1&&(a.hasMarkers(e)||a.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||f[0]===f[p-1]&&d[0]===d[p-1]?["tonextx","tozerox"].indexOf(e.fill)!==-1&&(v.padded=!1):v.tozero=!0,i.expand(c,f,m),i.expand(h,d,v);var x=new Array(p);for(u=0;u<p;u++)x[u]=n(f[u])&&n(d[u])?{x:f[u],y:d[u]}:{x:!1,y:!1},e.ids&&(x[u].id=String(e.ids[u]));return s(x,e),t.firstscatter=!1,x}},{"../../plots/cartesian/axes":706,"./arrays_to_calcdata":910,"./colorscale_calc":915,"./subtypes":931,"fast-isnumeric":106}],913:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var i=e-1;i>=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],914:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{ noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":565,"../../components/colorscale":576,"../../lib":667,"../../plots/plots":766,"fast-isnumeric":106}],915:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":568,"../../components/colorscale/has_colorscale":575,"./subtypes":931}],916:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],917:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),h=t("./text_defaults"),f=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var v=s(t,e,p,m),g=v<a.PTS_LINESONLY?"lines+markers":"lines";if(!v)return void(e.visible=!1);m("customdata"),m("text"),m("mode",g),m("ids"),o.hasLines(e)&&(u(t,e,r,p,m),c(t,e,m),m("connectgaps"),m("line.simplify")),o.hasMarkers(e)&&l(t,e,r,p,m),o.hasText(e)&&h(t,e,p,m);var y=[];(o.hasMarkers(e)||o.hasText(e))&&(m("marker.maxdisplayed"),y.push("points")),m("fill"),"none"!==e.fill&&(f(t,e,r,m),o.hasLines(e)||c(t,e,m)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),m("hoveron",y.join("+")||"points"),d(t,e,r,{axis:"y"}),d(t,e,r,{axis:"x",inherit:"y"})}},{"../../components/errorbars/defaults":590,"../../lib":667,"./attributes":911,"./constants":916,"./fillcolor_defaults":918,"./line_defaults":922,"./line_shape_defaults":924,"./marker_defaults":927,"./subtypes":931,"./text_defaults":932,"./xy_defaults":933}],918:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r,i){var a=!1;if(e.marker){var o=e.marker.color,s=(e.marker.line||{}).color;o&&!Array.isArray(o)?a=o:s&&!Array.isArray(s)&&(a=s)}i("fillcolor",n.addOpacity((e.line||{}).color||a||r,.5))}},{"../../components/color":562}],919:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./subtypes");e.exports=function(t,e){var r,a;if("lines"===t.mode)return r=t.line.color,r&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return a=o&&n.opacity(o)?o:s&&n.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"",a?n.opacity(a)<.3?n.addOpacity(a,.3):a:(r=(t.line||{}).color,r&&n.opacity(r)&&i.hasLines(t)&&t.line.width?r:t.fillcolor)}},{"../../components/color":562,"./subtypes":931}],920:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/graph_interact"),a=t("../../plots/cartesian/constants"),o=t("../../components/errorbars"),s=t("./get_trace_color"),l=t("../../components/color");e.exports=function(t,e,r,u){var c=t.cd,h=c[0].trace,f=t.xa,d=t.ya,p=f.c2p(e),m=d.c2p(r),v=[p,m];if(h.hoveron.indexOf("points")!==-1){var g=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(f.c2p(t.x)-p)-e,1-3/e)},y=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(d.c2p(t.y)-m)-e,1-3/e)},b=function(t){var e=Math.max(3,t.mrc||0),r=f.c2p(t.x)-p,n=d.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-3/e)},x=i.getDistanceFunction(u,g,y,b);if(i.getClosest(c,x,t),t.index!==!1){var _=c[t.index],w=f.c2p(_.x,!0),M=d.c2p(_.y,!0),A=_.mrc||1;return n.extendFlat(t,{color:s(h,_),x0:w-A,x1:w+A,xLabelVal:_.x,y0:M-A,y1:M+A,yLabelVal:_.y}),_.tx?t.text=_.tx:h.text&&(t.text=h.text),o.hoverInfo(_,h,t),[t]}}if(h.hoveron.indexOf("fills")!==-1&&h._polygons){var k,T,S,E,L,C,D,z,I,P=h._polygons,O=[],R=!1,j=1/0,F=-(1/0),N=1/0,B=-(1/0);for(k=0;k<P.length;k++)S=P[k],S.contains(v)&&(R=!R,O.push(S),N=Math.min(N,S.ymin),B=Math.max(B,S.ymax));if(R){N=Math.max(N,0),B=Math.min(B,d._length);var U=(N+B)/2;for(k=0;k<O.length;k++)for(E=O[k].pts,T=1;T<E.length;T++)z=E[T-1][1],I=E[T][1],z>U!=I>=U&&(C=E[T-1][0],D=E[T][0],L=C+(D-C)*(U-z)/(I-z),j=Math.min(j,L),F=Math.max(F,L));j=Math.max(j,0),F=Math.min(F,f._length);var V=l.defaultLine;return l.opacity(h.fillcolor)?V=h.fillcolor:l.opacity((h.line||{}).color)&&(V=h.line.color),n.extendFlat(t,{distance:a.MAXDIST+10,x0:j,x1:F,y0:U,y1:U,color:V}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":562,"../../components/errorbars":591,"../../lib":667,"../../plots/cartesian/constants":711,"../../plots/cartesian/graph_interact":713,"./get_trace_color":919}],921:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":714,"./arrays_to_calcdata":910,"./attributes":911,"./calc":912,"./clean_data":913,"./colorbar":914,"./defaults":917,"./hover":920,"./plot":928,"./select":929,"./style":930,"./subtypes":931}],922:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o){var s=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{var l=!Array.isArray(s)&&s||r;o("line.color",l)}o("line.width"),o("line.dash")}},{"../../components/colorscale/defaults":571,"../../components/colorscale/has_colorscale":575}],923:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM;e.exports=function(t,e){function r(e){var r=w.c2p(t[e].x),i=M.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function i(t){var e=t[0]/w._length,r=t[1]/M._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*T}function a(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var o,s,l,u,c,h,f,d,p,m,v,g,y,b,x,_,w=e.xaxis,M=e.yaxis,A=e.simplify,k=e.connectGaps,T=e.baseTolerance,S=e.linear,E=[],L=.2,C=new Array(t.length),D=0;for(A||(T=L=-1),o=0;o<t.length;o++)if(s=r(o)){for(D=0,C[D++]=s,o++;o<t.length;o++){if(u=r(o),!u){if(k)continue;break}if(S){if(f=a(u,s),!(f<i(u)*L)){for(p=[(u[0]-s[0])/f,(u[1]-s[1])/f],c=s,v=f,g=b=x=0,d=!1,l=u,o++;o<t.length;o++){if(h=r(o),!h){if(k)continue;break}if(m=[h[0]-s[0],h[1]-s[1]],_=m[0]*p[1]-m[1]*p[0],b=Math.min(b,_),x=Math.max(x,_),x-b>i(h))break;l=h,y=m[0]*p[0]+m[1]*p[1],y>v?(v=y,u=h,d=!1):y<g&&(g=y,c=h,d=!0)}if(d?(C[D++]=u,l!==c&&(C[D++]=c)):(c!==s&&(C[D++]=c),l!==u&&(C[D++]=u)),C[D++]=l,o>=t.length||!h)break;C[D++]=h,s=h}}else C[D++]=u}E.push(C.slice(0,D))}return E}},{"../../constants/numerical":649}],924:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=r("line.shape");"spline"===n&&r("line.smoothing")}},{}],925:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i,a=null,o=0;o<r.length;++o)n=r[o],i=n[0].trace,i.visible===!0?(i._nexttrace=null,["tonextx","tonexty","tonext"].indexOf(i.fill)!==-1&&(i._prevtrace=a,a&&(a._nexttrace=i)),a=i):i._prevtrace=i._nexttrace=null}},{}],926:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,i=e.sizemin||0,a="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=a(t/2);return n(e)&&e>0?Math.max(e,i):0}}},{"fast-isnumeric":106}],927:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l){var u,c=o.isBubble(t),h=(t.line||{}).color;h&&(r=h),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u=h&&!Array.isArray(h)&&e.marker.color!==h?h:c?n.background:n.defaultLine,l("marker.line.color",u),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode"))}},{"../../components/color":562,"../../components/colorscale/defaults":571,"../../components/colorscale/has_colorscale":575,"./subtypes":931}],928:[function(t,e,r){"use strict";function n(t,e){var r;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(r=t[0].trace,r._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var n=":first-child";e.select(".js-fill.js-tozero").size()&&(n+=" + *"),r._nextFill=e.insert("path",n).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),r._nextFill=null;r.fill&&("tozero"===r.fill.substr(0,6)||"toself"===r.fill||"to"===r.fill.substr(0,2)&&!r._prevtrace)?(r._ownFill=e.select(".js-fill.js-tozero"),r._ownFill.size()||(r._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),r._ownFill=null)})}function i(t,e,r,n,i,f,p){function m(t){return M?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function g(t){return t.id}function y(t){if(t.ids)return g}function b(){return!1}function x(t){var e,r,n=t[0].trace,i=o.select(this),a=c.hasMarkers(n),u=c.hasText(n),h=y(n),f=b,d=b;a&&(f=n.marker.maxdisplayed?v:s.identity),u&&(d=n.marker.maxdisplayed?v:s.identity),r=i.selectAll("path.point"),e=r.data(f,h);var p=e.enter().append("path").classed("point",!0);p.call(l.pointStyle,n).call(l.translatePoints,A,k,n),M&&p.style("opacity",0).transition().style("opacity",1),e.each(function(t){var e=o.select(this),r=m(e);l.translatePoint(t,r,A,k),l.singlePointStyle(t,r,n),n.customdata&&e.classed("plotly-customdata",null!==t.data&&void 0!==t.data)}),M?e.exit().transition().style("opacity",0).remove():e.exit().remove(),r=i.selectAll("g"),e=r.data(d,h),e.enter().append("g").append("text"),e.each(function(t){var e=m(o.select(this).select("text"));l.translatePoint(t,e,A,k)}),e.selectAll("text").call(l.textPointStyle,n).each(function(t){var e=t.xp||A.c2p(t.x),r=t.yp||k.c2p(t.y);o.select(this).selectAll("tspan").each(function(){m(o.select(this)).attr({x:e,y:r})})}),e.exit().remove()}var _,w;a(t,e,r,n,i);var M=!!p&&p.duration>0,A=r.xaxis,k=r.yaxis,T=n[0].trace,S=T.line,E=o.select(f);if(E.call(u.plot,r,p),T.visible===!0){m(E).style("opacity",T.opacity);var L,C,D=T.fill.charAt(T.fill.length-1);"x"!==D&&"y"!==D&&(D=""),n[0].node3=E;var z="",I=[],P=T._prevtrace;P&&(z=P._prevRevpath||"",C=P._nextFill,I=P._polygons);var O,R,j,F,N,B,U,V,H,q="",Y="",G=[],W=[],X=s.noop;if(L=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(C&&C.datum(n),["hv","vh","hvh","vhv"].indexOf(S.shape)!==-1?(j=l.steps(S.shape),F=l.steps(S.shape.split("").reverse().join(""))):j=F="spline"===S.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),S.smoothing):l.smoothopen(t,S.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return F(t.reverse())},G=h(n,{xaxis:A,yaxis:k,connectGaps:T.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,linear:"linear"===S.shape,simplify:S.simplify}),H=T._polygons=new Array(G.length),w=0;w<G.length;w++)T._polygons[w]=d(G[w]);G.length&&(B=G[0][0],U=G[G.length-1],V=U[U.length-1]),W=G.filter(function(t){return t.length>1}),X=function(t){return function(e){if(O=j(e),R=N(e),q?D?(q+="L"+O.substr(1),Y=R+("L"+Y.substr(1))):(q+="Z"+O,Y=R+"Z"+Y):(q=O,Y=R),c.hasLines(T)&&e.length>1){var r=o.select(this);if(r.datum(n),t)m(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=m(r);i.attr("d",O),l.singleLineStyle(n,i)}}}}}var Z=E.selectAll(".js-line").data(W);m(Z.exit()).style("opacity",0).remove(),Z.each(X(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(X(!0)),G.length&&(L?B&&V&&(D?("y"===D?B[1]=V[1]=k.c2p(0,!0):"x"===D&&(B[0]=V[0]=A.c2p(0,!0)),m(L).attr("d","M"+V+"L"+B+"L"+q.substr(1))):m(L).attr("d",q+"Z")):"tonext"===T.fill.substr(0,6)&&q&&z&&("tonext"===T.fill?m(C).attr("d",q+"Z"+z+"Z"):m(C).attr("d",q+"L"+z.substr(1)+"Z"),T._polygons=T._polygons.concat(I)),T._prevRevpath=Y,T._prevPolygons=H);var J=E.selectAll(".points");_=J.data([n]),J.each(x),_.enter().append("g").classed("points",!0).each(x),_.exit().remove()}}function a(t,e,r,n,i){var a=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),h=o.extent(s.simpleMap(l.range,l.r2c)),f=n[0].trace;if(c.hasMarkers(f)){var d=f.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/d),v=0;i.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++});var g=Math.round(v*m/3+Math.floor(v/3)*m/7.1);n.forEach(function(t){delete t.vis}),p.forEach(function(t,e){0===Math.round((e+g)%m)&&(t.vis=!0)})}}}var o=t("d3"),s=t("../../lib"),l=t("../../components/drawing"),u=t("../../components/errorbars"),c=t("./subtypes"),h=t("./line_points"),f=t("./link_traces"),d=t("../../lib/polygon").tester;e.exports=function(t,e,r,a,s){var l,u,c,h,d,p=e.plot.select("g.scatterlayer"),m=!a,v=!!a&&a.duration>0;for(c=p.selectAll("g.trace"),h=c.data(r,function(t){return t[0].trace.uid}),h.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),f(t,e,r),n(t,p),l=0,u=[];l<r.length;l++)u[l]=r[l][0].trace.uid;if(p.selectAll("g.trace").sort(function(t,e){var r=u.indexOf(t[0].trace.uid),n=u.indexOf(e[0].trace.uid);return r>n?1:-1}),v){s&&(d=s());var g=o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()});g.each(function(){p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)})})}else p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)});m&&h.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":585,"../../components/errorbars":591,"../../lib":667,"../../lib/polygon":677,"./line_points":923,"./link_traces":925,"./subtypes":931,d3:97}],929:[function(t,e,r){"use strict";var n=t("./subtypes"),i=.2;e.exports=function(t,e){var r,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],f=l[0].trace,d=f.index,p=f.marker,m=!n.hasMarkers(f)&&!n.hasText(f);if(f.visible===!0&&!m){var v=Array.isArray(p.opacity)?1:p.opacity;if(e===!1)for(r=0;r<l.length;r++)l[r].dim=0;else for(r=0;r<l.length;r++)a=l[r],o=u.c2p(a.x),s=c.c2p(a.y),e.contains([o,s])?(h.push({curveNumber:d,pointNumber:r,x:a.x,y:a.y,id:a.id}),a.dim=0):a.dim=1;return l[0].node3.selectAll("path.point").style("opacity",function(t){return((t.mo+1||v+1)-1)*(t.dim?i:1)}),l[0].node3.selectAll("text").style("opacity",function(t){return t.dim?i:1}),h}}},{"./subtypes":931}],930:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(t){var e=n.select(this),r=e.selectAll("path.point"),a=t.trace||t[0].trace;r.call(i.pointStyle,a),e.selectAll("text").call(i.textPointStyle,a)}),e.selectAll("g.trace path.js-line").call(i.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(i.fillGroupStyle),e.call(a.style)}},{"../../components/drawing":585,"../../components/errorbars":591,d3:97}],931:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&t.mode.indexOf("lines")!==-1},hasMarkers:function(t){return t.visible&&t.mode&&t.mode.indexOf("markers")!==-1},hasText:function(t){return t.visible&&t.mode&&t.mode.indexOf("text")!==-1},isBubble:function(t){return n.isPlainObject(t.marker)&&Array.isArray(t.marker.size)}}},{"../../lib":667}],932:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){i("textposition"),n.coerceFont(i,"textfont",r.font)}},{"../../lib":667}],933:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i){var a,o=i("x"),s=i("y"),l=n.getComponentMethod("calendars","handleTraceDefaults");if(l(t,e,["x","y"],r),o)s?(a=Math.min(o.length,s.length),a<o.length&&(e.x=o.slice(0,a)),a<s.length&&(e.y=s.slice(0,a))):(a=o.length,i("y0"),i("dy"));else{if(!s)return 0;a=e.y.length,i("x0"),i("dx")}return a}},{"../../registry":781}],934:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var i=t("../scatter/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/errorbars/attributes"),s=t("../../constants/gl_markers"),l=t("../../lib/extend").extendFlat,u=i.line,c=i.marker,h=c.line;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},text:l({},i.text,{}),mode:l({},i.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:n("x"),y:n("y"),z:n("z")},connectgaps:i.connectgaps,line:l({},{width:u.width,dash:u.dash,showscale:{valType:"boolean",dflt:!1}},a("line")),marker:l({},{symbol:{valType:"enumerated",values:Object.keys(s),dflt:"circle",arrayOk:!0},size:l({},c.size,{dflt:8}),sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:l({},c.opacity,{arrayOk:!1}),showscale:c.showscale,colorbar:c.colorbar,line:l({},{width:l({},h.width,{arrayOk:!1})},a("marker.line"))},a("marker")),textposition:l({},i.textposition,{dflt:"top center"}),textfont:i.textfont,error_x:o,error_y:o,error_z:o}},{"../../components/colorscale/color_attributes":569,"../../components/errorbars/attributes":587,"../../constants/gl_markers":647,"../../lib/extend":659,"../scatter/attributes":911}],935:[function(t,e,r){"use strict";var n=t("../scatter/arrays_to_calcdata"),i=t("../scatter/colorscale_calc");e.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(r,e),i(e),r}},{"../scatter/arrays_to_calcdata":910,"../scatter/colorscale_calc":915}],936:[function(t,e,r){"use strict";function n(t,e,r){if(!e||!e.visible)return null;for(var n=o(e),i=new Array(t.length),a=0;a<t.length;a++){var s=n(+t[a],a);i[a]=[-s[0]*r,s[1]*r]}return i}function i(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}function a(t,e){var r=[n(t.x,t.error_x,e[0]),n(t.y,t.error_y,e[1]),n(t.z,t.error_z,e[2])],a=i(r);if(0===a)return null;for(var o=new Array(a),s=0;s<a;s++){for(var l=[[0,0,0],[0,0,0]],u=0;u<3;u++)if(r[u])for(var c=0;c<2;c++)l[c][u]=r[u][s][c];o[s]=l}return o}var o=t("../../components/errorbars/compute_error");e.exports=a},{"../../components/errorbars/compute_error":589}],937:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n<t.length;++n){var l=t[n];!isNaN(l[i])&&isFinite(l[i])&&!isNaN(l[a])&&isFinite(l[a])&&(o.push([l[i],l[a]]),s.push(n))}var u=g(o);for(n=0;n<u.length;++n)for(var c=u[n],h=0;h<c.length;++h)c[h]=s[c[h]];return{positions:t,cells:u,meshColor:e}}function a(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&a.copy_zstyle!==!1&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=b(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}function o(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;o<e;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,y.identity);return a}function c(t,e){var r,n,i,c,h,f,d=[],p=t.fullSceneLayout,m=t.dataScale,v=p.xaxis,g=p.yaxis,w=p.zaxis,M=e.marker,k=e.line,T=e.x||[],S=e.y||[],E=e.z||[],L=T.length,C=e.xcalendar,D=e.ycalendar,z=e.zcalendar;for(n=0;n<L;n++)i=v.d2l(T[n],0,C)*m[0],c=g.d2l(S[n],0,D)*m[1],h=w.d2l(E[n],0,z)*m[2],d[n]=[i,c,h];if(Array.isArray(e.text))f=e.text;else if(void 0!==e.text)for(f=new Array(L),n=0;n<L;n++)f[n]=e.text;if(r={position:d,mode:e.mode,text:f},"line"in e&&(r.lineColor=x(k,1,L),r.lineWidth=k.width,r.lineDashes=k.dash),"marker"in e){var I=_(e);r.scatterColor=x(M,1,L),r.scatterSize=u(M.size,L,s,20,I),r.scatterMarker=u(M.symbol,L,l,"\u25cf"),r.scatterLineWidth=M.line.width,r.scatterLineColor=x(M.line,1,L),r.scatterAngle=0}"textposition"in e&&(r.textOffset=o(e.textposition),r.textColor=x(e.textfont,1,L),r.textSize=u(e.textfont.size,L,y.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var P=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var O=e.projection[P[n]];(r.project[n]=O.show)&&(r.projectOpacity[n]=O.opacity,r.projectScale[n]=O.scale)}r.errorBounds=A(e,m);var R=a([e.error_x,e.error_y,e.error_z]);return r.errorColor=R.color,r.errorLineWidth=R.lineWidth,r.errorCapSize=R.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=b(e.surfacecolor),r}function h(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function f(t,e){var r=new n(t,e.uid);return r.update(e),r}var d=t("gl-line3d"),p=t("gl-scatter3d"),m=t("gl-error3d"),v=t("gl-mesh3d"),g=t("delaunay-triangulate"),y=t("../../lib"),b=t("../../lib/str2rgbarray"),x=t("../../lib/gl_format_color"),_=t("../scatter/make_bubble_size_func"),w=t("../../constants/gl3d_dashes"),M=t("../../constants/gl_markers"),A=t("./calc_errors"),k=n.prototype;k.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels&&void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel="";var e=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},k.update=function(t){var e,r,n,a,o=this.scene.glplot.gl,s=w.solid;this.data=t;var l=c(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in w&&(s=w[l.lineDashes]),this.color=h(l.scatterColor)||h(l.lineColor),this.dataPoints=l.position,e={gl:o,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity,connectGaps:t.connectgaps},this.mode.indexOf("lines")!==-1?this.linePlot?this.linePlot.update(e):(this.linePlot=d(e),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var u=t.opacity;if(t.marker&&t.marker.opacity&&(u*=t.marker.opacity),r={gl:o,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:u,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},this.mode.indexOf("markers")!==-1?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=p(r),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),a={gl:o,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=l.text,this.mode.indexOf("text")!==-1?this.textMarkers?this.textMarkers.update(a):(this.textMarkers=p(a),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:o,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=m(n),this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);f.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=o,this.delaunayMesh=v(f),this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},k.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=f},{"../../constants/gl3d_dashes":646,"../../constants/gl_markers":647,"../../lib":667,"../../lib/gl_format_color":664,"../../lib/str2rgbarray":685,"../scatter/make_bubble_size_func":926,"./calc_errors":936,"delaunay-triangulate":98,"gl-error3d":135,"gl-line3d":145,"gl-mesh3d":178,"gl-scatter3d":221}],938:[function(t,e,r){"use strict";function n(t,e,r,n){var a=0,o=r("x"),s=r("y"),l=r("z"),u=i.getComponentMethod("calendars","handleTraceDefaults");return u(t,e,["x","y","z"],n),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),a<o.length&&(e.x=o.slice(0,a)),a<s.length&&(e.y=s.slice(0,a)),a<l.length&&(e.z=l.slice(0,a))),a}var i=t("../../registry"),a=t("../../lib"),o=t("../scatter/subtypes"),s=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),u=t("../scatter/text_defaults"),c=t("../../components/errorbars/defaults"),h=t("./attributes");e.exports=function(t,e,r,i){function f(r,n){return a.coerce(t,e,h,r,n)}var d=n(t,e,f,i);if(!d)return void(e.visible=!1);f("text"),f("mode"),o.hasLines(e)&&(f("connectgaps"),l(t,e,r,i,f)),o.hasMarkers(e)&&s(t,e,r,i,f),o.hasText(e)&&u(t,e,i,f);var p=(e.line||{}).color,m=(e.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",p||m);for(var v=["x","y","z"],g=0;g<3;++g){var y="projection."+v[g];f(y+".show")&&(f(y+".opacity"),f(y+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":590,"../../lib":667,"../../registry":781,"../scatter/line_defaults":922,"../scatter/marker_defaults":927,"../scatter/subtypes":931,"../scatter/text_defaults":932,"./attributes":934}],939:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl_markers":647,"../../plots/gl3d":745,"../scatter/colorbar":914,"./attributes":934,"./calc":935,"./convert":937,"./defaults":938}],940:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../lib/extend").extendFlat,s=n.marker,l=n.line,u=s.line;e.exports={lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names"],dflt:"ISO-3"},mode:o({},n.mode,{dflt:"markers"}),text:o({},n.text,{}),textfont:n.textfont,textposition:n.textposition,line:{color:l.color,width:l.width,dash:l.dash},connectgaps:n.connectgaps,marker:o({},{symbol:s.symbol,opacity:s.opacity,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,showscale:s.showscale,colorbar:s.colorbar,line:o({},{width:u.width},a("marker.line"))},a("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:n.fillcolor,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","location","text","name"]})}},{"../../components/colorscale/color_attributes":569,"../../lib/extend":659,"../../plots/attributes":704,"../scatter/attributes":911}],941:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc");e.exports=function(t,e){for(var r=Array.isArray(e.locations),a=r?e.locations.length:e.lon.length,o=[],s=0,l=0;l<a;l++){var u,c={};if(r){var h=e.locations[l];c.loc=h,u="string"!=typeof h}else{var f=e.lon[l],d=e.lat[l];c.lonlat=[+f,+d],u=!n(f)||!n(d)}u?s>0&&(o[s-1].gapAfter=!0):(s++,o.push(c))}return i(e),o}},{"../scatter/colorscale_calc":915,"fast-isnumeric":106}],942:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=0,o=r("locations");return o?(r("locationmode"),a=o.length):(n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length),a<n.length&&(e.lon=n.slice(0,a)),a<i.length&&(e.lat=i.slice(0,a)),a)}var i=t("../../lib"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("./attributes");e.exports=function(t,e,r,h){function f(r,n){return i.coerce(t,e,c,r,n)}var d=n(t,e,f);return d?(f("text"),f("mode"),a.hasLines(e)&&(s(t,e,r,h,f),f("connectgaps")),a.hasMarkers(e)&&o(t,e,r,h,f),a.hasText(e)&&l(t,e,h,f),f("fill"),"none"!==e.fill&&u(t,e,r,f),void f("hoverinfo",1===h._dataLength?"lon+lat+location+text":void 0)):void(e.visible=!1)}},{"../../lib":667,"../scatter/fillcolor_defaults":918,"../scatter/line_defaults":922,"../scatter/marker_defaults":927,"../scatter/subtypes":931,"../scatter/text_defaults":932,"./attributes":940}],943:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.location=e.lon?e.lon:null,t}},{}],944:[function(t,e,r){"use strict";function n(t,e,r){function n(t){return a.tickText(r,r.c2l(t),"hover").text+"\xb0"}var i=t.hoverinfo,o="all"===i?s.hoverinfo.flags:i.split("+"),l=o.indexOf("location")!==-1&&Array.isArray(t.locations),u=o.indexOf("lon")!==-1,c=o.indexOf("lat")!==-1,h=o.indexOf("text")!==-1,f=[];if(l?f.push(e.loc):u&&c?f.push("("+n(e.lonlat[0])+", "+n(e.lonlat[1])+")"):u?f.push("lon: "+n(e.lonlat[0])):c&&f.push("lat: "+n(e.lonlat[1])),h){var d=e.tx||t.text;Array.isArray(d)||f.push(d)}return f.join("
")}var i=t("../../plots/cartesian/graph_interact"),a=t("../../plots/cartesian/axes"),o=t("../scatter/get_trace_color"),s=t("./attributes");e.exports=function(t){function e(t){return c.projection(t)}function r(t){var r=t.lonlat;if(null===r[0]||null===r[1])return 1/0;if(c.isLonLatOverEdges(r))return 1/0;var n=e(r),i=l.c2p(),a=u.c2p(),o=Math.abs(i-n[0]),s=Math.abs(a-n[1]),h=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(o*o+s*s)-h,1-3/h)}var a=t.cd,s=a[0].trace,l=t.xa,u=t.ya,c=t.subplot;if(!a[0].placeholder&&(i.getClosest(a,r,t),t.index!==!1)){var h=a[t.index],f=h.lonlat,d=e(f),p=h.mrc||1;return t.x0=d[0]-p,t.x1=d[0]+p,t.y0=d[1]-p,t.y1=d[1]+p,t.loc=h.loc,t.lat=f[0],t.lon=f[1],t.color=o(s,h),t.extraText=n(s,h,c.mockAxis),[t]}}},{"../../plots/cartesian/axes":706,"../../plots/cartesian/graph_interact":713,"../scatter/get_trace_color":919,"./attributes":940}],945:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattergeo", n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/geo":730,"../scatter/colorbar":914,"./attributes":940,"./calc":941,"./defaults":942,"./event_data":943,"./hover":944,"./plot":946}],946:[function(t,e,r){"use strict";function n(t,e){if(!Array.isArray(t.locations))return u.identity;var r=c(t,e),n=t.locationmode;return function(t){var e=h(n,t.loc,r);return e?(t.lonlat=e.properties.ct,t):(t.lonlat=[null,null],!1)}}function i(t,e,r){function n(t,n){d(t,e,n,r)}var i=t.marker;if(n(t.text,"tx"),n(t.textposition,"tp"),t.textfont&&(n(t.textfont.size,"ts"),n(t.textfont.color,"tc"),n(t.textfont.family,"tf")),i&&i.line){var a=i.line;n(i.opacity,"mo"),n(i.symbol,"mx"),n(i.color,"mc"),n(i.size,"ms"),n(a.color,"mlc"),n(a.width,"mlw")}}function a(t){var e=t.framework.selectAll("g.trace.scattergeo");e.style("opacity",function(t){return t[0].trace.opacity}),e.each(function(t){var e=t[0].trace,r=o.select(this);r.selectAll("path.point").call(s.pointStyle,e),r.selectAll("text").call(s.textPointStyle,e)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=o.select(this),r=t.trace,n=r.line||{};e.call(l.stroke,n.color).call(s.dashLine,n.dash||"",n.width||0),"none"!==r.fill&&e.call(l.fill,r.fillcolor)})}var o=t("d3"),s=t("../../components/drawing"),l=t("../../components/color"),u=t("../../lib"),c=t("../../lib/topojson_utils").getTopojsonFeatures,h=t("../../lib/geo_location_utils").locationToFeature,f=t("../../lib/geojson_utils"),d=t("../../lib/array_to_calc_item"),p=t("../scatter/subtypes");e.exports=function(t,e){function r(t){return t[0].trace.uid}var s=t.framework.select(".scattergeolayer").selectAll("g.trace.scattergeo").data(e,r);s.enter().append("g").attr("class","trace scattergeo"),s.exit().remove(),s.selectAll("*").remove(),s.each(function(e){var r=o.select(this),a=e[0].trace,s=n(a,t.topojson);e[0].placeholder&&r.remove();for(var l=[],u=0;u<e.length;u++){var c=s(e[u]);c&&(i(a,e[u],u),l.push(c))}if(p.hasLines(a)||"none"!==a.fill){var h=f.calcTraceToLineCoords(l),d="none"!==a.fill?f.makePolygon(h,a):f.makeLine(h,a);r.selectAll("path.js-line").data([d]).enter().append("path").classed("js-line",!0)}p.hasMarkers(a)&&r.selectAll("path.point").data(l).enter().append("path").classed("point",!0),p.hasText(a)&&r.selectAll("g").data(l).enter().append("g").append("text")}),a(t)}},{"../../components/color":562,"../../components/drawing":585,"../../lib":667,"../../lib/array_to_calc_item":654,"../../lib/geo_location_utils":662,"../../lib/geojson_utils":663,"../../lib/topojson_utils":688,"../scatter/subtypes":931,d3:97}],947:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),a=t("../../constants/gl2d_dashes"),o=t("../../constants/gl_markers"),s=t("../../lib/extend").extendFlat,l=t("../../lib/extend").extendDeep,u=n.line,c=n.marker,h=c.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:s({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:u.color,width:u.width,dash:{valType:"enumerated",values:Object.keys(a),dflt:"solid"}},marker:l({},i("marker"),{symbol:{valType:"enumerated",values:Object.keys(o),dflt:"circle",arrayOk:!0},size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,showscale:c.showscale,colorbar:c.colorbar,line:l({},i("marker.line"),{width:h.width})}),connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:n.fillcolor,error_y:n.error_y,error_x:n.error_x}},{"../../components/colorscale/color_attributes":569,"../../constants/gl2d_dashes":645,"../../constants/gl_markers":647,"../../lib/extend":659,"../scatter/attributes":911}],948:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="scattergl",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.connectgaps=!0,this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float64Array(0),color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=d(t.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float64Array(0),errors:new Float64Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=p(t.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float64Array(0),errors:new Float64Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=p(t.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float64Array(0),sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=h(t.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=f(t.glplot,this.scatterOptions),this.fancyScatter._trace=this,this.isVisible=!1}function i(t,e,r){return Array.isArray(e)||(e=[e]),a(t,e,r)}function a(t,e,r){for(var n=new Array(r),i=e[0],a=0;a<r;++a)n[a]=t(a>=e.length?i:e[a]);return n}function o(t,e,r){return l(D(t,r),C(e,r),r)}function s(t,e,r,n){var i=w(t,e,n);return i=Array.isArray(i[0])?i:a(v.identity,[i],n),l(i,C(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;i<r;++i){for(var a=0;a<3;++a)n[4*i+a]=t[i][a];n[4*i+3]=t[i][3]*e[i]}return n}function u(t){for(var e,r=t.length,n=Math.max(1,(r-1)/Math.min(Math.max(r,1),1e3)),i=0;i<r;i+=n)if(e=t[Math.floor(i)],!(m(e)||e instanceof Date))return!1;return!0}function c(t,e){var r=new n(t,e.uid);return r.update(e),r}var h=t("gl-scatter2d"),f=t("gl-scatter2d-fancy"),d=t("gl-line2d"),p=t("gl-error2d"),m=t("fast-isnumeric"),v=t("../../lib"),g=t("../../plots/cartesian/axes"),y=t("../../plots/cartesian/axis_autotype"),b=t("../../components/errorbars"),x=t("../../lib/str2rgbarray"),_=t("../../lib/typed_array_truncate"),w=t("../../lib/gl_format_color"),M=t("../scatter/subtypes"),A=t("../scatter/make_bubble_size_func"),k=t("../scatter/get_trace_color"),T=t("../../constants/gl_markers"),S=t("../../constants/gl2d_dashes"),E=["xaxis","yaxis"],L=n.prototype;L.handlePick=function(t){var e=t.pointId;(t.object!==this.line||this.connectgaps)&&(e=this.idToIndex[t.pointId]);var r=this.pickXData[e];return{trace:this,dataCoord:t.dataCoord,traceCoord:[m(r)||!v.isDateTime(r)?r:v.dateTime2ms(r),this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},L.isFancy=function(t){if("linear"!==this.scene.xaxis.type&&"date"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;if(this.hasMarkers){var e=t.marker||{};if(Array.isArray(e.symbol)||"circle"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.color)||Array.isArray(e.line.width)||Array.isArray(e.line.color)||Array.isArray(e.opacity))return!0}return!(!this.hasLines||this.connectgaps)||(!!this.hasErrorX||!!this.hasErrorY)};var C=i.bind(null,function(t){return+t}),D=i.bind(null,x),z=i.bind(null,function(t){return T[t]||"\u25cf"});L.update=function(t){t.visible!==!0?(this.isVisible=!1,this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.isVisible=!0,this.hasLines=M.hasLines(t),this.hasErrorX=t.error_x.visible===!0,this.hasErrorY=t.error_y.visible===!0,this.hasMarkers=M.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.connectgaps=!!t.connectgaps,this.isVisible?this.isFancy(t)?this.updateFancy(t):this.updateFast(t):this.clear(),this.color=k(t,{})},L.clear=function(){this.lineOptions.positions=new Float64Array(0),this.line.update(this.lineOptions),this.errorXOptions.positions=new Float64Array(0),this.errorX.update(this.errorXOptions),this.errorYOptions.positions=new Float64Array(0),this.errorY.update(this.errorYOptions),this.scatterOptions.positions=new Float64Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.fancyScatter.update(this.scatterOptions)},L.updateFast=function(t){var e,r,n=this.xData=this.pickXData=t.x,i=this.yData=this.pickYData=t.y,a=n.length,o=new Array(a),s=new Float64Array(2*a),l=this.bounds,c=0,h=0,f=t.xcalendar,d=u(n),p=!d&&"date"===y(n,f);if(d||p)for(var g=0;g<a;++g)e=n[g],r=i[g],m(r)&&(d||(e=v.dateTime2ms(e,f)),o[c++]=g,s[h++]=e,s[h++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=_(s,h),this.idToIndex=o,this.updateLines(t,s),this.updateError("X",t),this.updateError("Y",t);var b;if(this.hasMarkers){this.scatterOptions.positions=s;var w=x(t.marker.color),M=x(t.marker.line.color),A=t.opacity*t.marker.opacity;w[3]*=A,this.scatterOptions.color=w,M[3]*=A,this.scatterOptions.borderColor=M,b=t.marker.size,this.scatterOptions.size=b,this.scatterOptions.borderSize=t.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float64Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float64Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(l,b)},L.updateFancy=function(t){var e=this.scene,r=e.xaxis,n=e.yaxis,a=this.bounds,o=this.pickXData=r.makeCalcdata(t,"x").slice(),l=this.pickYData=n.makeCalcdata(t,"y").slice();this.xData=o.slice(),this.yData=l.slice();var u,c,h,f,d,p,m,v,g=b.calcFromTrace(t,e.fullLayout),y=o.length,x=new Array(y),w=new Float64Array(2*y),M=new Float64Array(4*y),k=new Float64Array(4*y),T=0,S=0,E=0,L=0,D="log"===r.type?r.d2l:function(t){return t},I="log"===n.type?n.d2l:function(t){return t};for(u=0;u<y;++u)this.xData[u]=h=D(o[u]),this.yData[u]=f=I(l[u]),isNaN(h)||isNaN(f)||(x[T++]=u,w[S++]=h,w[S++]=f,d=M[E++]=h-g[u].xs||0,p=M[E++]=g[u].xh-h||0,M[E++]=0,M[E++]=0,k[L++]=0,k[L++]=0,m=k[L++]=f-g[u].ys||0,v=k[L++]=g[u].yh-f||0,a[0]=Math.min(a[0],h-d),a[1]=Math.min(a[1],f-m),a[2]=Math.max(a[2],h+p),a[3]=Math.max(a[3],f+v));w=_(w,S),this.idToIndex=x,this.updateLines(t,w),this.updateError("X",t,w,M),this.updateError("Y",t,w,k);var P;if(this.hasMarkers){this.scatterOptions.positions=w,this.scatterOptions.sizes=new Array(T),this.scatterOptions.glyphs=new Array(T),this.scatterOptions.borderWidths=new Array(T),this.scatterOptions.colors=new Array(4*T),this.scatterOptions.borderColors=new Array(4*T);var O,R=A(t),j=t.marker,F=j.opacity,N=t.opacity,B=s(j,F,N,y),U=z(j.symbol,y),V=C(j.line.width,y),H=s(j.line,F,N,y);for(P=i(R,j.size,y),u=0;u<T;++u)for(O=x[u],this.scatterOptions.sizes[u]=4*P[O],this.scatterOptions.glyphs[u]=U[O],this.scatterOptions.borderWidths[u]=.5*V[O],c=0;c<4;++c)this.scatterOptions.colors[4*u+c]=B[4*O+c],this.scatterOptions.borderColors[4*u+c]=H[4*O+c];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float64Array(0),this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float64Array(0),this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(o,l,P)},L.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,s=this.yData;for(n=new Float64Array(2*a.length),r=0;r<a.length;++r)n[i++]=a[r],n[i++]=s[r]}this.lineOptions.positions=n;var l=o(t.line.color,t.opacity,1),u=Math.round(.5*this.lineOptions.width),c=(S[t.line.dash]||[1]).slice();for(r=0;r<c.length;++r)c[r]*=u;switch(t.fill){case"tozeroy":this.lineOptions.fill=[!1,!0,!1,!1];break;case"tozerox":this.lineOptions.fill=[!0,!1,!1,!1];break;default:this.lineOptions.fill=[!1,!1,!1,!1]}var h=x(t.fillcolor);this.lineOptions.color=l,this.lineOptions.width=2*t.line.width,this.lineOptions.dashes=c,this.lineOptions.fillColor=[h,h,h,h]}else this.lineOptions.positions=new Float64Array(0);this.line.update(this.lineOptions)},L.updateError=function(t,e,r,n){var i=this["error"+t],a=e["error_"+t.toLowerCase()],s=this["error"+t+"Options"];"x"===t.toLowerCase()&&a.copy_ystyle&&(a=e.error_y),this["hasError"+t]?(s.positions=r,s.errors=n,s.capSize=a.width,s.lineWidth=a.thickness/2,s.color=o(a.color,1,1)):s.positions=new Float64Array(0),i.update(s)},L.expandAxesFast=function(t,e){for(var r,n,i,a=e||10,o=0;o<2;o++)r=this.scene[E[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},L.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};g.expand(n.xaxis,t,i),g.expand(n.yaxis,e,i)},L.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=c},{"../../components/errorbars":591,"../../constants/gl2d_dashes":645,"../../constants/gl_markers":647,"../../lib":667,"../../lib/gl_format_color":664,"../../lib/str2rgbarray":685,"../../lib/typed_array_truncate":689,"../../plots/cartesian/axes":706,"../../plots/cartesian/axis_autotype":707,"../scatter/get_trace_color":919,"../scatter/make_bubble_size_func":926,"../scatter/subtypes":931,"fast-isnumeric":106,"gl-error2d":133,"gl-line2d":143,"gl-scatter2d":218,"gl-scatter2d-fancy":213}],949:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/xy_defaults"),s=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("../../components/errorbars/defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p=o(t,e,f,d);return p?(d("text"),d("mode",p<i.PTS_LINESONLY?"lines+markers":"lines"),a.hasLines(e)&&(d("connectgaps"),l(t,e,r,f,d)),a.hasMarkers(e)&&s(t,e,r,f,d),d("fill"),"none"!==e.fill&&u(t,e,r,d),c(t,e,r,{axis:"y"}),void c(t,e,r,{axis:"x",inherit:"y"})):void(e.visible=!1)}},{"../../components/errorbars/defaults":590,"../../lib":667,"../scatter/constants":916,"../scatter/fillcolor_defaults":918,"../scatter/line_defaults":922,"../scatter/marker_defaults":927,"../scatter/subtypes":931,"../scatter/xy_defaults":933,"./attributes":947}],950:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="scattergl",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","symbols","errorBarsOK","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":742,"../scatter/colorbar":914,"../scatter3d/calc":935,"./attributes":947,"./convert":948,"./defaults":949}],951:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../scatter/attributes"),a=t("../../plots/mapbox/layout_attributes"),o=t("../../plots/attributes"),s=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat,u=n.line,c=n.marker;e.exports={lon:n.lon,lat:n.lat,mode:{valType:"flaglist",flags:["lines","markers","text"],dflt:"markers",extras:["none"]},text:l({},i.text,{}),line:{color:u.color,width:u.width,dash:u.dash},connectgaps:i.connectgaps,marker:{symbol:{valType:"string",dflt:"circle",arrayOk:!0},opacity:l({},c.opacity,{arrayOk:!1}),size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,color:c.color,colorscale:c.colorscale,cauto:c.cauto,cmax:c.cmax,cmin:c.cmin,autocolorscale:c.autocolorscale,reversescale:c.reversescale,showscale:c.showscale,colorbar:s},fill:n.fill,fillcolor:i.fillcolor,textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,hoverinfo:l({},o.hoverinfo,{flags:["lon","lat","text","name"]})}},{"../../components/colorbar/attributes":563,"../../lib/extend":659,"../../plots/attributes":704,"../../plots/mapbox/layout_attributes":762,"../scatter/attributes":911,"../scattergeo/attributes":940}],952:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../components/colorscale"),o=t("../scatter/subtypes"),s=t("../scatter/colorscale_calc"),l=t("../scatter/make_bubble_size_func");e.exports=function(t,e){var r=e.lon.length,u=e.marker,c=o.hasMarkers(e),h=c&&Array.isArray(u.color),f=c&&Array.isArray(u.size),d=c&&Array.isArray(u.symbol),p=Array.isArray(e.text);s(e);for(var m=a.hasColorscale(e,"marker")?a.makeColorScaleFunc(a.extractScale(u.colorscale,u.cmin,u.cmax)):i.identity,v=o.isBubble(e)?l(e):i.identity,g=[],y=0,b=0;b<r;b++){var x=e.lon[b],_=e.lat[b];if(n(x)&&n(_)){var w={};if(y++,w.lonlat=[+x,+_],c){if(h){var M=u.color[b];w.mc=M,w.mcc=m(M)}if(f){var A=u.size[b];w.ms=A,w.mrc=v(A)}if(d){var k=u.symbol[b];w.mx="string"==typeof k?k:"circle"}}if(p){var T=e.text[b];w.tx="string"==typeof T?T:""}g.push(w)}else y>0&&(g[y-1].gapAfter=!0)}return g}},{"../../components/colorscale":576,"../../lib":667,"../scatter/colorscale_calc":915,"../scatter/make_bubble_size_func":926,"../scatter/subtypes":931,"fast-isnumeric":106}],953:[function(t,e,r){"use strict";function n(){return{geojson:h.makeBlank(),layout:{visibility:"none"},paint:{}}}function i(t,e){function r(t,r,n,i){void 0===e[r][n]&&(e[r][n]=i),t[r]=e[r][n]}for(var n=t[0].trace,i=n.marker,a=Array.isArray(i.color),o=Array.isArray(i.size),s=[],l=0;l<t.length;l++){var u=t[l],c={};a&&r(c,p,u.mcc,l),o&&r(c,m,u.mrc,l),s.push({type:"Feature",geometry:{type:"Point",coordinates:u.lonlat},properties:c})}return{type:"FeatureCollection",features:s}}function a(t){for(var e=t[0].trace,r=e.marker||{},n=r.symbol,i=e.text,a="circle"!==n?l(n):u,o=f.hasText(e)?l(i):u,s=[],c=0;c<t.length;c++){var h=t[c];s.push({type:"Feature",geometry:{type:"Point",coordinates:h.lonlat},properties:{symbol:a(h.mx),text:o(h.tx)}})}return{type:"FeatureCollection",features:s}}function o(t,e){var r,n=t.marker;if(Array.isArray(n.color)){for(var i=Object.keys(e[p]),a=[],o=0;o<i.length;o++){var s=i[o];a.push([e[p][s],s])}r={property:p,stops:a}}else r=n.color;return r}function s(t,e){var r,n=t.marker;if(Array.isArray(n.size)){for(var i=Object.keys(e[m]),a=[],o=0;o<i.length;o++){var s=i[o];a.push([e[m][s],+s])}a.sort(function(t,e){return t[0]-e[0]}),r={property:m,stops:a}}else r=n.size/2;return r}function l(t){return Array.isArray(t)?function(t){return t}:t?function(){return t}:u}function u(){return""}var c=t("../../lib"),h=t("../../lib/geojson_utils"),f=t("../scatter/subtypes"),d=t("../../plots/mapbox/convert_text_opts"),p="circle-color",m="circle-radius";e.exports=function(t){var e=t[0].trace,r=e.visible===!0,l="none"!==e.fill,u=f.hasLines(e),v=f.hasMarkers(e),g=f.hasText(e),y=v&&"circle"===e.marker.symbol,b=v&&"circle"!==e.marker.symbol,x=n(),_=n(),w=n(),M=n(),A={fill:x,line:_,circle:w,symbol:M};if(!r||t[0].placeholder)return A;var k;if((l||u)&&(k=h.calcTraceToLineCoords(t)),l&&(x.geojson=h.makePolygon(k),x.layout.visibility="visible",c.extendFlat(x.paint,{"fill-color":e.fillcolor})),u&&(_.geojson=h.makeLine(k),_.layout.visibility="visible",c.extendFlat(_.paint,{"line-width":e.line.width,"line-color":e.line.color,"line-opacity":e.opacity})),y){var T={};T[p]={},T[m]={},w.geojson=i(t,T),w.layout.visibility="visible",c.extendFlat(w.paint,{"circle-opacity":e.opacity*e.marker.opacity,"circle-color":o(e,T),"circle-radius":s(e,T)})}if((b||g)&&(M.geojson=a(t),c.extendFlat(M.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),b&&(c.extendFlat(M.layout,{"icon-size":e.marker.size/10}),c.extendFlat(M.paint,{"icon-opacity":e.opacity*e.marker.opacity,"icon-color":e.marker.color})),g)){var S=(e.marker||{}).size,E=d(e.textposition,S);c.extendFlat(M.layout,{"text-size":e.textfont.size,"text-anchor":E.anchor,"text-offset":E.offset}),c.extendFlat(M.paint,{"text-color":e.textfont.color,"text-opacity":e.opacity})}return A}},{"../../lib":667,"../../lib/geojson_utils":663,"../../plots/mapbox/convert_text_opts":759,"../scatter/subtypes":931}],954:[function(t,e,r){"use strict";function n(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return a<n.length&&(e.lon=n.slice(0,a)),a<i.length&&(e.lat=i.slice(0,a)),a}var i=t("../../lib"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("./attributes"),h=t("../scatter/attributes");e.exports=function(t,e,r,f){function d(r,n){return i.coerce(t,e,c,r,n)}function p(r,n){var a=r.indexOf(".line")===-1?c:h;return i.coerce(t,e,a,r,n)}var m=n(t,e,d);if(!m)return void(e.visible=!1);if(d("text"),d("mode"),a.hasLines(e)&&(s(t,e,r,f,d),d("connectgaps")),a.hasMarkers(e)){o(t,e,r,f,p);var v=e.marker;"circle"!==v.symbol&&(Array.isArray(v.size)&&(v.size=v.size[0]),Array.isArray(v.color)&&(v.color=v.color[0]))}a.hasText(e)&&l(t,e,f,d),d("fill"),"none"!==e.fill&&u(t,e,r,d),d("hoverinfo",1===f._dataLength?"lon+lat+text":void 0)}},{"../../lib":667,"../scatter/attributes":911,"../scatter/fillcolor_defaults":918,"../scatter/line_defaults":922,"../scatter/marker_defaults":927,"../scatter/subtypes":931,"../scatter/text_defaults":932,"./attributes":951}],955:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}},{}],956:[function(t,e,r){"use strict";function n(t,e){function r(t){return t+"\xb0"}var n=t.hoverinfo.split("+"),i=n.indexOf("all")!==-1,a=n.indexOf("lon")!==-1,o=n.indexOf("lat")!==-1,s=e.lonlat,l=[];if(i||a&&o?l.push("("+r(s[0])+", "+r(s[1])+")"):a?l.push("lon: "+r(s[0])):o&&l.push("lat: "+r(s[1])),i||n.indexOf("text")!==-1){var u=e.tx||t.text;Array.isArray(u)||l.push(u)}return l.join("
")}var i=t("../../plots/cartesian/graph_interact"),a=t("../scatter/get_trace_color");e.exports=function(t,e,r){function o(t){var e=t.lonlat,n=Math.abs(u.c2p(e)-u.c2p([d,e[1]])),i=Math.abs(c.c2p(e)-c.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)}var s=t.cd,l=s[0].trace,u=t.xa,c=t.ya;if(!s[0].placeholder){var h=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),f=360*h,d=e-f;if(i.getClosest(s,o,t),t.index!==!1){var p=s[t.index],m=p.lonlat,v=[m[0]+f,m[1]],g=u.c2p(v),y=c.c2p(v),b=p.mrc||1;return t.x0=g-b,t.x1=g+b,t.y0=y-b,t.y1=y+b,t.color=a(l,p),t.extraText=n(l,p),[t]}}}},{"../../plots/cartesian/graph_interact":713,"../scatter/get_trace_color":919}],957:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.plot=t("./plot"),n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/mapbox":760,"../scatter/colorbar":914,"./attributes":951,"./calc":952,"./defaults":954,"./event_data":955,"./hover":956,"./plot":958}],958:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint))},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=e[0].trace,i=new n(t,r.uid);return i.update(e),i}},{"./convert":953}],959:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={a:{valType:"data_array"},b:{valType:"data_array"},c:{valType:"data_array"},sum:{valType:"number",dflt:0,min:0},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({},{symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({},{width:c.width},a("marker".line))},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,hoverinfo:s({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":563,"../../components/colorscale/color_attributes":569,"../../lib/extend":659,"../../plots/attributes":704,"../scatter/attributes":911}],960:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../scatter/subtypes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=["a","b","c"],u={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,c,h,f,d,p,m=t._fullLayout[e.subplot],v=m.sum,g=e.sum||v;for(r=0;r<l.length;r++)if(h=l[r],!e[h]){for(d=e[u[h][0]],p=e[u[h][1]],f=new Array(d.length),c=0;c<d.length;c++)f[c]=g-d[c]-p[c];e[h]=f}var y,b,x,_,w,M,A=e.a.length,k=new Array(A);for(r=0;r<A;r++)y=e.a[r],b=e.b[r],x=e.c[r],n(y)&&n(b)&&n(x)?(y=+y,b=+b,x=+x,_=v/(y+b+x),1!==_&&(y*=_,b*=_,x*=_),M=y,w=x-b,k[r]={x:w,y:M,a:y,b:b,c:x}):k[r]={x:!1,y:!1};var T,S;if(a.hasMarkers(e)&&(T=e.marker,S=T.size,Array.isArray(S))){var E={type:"linear"};i.setConvert(E),S=E.makeCalcdata(e.marker,"size"),S.length>A&&S.splice(A,S.length-A)}return o(e),s(k,e),k}},{"../../plots/cartesian/axes":706,"../scatter/arrays_to_calcdata":910,"../scatter/colorscale_calc":915,"../scatter/subtypes":931,"fast-isnumeric":106}],961:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p,m=d("a"),v=d("b"),g=d("c");if(m?(p=m.length,v?(p=Math.min(p,v.length),g&&(p=Math.min(p,g.length))):p=g?Math.min(p,g.length):0):v&&g&&(p=Math.min(v.length,g.length)),!p)return void(e.visible=!1);m&&p<m.length&&(e.a=m.slice(0,p)),v&&p<v.length&&(e.b=v.slice(0,p)),g&&p<g.length&&(e.c=g.slice(0,p)),d("sum"),d("text");var y=p<i.PTS_LINESONLY?"lines+markers":"lines";d("mode",y),a.hasLines(e)&&(s(t,e,r,f,d),l(t,e,d),d("connectgaps")),a.hasMarkers(e)&&o(t,e,r,f,d),a.hasText(e)&&u(t,e,f,d);var b=[];(a.hasMarkers(e)||a.hasText(e))&&(d("marker.maxdisplayed"),b.push("points")),d("fill"),"none"!==e.fill&&(c(t,e,r,d),a.hasLines(e)||l(t,e,d)),d("hoverinfo",1===f._dataLength?"a+b+c+text":void 0),"tonext"!==e.fill&&"toself"!==e.fill||b.push("fills"),d("hoveron",b.join("+")||"points")}},{"../../lib":667,"../scatter/constants":916,"../scatter/fillcolor_defaults":918,"../scatter/line_defaults":922,"../scatter/line_shape_defaults":924,"../scatter/marker_defaults":927,"../scatter/subtypes":931,"../scatter/text_defaults":932,"./attributes":959}],962:[function(t,e,r){"use strict";var n=t("../scatter/hover"),i=t("../../plots/cartesian/axes");e.exports=function(t,e,r,a){function o(t,e){g.push(t._hovertitle+": "+i.tickText(t,e,"hover").text)}var s=n(t,e,r,a);if(s&&s[0].index!==!1){var l=s[0];if(void 0===l.index){var u=1-l.y0/t.ya._length,c=t.xa._length,h=c*u/2,f=c-h;return l.x0=Math.max(Math.min(l.x0,f),h),l.x1=Math.max(Math.min(l.x1,f),h),s}var d=l.cd[l.index];l.a=d.a,l.b=d.b,l.c=d.c,l.xLabelVal=void 0,l.yLabelVal=void 0;var p=l.trace,m=p._ternary,v=p.hoverinfo.split("+"),g=[];return v.indexOf("all")!==-1&&(v=["a","b","c"]),v.indexOf("a")!==-1&&o(m.aaxis,d.a),v.indexOf("b")!==-1&&o(m.baxis,d.b),v.indexOf("c")!==-1&&o(m.caxis,d.c),l.extraText=g.join("
"),s}}},{"../../plots/cartesian/axes":706,"../scatter/hover":920}],963:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/ternary":774,"../scatter/colorbar":914,"./attributes":959,"./calc":960,"./defaults":961,"./hover":962,"./plot":964,"./select":965,"./style":966}],964:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r},a=0;a<e.length;a++)e[a][0].trace._ternary=t;n(t.graphDiv,i,e)}},{"../scatter/plot":928}],965:[function(t,e,r){"use strict";var n=t("../scatter/select");e.exports=function(t,e){var r=n(t,e);if(r){var i,a,o,s=t.cd;for(o=0;o<r.length;o++)i=r[o],a=s[i.pointNumber],i.a=a.a,i.b=a.b,i.c=a.c,delete i.x,delete i.y;return r}}},{"../scatter/select":929}],966:[function(t,e,r){"use strict";var n=t("../scatter/style");e.exports=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++)if("scatter"===e[r].name)return;n(t)}},{"../scatter/style":930}],967:[function(t,e,r){"use strict";function n(t){return{valType:"boolean",dflt:!1}}function i(t){return{show:{valType:"boolean",dflt:!1},project:{x:n("x"),y:n("y"),z:n("z")},color:{valType:"color",dflt:a.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:a.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var a=t("../../components/color"),o=t("../../components/colorscale/attributes"),s=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat;e.exports={z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:o.zauto,cmin:o.zmin,cmax:o.zmax,colorscale:o.colorscale,autocolorscale:l({},o.autocolorscale,{dflt:!1}),reversescale:o.reversescale,showscale:o.showscale,colorbar:s,contours:{x:i("x"),y:i("y"),z:i("z")},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8 },specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:l({},o.zauto,{}),zmin:l({},o.zmin,{}),zmax:l({},o.zmax,{})}}},{"../../components/color":562,"../../components/colorbar/attributes":563,"../../components/colorscale/attributes":567,"../../lib/extend":659}],968:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":568}],969:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,u=r.cmin,c=r.cmax,h=r.surfacecolor||r.z;if(n(u)||(u=i.aggNums(Math.min,null,h)),n(c)||(c=i.aggNums(Math.max,null,h)),t._fullLayout._infolayer.selectAll("."+l).remove(),!r.showscale)return void a.autoMargin(t,l);var f=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});f.fillcolor(d).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":565,"../../components/colorscale":576,"../../lib":667,"../../plots/plots":766,"fast-isnumeric":106}],970:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=p(t[1]),i=n.toRgb();return{index:r,rgb:[i.r,i.g,i.b,e]}})}function a(t){var e=t[0].rgb,r=t[t.length-1].rgb;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function o(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=c(new Float32Array(r[0]*r[1]),r);return d.assign(n.lo(1,1).hi(e[0],e[1]),t),d.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),d.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),d.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),d.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}function s(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e<v){for(var r=v/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],a=0;a<t.length;++a){var s=o(t[a]),l=c(new Float32Array(i),n);h(l,s,[r,0,0,0,r,0,0,0,1]),t[a]=l}return r}return 1}function l(t,e){var r=t.glplot.gl,i=u({gl:r}),a=new n(t,i,e.uid);return a.update(e),t.glplot.add(i),a}var u=t("gl-surface3d"),c=t("ndarray"),h=t("ndarray-homography"),f=t("ndarray-fill"),d=t("ndarray-ops"),p=t("tinycolor2"),m=t("../../lib/str2rgbarray"),v=128,g=n.prototype;g.handlePick=function(t){if(t.object===this.surface){var e=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0],0,this.data.xcalendar)*this.scene.dataScale[0],n.yaxis.d2l(r[1],0,this.data.ycalendar)*this.scene.dataScale[1],n.zaxis.d2l(r[2],0,this.data.zcalendar)*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},g.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;r<3;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},g.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,o=this.surface,l=t.opacity,u=i(t.colorscale,l),h=t.z,d=t.x,p=t.y,v=n.xaxis,g=n.yaxis,y=n.zaxis,b=r.dataScale,x=h[0].length,_=h.length,w=[c(new Float32Array(x*_),[x,_]),c(new Float32Array(x*_),[x,_]),c(new Float32Array(x*_),[x,_])],M=w[0],A=w[1],k=r.contourLevels;this.data=t;var T=t.xcalendar,S=t.ycalendar,E=t.zcalendar;f(w[2],function(t,e){return y.d2l(h[e][t],0,E)*b[2]}),Array.isArray(d[0])?f(M,function(t,e){return v.d2l(d[e][t],0,T)*b[0]}):f(M,function(t){return v.d2l(d[t],0,T)*b[0]}),Array.isArray(p[0])?f(A,function(t,e){return g.d2l(p[e][t],0,S)*b[1]}):f(A,function(t,e){return g.d2l(p[e],0,S)*b[1]});var L={colormap:u,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:t.opacity};if(L.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var C=c(new Float32Array(x*_),[x,_]);f(C,function(e,r){return t.surfacecolor[r][e]}),w.push(C)}else L.intensityBounds[0]*=b[2],L.intensityBounds[1]*=b[2];this.dataScale=s(w),t.surfacecolor&&(L.intensity=w.pop());var D=[!0,!0,!0],z=["x","y","z"];for(e=0;e<3;++e){var I=t.contours[z[e]];D[e]=I.highlight,L.showContour[e]=I.show||I.highlight,L.showContour[e]&&(L.contourProject[e]=[I.project.x,I.project.y,I.project.z],I.show?(this.showContour[e]=!0,L.levels[e]=k[e],o.highlightColor[e]=L.contourColor[e]=m(I.color),I.usecolormap?o.highlightTint[e]=L.contourTint[e]=0:o.highlightTint[e]=L.contourTint[e]=1,L.contourWidth[e]=I.width):this.showContour[e]=!1,I.highlight&&(L.dynamicColor[e]=m(I.highlightcolor),L.dynamicWidth[e]=I.highlightwidth))}a(u)&&(L.vertexColor=!0),L.coords=w,o.update(L),o.visible=t.visible,o.enableDynamic=D,o.snapToData=!0,"lighting"in t&&(o.ambientLight=t.lighting.ambient,o.diffuseLight=t.lighting.diffuse,o.specularLight=t.lighting.specular,o.roughness=t.lighting.roughness,o.fresnel=t.lighting.fresnel),"lightposition"in t&&(o.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]),l&&l<1&&(o.supportsTransparency=!0)},g.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=l},{"../../lib/str2rgbarray":685,"gl-surface3d":236,ndarray:434,"ndarray-fill":424,"ndarray-homography":426,"ndarray-ops":428,tinycolor2:498}],971:[function(t,e,r){"use strict";function n(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}var i=t("../../registry"),a=t("../../lib"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,n){return a.coerce(t,e,s,r,n)}var c,h,f=u("z");if(!f)return void(e.visible=!1);var d=f[0].length,p=f.length;u("x"),u("y");var m=i.getComponentMethod("calendars","handleTraceDefaults");if(m(t,e,["x","y","z"],l),!Array.isArray(e.x))for(e.x=[],c=0;c<d;++c)e.x[c]=c;if(u("text"),!Array.isArray(e.y))for(e.y=[],c=0;c<p;++c)e.y[c]=c;["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","opacity"].forEach(function(t){u(t)});var v=u("surfacecolor");u("colorscale");var g=["x","y","z"];for(c=0;c<3;++c){var y="contours."+g[c],b=u(y+".show"),x=u(y+".highlight");if(b||x)for(h=0;h<3;++h)u(y+".project."+g[h]);b&&(u(y+".color"),u(y+".width"),u(y+".usecolormap")),x&&(u(y+".highlightcolor"),u(y+".highlightwidth"))}v||(n(t,"zmin","cmin"),n(t,"zmax","cmax"),n(t,"zauto","cauto")),o(t,e,l,u,{prefix:"",cLetter:"c"})}},{"../../components/colorscale/defaults":571,"../../lib":667,"../../registry":781,"./attributes":967}],972:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("./colorbar"),n.calc=t("./calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="surface",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","noOpacity"],n.meta={},e.exports=n},{"../../plots/gl3d":745,"./attributes":967,"./calc":968,"./colorbar":969,"./convert":970,"./defaults":971}],973:[function(t,e,r){"use strict";function n(t,e){if("string"==typeof e&&e){var r=o.nestedProperty(t,e).get();return Array.isArray(r)?r:[]}return!!Array.isArray(e)&&e.slice()}function i(t,e,r){var n;if(Array.isArray(r)){if(n={type:c(r),_categories:[]},h(n),"category"===n.type)for(var i=0;i<r.length;i++)n.d2c(r[i])}else n=u.getFromTrace(t,e,r);return n?n.d2c:"ids"===r?function(t){return String(t)}:function(t){return+t}}function a(t,e,r){function n(t){return t.indexOf(a)!==-1}var i,a=t.operation,o=t.value,s=Array.isArray(o),l=function(r){return e(r,0,t.valuecalendar)},u=function(t){return e(t,0,r)};switch(n(f)?i=l(s?o[0]:o):n(d)?i=s?[l(o[0]),l(o[1])]:[l(o),l(o)]:n(p)&&(i=s?o.map(l):[l(o)]),a){case"=":return function(t){return u(t)===i};case"<":return function(t){return u(t)<i};case"<=":return function(t){return u(t)<=i};case">":return function(t){return u(t)>i};case">=":return function(t){return u(t)>=i};case"[]":return function(t){var e=u(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=u(t);return e>i[0]&&e<i[1]};case"[)":return function(t){var e=u(t);return e>=i[0]&&e<i[1]};case"(]":return function(t){var e=u(t);return e>i[0]&&e<=i[1]};case"][":return function(t){var e=u(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=u(t);return e<i[0]||e>i[1]};case"](":return function(t){var e=u(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=u(t);return e<i[0]||e>=i[1]};case"{}":return function(t){return i.indexOf(u(t))!==-1};case"}{":return function(t){return i.indexOf(u(t))===-1}}}var o=t("../lib"),s=t("../registry"),l=t("../plot_api/plot_schema"),u=t("../plots/cartesian/axis_ids"),c=t("../plots/cartesian/axis_autotype"),h=t("../plots/cartesian/set_convert"),f=["=","<",">=",">","<="],d=["[]","()","[)","(]","][",")(","](",")["],p=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x"},operation:{valType:"enumerated",values:[].concat(f).concat(d).concat(p),dflt:"="},value:{valType:"any",dflt:0}},r.supplyDefaults=function(t){function e(e,i){return o.coerce(t,n,r.attributes,e,i)}var n={},i=e("enabled");if(i){e("operation"),e("value"),e("target");var a=s.getComponentMethod("calendars","handleDefaults");a(t,n,"valuecalendar",null),a(t,n,"targetcalendar",null)}return n},r.calcTransform=function(t,e,r){function s(t,r){var n=y[t],i=o.nestedProperty(e,t).get();i.push(n[r])}if(r.enabled){var u=r.target,c=n(e,u),h=c.length;if(h){var f=r.targetcalendar;if("string"==typeof u){var d=o.nestedProperty(e,u+"calendar").get();d&&(f=d)}for(var p="x"===u||"y"===u||"z"===u?u:c,m=i(t,e,p),v=a(r,m,f),g=l.findArrayAttributes(e),y={},b=0;b<g.length;b++){var x=g[b],_=o.nestedProperty(e,x);y[x]=o.extendDeep([],_.get()),_.set([])}for(var w=0;w<h;w++){var M=c[w];if(v(M))for(var A=0;A<g.length;A++)s(g[A],w)}}}}},{"../lib":667,"../plot_api/plot_schema":695,"../plots/cartesian/axis_autotype":707,"../plots/cartesian/axis_ids":709,"../plots/cartesian/set_convert":720,"../registry":781}],974:[function(t,e,r){"use strict";function n(t,e){o.nestedProperty(t,e).set([])}function i(t,e,r,n){o.nestedProperty(t,n).set(o.nestedProperty(t,n).get().concat([o.nestedProperty(e,n).get()[r]]))}function a(t,e){var r=e.transform,a=t.transforms[e.transformIndex].groups;if(!Array.isArray(a)||0===a.length)return t;for(var l=o.filterUnique(a),u=new Array(l.length),c=a.length,h=s.findArrayAttributes(t),f=r.style||{},d=0;d<l.length;d++){var p=l[d],m=u[d]=o.extendDeepNoArrays({},t);h.forEach(n.bind(null,m));for(var v=0;v<c;v++)a[v]===p&&h.forEach(i.bind(0,m,t,v));m.name=p,m=o.extendDeepNoArrays(m,f[p]||{})}return u}var o=t("../lib"),s=t("../plot_api/plot_schema");r.moduleType="transform",r.name="groupby",r.attributes={enabled:{valType:"boolean",dflt:!0},groups:{valType:"data_array",dflt:[]},style:{valType:"any",dflt:{}}},r.supplyDefaults=function(t){function e(e,i){return o.coerce(t,n,r.attributes,e,i)}var n={},i=e("enabled");return i?(e("groups"),e("style"),n):n},r.transform=function(t,e){for(var r=[],n=0;n<t.length;n++)r=r.concat(a(t[n],e));return r}},{"../lib":667,"../plot_api/plot_schema":695}]},{},[17])(17)});